View Full Version : [release vB2.0]couter in vB page
a. open vb2/global.php
find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Immediately ABOVE it put any PHP counter, i using this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
b. edit the template footer
find in last:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Immediately ABOVE it put:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Done!
First-Man
25 May 2001, 18:36
Where can i see an Demo?
thx
It works on my board, but I get this at the top of my page :
Warning: file("../addons/count.txt") - No such file or directory in /home/gaminghq/public_html/forums/global.php on line 69
Warning: file("../addons/ip.txt") - No such file or directory in /home/gaminghq/public_html/forums/global.php on line 70
Warning: fopen("../addons/ip.txt","w") - No such file or directory in /home/gaminghq/public_html/forums/global.php on line 101
Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 102
Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 103
Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 104
Warning: fopen("../addons/count.txt","w") - No such file or directory in /home/gaminghq/public_html/forums/global.php on line 108
Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 109
Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 110
Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 111
Not sure what to make of this :(
see this?
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
check the path first plx...:(
i set the path of count.txt and ip.txt to "../addons/", if you like, you can change it to anything else...
or like this:
chage those two lines to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
it will be ok!
bokhalifa
25 May 2001, 21:42
good werk;)
Blue2000
26 May 2001, 14:16
i made a live counter ages ago
its posted here somwhere
i can repost it if people what it
maverick1236
26 May 2001, 14:56
Id like to see it :)
TimberLand
26 May 2001, 18:11
Anyway to make this an option only the admin can see.
Good hack.
I'll try it on my vb page.
ccxx
BBQFan,
I made the changes, but am still getting the same errors. :(
You have to create two files, called count.txt and ip.txt and chmod them to 777.
Hm, i think there is something wrong.
It always displays this: (it is installed since two days)
vb test received page views: today = 1, total = 22. variant IP visitors: today = 1, total = 22.
today = 1 ? What does this mean? I know that there were more than one person on my test board, it should display today = 2 or so.
Suggestions on this?
Originally posted by h4p3
Hm, i think there is something wrong.
It always displays this: (it is installed since two days)
vb test received page views: today = 1, total = 22. variant IP visitors: today = 1, total = 22.
today = 1 ? What does this mean? I know that there were more than one person on my test board, it should display today = 2 or so.
Suggestions on this?
same problem here
same prob here too :(
Santa
yah I am having the same problem.... but I am going to use another counter and just intergrate it tonight :)
or tweak this one to work...
Originally posted by h4p3
Hm, i think there is something wrong.
It always displays this: (it is installed since two days)
vb test received page views: today = 1, total = 22. variant IP visitors: today = 1, total = 22.
today = 1 ? What does this mean? I know that there were more than one person on my test board, it should display today = 2 or so.
Suggestions on this?
Hi guys!
would you plx tell me where your test boards are? maybe i can find out any mistakes in this mini hack...:(
but it works ok for me...
http://vbgatetest.51.net/vgate/vb
i have found some servers set this::(
$ENV{REMOTE_ADDR} = 127.0.0.1
so every day the number of variant IP visitors is very ONE... we may try to change the counter code:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
to this new line:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
if you test vB on your local PC(like me), the visitors' IP always be 127.0.0.1. of course "variant IP visitors: today = 1,"...
still wont work.
I get today=1
total=1809
Santa
Originally posted by Santa
still wont work.
I get today=1
total=1809
Santa
which "today"? views or IP?
i think this hack code just simple or i should double check it...
Nope, both.
I tested it on my local Server (Gateway) and on my dedicated Server for my website -> same effect.
my GOD... i m very very sorry for my mistakes...
:(
the right codes have been put in the first post of this thread...
this time every thing would be ok...
Originally posted by Santa
Yeahhh now it works :)
thank you! i can set my heart at rest now...:):D
no mate. make more of this hacks :D
sorry again!:(
another bug: these 2 variables $t and $day are collided with vB...
so it will bring on some unpredictable results...:(
the right codes have been put in the first post of this thread... i think so :)
Great... it works just fine now.. but
Where else can we put the counter code so that it does not count everything... like when you click on a forum.. and read a post.. or go to another page that is including the global.php file.. it counts as a daily visit.. heh :)
ThomasP
02 Jun 2001, 21:22
Hi there,
works perfect,
thanks!
-Tom
Originally posted by BradC
Great... it works just fine now.. but
Where else can we put the counter code so that it does not count everything... like when you click on a forum.. and read a post.. or go to another page that is including the global.php file.. it counts as a daily visit.. heh :)
mmmh, i think it is easy too...
maybe you can put the display code like this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
in any Templates you want, instead of the Templates FOOTER, or you can just display one or more of $detail[1]~~[4].
but, you have to create some new count.txt and ip.txt.:(
ThomasP:
Hi there,
works perfect,
thanks!
-Tom
you are welcome:)
ThomasP
02 Aug 2001, 22:22
Sorry to bring this up again, but it works perfect in 2.0.3 and I reeeaaally love it :D
cu,
-Tom
Robert Basil
16 Aug 2001, 03:07
I just put the hack in my forums and also placed it throughout my website. Works great, thanks!
eva2000
16 Aug 2001, 20:03
just tried this hack and it was doing fine for a few minutes and then reset itself again to zero?
I get exact the same error at different times.... now 879 hits and a few minutes later it starts over at 0
Its working fine for me, I just installed it. It may reset, but you never know. :p
Pie'oh'pah
18 Aug 2001, 09:13
Well, just installed it, too :D
nicely done mate. any chance of making this part of the database?
-Alex
I have installed bbqfan's hack and it works great!! I wanted to keep a running history
of my page views and unique IP's so I made the following hack and attached a
picture of what it looks like. There may be a better way to do this...but this is
as simple a hack as I could create!
NOTE: I could only figure out how to get this to work for daily stats. Weekly/Monthly
don't calculate correctly. If anyone knows what to add/change in the query
to get Weekly/Monthly to show correctly, please post the changes here!
Here's what you need to do:
First create a table called 'ip_views' in your vbulletin database, and add the
following fields: 'date' as INT(10), 'views' as INT(6), 'uip' as INT(6)
Note: You can run the following query in phpMyAdmin to create the table:
CREATE TABLE ip_views (
date int(10) NOT NULL,
views int(6) NOT NULL,
uip int(6) NOT NULL
)
==============================================================
** In bbqfan's hack in global.php
Find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
CHANGE it to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Done with global.php!
** Open admin/stats.php
Find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Below it add:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
CHANGE it to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
CHANGE it to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Done with admin/stats.php!
This works on vBulletin 2.0.1...any other 2.x versions should work, but I
can't verify. Hopefully someone will know how to make the weekly and
monthly stats add up the views/ip's correctly for the week/month!
AJ
Strange...the picture didn't attach in the above post. Here it is:
Robert Basil
19 Aug 2001, 23:04
This hack was working great for almost a full 24hrs and then it started resetting itself at random times back to zero (Both the visitor stats and the page view stats) So I removed it from my site.
eva2000
19 Aug 2001, 23:07
Originally posted by Sportbikeworld
This hack was working great for almost a full 24hrs and then it started resetting itself at random times back to zero (Both the visitor stats and the page view stats) So I removed it from my site. yup join the club :(
After afew hours I was at about 1500 page views, then I checked back the next morning and it was at like 250. Reset is occuring with me too.
eva2000
28 Aug 2001, 05:55
try this mysql counter http://vbulletin.com/forum/showthread.php?s=&threadid=26527 doesn't reset at all :D
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.