![]() |
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. |
There's probably more than one hook you could use. What do you want to do when the button's pressed?
|
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. |
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 */) I hope that makes sense. |
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).
|
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?
|
Quote:
Code:
// ############################### start post thread ############################### which is the start of the code that posts a new thread. And a little farther down is this: Code:
// ############################### start new thread ############################### 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. |
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') i now i do something wrong or use the wrong hook. but i don't know what. |
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.
|
Well it is the button beside the preview button called post new thread.
|
Right, that's what I thought. If removing $_REQUEST['do'] == 'postthread' makes it work, then $_REQUEST['do'] must be something else at that point. If you can figure out what it is we might be able to figure out why you're having a problem.
|
@KH99 pretty well summed it up. Maybe you wanted 'newthread' instead of 'postthread' so your not checking the right response?
Add to your plugin at the top for a simple check or in the else part as @Kh99 suggested. Code:
var_dump($foruminfo['forumid']); |
@tbworld, ai put them there, tryed several hook locations but non worked for me.
i will try to somehow find a different hook location to get this done. for now work calls |
Three things you might try...
1.) See if you have another plugin that is using that hook, and interfering. 2.) Check your PHP error file for an eval error on that hook. 3.) Temporarily embed the hook code in newpost.php to check your code without the hook. |
Hello,
i have findout that this hook location looks to work for me showthread post_start but it is always called, even with a follow up post. How can i check that it is a new post. |
I'm looking ad the php code from the file newthread.php there is a hook newthread_post_start
It look's to me that this hook should accesed when a user hit the button submit new thread. but when i set this hook location in my plugin, nothing happens. why isn't it running. there should be a popup message for testing purpose, when ttry other hook location the popup is shown. so that part of the code is oke. please need help on this. --------------- Added [DATE]1391339902[/DATE] at [TIME]1391339902[/TIME] --------------- I really need some help with this, i tryed hole night to get my plugin to popup a new screen/message. but nothing works not one hook location seems to do the job. I would have a new screen in between hitting the post button and actualy post the data. in this screen it should be possible to cancel the post or to allow the post. How could this be done ? |
All times are GMT. The time now is 09:14 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|