View Full Version : new posts doubling page queries?
EchoHype.com
03-02-2003, 11:26 PM
Alright,
After I installed the store hack and such, I noticed that every time there is a post added in a thread, the queries jump drastically.
Example: http://www.echohype.com/forums/showthread.php?s=&threadid=307
My partner thought it may be a problem inside showthread, and he thinks that the postbit/posts are being told to do double.
Attached is the current showthread.php
Any help is greatly appreciated!
holy crap, 282 queries!
it looks like you have a block of code repeated at line 271, besides that i dunno
but, i dont think your allowed to post full php files
EchoHype.com
03-02-2003, 11:40 PM
oh......hmm.........sorry about that, I will remove it and look at the repeated block!
thanks
EDIT: couldn't seem to find that duplicate block your talking about?
@line 271 there's some code, and below that it looks like it repeats...maybe it doesn't, but it sure looked close
EchoHype.com
03-02-2003, 11:51 PM
hmm, after checking the instructions of the store hack, that block is supposed to be like that.
......hmm
is there any queries inside a while loop?
EchoHype.com
03-03-2003, 12:00 AM
how do you mean?
here's what is from the instructions of the store hack
if ($noshutdownfunc) {
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
// Store hack by Lesane
$storeview=$DB_site->query_first("select views, postuserid from thread WHERE threadid='$threadid'");
$views=$storeview[views];
$postuserid=$storeview[postuserid];
$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$view1=$storeadmin[view1];
$view2=$storeadmin[view2];
$view3=$storeadmin[view3];
$view4=$storeadmin[view4];
$view5=$storeadmin[view5];
$viewpoint1=$storeadmin[vpoint1];
$viewpoint2=$storeadmin[vpoint2];
$viewpoint3=$storeadmin[vpoint3];
$viewpoint4=$storeadmin[vpoint4];
$viewpoint5=$storeadmin[vpoint5];
if ($views == $view1)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint1 where userid='$postuserid'");
}
elseif ($views == $view2)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint2 where userid='$postuserid'");
}
elseif ($views == $view3)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint3 where userid='$postuserid'");
}
elseif ($views == $view4)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint4 where userid='$postuserid'");
}
elseif ($views == $view5)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint5 where userid='$postuserid'");
}
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
// Store hack by Lesane
$storeview=$DB_site->query_first("select views, postuserid from thread WHERE threadid='$threadid'");
$views=$storeview[views];
$postuserid=$storeview[postuserid];
$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$view1=$storeadmin[view1];
$view2=$storeadmin[view2];
$view3=$storeadmin[view3];
$view4=$storeadmin[view4];
$view5=$storeadmin[view5];
$viewpoint1=$storeadmin[vpoint1];
$viewpoint2=$storeadmin[vpoint2];
$viewpoint3=$storeadmin[vpoint3];
$viewpoint4=$storeadmin[vpoint4];
$viewpoint5=$storeadmin[vpoint5];
if ($views == $view1)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint1 where userid='$postuserid'");
}
elseif ($views == $view2)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint2 where userid='$postuserid'");
}
elseif ($views == $view3)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint3 where userid='$postuserid'");
}
elseif ($views == $view4)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint4 where userid='$postuserid'");
}
elseif ($views == $view5)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint5 where userid='$postuserid'");
}
}
Erwin
03-03-2003, 12:01 AM
This will kill your server.
Page generated in 0.73848796 seconds (49.96% PHP - 50.04% MySQL) with 282 queries.
There is something wrong with how you've installed the Store Hack I'm sure. Uninstall it out of showthreads, and reinstall it and see if that fixes it.
EchoHype.com
03-03-2003, 12:14 AM
ugh,
I reverted them, uploaded, was still there. then reinstalled the changes and still there........
:(
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.