vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Optimizing Forumhome (https://vborg.vbsupport.ru/showthread.php?t=46848)

ImportPassion 02-21-2003 01:25 PM

well, the post count and thread count is WAY off for me.

optimize hack = 608,313 posts
original vbb = 559,113 (which is the # of rows in that table)

not to mention the thread count is off too.
Think i will keep the count(*) for now, but keep the rest of the optimize hack.

D

Xenon 02-21-2003 02:31 PM

you should update your counters if there is really that difference....

also not moderated posts don't count towards the stats..

Xenon 02-25-2003 11:21 PM

Ok, i have released version 2 of the hack.

I've nearly completely recoded it up from ground, so you do better in completly uninstall version1 and install version2

the new version doesn't use the table cache_forumhome anymore, so you could DROP it from your database.

at least, no single caching is used anymore (except from moderatorlist caching)
The hack is now just an optimization of the forumhome queries.
on more frequented boards this will help much better than the old version.
also the pm query section has been optimized, so it would work much faster on large DB's than the old one..

sHORTYWZ 02-25-2003 11:31 PM

could you post the old instructions for v1 so that I can uninstall? I didn't keep them =(

Boofo 02-25-2003 11:37 PM

Will the users browsing forums hack work now with this new version? :)

Xenon 02-25-2003 11:38 PM

oops, sorry, have overwritten them, too.

maybe someon other has kept them :)

if you have no other hacks installed on index.php you can just use an unhacked index.php and start reinstalling.
just deltet the one table from the db.

Xenon 02-25-2003 11:39 PM

Quote:

Originally posted by Boofo
Will the users browsing forums hack work now with this new version? :)
yes :)

Boofo 02-25-2003 11:42 PM

/me slam-dunks the install button!

nuno 02-26-2003 12:05 AM

Don't know why, but the mods column is now gone.

sHORTYWZ 02-26-2003 12:10 AM

I have a ton of hacks on my index =(

Anyone have the old install txt lying around? Please! =)

Erwin 02-26-2003 12:17 AM

Quote:

Originally posted by Xenon
the new version doesn't use the table cache_forumhome anymore, so you could DROP it from your database.

The text file in your first post still refers to this though. It has queries to add the table, and other queries to look it up.

Erwin 02-26-2003 12:19 AM

Ignore that - I had to refresh my browser cache. :)

Looks good. I have already optimized my index.php like that, but by removing the extra queries rather than combining them, so this hack won't help me, but it's fantastic nonetheless.

Dan_UPC 02-26-2003 10:37 AM

I've attached the version 1 install file

Aaron1 02-26-2003 11:12 AM

Damn i got a parse error, in the index.php

Parse error: parse error in /forum/index.php on line 433
(thats the last line with the ?> mark) Did i miss an accolade somewhere or do more people have that problem?

Btw: Any ideas where i should look for?
Accolades?

lifesourcerec 02-26-2003 11:14 AM

I had to do this line by line because of other hacks, but this is amazing. Was as high as 49 queries. Removed a hack which dropped it down to 43. Just installed this hack, now I'm down to 37. :) Forum runs a little smoother.

version2 02-26-2003 01:10 PM

Hmm. Where is the new version?

Aaron1 02-26-2003 01:16 PM

I solved the Parse error, because i seem to have left some old code in there. :) Dunno if things work out faster yet, although my board has an average of a 1000 pageviews a day. So let's hope users will find it a bit faster....

I didn's see any drop of queries though (28)

Xenon 02-26-2003 04:57 PM

@Aaron1: if you install everything correct, it should reduce the queries by 4 to an unhacked, not to version 1 which was different :)

Xenon 02-26-2003 04:58 PM

@boofo: that part hasn't changed from version one, so you can use the code i posted in the thread here :)

nuno 02-26-2003 05:24 PM

Quote:

Originally posted by nuno
Don't know why, but the mods column is now gone.
bump

Xenon 02-26-2003 05:53 PM

sorry, have overread it nuno.

have you done the last step and edited a forum (save without any changes?)

nuno 02-26-2003 06:09 PM

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.

Xenon 02-26-2003 09:01 PM

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 ;)

nuno 02-26-2003 09:35 PM

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. ;)

Seby 02-26-2003 10:35 PM

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 :D

Xenon 02-26-2003 10:47 PM

i haven't time for private requests!

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

@nuno: you're welcome :)

Xenon 02-28-2003 12:42 PM

little upgrade.
the pm queries had a bug, just replace the old pm code with the new one :)

Xyphen 03-01-2003 11:17 PM

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.

Xenon 03-01-2003 11:53 PM

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 ;)

erdem 03-03-2003 01:34 PM

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

Xenon 03-03-2003 04:01 PM

yes right

it won't hurt anymore then :)
you shouldn't have any upgrade problems, AFAIK Erwin has removed that col long time ago already and didn't get in trouble..

nevertheless if you just remove the mod query and don't install the mod thing into forum.php (of my file) and also don't improve the whos' online on forumhome queries with my hacking advices, mods wouldn't be highlighted anymore (just supermods and admins would..)

erdem 03-03-2003 04:24 PM

is that means after removing moderator querys from index.php , i have to apply other querys to other files ?

a little confused ...

;)

Xenon 03-03-2003 08:16 PM

no, no other files are affected :)

hmm, maybe i've posted a bit complicated.

There is the online now feature on forumhome right?
and if you have enabled the moderatorhighlightin, all your online mods show up bold.
if you remove the mod query above and do not change the part which generates the current online users, all normal mods wouldn't be bold anymore :)

Xyphen 03-03-2003 08:44 PM

Quote:

Originally posted by Xenon
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 ;)

Now the result is 'Page generated in 0.26656604 seconds (43.08% PHP - 56.92% MySQL) with 50 queries.' Since I turned off the vBportal left colum display.

One question, how can I optimize it even more? :knockedout:

Xenon 03-03-2003 08:49 PM

well i don't know without knowing your index.php ;)

you can look into my way to combine some queries and try if you can do so yourself on other queries :)

Xyphen 03-04-2003 07:09 PM

Thanks for the tip, but I am not quite good at php as you are.

Xenon 03-04-2003 07:20 PM

well, also i started from a not so experienced level ;)
with time you'll learn how to do these things :)

i'd help you, but i really don't have any time left these days.

VeoMorphine 03-04-2003 07:47 PM

whoa..... Dramatic change for me. Very Very Very good hack indeed.

Roderik 03-04-2003 10:23 PM

Before:
Code:

Page generated in 0.50040603 seconds (27.94% PHP - 72.06% MySQL) with 27 queries.
[Debug Mode OFF] [PHP v4.1.2] [GZIP enabled - level 9] [Server Load: 0.08 ? 0.17 : 0.22]

After:
Code:

Page generated in 0.51396000 seconds (26.39% PHP - 73.61% MySQL) with 23 queries.
[Debug Mode OFF] [PHP v4.1.2] [GZIP enabled - level 9] [Server Load: 0.22 ? 0.13 : 0.16]

a full 4 queries! a great improvement for a few changed lines!
MORE MORE! :D

Xenon 03-05-2003 06:53 AM

thx, i do what i can to find some more ;)

btw. you should reduce your gzip level from 9 to 1.
the 9 isn't so much better in compressing, but the load of a server increases.


All times are GMT. The time now is 04:06 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.01275 seconds
  • Memory Usage 1,831KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete