Okay installed NanoEntity (i believe it was his) stats hack. NOW its gone, and I have a problem. Here is the code. (sorry if im not suppost to post it)
PHP Code:
// Top 5 Statistics BY NanoEntity
// Top 5 Attachments
$attach5 = $DB_site->query('SELECT attachmentid,counter,filename FROM attachment ORDER BY attachmentid DESC LIMIT 5');
while ($attach5top = mysql_fetch_array($attach5)):
++$attach5topnbsp;
$attach5file .= "$attach5top[filename]<br>";
$attach5hits .= "$attach5top[counter]<br>";
endwhile;
// Top 5 Attachments
// Top 5 New Members
$user = $DB_site->query('SELECT userid,posts,username,joindate FROM user ORDER BY joindate DESC LIMIT 5');
while ($usertop = mysql_fetch_array($user)):
++$usertopnbsp;
$username .= "<a href=member.php?s=$session[sessionhash]&action=getinfo&userid=$usertop[userid]>$usertop[username]</a><br>";
$userposts .= "$usertop[posts]<br>";
endwhile;
// Top 5 New Members
// Top 5 Thread Replys
$pop = $DB_site->query('SELECT title,threadid,lastpost,lastposter,views FROM thread ORDER BY lastpost DESC LIMIT 5');
while ($poptop = mysql_fetch_array($pop)):
++$poptopnbsp;
$popthread .= "<a href=showthread.php?s=$session[sessionhash]&threadid=$poptop[threadid]>$poptop[title]</a><br>";
$poplastposter .= "$poptop[lastposter]<br>";
$popviews .= "$poptop[views]<br>";
endwhile;
// Top 5 Thread Replys
// Top 1 Most Popular Thread
$pop1 = $DB_site->query('SELECT title,threadid,views FROM thread ORDER BY views DESC LIMIT 1');
while ($pop1top = mysql_fetch_array($pop1)):
++$pop1topnbsp;
$pop1title .= "<a href=showthread.php?s=$session[sessionhash]&threadid=$pop1top[threadid]>$pop1top[title]</a>";
$pop1views .= "$pop1top[views]";
endwhile;
// Top 1 Most Popular Thread
// Top 1 Most Rated Thread
$rated = $DB_site->query('SELECT title,threadid,votenum FROM thread ORDER BY votenum DESC LIMIT 1');
while ($ratedtop = mysql_fetch_array($rated)):
++$ratedtopnbsp;
$ratedtitle .= "<a href=showthread.php?s=$session[sessionhash]&threadid=$ratedtop[threadid]>$ratedtop[title]</a>";
$ratedrating .= "$ratedtop[votenum]";
endwhile;
// Top 1 Most Rated Thread
eval("\$top5threadstats = \"".gettemplate("g_statistics")."\";");
// Top 5 Statistics BY NanoEntity
The hack works great! But see in my attachment, it lists 6 of the last attachments, and 5 of there hits. Could someone help fix this? It sets everything outta wack, I went though the code as best I could, and couldn't find what the problem was? Why is it showing 6 attachment names, and only 5 hits?