Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 28 Jan 2014, 17:10
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Real name: arnold
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.
Reply With Quote
  #2  
Old 28 Jan 2014, 17:14
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
There's probably more than one hook you could use. What do you want to do when the button's pressed?
Reply With Quote
  #3  
Old 28 Jan 2014, 17:34
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Real name: arnold
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.
Reply With Quote
  #4  
Old 28 Jan 2014, 17:46
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


I hope that makes sense.
Reply With Quote
  #5  
Old 28 Jan 2014, 17:56
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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).
Reply With Quote
  #6  
Old 28 Jan 2014, 18:06
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Real name: arnold
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?
Reply With Quote
  #7  
Old 28 Jan 2014, 18:21
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by ageurtse View Post
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?
Most of the php scripts in vb perform more than one function. newpost.php is called to display the form for a new thread, and also to post the thread (and a few other functions). The "do" parameter is used to tell the script which function is being performed. You might want to take a look at newpost.php to see what's going on. You can see there are different sections, for instance, around line 100 is this code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


which is the start of the code that posts a new thread. And a little farther down is this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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.
Reply With Quote
  #8  
Old 28 Jan 2014, 18:54
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Real name: arnold
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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

when i leave $_REQUEST['do'] == 'postthread' away, there is a pop-up only on the hook location newthread_start.

i now i do something wrong or use the wrong hook. but i don't know what.
Reply With Quote
  #9  
Old 28 Jan 2014, 19:56
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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.
Reply With Quote
  #10  
Old 28 Jan 2014, 20:59
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Real name: arnold
Well it is the button beside the preview button called post new thread.
Reply With Quote
  #11  
Old 28 Jan 2014, 21:11
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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.
Reply With Quote
  #12  
Old 28 Jan 2014, 21:32
tbworld tbworld is offline
 
Join Date: Oct 2008
@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.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #13  
Old 29 Jan 2014, 05:41
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Real name: arnold
@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
Reply With Quote
  #14  
Old 29 Jan 2014, 06:08
tbworld tbworld is offline
 
Join Date: Oct 2008
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.
Reply With Quote
  #15  
Old 30 Jan 2014, 17:18
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Real name: arnold
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.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 09:49.

Layout Options | Width: Wide Color: