View Full Version : Hit Counter
BigJohnson
10-27-2002, 03:19 PM
I need a hit counter for my site it is for a simple html part of the message board. This is not a php page. I would love to have a counter look like this for my site
http://okcounter.com/skin_images/697_sample.gif
It will show you how many hits total and how many hits just for that day
Can anyone help me finish this thought?
cpradio
10-27-2002, 08:22 PM
I have been thinking towards the same idea, except i plan to make it hits per forum, hits per day, and total hits per month. My idea is to have a single table with the following fields: forumid, date, ip
Then I plan to check to see if the user's ip address and the forum id matches anything in the database, if it does then not to insert their record again.
BigJohnson
10-27-2002, 09:09 PM
Ya but i have an html page. I was just looking for a script to show the hits for the day and hits total in that type of style. If anyone can help me out that would be amazingly awesome.
cpradio do u think u can help me?
cpradio
10-27-2002, 10:41 PM
Well i have my idea complete and implemented tell me if it is what you are looking for:
http://www.wdforums.com/forums/index.php?styleid=7
BigJohnson
10-27-2002, 11:23 PM
I would like the hits for the day and hits totall for my html page. A non integrated page. That would be awesome.
cpradio
10-28-2002, 12:21 AM
Here is the file I used for the Unique Forum Counter, all that you would need to do is:
1) Make a table called forumcounter using the following SQL/MySQL query:
CREATE TABLE forumcounter (
id int(11) NOT NULL auto_increment,
month char(2) NOT NULL default '',
day char(2) NOT NULL default '',
year varchar(4) NOT NULL default '',
remoteip varchar(250) NOT NULL default '',
PRIMARY KEY (id)
)
2) Upload forumcounter.php to your forums directory
3) Then edit your phpinclude template and add this code after the last comment:
include ("forumcounter.php");
4) Open the forumcounter.php file find the Display Variable code and copy it so your HTML file can use it.
-Matt
BigJohnson
10-28-2002, 08:56 AM
nice. this is a great feature thanks..
I am having trouble with the html feature though. I cannot get that one to work. I need one to show the number total and the hits for today. Do you think u can do that?
Non MySQl one for the HTML.
BigJohnson
10-28-2002, 09:01 AM
I am also getting an error on the forum version i get this.
Warning: Supplied argument is not a valid MySQL result resource in /usr/local/psa/home/vhosts/new-dimensionz.com/httpdocs/messageboard/forumcounter.php on line 21
Warning: Supplied argument is not a valid MySQL result resource in /usr/local/psa/home/vhosts/new-dimensionz.com/httpdocs/messageboard/forumcounter.php on line 26
Warning: Cannot add header information - headers already sent by (output started at /usr/local/psa/home/vhosts/new-dimensionz.com/httpdocs/messageboard/forumcounter.php:21) in /usr/local/psa/home/vhosts/new-dimensionz.com/httpdocs/messageboard/admin/functions.php on line 1838
Also what do i put in the template to see the hits and stuff.
cpradio
10-28-2002, 10:57 AM
Okay I have attached a zip file in which forumcounter.php, displaycounter.php should be uploaded to the main forum folder
Read the txt file for how to install
To display the stats on a non-HTML page using this code:
<script type="text/javascript" href="displaycounter.php"></script>
BigJohnson
10-28-2002, 07:46 PM
No this other html page has nothing to do with the message board. I just need a java script that tells total number hits for that day and for the total hits forever.
BigJohnson
10-28-2002, 07:56 PM
and now i get this error
Fatal error: Cannot redeclare stripslashesarray() in /usr/local/psa/home/vhosts/new-dimensionz.com/httpdocs/messageboard/global.php on line 14
cpradio
10-28-2002, 09:05 PM
hmm...i dont know why you get that error as I never edited the global.php page.
You may want to see if your host gives out a free counter
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.