Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Bane Bane is offline
Developer Last Online: Apr 2013 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 10-18-2001 Last Update: Never Installs: 335
 
No support by the author.

For vBulletin version: 2.3.x
Files added: vbs_counter.php, vbstats.php, vbstats_admin.php, vbstats_set.php
Files to edit: None! (all hacking is optional)
Current Version: 230.b (02.14.03 - 3am CST)

What does it do?
  • Tracks + Displays Visitors Browser
  • Tracks + Displays Visitors OS
  • Tracks Referring Sites
  • Tracks Total Hits
  • Tracks Top Posters
  • Tracks Top Forums
  • Tracks Top Threads
  • Displays a Massive Amount of Stats
  • Link Queue!
  • Install File!
  • Un-Install File
  • Intergration with vBPortal 2.x/3.x
  • Members,Staff,Active,Non-Active,Activity Level,Newest Member,Top Referrer
  • Threads,Posts,PMs,Thread Views,Page Views
  • (vBPortal) News Stories,Comments,Weekly Surveys
  • (vBPortal 3.x) Link Categories, Links
  • More but I'm tired of typing already

Check the samples:
Stats
http://www.talkloud.net/forums/vbstats.php
Incoming Referrals
http://www.talkloud.net/forums/vbsta...ction=incoming
Member Referrals
http://www.talkloud.net/forums/vbsta...on=memberrefer
Top Posters
http://www.talkloud.net/forums/vbsta...ion=topposters
Top Threads/Forums
http://www.talkloud.net/forums/vbsta...ion=topthreads
Top Visitors Countries
http://www.talkloud.net/forums/vbsta...action=country


Here's the newest version, it's only been a year and a half since the last update!

Translations have been removed as it just made it easy for people to get the hack even without a license. I am hoping people who make translations will be kind enough to post here.

Special Note: I am about as far as it gets from a PHP guru. This is my first hack or addon or whatchamacallit. If this somehow nukes your system Im quite apologetic, but I know you will all be smart enough to BACK UP YOUR DATABASE BEFORE INSTALLING THIS.. I have faith Brad and Chen have both checked this out and given their stamps on it but that doesnt mean it will all Gel for you. Be smart, back it up.

Install: There is a self install file that takes care of the templates and tables, simply unzip the package and upload it (with paths) to your vbulletin directory. Then run the install. Please be sure you add your site (yoursite.com) to the excluded urls in the CP. If you dont your site will get counted as a referrer and that can get messy.

Demo: You can of course see the demo at http://www.talkloud.net/ however if you'd like to see it in use on some other boards check out vbstats page where I will try to keep a list of installs for you to check out. If you do install it please let me know so I can put your site up!

I tested this on my test forum, and on one public forum, and all went well, if there are any problems you notice please report them here as soon as possible.

-------
CHANGELOG

[230.b] Changed Active Users to fix a small bug.
[230.b] Like, tested it and stuff..
[230.a] The MySQL Row=O error is now customized to say add to the template!!!!
hopefully no more "where did I go wrong?" posts! Muahahaha!
[230.a] Fixed Upgrade Counter (?action=upgrade)
[230.a] Set Excluded URL.. Now lists URLS
[230.a] Updated Istall to be compatible with vB 2.3.0
[230.a] Changed Most Number Results to Have a , format (ie 1,000 instead of 1000)
[230.a] I decided Frosted Flakes really are pretty tasty.
[230.a] Implemented Kurafires Member Referrer Changes, thanks Kura
[230.a] Implemented Kurafires Top Posters rewrite.



DEAR GOD CHECK THE SECOND POST OF THIS THREAD BEFORE YOU ASK A QUESTION!!!!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #1172  
Old 11-14-2003, 06:50 PM
digitalSite's Avatar
digitalSite digitalSite is offline
 
Join Date: Nov 2003
Location: Gator Nation
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does not show up on my FRONT PAGE!
It only works in my admin...does anyone know how to have it show on the forum home?

EDIT:

I added MY OWN STATISTICS link in the FOOTER template right next to "Contact Us - MYForum" links at the bottom.

I am also using vbHome Lite and got errors on top of my home page, like Warning Failed vbs_counter.php or something like that. All I did to solve that problem was do what others did in this thread:

Put (a copy of ) vbs_counter.php in your ROOT directory of vbHome. So that you have one inside root and the other copy inside /forum folder.

That's it!
Reply With Quote
  #1173  
Old 11-16-2003, 02:39 PM
highlander_RD's Avatar
highlander_RD highlander_RD is offline
 
Join Date: Oct 2003
Location: Italy
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm sorry to bother again after so many tons of posts... but I definetely need your help!

I installed the hack today on my vB 2.2.9 (licensed)
Everything was OK, except the problem of showing stats on forum's front page.
I followed what was indicated here:
https://vborg.vbsupport.ru/showthrea...406#post201406 and installed the add-ons,
and I copied vbs_counter.php in forum's root.

*** No results: no stats in my homepage. ***

here is the vbstats.php page: http://forum.risiko.it/vbstats.php
and here the forum home page: http://forum.risiko.it
below the forumlist you can find the "empty" stats area...
[added at the bottom of forumhome_loggedinusers template]

ThanXs for help!

EDITED:
I fixed everything.
1) I put $vbstats in my forumhome template, formatting as desired the vbstast_forumhome template as suggested in add-ons.
2) I had to copy all the codes contained in vbstats.php (related to stats of forumand today) to index.php (under firefly today is missing the code $todayviews!)
3) I had to put $tltoday=time()-(86400); under // Today [FireFly] as indicated in some of these 77 pages...

I thank a lot Bane for the masterpiece. Great!!! (already clicked "install")

Byez
Reply With Quote
  #1174  
Old 11-16-2003, 07:33 PM
digitalSite's Avatar
digitalSite digitalSite is offline
 
Join Date: Nov 2003
Location: Gator Nation
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I only set up vbStat that was on the first entry.
I followed the "addon" instructions, but it never showed up on my forum 2.3.2.
So I removed all the things that the "addon instructions" told me to do and only did what the original vbStat instructions told me to do only.

Then I just went to admin control panel and clicked on vbStats, which showed up fine, looked at what page or link that was, and then edited FOOTER template for the forum and added the link to Stats there.

The only thing I see now, is the the PMs or Private Messages show DOUBLE the amount there really are in my box...probably because we have TWO counters, one in root and one in forums folder.

I don't know how to fix this.
Reply With Quote
  #1175  
Old 11-16-2003, 10:18 PM
Xyphen's Avatar
Xyphen Xyphen is offline
 
Join Date: Dec 2002
Location: ON, Canada
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bane, are you going to release a vB3 version of vBStats when the vb3 hacks are allowed or you quit?
Reply With Quote
  #1176  
Old 11-18-2003, 09:51 PM
highlander_RD's Avatar
highlander_RD highlander_RD is offline
 
Join Date: Oct 2003
Location: Italy
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wonder if there's any mercy soul who can help me in the optimization of the frontpage vbstats code.

Everything is working fine ( http://forum.risiko.it ) but, since I'm a totally newbie in php and mysql programming, I'm quite sure there's a fastest way to obtain the same figures shown in my forum HP.

I'm publishing below
1) index.php
2) vbstats_forumhome template

I beg your pardon if i post in the wrong area. Sorry, and forgive me.
Thanks much to people who can help me.

1) index.php
Code:
<?php
error_reporting(7);

$templatesused='forumhome_birthdaybit,error_nopermission,forumhome_pmloggedin,forumhome_welcometext,forumhome_logoutcode,forumhome_newposts,forumhome_todayposts,forumhome_logincode,forumhome_loggedinuser,forumhome_loggedinusers,forumhome_lastpostby,forumhome_moderator,forumhome_forumbit_level1_nopost,forumhome_forumbit_level1_post,forumhome_forumbit_level2_nopost,forumhome_forumbit_level2_post,forumhome,forumhome_unregmessage';
$loadbirthdays=1;
$loadmaxusers=1;

require('./global.php');

$permissions=getpermissions();
if (!$permissions['canview']) {
	show_nopermission();
}

//check usergroup of user to see if they can use PMs
//$permissions=getpermissions($forumid);
if ($enablepms==1 and $permissions['canusepm'] and $bbuserinfo['receivepm']) {
  $ignoreusers="";
  if (trim($bbuserinfo['ignorelist'])!="") {
    $ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' ', trim($bbuserinfo['ignorelist'])));
  }

  $allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
  $newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
  $unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");

  if ($newpm['messages']==0) {
    $lightbulb='space';
  } else {
    $lightbulb='sirena';
  }
  eval("\$pminfo = \"".gettemplate('forumhome_pmloggedin')."\";");

} else {
  $pminfo='';
}

// How Many?
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format(($numbersmembers['users']), 0, ',', '.');
$snonposters=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user WHERE posts=0');
$nonposters=number_format(($snonposters['users']), 0, ',', '.');
$activemembers=number_format((($numbersmembers['users'])-$nonposters), 0, ',', '.');
$activityrate=number_format(($activemembers/$numbermembers/10), 2, ',', '.');
	
// Equate [Added Post 230.b to resolve Active Users issues]
// $activemembers=number_format($activemembers);
// $nonposters=number_format($nonposters);

// PM Totals
$totalpms = $DB_site->query_first("SELECT count(*) as pmcount FROM privatemessage");
$totalpm = number_format(($totalpms[pmcount]), 0, ',', '.');

// Staff
$anum = mysql_num_rows(mysql_query("select * from user WHERE usergroupid=5 or usergroupid=6 or usergroupid=7"));

// get total posts & threads
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format(($countposts['posts']), 0, ',', '.');

$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format(($countthreads['threads']), 0, ',', '.');

// thread Most Viewed
$top3d1=$DB_site->query("SELECT threadid, title, views FROM thread GROUP BY threadid ORDER BY views DESC LIMIT 1");
	while ($top3d=$DB_site->fetch_array($top3d1)) {
	$top3d1views = number_format(($top3d[views]), 0, ',', '.');
	$top3d1id =($top3d[threadid]);
	$top3d1title =($top3d[title]);	
	$maxchars='20'; // title lenght
    if (strlen($top3d1title) > $maxchars) {
	$top3d1title = substr($top3d1title, 0, $maxchars-2) . '...';
		}
	}

// get total views
$boardviews = $DB_site->query_first("SELECT SUM(views) AS threadviews FROM thread");
$totalviews = number_format(($boardviews[threadviews]), 0, ',', '.');

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

// if user is know, then welcome
if ($bbuserinfo['userid']!=0) {
  $username=$bbuserinfo['username'];
  eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";");
  eval("\$logincode = \"".gettemplate('forumhome_logoutcode')."\";");
  eval("\$newposts = \"".gettemplate('forumhome_newposts')."\";");

} else {
  $welcometext = "";
  eval("\$newposts = \"".gettemplate('forumhome_todayposts')."\";");
  eval("\$logincode = \"".gettemplate('forumhome_logincode')."\";");
}

$birthdaybits="";
if ($showbirthdays) {

  $birthdays = gettemplate('birthdays',0,0);
  $btoday = explode('|||',$birthdays);
  $today = vbdate("Y-m-d",time());
  if (($today != $btoday[0] and $today != $btoday[1]) or empty($birthdays))  { // Need to update!
    if (empty($birthdays)) {
		$DB_site->query("INSERT INTO template (templateid, templatesetid, title, template) VALUES (NULL, '-2', 'birthdays', '')");
	}
    getbirthdays();
    $birthdays = $DB_site->query_first("SELECT template FROM template WHERE title='birthdays' and templatesetid = -2");
    $birthdays = $birthdays[template];
    $btoday = explode('|||',$birthdays);
  }

  if ($today == $btoday[0]) {
    $birthdays = $btoday[2];
  } elseif ($today == $btoday[1]) {
    $birthdays = $btoday[3];
  }

  if ($birthdays) {
    eval("\$birthdaybits = \"".gettemplate("forumhome_birthdaybit")."\";");
  }
}

//Forum info
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
while ($forum=$DB_site->fetch_array($forums)) {
    $iforumcache["$forum[parentid]"]["$forum[displayorder]"]["$forum[forumid]"] = $forum;
}
$DB_site->free_result($forums);
unset($forum);

//Forum perms
$forumperms=$DB_site->query("SELECT forumid,canview,canpostnew FROM forumpermission WHERE usergroupid='$bbuserinfo[usergroupid]'");
while ($forumperm=$DB_site->fetch_array($forumperms)) {
  $ipermcache["$forumperm[forumid]"] = $forumperm;
}
$DB_site->free_result($forumperms);
unset($forumperm);

$accesscache = array();
if ($bbuserinfo['userid']!=0 AND $enableaccess) {
  //Access table perms
  $accessperms=$DB_site->query("SELECT forumid,accessmask FROM access WHERE userid='$bbuserinfo[userid]'");
  while ($accessperm=$DB_site->fetch_array($accessperms)) {
    $accesscache["$accessperm[forumid]"] = $accessperm;
  }
  $DB_site->free_result($accessperms);
  unset($accessperm);

  // usergroup defaults
  $usergroupdef['canview'] = $permissions['canview'];
  $usergroupdef['canpostnew'] = $permissions['canpostnew'];

  // array for accessmask=0
  $noperms['canview'] = 0;
  $noperms['canpostnew'] = 0;
}

$imodcache = array();
$mod = array();
$forummoderators=$DB_site->query('SELECT user.userid,user.username,moderator.forumid
                                  FROM moderator
                                  LEFT JOIN user
                                    ON (moderator.userid=user.userid)
                                  ORDER BY user.username');
while ($moderator=$DB_site->fetch_array($forummoderators)) {
  $imodcache["$moderator[forumid]"][] = $moderator;
  $mod["$moderator[userid]"] = 1;
}
$DB_site->free_result($forummoderators);
unset($moderator);

$activeusers = "";
$loggedinusers = "";
if ($displayloggedin) {
  $datecut=time()-$cookietimeout;

  $loggedins=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut");
  $numberguest=$loggedins['sessions'];

  $numbervisible=0;
  $numberregistered=0;

  $loggedins=$DB_site->query("SELECT DISTINCT session.userid,username,invisible,usergroupid
                              FROM session
                              LEFT JOIN user ON (user.userid=session.userid)
                              WHERE session.userid>0 AND session.lastactivity>$datecut
                              ORDER BY invisible ASC, username ASC");
  if ($loggedin=$DB_site->fetch_array($loggedins)) {
    $numberregistered++;
    if ($loggedin['invisible']==0 or $bbuserinfo['usergroupid']==6) {
      $numbervisible++;
      $userid = $loggedin['userid'];
      if ($loggedin['invisible'] == 1) { // Invisible User but show to Admin
        $invisibleuser = '*';
      } else {
        $invisibleuser = '';
      }
      if ($loggedin['usergroupid'] == 6 and $highlightadmin) {
      	$username = "<b><i>$loggedin[username]</i></b>";
      } else if (($mod["$userid"] or $loggedin['usergroupid'] == 5) and $highlightadmin) {
      	$username = "<b>$loggedin[username]</b>";
      } else {
				$username = $loggedin['username'];
			}
      eval("\$activeusers = \"".gettemplate('forumhome_loggedinuser')."\";");
    }

    while ($loggedin=$DB_site->fetch_array($loggedins)) {
      $numberregistered++;
      $invisibleuser = '';
      if ($loggedin['invisible']==1 and $bbuserinfo['usergroupid']!=6) {
        continue;
      }
      $numbervisible++;
      $userid=$loggedin['userid'];
      if ($loggedin['invisible'] == 1) { // Invisible User but show to Admin
        $invisibleuser = '*';
      }
      if ($loggedin['usergroupid'] == 6 and $highlightadmin) {
	    $username = "<b><i>$loggedin[username]</i></b>";
			} else if (($mod["$userid"] or $loggedin['usergroupid'] == 5) and $highlightadmin) {
				$username = "<b>$loggedin[username]</b>";
			} else {
				$username = $loggedin['username'];
			}
      eval("\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";");
    }
  }
  $DB_site->free_result($loggedins);

  $totalonline=$numberregistered+$numberguest;
  $numberinvisible=$numberregistered-$numbervisible;

  $maxusers=explode(" ", gettemplate('maxloggedin',0,0));
  if ((int)$maxusers[0] <= $totalonline) {
    $time = time();
    $maxloggedin = "$totalonline " . $time;
    $DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
    $maxusers[0] = $totalonline;
    $maxusers[1] = $time;
  }
  $recordusers = $maxusers[0];
  $recorddate = vbdate($dateformat,$maxusers[1]);
  $recordtime = vbdate($timeformat,$maxusers[1]);
  eval("\$loggedinusers = \"".gettemplate('forumhome_loggedinusers')."\";");
}

// Start makeforumbit
function makeforumbit($forumid,$depth=1,$permissions='') {
  global $DB_site,$bbuserinfo,$iforumcache,$ipermcache,$imodcache,$session,$accesscache,$usergroupdef,$noperms;
  global $showlocks,$hideprivateforums,$showforumdescription,$forumhomedepth,$dateformat,$timeformat,$enableaccess;

  if ( !isset($iforumcache["$forumid"]) ) {
    return;
  }

  $forumbits = '';

  while ( list($key1,$val1)=each($iforumcache["$forumid"]) ) {
    while ( list($key2,$forum)=each($val1) ) {

      // Permissions
      if ( $enableaccess and is_array($accesscache["$forum[forumid]"]) ) {
        if ($accesscache["$forum[forumid]"]['accessmask']==1) {
          $forumperms = $usergroupdef;
        } else {
          $forumperms = $noperms;
        }
      } else if ( is_array($ipermcache["$forum[forumid]"]) ) {
        $forumperms = $ipermcache["$forum[forumid]"];
      } else {
        $forumperms = $permissions;
      }

      $trueperm['canview'] = $forumperms['canview'];

      if (!$hideprivateforums) {
        $forumperms['canview']=1;
      }

      if (!$forumperms['canview']) {
        continue;
      } else {
        $forumshown=1;

        // do light bulb
        if ($bbuserinfo['lastvisitdate']=='Never') {
          $forum['onoff']='on';
        } else {
					if (($fview = get_bbarraycookie('forumview', $forum['forumid'])) > $bbuserinfo['lastvisit']) {
						$userlastvisit=$fview;
					} else {
						$userlastvisit=$bbuserinfo['lastvisit'];
					}
          if ($userlastvisit<$forum['lastpost']) {
            $forum['onoff']='on';
          } else {
            $forum['onoff']='off';
          }
        }

        if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
          $forum['onoff'].='lock';
        }

        // prepare template vars
        if (!$showforumdescription) {
          $forum['description']='';
        }

        // dates
        if ($forum['lastpost']>0) {
          $maxchars='30'; // title lenght
          if($trueperm['canview']) {
            $forum['lastthread']=unhtmlspecialchars($forum['lastthread']);
            if (strlen($forum['lastthread']) > $maxchars) {
              $forum['lastthread'] = substr($forum['lastthread'], 0, $maxchars-2) . '...';
            }
          }
          $forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
          $forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
          eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
        } else {
          $forum['lastpostinfo']='Never';
        }

        $listexploded=explode(",", $forum['parentlist']);
        while ( list($mkey1,$mval1)=each($listexploded) ) {
          if ( !isset($imodcache["$mval1"]) ) {
            continue;
          }
          reset($imodcache["$mval1"]);
          while ( list($mkey2,$moderator)=each($imodcache["$mval1"]) ) {
            if ( !isset($forum['moderators']) ) {
              eval("\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";");
            } else {
              eval("\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";");
            }
          }
        }

        if ( !isset($forum['moderators']) ) {
          $forum['moderators'] = '&nbsp;';
        }

        if ($forum['cancontainthreads']==1) {
          $tempext = '_post';
        } else {
          $tempext = '_nopost';
        }

        eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");

        if ($depth<$forumhomedepth) {
          $forumbits.=makeforumbit($forum['forumid'],$depth+1,$forumperms);
        }
      } // END if can view
    } // END while ( list($key2,$forum)=each($val1) ) {
  } // END while ( list($key1,$val1)=each($iforumcache["$forumid"]) ) {

  unset($iforumcache["$forumid"]);
  return $forumbits;
}

if (!isset($forumid) or $forumid==0 or $forumid=='') {
  $forumid=-1;
} else {
  // need to get permissions for this specific forum
  $permissions=getpermissions(intval($forumid));
}
$forumbits=makeforumbit(intval($forumid), 1, $permissions);

/* vbStats [forumhome]
#########################################*/
// Today post and threads [FireFly]
$tltoday=time()-(86400);
$getpoststoday=$DB_site->query_first("SELECT count(*) AS count FROM post WHERE dateline>='$tltoday'");
$poststoday=number_format(($getpoststoday[count]), 0, ',', '.');
$getthreadstoday=$DB_site->query_first("SELECT count(*) AS count FROM thread WHERE dateline>='$tltoday'");
$threadstoday=number_format(($getthreadstoday[count]), 0, ',', '.');

// Today Views
$tltoday=time()-(86400);
$todayboardviews = $DB_site->query_first("SELECT SUM(views) AS threadviews FROM thread WHERE dateline>='$tltoday'");
$todayviews = number_format(($todayboardviews[threadviews]), 0, ',', '.');

// ########## New Users Today
$tltoday=time()-(86400);
$getnewusertoday=$DB_site->query_first("SELECT count(*) AS count FROM user WHERE joindate>='$tltoday'");
$newusertoday=number_format(($getnewusertoday[count]), 0, ',', '.');

// PM Today
$tltoday=time()-(86400);
$todaypms = $DB_site->query_first("SELECT count(*) as pmcount FROM privatemessage WHERE dateline>='$tltoday'");
$todaypm = number_format(($todaypms[pmcount]), 0, ',', '.');

	// 24 Hours
$datecut3=time()-(86400);
	$toppost3=$DB_site->query("SELECT COUNT(post.userid) as posts, user.username, user.userid FROM post, user WHERE post.userid=user.userid AND post.dateline>=$datecut3 GROUP BY user.userid ORDER BY posts DESC LIMIT 1");
	while ($user3=$DB_site->fetch_array($toppost3)) {
		$numbertopposts=number_format($user3[posts]);
		$topposter=($user3[username]);
		$topposterid=($user3[userid]);
}

  eval("\$vbstats = \"".gettemplate('vbstats_forumhome')."\";");
// vbStats [forumhome] END


$unregwelcomemessage='';
if ($bbuserinfo['userid']==0) {
  eval("\$unregwelcomemessage = \"".gettemplate('forumhome_unregmessage')."\";");
}

eval("dooutput(\"".gettemplate('forumhome')."\");");

?>
2) template
Code:
<table align="left" border=0 cellpadding="0" cellspacing="0" valign="top">
<tr height="3">
<td></td>
</tr>
<tr align="left">
<td width="120"><smallfont><a href="memberlist.php?s=$session[sessionhash]">Iscritti</a>:&nbsp; <b>$numbermembers</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
Nuovi Iscritti:&nbsp;<b>$newusertoday</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
<a href="showgroups.php?s=$session[sessionhash]">Staff</a>:&nbsp;<b>$anum</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
Attivi:&nbsp;<b>$activemembers</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
Non Attivi:&nbsp;<b>$nonposters</b>&nbsp;&nbsp;</smallfont></td>
<td colspan="2"><smallfont>
% Attivi:&nbsp;<b>$activityrate<b><smallfont>%</b></smallfont></b>&nbsp;&nbsp;</smallfont></td></tr>
<tr>
<td><smallfont>
Stat. totali:&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
Discussioni:&nbsp;<b>$totalthreads</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
MP:&nbsp;<b>$totalpm</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
Post:&nbsp;<b>$totalposts</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
Visite:&nbsp;<b>$totalviews</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>Top Disc.: &nbsp;<b>
<a href=showthread.php?threadid=$top3d1id>$top3d1title</a></b>
&nbsp;&nbsp;</smallfont></td>
<td><smallfont>($top3d1views Visite)
&nbsp;&nbsp;</smallfont></td></tr>
<tr>
<td><smallfont>
Stat. ultime 24 ore:&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
Discussioni:&nbsp;<b>$threadstoday</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
<a href='private.php?s=$session[sessionhash]'>MP</a>: <b>$todaypm</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
<a href='search.php?action=getdaily'>Post</a>:&nbsp;<b>$poststoday</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>
Visite:&nbsp;<b>$todayviews</b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>Top Poster:&nbsp;<b><a href=member.php?action=getinfo&userid=$topposterid">$topposter</a></b>&nbsp;&nbsp;</smallfont></td>
<td><smallfont>($numbertopposts Post) &nbsp;&nbsp;</smallfont></td></tr>
</table>
</td></tr>
Reply With Quote
  #1177  
Old 11-27-2003, 05:27 AM
VAN's Avatar
VAN VAN is offline
 
Join Date: Oct 2001
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

v2.3.3 here, and I am having the same problem as many others in this thread and in the 30+ posts I've read, no solution was offered.

Installation went easy. No errors. I get no parse errors or anything, but calling myforums.com/vbstats.php brings up...

Quote:
vbStats Error!
Be sure to add this line to your phpinclude template:

include("./vbs_counter.php");

you can find you phpinclude template in your vbulletin
admin panel and in the menu templates click |edit| you
should click on the set you wish to edit and scroll down
until you see the name: phpinclude

Your template should look something like this:

// This code is PHP4 only:
// ob_start();
// require("yourheader.html");
// $header = ob_get_contents();
// ob_end_clean();
include("./vbs_counter.php");
My phpinclude template looks just like that. I have even tried it with the full path and still get the error.

How is this corrected?
Reply With Quote
  #1178  
Old 12-05-2003, 12:13 AM
fantasyiq fantasyiq is offline
 
Join Date: Oct 2003
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack, but I think the design has WAY too many database hits and I definitely noticed a slowdown on my site, especially with a lot of users online. I made a couple small modifications that greatly reduce the database hits and improve performance.

1) Removed the "include("./vbs_counter.php");" from the phpinclude template.

2) Modified global.php:
Find:
if (!$servertoobusy) {
require('./admin/sessions.php');

Add before:
if (!isset($sessionhash)) include("./vbs_counter.php");

3) Modified vbstats.php:
Find:
$vbs_today=time()-(86400);
Add:
$vbs_date = date("Y-m-j");

4) Modified template vbstats_stats:
Replaced text "Page Views" with "Sessions"
Replaced text "Views" with "Sessions" (in last 24 hour section)

That's it. What this essentially does is replace all page hit information with new session information. So the stats are only updated when a new session is created, not with every page hit. Although you lose the "Page Views" stat, everything else works fine, and the database only gets hit by vbs_counter.php when there's a new session rather than with every page hit. You would likely want to reset your counters after making this change.
Reply With Quote
  #1179  
Old 12-05-2003, 02:35 AM
zsmom's Avatar
zsmom zsmom is offline
 
Join Date: Sep 2003
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by fantasyiq
Great hack, but I think the design has WAY too many database hits and I definitely noticed a slowdown on my site, especially with a lot of users online. I made a couple small modifications that greatly reduce the database hits and improve performance.

1) Removed the "include("./vbs_counter.php");" from the phpinclude template.

2) Modified global.php:
Find:
if (!$servertoobusy) {
require('./admin/sessions.php');

Add before:
if (!isset($sessionhash)) include("./vbs_counter.php");

3) Modified vbstats.php:
Find:
$vbs_today=time()-(86400);
Add:
$vbs_date = date("Y-m-j");

4) Modified template vbstats_stats:
Replaced text "Page Views" with "Sessions"
Replaced text "Views" with "Sessions" (in last 24 hour section)

That's it. What this essentially does is replace all page hit information with new session information. So the stats are only updated when a new session is created, not with every page hit. Although you lose the "Page Views" stat, everything else works fine, and the database only gets hit by vbs_counter.php when there's a new session rather than with every page hit. You would likely want to reset your counters after making this change.
Worked great...reduced page load, lost 4 queries and server load is down. THANKS!

HA, it even took care of the errors I was getting on my vbhome page. Cool! :up:
Reply With Quote
  #1180  
Old 12-19-2003, 10:31 AM
Kamui Shirou's Avatar
Kamui Shirou Kamui Shirou is offline
 
Join Date: Sep 2002
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont think Bane's going to release the update running on his site. aww never mind. thanx
Reply With Quote
  #1181  
Old 01-06-2004, 03:23 AM
monstergamer's Avatar
monstergamer monstergamer is offline
 
Join Date: Feb 2003
Location: around the corner
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@ bane, do you think you well port this hack to VB3?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:25 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06190 seconds
  • Memory Usage 2,370KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete