The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Help me start a new thread from within a script...
If a certain circumstance is true, I want a redirect to go newthread.php and have the Title and Message parts filled out with pre-determined info. How do I do this?
This will be done from one of the admincp pages (not going to say which at this time). So far, I have: Code:
if ($_POST['discussannouncement'] == '1') { define('CP_REDIRECT', $vboptions[bburl].'/newthread.php'); } else { define('CP_REDIRECT', '-------.php'); } But I'd like for the new thread page to have the Title and Message pre-filled out with the values of two separate variables. Is there a way to do this? Thanks in advance! |
#2
|
|||
|
|||
Just set the correct variables, shouldn't be much of a problem, check how preview works.
PS Not difficult to gues what you are working on. ` |
#3
|
||||
|
||||
Especially with 'discussannouncement' in the conditional there... lol. Sounds like a good idea, though.
|
#4
|
||||
|
||||
Hehe...
But I guess my problem is what are the correct variables. The way I'm trying to do it now, the only way to pass the variables is through the URL, correct? On the newthread.php page, the name of the subject field is "subject". I've tried loading newthread.php?f=2&subject=test, yet the subject stays blank. But if I edit newthread.php and find the last time $subject is set to something, then after that add $subject="test", and load the page newthread.php?f=2, test IS in the subject. To isolate the problem, in the newthread template I renamed the subject field to subject666, then loaded the page newthread.php?f=2&subject666=test. Still, the subject line was blank. What am I doing wrong? Quote:
|
#5
|
|||
|
|||
Hi JJR512,
I don't know if you need the code anymore, in any case I give you my solution (that is real similar to your) In newthread.php I added 2 lines, First for the text that must apper in messagetextarea PHP Code:
PHP Code:
PHP Code:
Now you can open a 3D with a link like this : newthread.php?do=newthread&f=1&oggettonews=YOUROBJ ECTHERE&messaggionews=YOURMESSAGEHERE bYE |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|