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

Reply
 
Thread Tools
Optimizing Forumhome Details »»
Optimizing Forumhome
Version: 1.00, by Xenon Xenon is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

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

Ok, what this Hack does is it reduces the ammount of queries on forumhome by caching the moderatorlist and by optimizing most of the queries used on index.php


I'd really appreciate getting feedback how it reduces serverload on greater boards

On an unhacked vb index.php (pm enabled accesmask disabled) it reduces the ammount of queries from 19 to 15
my experiments have shown, that the queries are faster than the normal ones, too....

Show Your Support

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

Comments
  #182  
Old 02-26-2003, 05:53 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry, have overread it nuno.

have you done the last step and edited a forum (save without any changes?)
Reply With Quote
  #183  
Old 02-26-2003, 06:09 PM
nuno's Avatar
nuno nuno is offline
 
Join Date: Oct 2001
Posts: 469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes.
Just go to ACP and save any forum right?
Did that, all mods are gone.
Guess i'll just have to redo the whole install from the start.
Reply With Quote
  #184  
Old 02-26-2003, 09:01 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes, it should work have tested it on two boards right now, and everything works

the jumping point for the mods part is the modified forum.php if you have forgotten just one line your bug could appear

just check in the db if the fields are filles
Reply With Quote
  #185  
Old 02-26-2003, 09:35 PM
nuno's Avatar
nuno nuno is offline
 
Join Date: Oct 2001
Posts: 469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Xenon
yes, it should work have tested it on two boards right now, and everything works

the jumping point for the mods part is the modified forum.php if you have forgotten just one line your bug could appear

just check in the db if the fields are filles
Thank you Xenon, that did it.
Reply With Quote
  #186  
Old 02-26-2003, 10:35 PM
Seby Seby is offline
 
Join Date: Apr 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have the "user online today" hack installed and that cause not being able to install the hack. even when I remove it I cant do teh find/replace stuff cause my lines are different, I'll be bugging you on icq xenon, maybe you can help me
Reply With Quote
  #187  
Old 02-26-2003, 10:47 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i haven't time for private requests!

remove the hack and apply my part or just leave that part out..

@nuno: you're welcome
Reply With Quote
  #188  
Old 02-28-2003, 12:42 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

little upgrade.
the pm queries had a bug, just replace the old pm code with the new one
Reply With Quote
  #189  
Old 03-01-2003, 11:17 PM
Xyphen's Avatar
Xyphen Xyphen is offline
 
Join Date: Dec 2002
Location: ON, Canada
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did this on vB2.3.0 and worked fine, dropped about 3 queries I belive or maybe more.

My forum is hacked badly -_-.

Result: Page generated in 0.25047302 seconds (53.65% PHP - 46.35% MySQL) with 55 queries.

Result Before: Page generated in 0.25559199 seconds (53.88% PHP - 46.12% MySQL) with 58 queries.
Reply With Quote
  #190  
Old 03-01-2003, 11:53 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow, good server if it's that fast with 55 queries

but i think you should optimize index.php more than just with my hack
Reply With Quote
  #191  
Old 03-03-2003, 01:34 PM
erdem erdem is offline
 
Join Date: Oct 2001
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi xenon ...

i just want to remove moderator querys from index ...
i have to do these
PHP Code:
remove:
$imodcache = array();
$mod = array();
$forummoderators=$DB_site->query('SELECT user.userid,user.username,moderator.forumid
                                  FROM moderator
                                  LEFT JOIN user
                                    ON (moderator.userid=user.userid)
                                  ORDER BY user.username'
);
while (
$moderator=$DB_site->fetch_array($forummoderators)) {
  
$imodcache["$moderator[forumid]"][] = $moderator;
  
$mod["$moderator[userid]"] = 1;
}
$DB_site->free_result($forummoderators);
unset(
$moderator); 
PHP Code:
find:
        
$listexploded=explode(","$forum['parentlist']);
        while ( list(
$mkey1,$mval1)=each($listexploded) ) {
          if ( !isset(
$imodcache["$mval1"]) ) {
            continue;
          }
          
reset($imodcache["$mval1"]);
          while ( list(
$mkey2,$moderator)=each($imodcache["$mval1"]) ) {
            if ( !isset(
$forum['moderators']) ) {
              eval(
"\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";");
            } else {
              eval(
"\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";");
            }
          }
        }

        if ( !isset(
$forum['moderators']) ) {
          
$forum['moderators'] = ' ';
        }

replace with:
        eval(
"\$forum[moderators] = \"".addslashes($forum[moderators])."\";"); 
right ?

also this wont cause any problem right ? like update problem or so ?
Thanks
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 09:43 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05010 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
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
  • (2)bbcode_php
  • (1)bbcode_quote
  • (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
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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