vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to have this option? (https://vborg.vbsupport.ru/showthread.php?t=290433)

Easy5s.net 11-10-2012 04:47 AM

How to have this option?
 
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:

Code:

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

Quote:

Originally Posted by kh99 (Post 2379983)
I'd have to see exactly how the option is defined, but I think you want something like this:

Code:

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

Quote:

Originally Posted by kh99 (Post 2379994)
Do you have "Option Code" set to yesno? Then I think what I posted above should work.

Code:

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:

Code:

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


Easy5s.net 11-10-2012 03:51 PM

Oh, working :)


All times are GMT. The time now is 03:08 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01105 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete