Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Logged in users optimization (1.0.1) Details »»
Logged in users optimization (1.0.1)
Version: 1.00, by fury fury is offline
Developer Last Online: Sep 2018 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 12-27-2002 Last Update: Never Installs: 15
 
No support by the author.

Note to users who have installed Xenon's Optimizing Forumhome v2.0 located here need not install this hack. Furthermore, should you wish to install that hack later on after installing this one, you will need to either uninstall it, or forego the section instructing you to modify the logged in users code.

-------------

This simple hack modifies the Logged in users list on the forumhome, reducing queries by one. This is done by knocking off the extra query for guest counting and instead changing the way the while loop that is used for the logged in users list works.

In other words, less queries = win.

Versions of vBulletin: 2.2.x
Tested on: 2.2.9
Modifications: File only (no database or template modifications)

Example: http://www.otcentral.com/forum/index.php
Except for the showing of one less query on the query count, you can see that the result is truly unnoticeable. Logged in users operates the same exact way as it does before the hack is made.

Although there's not much that can go wrong with this hack, support will be provided in this thread and by email. Preferrably thread in case someone else runs across the same problem.

Update: 12/29/2002 - 0:11

Version 1.0.1 released - Counter was still counting duplicate sessions but not displaying them.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-28-2002, 09:34 PM
JulianD's Avatar
JulianD JulianD is offline
 
Join Date: Jan 2002
Posts: 455
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice hack. I'm going to test it on my local server
Reply With Quote
  #3  
Old 12-28-2002, 09:39 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

looks nice, but i think it could be buggy, because you've thrown out the DISTINCT selection, which wasn't there without reason i think .

But we'll see, it's a beta, maybe everything works correct and the distinct was just a devs paranoia
Reply With Quote
  #4  
Old 12-28-2002, 10:17 PM
fury's Avatar
fury fury is offline
 
Join Date: Oct 2001
Location: Indiana
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

DISTINCT is there to make sure no sessions get repeated in the logged in user list. I took that out because no matter how many guests would be there, it would only show up with the first. In its place I put a username token check to make sure the list doesn't already have the user in it.
Reply With Quote
  #5  
Old 12-29-2002, 12:42 AM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The number of users online on the index is after this mod not the same as the detaild list when you look at the locations and ip. On the index there were 20 and on the detailed list 13! So it looks there is a problem.
Reply With Quote
  #6  
Old 12-29-2002, 02:48 AM
fury's Avatar
fury fury is offline
 
Join Date: Oct 2001
Location: Indiana
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems to work fine on my board. Have you applied any other hacks that affect the logged in users part of your forumhome? Can I get a link to the board you installed it on?
Reply With Quote
  #7  
Old 12-29-2002, 03:13 AM
fury's Avatar
fury fury is offline
 
Join Date: Oct 2001
Location: Indiana
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nevermind. I see the problem. The check which prevents duplicate sessions from showing is put outside of the registered user counter. The file is fixed, if you already installed this hack here is the code to move:

PHP Code:
if (!substr_count($activeusers_bare,"|||".$username."|||")) { 
REPLACE it with this
PHP Code:
if (!substr_count($activeusers_bare,"|||".$loggedin['username']."|||")) { 
and Move this just BELOW this line:
PHP Code:
} else { 
and ABOVE this line:
PHP Code:
$numberregistered++; 
Reply With Quote
  #8  
Old 12-29-2002, 12:03 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow so we've found another way the vb dev's could reduce queries?

- miSt
Reply With Quote
  #9  
Old 12-29-2002, 12:22 PM
fury's Avatar
fury fury is offline
 
Join Date: Oct 2001
Location: Indiana
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not quite yet

It appears for some mods and admins the dupe sessions are still counted and displayed.

Edit: I know what I did wrong. Thank god this is only a beta hack, i would've been dead after the first bug

Find this text (note: it's not its own line, there is text after it)

PHP Code:
$activeusers_bare .= $username 
Change it to this:

PHP Code:
$activeusers_bare .= $loggedin['username'
Make sure there's still the . "|||"; after it.

Fixed the text file with the change, but didn't bother updating the version number.
Reply With Quote
  #10  
Old 12-29-2002, 12:26 PM
fury's Avatar
fury fury is offline
 
Join Date: Oct 2001
Location: Indiana
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Surely the vB devs would've thought of this for vB3, I think Kier said vB3's index.php is down to 8 queries... That's not bad considering all the info on it (number of users browsing each forum, last post title, etc)
Reply With Quote
Reply

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

Forum Jump


All times are GMT. The time now is 05:13 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
  • Page Generation 0.13828 seconds
  • Memory Usage 2,293KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete