The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
hook location newthread
Is there a hook location when i push the post button after writing a new thread.
I can't find it, is it there or do i have to modify somthing so i could get a hook location there. |
#2
|
|||
|
|||
There's probably more than one hook you could use. What do you want to do when the button's pressed?
|
#3
|
|||
|
|||
i wan't the person be redirect to a different page, where the user has to fill in some more information. after the info is validated the post has to be released.
if the validation fails the post has to be canceld. |
#4
|
|||
|
|||
Well, when you're submitting a new post, it goes to newpost.php with do=postthread, so maybe you could use hook newthread_start with code like:
Code:
if ($_REQUEST['do'] == 'postthread' && /* check for validation not done */) { show validation page (i.e., render a template and call print_output(), or do a redirect) } I hope that makes sense. |
#5
|
|||
|
|||
Actually, on second thought it might be easier to use hook newthread_post_start. You wouldn't need to do the check for $_REQUEST['do'] == 'postthread' because it's been done already, and the form fields from the new thread page have been cleaned already (you might want to look at newthread.php and search for newthread_post_start to see what's going on there).
|
#6
|
|||
|
|||
When i use that hook location it is called on the start of an new thread, how can it now that i hit the post button?
|
#7
|
|||
|
|||
Quote:
Code:
// ############################### start post thread ############################### if ($_POST['do'] == 'postthread') { which is the start of the code that posts a new thread. And a little farther down is this: Code:
// ############################### start new thread ############################### if ($_REQUEST['do'] == 'newthread') { which starts the section that displays the form for a new thread. I hope this answers you question - I'm not completely sure I understood. |
#8
|
|||
|
|||
hmmmm i can't get it to work
this is what i have done but no pop-up. hook location newthread_start and newthread_post_start and this is the code Code:
if ($foruminfo['forumid'] == 356 && $_REQUEST['do'] == 'postthread') { $message = 'This is a message.'; echo "<SCRIPT> alert('$message'); </SCRIPT>"; } i now i do something wrong or use the wrong hook. but i don't know what. |
#9
|
|||
|
|||
I tried it and it seems to work. Are we talking about the same button? Try adding another message as an "else" to your if, and display $_REQUEST['do'] in the message.
|
#10
|
|||
|
|||
Well it is the button beside the preview button called post new thread.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|