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)

Kars10 03-21-2003 04:02 PM

First of all this hack works great for me!!
Thanks Xenon.
But i have a problem with my $forum[moderators]. This variable is not working for me anymore.

I have deleted this code:

PHP Code:

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

When i put the moderator-code back in my index.php i have my moderators showing up, but all with a >> , << comma bevor there names (examble: , xxx, xxx).
What can i do to make the moderators work.

Thanks in advance.

Xenon 03-21-2003 04:05 PM

have you run the last step and modified a forum from your acp to initialise the Mod cache?

Kars10 03-21-2003 04:33 PM

Yes i have, and my mods are cached in the DB :)

Xenon 03-21-2003 04:37 PM

then they should also be displayed!

the var is filled, that's why all other mods are added with a , in front to it.

maybe you have an disturbing hack installed which doesn't like mine ^^
i know your complicated index.php :p

Kars10 03-21-2003 04:42 PM

No way buddy...my index works!! ;)
But what could it be that this variable don?t work anymore??
I promise, when i put the orginal mod-code back in the file, it works like a charm (but than i get that wierd comma)... :(

Xenon 03-21-2003 04:56 PM

well i know the hack works, and as it used the variable correct, it should show up :)

so it must be your index.php, and no i don't have time to take a closer look at your file ;)

AlexanderT 03-22-2003 03:46 PM

I don't really know, but most of you guys only speak of reducing queries, but not total page generation time (see here: https://vborg.vbsupport.ru/showthrea...243#post361243)

I installed the hack and got the following timings:

WITHOUT Hack:
Page generated in 0.12671995 seconds (70.49% PHP - 29.51% MySQL) with 30 queries.
[Debug Mode OFF] [PHP v4.3.1] [GZIP enabled - level 1] [Server Load: 0.33 ? 0.55 : 0.87]


WITH Hack:
Page generated in 0.23996496 seconds (37.26% PHP - 62.74% MySQL) with 26 queries.
[Debug Mode OFF] [PHP v4.3.1] [GZIP enabled - level 1] [Server Load: 0.33 ? 0.55 : 0.87]


... So yes, queries were reduced by a lot, but total page generation took almost twice as long. So I assume the hack doesn't really do it for me.

Xenon 03-23-2003 04:30 PM

i hope you have run those test a bit more often than just once did ya?

i've tested it several times and the gen time was in average 80% of the old gen time.

of course if you just look on the time once it could happen that the time differences so much.

AlexanderT 03-23-2003 04:41 PM

yup I did... one entire evening testing. Query time was always below non-hack, but final page generation was above. I think the replacement of the pm query routine took most additional time.

Xenon 03-23-2003 05:01 PM

hmm, could i have some stats of you board?
post ammount, thread ammount, total pm ammount(and the ammount of pm's you have had in your account while testing)...

especially the pm ammount would be important, in version1 i know it was slower when there are a lot of pm's of a user that for this user the generation was slower, but for the average users who doesn't have much pm's it was faster.

normally all other queries should be faster than the original ones.

VampireMan 03-28-2003 11:46 PM

Worked like dream , reduced over 4 querys on my system.

My system = vb 2.3.0 + vbportal + a few homepage mods

Page generated in 0.19411397 seconds (70.19% PHP - 29.81% MySQL) with 40 queries.
[Debug Mode OFF] [PHP v4.3.1] [GZIP enabled - level 1] [Server Load: 0.07 ยป 0.06 : 0.01]

The_Wanderer 04-17-2003 11:34 PM

very nice... this is a MUST for me, seeing how i have 37 queries on forumhome :o

Doubledoom 04-21-2003 12:04 PM

I also have that comma before the mods on the index page. Not sure how or why its there but it isnt before the hack is installed. I havent done any investigations yet as to why but i will be checking against conflicts with other hacks and will post back.

iwearnosox 04-21-2003 12:27 PM

Went from 29 to 25 queries, loads noticably faster too.

Thanks!

iwearnosox 04-21-2003 02:43 PM

My bad.

Xenon 04-21-2003 02:51 PM

maybe just your cookie was corrupted.

my hack doesn't change anything which belongs to login procedure.

iwearnosox 04-21-2003 08:34 PM

Quote:

Today at 03:51 PM Xenon said this in Post #216
maybe just your cookie was corrupted.

my hack doesn't change anything which belongs to login procedure.

I stand corrected, it is not this hack. I also added a seemingly harmless chat room hack which, as it turns out, is the culprit. It is pooping a cookie out on it's own that interferes with the vbulletin cookie.

Thanks for your effort on this hack again, sorry about that. Feel free to delete these last three if it will help from a confusion perspective...

drumsy 04-23-2003 05:07 PM

How do I undo this query:

Code:

ALTER TABLE `forum` ADD `moderators` MEDIUMTEXT NOT NULL

iwearnosox 04-23-2003 10:46 PM

Quote:

Today at 06:07 PM drumsy said this in Post #218
How do I undo this query:

Code:

ALTER TABLE `forum` ADD `moderators` MEDIUMTEXT NOT NULL

Just drop it.

drumsy 04-24-2003 12:29 AM

Quote:

Today at 06:46 PM iwearnosox said this in Post #219
Just drop it.

Code:

ALTER TABLE `forum` DROP `moderators`
?

solent 04-24-2003 12:40 PM

perfect thanks for that. will let you know once my board is in production.

iwearnosox 04-24-2003 01:01 PM

Quote:

Today at 01:40 PM solent said this in Post #221
perfect thanks for that. will let you know once my board is in production.
solent if you're unfamiliar with basic mysql syntax you might want to see if your host has phpmyadmin, it's got a basic gui front end that might help you.

solent 04-24-2003 01:05 PM

Quote:

Today at 04:01 PM iwearnosox said this in Post #222
solent if you're unfamiliar with basic mysql syntax you might want to see if your host has phpmyadmin, it's got a basic gui front end that might help you.

well i have no host i build and maintane my own server i am trying my best and upto now i had no problems. anyway this hack has be installed and works just fine i am at the vbmicrostats hack now and hopefully i will set that up to.

Neopiper 04-29-2003 05:22 PM

thx a lot xenon, i got now Page generated in 0.1170980 seconds (17.90% PHP - 82.10% MySQL) with 17 queries.

http://www.animeonline.net/forums/

mute 05-01-2003 12:21 PM

Page generated in 0.47 seconds (16.79% PHP - 83.21%MySQL) with 11 queries.

Yay! :)

