vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Stats In Header (https://vborg.vbsupport.ru/showthread.php?t=68941)

Cyphrix 09-07-2004 10:48 AM

for newest member add this to phpinclude_start:
PHP Code:

// get newest member name and userid start
        
$getnewestmember=$DB_site->query_first("SELECT userid, username FROM user WHERE userid=$numbersmembers[max]");
        
$newusername $getnewestmember['username'];
        
$newuserid $getnewestmember['userid'];
// get newest member name and userid end 

then in the header use:
HTML Code:

<a href="member.php?u=$newuserid">$newusername</a>

Almotmaiz.Net 04-18-2005 08:36 AM

heloo FREIND ,

Step 1 : open : global.php
Step 2 : Find line 491)
Code:

eval('$header = "' . fetch_template('header') . '";');

Step 3 :Repalce with :
Code:

$mem=$DB_site->query_first("SELECT COUNT(*) AS users FROM " . TABLE_PREFIX . "user");

$thr=$DB_site->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");

$post=$DB_site->query_first("SELECT COUNT(*) AS posts FROM " . TABLE_PREFIX . "post");

$line=$DB_site->query_first("SELECT COUNT(*) AS ond FROM " . TABLE_PREFIX . "session");

$getnewestusers=$DB_site->query_first("SELECT userid,username FROM " . TABLE_PREFIX . "user order by userid DESC limit 1");

$newusername=$getnewestusers['username'];

$newuserid=$getnewestusers['userid'];

eval('$header = "' . fetch_template('header') . '";');




Step 4:
threads : $thr[threads]
Posts : $post[posts]
members : $mem[users]
new member : $newusername
finish

Marco van Herwaarden 04-18-2005 08:55 AM

Was this a reply to someones question? This is a very old thread, and the changes you suggest add more queries then needed to the page.
Quote:

Originally Posted by Almotmaiz.Net
heloo FREIND ,

Step 1 : open : global.php
Step 2 : Find line 491)
Code:

eval('$header = "' . fetch_template('header') . '";');

Step 3 :Repalce with :
Code:

$mem=$DB_site->query_first("SELECT COUNT(*) AS users FROM " . TABLE_PREFIX . "user");
 
$thr=$DB_site->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");
 
$post=$DB_site->query_first("SELECT COUNT(*) AS posts FROM " . TABLE_PREFIX . "post");
 
$line=$DB_site->query_first("SELECT COUNT(*) AS ond FROM " . TABLE_PREFIX . "session");
 
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM " . TABLE_PREFIX . "user order by userid DESC limit 1");
 
$newusername=$getnewestusers['username'];
 
$newuserid=$getnewestusers['userid'];
 
eval('$header = "' . fetch_template('header') . '";');




Step 4:
threads : $thr[threads]
Posts : $post[posts]
members : $mem[users]
new member : $newusername
finish


Princeton 04-18-2005 10:37 AM

LOL ...

Sjakie 05-08-2007 08:25 AM

Does this still work for 3.6.4? I can't seem to find the template: phpinclude_start

Logikos 05-08-2007 04:39 PM

This will not work for 3.6 versions. Instead, you need to use the global_start plugin.

Sjakie 05-12-2007 07:20 AM

Do I have to create the "golbal_start" plugin? I can't find it?

CycoreFredde 05-16-2008 09:55 AM

I want to do this aswell!

I'm using 3.7, would appreciate som help here :-)

Marco van Herwaarden 05-16-2008 11:45 AM

This thread is 4 years old, and contains mostly outdated information.

I suggest you search for a more recent thread or create a new one.

GameWizard 05-17-2008 07:13 AM

Displaying Avatar in Header Plugin:

Hook Location: global_start
Code:
Code:

if ($vbulletin->userinfo['userid'])
{
    require_once(
'./includes/functions_user.php'); //make sure we have the function we need
   
$header_avatar = fetch_avatar_url($vbulletin->userinfo['userid']);
    if (!
is_array($header_avatar))
    {
       
$header_avatar[] = $vbulletin->options['bburl'] . "/images/misc/unknown.gif";
    }
}

Then place $header_avatar where you'd like the users avatar to appear. Mind you the /images/misc/unknown.gif is the location of the image if the user does not have an avatar.
---------
Showing user stats in the header Plugin:

Hook Location: global_start
Code:
Code:

// forum stats start 
$numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user"); 
$numbermembers = number_format($numbersmembers['users']); 
$counter = $db->query_first("SELECT COUNT(postid) AS posts, COUNT(threadid) AS threads FROM " . TABLE_PREFIX . "post");
$totalposts=number_format($counter['posts']); 
$countthreads = $db->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");
$totalthreads=number_format($countthreads['threads']); 
// forum stats end 

// total online start 
$datecut = TIMENOW - $vbulletin->options['cookietimeout']; 
$headerguests=$db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "session WHERE userid=0 AND lastactivity>$datecut"); 
$headerusers=$db->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM " . TABLE_PREFIX . "session WHERE " . TABLE_PREFIX . "session.userid>0 AND " . TABLE_PREFIX . "session.lastactivity>$datecut"); 
$headerguests=$headerguests[count]; 
$headerusers=$headerusers[count]; 
$totalonline=$headerguests+$headerusers; 
// total online end

// get newest member name and userid start 
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid=$numbersmembers[max]"); 
$newusername = $getnewestmember['username']; 
$newuserid = $getnewestmember['userid']; 
// get newest member name and userid end

Use the following variables:
$totalonline = Total Users Online
$numbermembers = Total Members Registered

Unfortunately I don't have any other variables, so you'll need to find code for the other ones you'd like to display.


All times are GMT. The time now is 08:23 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.02036 seconds
  • Memory Usage 1,751KB
  • 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
  • (6)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete