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)

NYI Fan 11-10-2001 05:51 PM

Bane, and everyone else who posted help along the way on this thread
THANK YOU!

This was an easy install and my members LOVE it!!

Than you Thank you Thank you!!!

Dartigan 11-10-2001 11:52 PM

Thanks. :) Quick Q though: Is there an easy way to reset it? MY forum isn't open to the public yet and I'll want to reset it when it goes live.

Thanks again on the nice hack. :D
- Dart

FWC 11-11-2001 12:23 AM

Great job, Bane!! I just installed it with the 2.2.0 mods and it worked perfectly. :)

jselwyn 11-13-2001 02:08 PM

Thanks Bane.
Until 3 weeks ago, I knew little about html, php etc. Then bought vBulletin, have now just installed your hack and it works brilliantly first time. We are now running a UK government online consultation without a problem and can provide them with excellent stats. Thanks again

LuBi 11-13-2001 02:45 PM

Said it before, but this is great! Thanks! :D

LuBi 11-13-2001 03:01 PM

I get the following error at the top of my vbstats.php page.

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 159

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 165

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 162

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 186

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 148

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 139

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 145

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 142

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 136

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 151

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 154

Any help would be great. Thanks again

DarkReaper 11-13-2001 04:17 PM

I think that's because you didn't <? include("vbs_counter.php"); ?> in your phpinclude header.

Bane, any idea on when you'll be releasing the new version with 2.2.0 compatibility, as well as new features?

LuBi 11-13-2001 05:00 PM

lol now I get:

Parse error: parse error in /www/htdocs/forums/global.php(274) : eval()'d code on line 6

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 159

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 165

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 162

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 186

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 148

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 139

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 145

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 142

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 136

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 151

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 154

** Also it does work with 2.2, it works with mine... Kind of.. But others have it running on their 2.2 forums.

FWC 11-13-2001 05:04 PM

I don't know if it matters, but my phpinclude only has:

include("vbs_counter.php");

added to it.

DarkReaper 11-13-2001 06:13 PM

Sorry, should've been more clear. You don't throw in the <??>, I just habitually did that because its php code :)

LuBi 11-13-2001 08:56 PM

Well I got rid of one problem, thanks... but still have this.

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 159

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 165

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 162

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 186

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 148

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 139

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 145

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 142

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 136

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 151

Warning: Division by zero in /www/htdocs/forums/vbstats.php on line 154

Any help would be great..

Bane 11-13-2001 10:13 PM

LuBi make sure that you add

include("vbs_counter.php");

to the php include template. That error springs from having no entries in the database.

DarkReaper I have been slacking a little due to some personal issues that are being dealt with atm. This is still on my to do list, it just had to be moved back a bit to make way for some paying projects as the fundage was running awful low. As soon as Im caught up there will be a new release, I havent given up on vbStats.

LuBi 11-13-2001 10:18 PM

Quote:

Originally posted by Bane
LuBi make sure that you add

include("vbs_counter.php");

to the php include template. That error springs from having no entries in the database.

DarkReaper I have been slacking a little due to some personal issues that are being dealt with atm. This is still on my to do list, it just had to be moved back a bit to make way for some paying projects as the fundage was running awful low. As soon as Im caught up there will be a new release, I havent given up on vbStats.

Great as usual! thanks, I forgot the "include" from the line... works great now

Steve Machol 11-15-2001 01:00 AM

Something strange happened. All my vbstat templates are gone. I haven't made any changes yet when I checked them today they were gone from all my style sets?

What could have caused this? And more importantly, how do I get them back? I'm hesitant to tun the installation again because I don't want duplicate tables in my database.

Bane 11-15-2001 01:57 AM

Not sure what would set them missing (unless you reuploaded the vb default style) but to get them back run the install again and select [UPGRADE]

Steve Machol 11-15-2001 02:07 AM

No - no changes to the styles. The only thing I changed was a bug-fix test of template.php. However reinstalling the original template.php did not bring them back.

Steve Machol 11-15-2001 02:09 AM

Thanks - the 'upgrade' worked! :)

JTMON 11-15-2001 03:07 AM

Great Hack!!!

Just installed using only the code in the zipfile using 2.2.0. The only time I ran into slight problems was with the code to replace for admin/index.php. I just threw it inbetween the Forum Home and Forum Options and all seems to work great.

One question. Where/how would I edit the footer to include the stats on the main index?

Thanks for a great hack!!

FWC 11-15-2001 03:36 AM

Quote:

Originally posted by JTMON
One question. Where/how would I edit the footer to include the stats on the main index?
You could just put something like:

<a href="vbstats.php?s=$session[sessionhash]"><smallfont>Statistics</smallfont></a>

anywhere you want in your footer template. You can add any enhancements like making it bold.

jselwyn 11-15-2001 09:34 AM

As I said before the hack is great - just some questions on it:
1) Excuse my ignorance but what does Activity Level represent?
2) On forum stats I have over 300 views this week and going up all the time but on views in last 24 hours it shows 0 even though total views continues to increase - is this something different?
3) Is it possible to insert some code to find out how many different people viewed the site over a set period of time (even better who viewed the site)?
cheers

JTMON 11-15-2001 12:34 PM

Quote:

Originally posted by FWC
You could just put something like:

<a href="vbstats.php?s=$session[sessionhash]"><smallfont>Statistics</smallfont></a>

anywhere you want in your footer template. You can add any enhancements like making it bold.

Well that's almost what I wanted to do. But actually, I want to take the code in vb_stats.php and tack it on the end of whatever template the main forum index is. So that, beneath the Private Message part, the vb_stats would show there.

TIA!

SWFans.net 11-15-2001 06:22 PM

Quote:

Originally posted by JTMON


Well that's almost what I wanted to do. But actually, I want to take the code in vb_stats.php and tack it on the end of whatever template the main forum index is. So that, beneath the Private Message part, the vb_stats would show there.

TIA!

I just copied a few of the variable's defenition lines into index.php, and set it up like you are trying to, though its under my "Currently Online" display.

http://www.swforums.net/forum

Gholsie 11-15-2001 10:43 PM

Quote:

Originally posted by Bane
LuBi make sure that you add

include("vbs_counter.php");

to the php include template. That error springs from having no entries in the database.

I've been reading up on this issue because I just installed vbStats on my system with phpPortals. I dug deep into the system and couldn't find a file named "phpinclude" at all. But, I did manage to find (from this thread) instructions to add your include statement to my "globals.php" located in my vBulletin forum (/forums) directory.

After I added that statement, it all works fine.

BTW: Your DOCS Install.txt file is vague on this issue. It just says, "Add this statement to your phpinclude template"..... This, I think, is where people got a little lost. I know I did. I was looking for a file the whole time.

[m]

FWC 11-15-2001 10:59 PM

Quote:

Originally posted by Gholsie

I dug deep into the system and couldn't find a file named "phpinclude" at all.

phpinclude is not a file. It's a template. It also shows up at the top of Modify Styles as PHP parsed code:.

humble 11-15-2001 11:23 PM

Excellent hack!!! working great on both my old 2.0.3 and my new 2.2.0...

Much appreciated.

JTMON 11-16-2001 04:17 AM

ok I'm having a slight problem trying to add the relevant code to my forumhome template. I copy the appropriate code I want from the vbstats templates into the forumhome template where I want it. It displays correctly, links and all, but I get no totals for any fields except threads, members, and posts, the rest are empty. I have put the vbcounter... in the phpinclude template also and if I goto vbstats.php all the totals are there.

Bane 11-16-2001 04:22 AM

You need the corresponding code from the vbstats.php file added in as well if you wish to have that found

JTMON 11-16-2001 04:23 AM

So look at the variables in the source and put them in the template?

Bane 11-16-2001 04:47 AM

No, you would have to hack them into the index.php if you want it to show on forumhome.

What are you trying to include there?

JTMON 11-16-2001 04:50 AM

Member Stats, Forum Stats and Last 24 Hours. I have everything showing up except for the totals. All the text and tables are there. I just don't know what to grab from vbstats.php

FWC 11-16-2001 05:11 AM

