PDA

View Full Version : How to have this option?


Easy5s.net
11-10-2012, 04:47 AM
I have a the function hook into newpost_process, now I want to turn it post processing sent first (newthread), and if its off, it will handle all of the reply of the topic (thread) is always. Thank :)

kh99
11-10-2012, 01:44 PM
Sorry, I don't quite understand that. Can you try to explain it again?

Easy5s.net
11-10-2012, 02:54 PM
I wrote a function to check the posts and add it into hook newpost_process, it worked. I set admincp with check fistpost option only.

Now, I want if is check firstpost only option = on, this function only checks the first post.
And this option = off, check all messages in thread.

kh99
11-10-2012, 03:05 PM
I'd have to see exactly how the option is defined, but I think you want something like this:

if ($vbulletin->options['firstpost_only'])
{
// existing code here
}


Of course 'firstpost_only' would be replaced with the actual Varname for your option.

Easy5s.net
11-10-2012, 03:26 PM
I'd have to see exactly how the option is defined, but I think you want something like this:

if ($vbulletin->options['firstpost_only'])
{
// existing code here
}


Of course 'firstpost_only' would be replaced with the actual Varname for your option.

In admincp have options for the Product, name is firstpost_only.

Now in code, how do i do when set to YES, it will only check the first post. ==> OK

But if select NO, it will check all the replies.<== how to do this

kh99
11-10-2012, 03:30 PM
Do you have "Option Code" set to yesno? Then I think what I posted above should work.

Easy5s.net
11-10-2012, 03:37 PM
Do you have "Option Code" set to yesno? Then I think what I posted above should work.


if ($vbulletin->options['firstpost_only'])
{
// existing code here
}


This code can not do that, it will not check the reply if you select NO.
I want to select NO, it will check and check all the reply.

kh99
11-10-2012, 03:40 PM
Oh, OK, I see what you mean now. Try this:

if ($type == 'thread' OR !$vbulletin->options['firstpost_only'])
{
// existing code here
}

Easy5s.net
11-10-2012, 03:51 PM
Oh, working :)