forumdude 05-18-2003 02:20 AM

When users don't have any new pms since their last visit this is what the Private Message box says:

You have new message(s) since your last visit.

where it should be:

You have 0 new message(s) since your last visit.

Anyone else notice this or have the same problem?

Also, it lists fine if there are 1 or more new pms.

Xenon 05-18-2003 09:37 AM

that problem normally can't occur if you have this lines in your code:
PHP Code:

  $unreadpm['messages'] = intval($unreadpm['messages']);
  
$newpm['messages'] = intval($newpm['messages']); 

edit: oops, the last line wasn't in the uploaded file, sorry ;)

just add it to your code and it'll work

forumdude 05-18-2003 03:07 PM

Thank you so much.

:)

DeeperImage 05-22-2003 09:14 PM

I have installed it and almost imediately the server loads dropped down to half. Is there a way for me to check how many queries are being requested by typing in some kind of command from phpmyadmin? I dont have the GZIP, Queries hack installed yet. Thanks.

xs1 05-23-2003 06:06 AM

anyone tested in 2.3.0 ?

Xenon 05-23-2003 10:52 AM

@Deeper: you should install teck's microstatshack :)

@xs1: yes, it's used here on vb.org :)

Courage 05-23-2003 02:57 PM

I use this on 2.3.0 is a very good hack, but i still ahve a big problem. I need to optimize showtheread page. It has to many querries

Any ideea ?

Xenon 05-23-2003 03:54 PM

*gg*
yeah, rewrite the whole file ^^

i didn't found a easy way to optimize showthread.php without rewriting it a lot...

Courage 05-23-2003 03:57 PM

this is bad. I looked to my online visitors behavior.
I have very few on Forum Home...

Y2KevSE 05-28-2003 06:24 PM

Works nicely on 2.3.0! https://vborg.vbsupport.ru/external/2003/05/1.gif https://vborg.vbsupport.ru/external/2003/05/2.gif

Alien 05-28-2003 11:17 PM

I have this hack installed, now since I don't show the moderator column on forum home and removed it's display from the templates, is there some code here that I can get rid of to reduce a query? :D

-Jason

Erwin 05-29-2003 07:17 AM

Yes - just edit index.php and comment out or remove the query that searches for the moderators. That will save you 1 query too. :)

Xenon 05-29-2003 09:55 AM

Erwin, he has my hack installed!

@Alien: nope, when you have installed my hack the query for the mods is gone already and a cache is used, so you cannot save anything more with removing the mod col

Erwin 05-29-2003 11:37 AM

Oops, sorry! :) I don't know anything about your hack, Xenon. LOL!

Xenon 05-29-2003 12:31 PM

you should look into vb.org index.php to see most of my hack ;)


All times are GMT. The time now is 05:03 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.01412 seconds
  • Memory Usage 1,824KB
  • 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
  • (3)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
  • (3)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