Quote:

Originally posted by JTMON
Member Stats, Forum Stats and Last 24 Hours. I have everything showing up except for the totals. All the text and tables are there. I just don't know what to grab from vbstats.php
To get the totals you'll have to do what Bane said and hack the PHP code in that generates the totals. The variables are generated in vbstats.php. If you want them somewhere else, you need to put the code to generate the variables there.

JTMON 11-16-2001 04:19 PM

Well when I grab the code I want from vbstats and add it just about anywhere in index.php I get a parse error on the last line of index.php which is ?>

JTMON 11-16-2001 04:23 PM

The code I am trying to insert into index.php from vbstats.php is:

Code:

// #########################################
// vBStats by Bane Macleod (http://www.talkloud.net/)
// (c) influx9.Design
// For vBulletin version 2.0.3
// (c) 2001 Jelsoft Enterprises, Ltd.
// #########################################
// Thanks for trying out vbStats. I would appreciate you leaving
// everything as is (including gratis) and if you do that you certainly
// deserve a thank you, and I do, however I know most of you
// won't so here is the one thing I ask. Please do not claim this work
// as your own or remove the header/hack notifications. This is
// peoples work and they should get credit.
// #########################################

// ###############################
// Other Vars (DO NOT MODIFY!!!)
// ###############################

$tl_statsv="203.2";
$tl_statsu="talkloud.net/vbstats/";
$tltoday=time()-(86400);

// ###############################

require('./global.php3'); // vBulletin Globals
require('./vbslang_en.php3'); // Future Language File

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

// ###############################
//  Stats Page
// ###############################
// Hacks Incorperated:
//  Colored Users Online Hack by Afterburner
//  Top Referrer by FireFly
// ###############################
if ($action=="stats") {

// ########## Breadcrumb
$tl_title=""._STATS."";
$breadcrumb=""._SITESTATS."";

        $statistic=$DB_site->query_first("SELECT statloc,useonnow,usequeue,usevbp,usevbpl,queuemax,color1,color2,color3,color4,acolor,scolor,mocolor,mecolor,ucolor,norefer1 FROM vbstats_options");
          $startdate=$statistic[startdate];
          $statloc=$statistic[statloc];
          $useonnow=$statistic[useonnow];
          $usequeue=$statistic[usequeue];
          $usevbp=$statistic[usevbp];
          $usevbpl=$statistic[usevbpl];
          $queuemax=$statistic[queuemax];
          $color1=$statistic[color1];
          $color2=$statistic[color2];
          $color3=$statistic[color3];
          $color4=$statistic[color4];
          $acolor=$statistic[acolor];
          $scolor=$statistic[scolor];
          $mocolor=$statistic[mocolor];
          $mecolor=$statistic[mecolor];
          $ucolor=$statistic[ucolor];
          $norefer1=$statistic[norefer1];

// ########## Member Stats
        // How Many?
        $numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
        $numbermembers=$numbersmembers['users'];

        // Active/Non?
        $snonposters=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user WHERE posts=0');
        $nonposters=$snonposters['users'];
        $activemembers=$numbermembers-$nonposters;
        $activityrate=sprintf("%.2f",(1000*$activemembers/$numbermembers));

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

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

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

        // Top Referrer
        if ($usereferrer) {
                $topref = $DB_site->query_first("SELECT COUNT(*) AS referrals, user.username, user.userid FROM user AS users
                                                LEFT JOIN user ON (users.referrerid = user.userid)
                                        WHERE users.referrerid <> 0 AND
                                                user.userid NOT IN ($norefer1)
                                                GROUP BY users.referrerid
                                                ORDER BY referrals DESC
                                                LIMIT 1");
        $tl_refid = $topref[userid];
        $tl_refname = $topref[username];
        $tl_refnum = $topref[referrals];
}

// ########## Post/Thread Stats
// Total
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=$countposts['posts'];
if ($totalposts=='') { $totalposts=0; }
$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=$countthreads['threads'];
if ($totalthreads=='') { $totalthreads=0; }

// Today [FireFly]
$getpoststoday=$DB_site->query_first("SELECT count(*) AS count FROM post WHERE dateline>='$tltoday'");
$poststoday=$getpoststoday[count];
$getthreadstoday=$DB_site->query_first("SELECT count(*) AS count FROM thread WHERE dateline>='$tltoday'");
$threadstoday=$getthreadstoday[count];

// Views
$boardviews = $DB_site->query_first("SELECT SUM(views) AS threadviews FROM thread");
$totalviews = number_format($boardviews[threadviews]);

// ########## Visits Today
$vbs_atviews = $DB_site->query_first("SELECT count FROM vbstats_date WHERE date = '$vbs_date'");
$todayviews = number_format($vbs_atviews[count]);


FWC 11-16-2001 04:40 PM

Quote:

Originally posted by JTMON
The code I am trying to insert into index.php from vbstats.php is:

require('./global.php3'); // vBulletin Globals

You don't need that line. It's already called at the top of index.php

JTMON 11-16-2001 06:55 PM

Yep, I had noticed that and removed that. I also tried putting the variables part up at the top of index.php with the other variables and then the relevant other vbstat code below elsewhere in index but every time I get a parse error on whatever line number ?> happens to be on. What exactly does a parse error means. Doesn't that mean I coded something wrong?

|DarkManX| 11-16-2001 08:24 PM

Quote:

Originally posted by SWFans.net
I just copied a few of the variable's defenition lines into index.php, and set it up like you are trying to, though its under my "Currently Online" display.

http://www.swforums.net/forum


that is awesome man, how did you do that?

SWFans.net 11-16-2001 09:10 PM

Thanks. :)

I just placed this code into my index.php:

PHP Code:

// Total Thread Views
$boardviews=$DB_site->query_first("SELECT SUM(views) AS threadviews FROM thread");
$totalviews=number_format($boardviews['threadviews']); 

Above the "//get newest member" section, then built a table row like loggedinusers in forum home and put the things I wanted inside it, all done in the forumhome template

|DarkManX| 11-16-2001 09:12 PM

Quote:

Originally posted by SWFans.net
Thanks. :)

I just placed this code into my index.php:

PHP Code:

// Total Thread Views
$boardviews=$DB_site->query_first("SELECT SUM(views) AS threadviews FROM thread");
$totalviews=number_format($boardviews['threadviews']); 

Above the "//get newest member" section, then built a table row like loggedinusers in forum home and put the things I wanted inside it, all done in the forumhome template


i think you should make this a mini-release :)


i am not smart enough to figure all that myself......but i am smart enough to follow detailed directions :)

SWFans.net 11-16-2001 09:16 PM

I'm not sure if vbstats added this to global.php, or if I did, but this is in there above the "// ###################### Start sessions #######################" section.

PHP Code:

// ########## Visits Today
$vbs_atviews $DB_site->query_first("SELECT count FROM vbstats_date WHERE date = '$vbs_date'");
$todayviews number_format($vbs_atviews[count]);

// Today [FireFly]
$getpoststoday=$DB_site->query_first("SELECT count(*) AS count FROM post WHERE dateline>='$tltoday'");
$poststoday=number_format($getpoststoday[count]);
$getthreadstoday=$DB_site->query_first("SELECT count(*) AS count FROM thread WHERE dateline>='$tltoday'");
$threadstoday=number_format($getthreadstoday[count]);

// Views
$boardviews $DB_site->query_first("SELECT SUM(views) AS threadviews FROM thread");
$totalviews number_format($boardviews[threadviews]); 

Now that I think about it a little, moving it to index.php, might speed my forums up some, if it was in fact me that put it there. Those database queries don't need to be in global and thus run on every page load for threads forums and all. :x

SWFans.net 11-16-2001 09:25 PM

Thanks for making me look into that. I was right, I moved the code I had in global.php to index.php, and now threads load considerably faster again. :)

I placed the section I quoted from global.php to the same place, just after, I had the other code in index.php.


All times are GMT. The time now is 04:31 PM.

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.02299 seconds
  • Memory Usage 1,876KB
  • 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_code_printable
  • (3)bbcode_php_printable
  • (10)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