vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   I need different "Maximum Displayed Threads Before Page Split" for guests vs members (https://vborg.vbsupport.ru/showthread.php?t=283582)

Marvin Hlavac 05-28-2012 01:48 PM

I need different "Maximum Displayed Threads Before Page Split" for guests vs members
 
Which file do I need to edit to achieve different number of threads per page for guests versus members?

My current setting is 200 threads per page, which loads fast for guests because my guests are served fully cached pages. However, I'd like my members to view 50 threads per page so they don't suffer the speed decrease.

Any help would be very much appreciated.

Boofo 05-28-2012 02:07 PM

You should be able to do that with a plugin with a conditional in the plugin. I'm working on a mod now for my site that will have that option, among many others.

Marvin Hlavac 05-28-2012 02:54 PM

Boofo, if it's not too big of a trouble, would you please give me a sample code to try for such plugin, and which hook location to use?

Boofo 05-28-2012 03:20 PM

Hook: global_bootstrap_init_start

Code:

$maxthreadsgroups = array(5,6,7);  // Usergroups
$maxthreadsids = array();  // User IDs

if (is_member_of($vbulletin->userinfo, $maxthreadsgroups) OR in_array($vbulletin->userinfo['userid'], $maxthreadsids))
{
        $vbulletin->options['maxthreads'] = 50;
}


Change the numbers in red to your liking. You can also use userids. I have settings in a product for mine but this should give you what you need. TESTED and WORKS!

Marvin Hlavac 05-28-2012 03:57 PM

That sounds like the thing I need, but my 3.8.4 version of vB doesn't seem to have the required hook location. I only see global_complete, global_setup_complete, global_shutdown, and global_start.

Is there a way for me to accomplish it in my vB version somehow? Can I somehow add the hook location, or use an alternate hook location?

I much appreciate you taking the time to help.

Boofo 05-28-2012 04:41 PM

Try global_start and let me know if that works.

Marvin Hlavac 05-28-2012 05:18 PM

Boofo, in the mean time I tested the forumdisplay_start hook, and it appears to work as intended, as far as I can tell.

Should forumdisplay_start be OK for this, or should I test it with the global_start?

Thanks again, Boofo!

Boofo 05-28-2012 05:22 PM

Do global_start

Marvin Hlavac 05-28-2012 05:55 PM

Boofo, I switched to global_start, tested as a member vs guest, and it works as intended. I owe you one my friend. Thanks a million!

Boofo 05-28-2012 06:41 PM

I'd rather have the million. ;)


All times are GMT. The time now is 09:49 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.01130 seconds
  • Memory Usage 1,721KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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