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)

JTMON 11-16-2001 09:28 PM

ok but lets say I wanted what you have in my index.php, when I put it in I get the parse error. Where would I put it to get it to show below the newest member text?

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

Just add this to index.php right above the "// get newest member" section:


PHP Code:

// Total Thread 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]);

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

Once that is there, then you can call the variables from the forumhome template. the variables it makes available are:

Code:

$totalviews
$todayviews
$poststoday
$threadstoday


Princeton 11-17-2001 12:53 AM

I have vbportal and I would like to add TOP POP REVIEWS and NEW REVIEWS to vbstats. How can I do this?
thank you

Bane 11-17-2001 01:12 AM

Interesting Idea. I will work on this in a minute and see if I cant get it to do what you want.

Bane 11-17-2001 01:20 AM

Or not.. I see SWFans.net has already :p For the Top Pop Reviews and such the code is in the top.php file I believe, you could just copy the code from there.

Bane 11-17-2001 03:28 AM

OK, I was a bit bored and decided to add this into the next version :D Here is an example.

Bane 11-17-2001 03:29 AM

For those of you who dont wish to wait for the next version instructions follow:

edit: attachment deleted. added on next page

Princeton 11-17-2001 04:37 PM

My $linkqueue and $navbar menu just disappeared. How can I get it back?

UPDATE: It's fixed.

|DarkManX| 11-17-2001 05:35 PM

Quote:

Originally posted by Bane
For those of you who dont wish to wait for the next version instructions follow:

getting a database error when i install this addon......

SWFans.net 11-17-2001 08:58 PM

I decided to remove the last 24 hour stats from my index.php and from my forumhome template. It was causing the load time of my main page to be about double, if not a little more, than without. 4 extra DB queries make a big difference there. @_@

JTMON 11-17-2001 09:07 PM

Hmmm, strange. I had an issue where it was loading slow so I emailed my hosters. We are back to superspeed with the last 24 hours in there.

|DarkManX| 11-17-2001 09:13 PM

could someone help me out with this index.php part of the code, i get a mysql error.....

SWFans.net 11-17-2001 09:14 PM

JTMON: Are you on a dedicated or shared host? I have been having the speed problems/load time issues for over a week(since I added the 24 hour stats to the forumhome) and at first thought it a host issue, but with it lasting so long, I decided to start experimenting. Removing those queries helped my load time a great deal.

Could you PM me the URL of your board and your host provider information, if its not too much trouble?

Dark: Bane provided instrictions and the ones I provided also work, but don't include as many stats as Bane's. Did you revert back to your original index.php and try reapplying the hack?

JTMON 11-17-2001 09:18 PM

Sure SWF, Pm'ing you now.

Bane 11-18-2001 05:28 AM

Dark: Try using the zip that has changed. There was a teeny problem :) This new one works swell. (or should) I'll attach to this post. Let me know.

The only difference between this version and the excellent Idea from SWFans is this one uses a seperate template. And has a few more stats.

Pady 11-18-2001 08:11 AM

Thanx Bane gunna give this one a try

orca 11-18-2001 01:13 PM

I think you have an error in the following line for the index.php modification:

PHP Code:

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

I get a mySQL error there. Looking at the code I think that the variable $norefer1 isn't defined.

|DarkManX| 11-18-2001 02:39 PM

Quote:

Originally posted by Bane
Dark: Try using the zip that has changed. There was a teeny problem :) This new one works swell. (or should) I'll attach to this post. Let me know.

The only difference between this version and the excellent Idea from SWFans is this one uses a seperate template. And has a few more stats.



thanks bane, i gave it a try, but i got this error

Database error in vBulletin 2.2.0:

Invalid SQL: 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 ()
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT 1
mysql error: You have an error in your SQL syntax near ')
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT 1' at line 4

mysql error number: 1064

Date: Sunday 18th of November 2001 11:34:11 AM
Script: http://www.partylounge.net/tof/tof/index.php?
Referer: http://www.partylounge.net/tof/online.php?

orca 11-18-2001 03:11 PM

Darkman, that was exactly the error I got and I think it's related to that $norefer1 isn't declared.

|DarkManX| 11-18-2001 03:25 PM

hmmmmmmm............i dunno, do you think its just a typo in the code somewhere, or more to it than that?

Bane 11-18-2001 07:51 PM

I put up a new zip with that removed.. kindof a stupid mistake on my part since I took out the top referrer bit in the display. It didnt come up on the test board since I never turned on the referrer system.

Please note, If you want to add the top referrer to your front page you can add the following code..

PHP Code:

// Set this to ids you dont want counted, seperated by , 0 for none
$norefer1="0";

// 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];


And in your vbstats_forumhome template add:

Code:

