vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   changing statistics in index page (modified) (https://vborg.vbsupport.ru/showthread.php?t=66184)

meowmeow 06-15-2004 09:39 AM

changing statistics in index page (modified)
 
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:

PHP Code:

$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:

PHP Code:

$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?
HTML Code:

<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.
PHP Code:

// ### 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...


All times are GMT. The time now is 10:09 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01155 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete