vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vbStats (https://vborg.vbsupport.ru/showthread.php?t=30751)

Moreliator 08-05-2003 02:46 PM

I installed on 2.3, but I think I'm missing a lot of options. For example, I can't find anywhere to turn "top styles" on and stuff.
THanks for help.

Host Directory 08-05-2003 05:14 PM

Sadly the demo hack shown at the front of this thread is not the one which you get. In fact many of the features that are shown in the demo hack do not come with this hack.
At first this seemed like a good hack but the install instructions are poor to say the least and the hack has several bugs.
For example , linux ( in operating systems ) does not count at all and i have found that i have two uk countries in the referring countries table.
There are no instructions to add the link queue to the forum homepage also.

Looks like lots of people have found bugs and there has been no updates, which is a shame because the demo vbstats looked complete.

I am probably going to uninstall and look for a different stats hack, although this one could have been the best if it had been finished.

Shame to leave a hack like this uncompleted.

influence 09-13-2003 10:09 PM

such a shame?
stop complaining. at least he gave us something instead of keeping this great feature to himself like others.

if u check his website, u will see he have other versions of it and this is the only version he is willing to release to the public.

I hate people who like to talk bad about people who are willing to share their work especially after spending alot of time doing it and then packing it up for people to use.

go make your own

steppin 09-28-2003 08:33 PM

Will this work with 2.2.6?

docvader 10-14-2003 06:59 AM

Just curious. I've installed this on my 2.3 Vbulletin without any problem, and it seems to be working just fine. (Easy install, very impressive). But, I'm getting visitors from El Salvador (lol), that are probably from Sweden. I know that this was an issue in the past, have not found any posts that have identified a fix for this.

Any news on the country detection part of this hack? Otherwise, it's just working beautifully for me.

rich
www.russbo.com

paddysplace 10-14-2003 07:09 PM

Wow, I was looking for a LOT of these so I'll definitely use this code (taking out a few functions to reduce queries to bare minimum) thanks Bane..

Regards,
Patrick

DanGarion 10-22-2003 04:23 AM

I get this everytime I click on the View Stats

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");

I have included it in my template but it still keeps doign this. Any suggestions?

Jakor Sevel 11-02-2003 09:52 PM

How do i uninstall the referrals part?

PranK 11-03-2003 07:50 AM

sweet

*clicks install*

mfacer 11-13-2003 10:36 AM

works perfeclty!!
installed in minutes with no trouble! :)

I dont suppose you might release a beta version of the version used on talkloud.net ? I went to http://influx9.com/vbstats/ to see if there was a newer version, but it says not.

I'd really like to include the search engine keyword stats.... any chance of getting that part?!

thanks!! :)

digitalSite 11-14-2003 06:50 PM

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!

highlander_RD 11-16-2003 02:39 PM

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! :D

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 ;)

digitalSite 11-16-2003 07:33 PM

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.

Xyphen 11-16-2003 10:18 PM

Bane, are you going to release a vB3 version of vBStats when the vb3 hacks are allowed or you quit?

highlander_RD 11-18-2003 09:51 PM

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>


VAN 11-27-2003 05:27 AM

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?

fantasyiq 12-05-2003 12:13 AM

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.

zsmom 12-05-2003 02:35 AM

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:

Kamui Shirou 12-19-2003 10:31 AM

I dont think Bane's going to release the update running on his site. aww never mind. thanx

monstergamer 01-06-2004 03:23 AM

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

cnczone 01-09-2004 09:38 PM

I hope so!!!

Andreas 01-11-2004 11:43 PM

I've already "ported" vBStats to vBulletin 3.

You can see it working at http://www.planetliebe.de/vbb/vbstats.php (german board, sorry).

Edit:
The path on the server is actually / v b b/vbstats.php (without the spaces) - don't know why the board keeps changing the URL :(

It's currently running on a Beta 7 Board, but will work on RC2 too (with only slight modifications).
If there's enough interest and i've got the time to compile an installation package I could release this (if Bane does allow that).

monstergamer 01-12-2004 02:12 AM

Quote:

Originally Posted by KirbyDE
I've already "ported" vBStats to vBulletin 3.

You can see it working at http://www.planetliebe.de/vB/vbstats.php (german board, sorry).

Edit:
The path on the server is actually / v b b/vbstats.php (without the spaces) - don't know why the board keeps changing the URL :(

It's currently running on a Beta 7 Board, but will work on RC2 too (with only slight modifications).
If there's enough interest and i've got the time to compile an installation package I could release this (if Bane does allow that).

i hope he dose and if he dose well you redo it in english ?

Andreas 01-12-2004 04:29 AM

It's 98% phrased, with standard phrases being english.
Just my board does use german ones as it is a german board ;)

Zelda-King 01-12-2004 07:36 AM

That's really nice. I've missed this hack due to having upgraded to vB3 quite some time ago.

monstergamer 01-12-2004 02:40 PM

i would like it back :) on vb3
as the other stats hack dont look as good and is not on a different page

carryapple 01-15-2004 09:28 AM

Hi Guys,

vbStats was working like a charm - until today. I installed phpadsnew and for some reason I can't access vbstats anymore:

Warning: Supplied argument is not a valid MySQL result resource in /home/xxxxxx/www/home/vbstats.php on line 133
1146: Table 'phpmyads.vbstats_counter' doesn't exist

any ideas? pretty weird. I already uninstalled vbstats and reinstalled it - no go, same error.

carryapple 01-16-2004 05:50 PM

anyone?

I believe vbstats tis trying to access the wrong database, can I hardcode it somehow to access the right one?

Serge 01-16-2004 06:38 PM

Quote:

Originally Posted by carryapple
anyone?

I believe vbstats tis trying to access the wrong database, can I hardcode it somehow to access the right one?

Sounds to me like you overwrited a global file reupload your vbulletin global file and make sure that you table prefix is correct.

carryapple 01-17-2004 07:22 AM

thanks for your help.

I reupped a fresh global.php, that didn't change anything though.

Where do I check if it has the right table prefix?

thanks!

Zaeolos 01-17-2004 09:15 PM

How do you get this thing to show up on your board?

Sorry if this is a stupid ?

Thanks

Zelda-King 01-17-2004 09:38 PM

You need to make a link to the page somewhere, ie, make a vBStats button as a link in your header.

Zaeolos 01-17-2004 09:51 PM

Ok..I did that..I thought there might be a way to actually show up at the bottom of the board at all times.

Thanks

Zelda-King 01-17-2004 09:58 PM

Well you could stick a link in the footer instead. It doesn't show on the actual board. It wouldn't be good for server load for all that information to be showing ALL the time.

chrisvonc 01-18-2004 05:11 PM

Installed this and seems to be working good until I tried to do a backup of my DB. I had run one the night before installing this and now after, my backup consistantly stalls at the 18mb mark.

Any idea how it could be related?

Thanks,

Chris

carryapple 01-19-2004 03:31 PM

Guys,

I've still got that problem with vBstats (see above) - it keeps on trying to access the wrong database... please help, I'd apprechiate it!

Andreas 01-19-2004 03:40 PM

@CarryApple
That's kinda strange as VbStats does use vBs Database-Class.
Where did you put vbstats.php?
Maybe it's using the wrong global.php ...

You could also try to replace all instances of mysql_query in vbstats.php with $DB_site->query.

carryapple 01-19-2004 05:42 PM

Kirby,

Weeeeee, thanks a LOT!
Replacing mysql_query with $DB_site->query did the trick, vb stats is up and running again - thank you so much! :)

Darken Rahl 01-19-2004 06:02 PM

Any way to make the vbstats.php viewable only after you login?

Andreas 01-19-2004 06:10 PM

@Darken Rahl
I don't know which vBulletin & vBStats-Version you use, but this should do the trick:

In vbstats.php, before
PHP Code:

   if (!isset($action) or $action=="") {
     
$action="stats";
   } 

Add the following code
PHP Code:

   // Check if user is logged in
   
if (!$bbuserinfo['userid'])
     
show_nopermission(); 



All times are GMT. The time now is 01:29 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.03048 seconds
  • Memory Usage 1,937KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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