Log in

View Full Version : changing statistics in index page (modified)


meowmeow
06-15-2004, 09:39 AM
the forum statistics in the index page give some info about the forum.
one thing i'd like to change is the "newest member"
form index.php i can see it is taken from these two queries:

$members = ("SELECT COUNT(*) AS users, MAX(userid) AS max FROM " . TABLE_PREFIX . "user");

and
$newuser = ("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid = $members[max]");


I want to modify it so that instead of taking the MAX(userid) it takes the MAX(joindate)

so I changed it to this:


$members = ("SELECT COUNT(*) AS users, MAX(joindate) AS max FROM " . TABLE_PREFIX . "user");
and
$newuser = ("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE joindate = $members[max]");

still it doesnt work!
when i tried these 2 queries on a test script it worked, but on the forum it didnt change.
I dont know when functions_databuild.php is called, so it could be that it just hasnt refreshed, otherwise i don't know what i'm doing wrong!

meowmeow
06-15-2004, 11:58 AM
could it have something to do with the template?

<div><phrase 1="member.php?$session[sessionurl]u=$newuserid"
2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>

meowmeow
06-16-2004, 06:29 AM
nobody can help?? please...
I have the number of posts and the number of threads which update regularly, but the number of members and the newest member who havent changed for the past 2 weeks... here is the relevant code.
everything looks alright with me.

// ### BOARD STATISTICS #################################################
// get total threads & posts from the forumcache
$totalthreads = 0;
$totalposts = 0;
if (is_array($forumcache))
{
foreach ($forumcache AS $forum)
{
$totalthreads += $forum['threadcount'];
$totalposts += $forum['replycount'];
}
}
$totalthreads = vb_number_format($totalthreads);
$totalposts = vb_number_format($totalposts);
// get total members and newest member from template
$userstats = unserialize($datastore['userstats']);
$numbermembers = vb_number_format($userstats['numbermembers']);
$newusername = $userstats['newusername'];
$newuserid = $userstats['newuserid'];


and the sql selects in the previous post...