eXtremeTim
08-21-2002, 02:30 AM
The following code is part of my new revised version of total thread hits per forum hack. The following code if from showthread.php
Its a modified version of the original code so i know the placement is good. But the parent forums are not pulled. Thus the scripts not exicuting the quirie perfect= no count increase on db feilds.
When i hard code the variables like 2,3,4,5,6 it works just fine. So i just need it to pull the parent forums correctly.
Heres the code.
if ($noshutdownfunc) {
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
$forumparents=$DB_site->query('SELECT parentlist,displayorder,active FROM forum');
$DB_site->query("UPDATE forum SET hits=hits+1 WHERE forumid IN ($forumparents[parentlist])");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
$forumparents=$DB_site->query('SELECT parentlist,displayorder,active FROM forum');
$shutdownqueries[]="UPDATE LOW_PRIORITY forum SET hits=hits+1 WHERE forumid IN ($forumparents[parentlist])";
}
Its a modified version of the original code so i know the placement is good. But the parent forums are not pulled. Thus the scripts not exicuting the quirie perfect= no count increase on db feilds.
When i hard code the variables like 2,3,4,5,6 it works just fine. So i just need it to pull the parent forums correctly.
Heres the code.
if ($noshutdownfunc) {
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
$forumparents=$DB_site->query('SELECT parentlist,displayorder,active FROM forum');
$DB_site->query("UPDATE forum SET hits=hits+1 WHERE forumid IN ($forumparents[parentlist])");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
$forumparents=$DB_site->query('SELECT parentlist,displayorder,active FROM forum');
$shutdownqueries[]="UPDATE LOW_PRIORITY forum SET hits=hits+1 WHERE forumid IN ($forumparents[parentlist])";
}