View Full Version : PHP Coding
Dean C
04-21-2002, 02:51 PM
I am using the hack which displays the top thread starter (think its called stats hack)
and i have made a page using c-prompts tutorial to get a php to refer to a template...
so i have home.php and my html in a template..
i would like to display the top thread starters and also the basic stats like total number of members in my home.php file
i have tried inserting them into the template but it does not work...
here's is my current php file:
<?php
error_reporting(7);
require('./global.php');
eval("dooutput(\"".gettemplate('homepage')."\");");
?>
Thanks in Advance
Dean C
04-22-2002, 03:09 PM
*bump* - i really need help with this :D
Well total number of members would be
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);
and the top posters would be
// Top 10 Posters
$posts10 = $DB_site->query('SELECT userid,username,posts FROM user ORDER BY posts DESC LIMIT 10');
while ($posts10top = mysql_fetch_array($posts10)):
++$posts10topnbsp;
$posts10name .= "<a href=member.php?s=$session[sessionhash]&action=getinfo&userid=$posts10top[userid]>$posts10top[username]</a><br>";
$posts10post .= "$posts10top[posts]<br>";
Dean C
04-23-2002, 05:37 PM
i tried inserting the no.of members thing in there and it didn't work... and the TOP 10 posters gave me an error...
it may be myself just inserting it into the wrong place... can any1 help me ??
Thanks In Advance
Sparkz
04-23-2002, 06:09 PM
It would help if you posted the error messages too.
Kinda hard to guess what might be wrong without seeing any output from the script :)
Dean C
04-23-2002, 06:21 PM
i corrected the error.. so i wud have to go bac and do it again...
Dean C
04-24-2002, 05:49 PM
perhaps i shud explain more fully what i want to do ...
the code in the first post is what i have at the moment... it simply links to a template... but i want to be able to display the total no. of members, thread, posts and the newest member and the top posters in it...
i really have no idea where to start... i don't kno where to insert any codes even if i had them...
can any1 help :D??
Thanks In Advance
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.