<smallfont>Top Referrer: <b><a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$tl_refid">$tl_refname</a></b> (<smallfont color="$tl_color1">$tl_refnum referrals!</smallfont>)
&nbsp;[<a href="vbstats.php?s=$session[sessionhash]&action=memberrefer">Full List</a>] &nbsp; [ <a href="misc.php?s=$session[sessionhash]&action=faq&page=2#referrals">Help</a> ]</smallfont>


This is not fully tested as Im about to go to lunch but it should work dandy. The non referrer top stats is in the zip sorry about the messup.

|DarkManX| 11-18-2001 08:14 PM

thanks, that did the trick :D

jselwyn 11-19-2001 09:10 AM

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)?
By the way why is this bulletin board so wide on my screen when none of the others are?
cheers

Bane 11-19-2001 12:59 PM

1) Activity level is percentage of your users that have at least one post. "Active on your board"

2) What server do you run on? It may be possible its not doing the 24 hour function correctly, or that you need to change the var name, not sure.

3) This will be logged per day in the next release. So you can find out how many today, this week, etc..

Because there is code in it and for some reason it doesnt pop out of the table like vbs so..

|DarkManX| 11-19-2001 08:04 PM

my 24 hour stats won't update.....

take a look.....

Bane 11-19-2001 08:59 PM

Like I said :) A quickie. Try putting this code right after

// Today [FireFly]

Code:

$tltoday=time()-(86400);

Wordplay 11-19-2001 10:59 PM

Excuse me but i'm really new to this board. And was just wondering... it says v2.21 in the subject, but your post says that it's v2.03 compatible. Does that mean that it was originally designed for 2.03 but also works for 2.21 or did somebody mess up the subject/post :confused:?

Bane 11-19-2001 11:28 PM

What it means is that for some reason the admin/moderator of this board has taken it upon himself to change the title of the post. It will work with 2.2.1 with the changes that were explained earlier in the thread. But yes, it was originally made for 2.0.3 and yes, I find it as annoying as you do.

BaldNut 11-20-2001 02:28 PM

couple of little problems im having getting this running :(

first my hands are too cold :D

secondly :) i cant find my online.php in on my server ? but it is in my local machine in my vb folder

thirdly i get this message when i click on the online users link

Warning: Failed opening './counter.php' for inclusion (include_path='') in /home/sites/site4/web/vbp_includes.php on line 12

ive also tried changing it to: include("vbs_counter.php"); in the vbp_includes.php file ?

and if i go to http://www.golden-springs.com/vbstats.php i get a blank page ?


i have not changed the hacks on the online.php because it aint their, i looked in the one on my local machine but i could not find the parts i needed to change ? any help will be appreciated

Many thanx

Balds.

PS your all doing a great job here, keep up the good work ;)

JTMON 11-20-2001 02:31 PM

BaldNut,

You put the include statement in your phpinclude TEMPLATE. Not file.

BaldNut 11-20-2001 02:33 PM

cheers m8 i try now, any ideas on the online.php ?

JTMON 11-20-2001 02:34 PM

Not really, if it's not there, why not try uploading it.

BaldNut 11-20-2001 02:37 PM

i just got this message now ?

Warning: Failed opening 'vbs_counter.php' for inclusion (include_path='') in /home/sites/site4/web/forums/global.php(274) : eval()'d code on line 3

JTMON 11-20-2001 02:39 PM

Do you have that file vbs_counter.php on your server?

BaldNut 11-20-2001 02:41 PM

yes m8 that is their

JTMON 11-20-2001 02:42 PM

The correct include statement that should be in your PHPINCLUDE template is:

include("./counter.php");

Make sure that the ./ is in there and the syntax is the same

BaldNut 11-20-2001 02:45 PM

right i put in my template what you said this is what is in my phpincludes now

if (!isset($mainfile)){
include("../vbp_includes.php");
include("./counter.php");
}

this is the new report
Warning: Failed opening './counter.php' for inclusion (include_path='') in /home/sites/site4/web/forums/global.php(274) : eval()'d code on line 3

JTMON 11-20-2001 02:46 PM

I see you have PHPportal installed. This would mean that the path to the file is probably different as I assume you have the forums in a forum folder?

JTMON 11-20-2001 02:48 PM

Well now I am not sure as this file has changed since I installed it. I have my forums in my root folder so my phpinclude template is:

// This code is PHP4 only:
// ob_start();
// require("yourheader.html");
// $header = ob_get_contents();
// ob_end_clean();
include("vbs_counter.php3");

Also I'm using php3 extensions

JTMON 11-20-2001 02:51 PM

Maybe putting that include statement at the end of your phpinclude template out of the loop?


All times are GMT. The time now is 08:17 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.02653 seconds
  • Memory Usage 1,834KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (2)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