The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Heres a counter I quickly made for a freind, it uses no cookies and so on, it stores the useragent and host of the person instead. You can also esily reset the counter any time you want by going to:
http://yoursite/counter.php?action=r...sword=password Also if some one tries to access the counter file, they'll get a 404 error. Also the counter wont count the person accessing the counter file itself. How to use the script on your site: All you have to do is include/require the counter file any wheres inside the site where you want to keep track of the hits. For example, if you have a php file all you have to do is add include('counter.php'); just below the <?. If your index/or the page you wanna keep track of hits is an html file, change it to file.php (can be what ever you choose) and at the top have <? include('counter.php'); ?>, you can leave the rest of the html intact. Instead of printing the hit data directly out, the data is stored within varibles so you can esily customise the looks. Just place the varible any wheres you want for example: echo "Total Hits: $counter_total"; or if you renamed a html file to php as stated before, you can use: <? echo "Total Hits: $counter_total"; ?> The password for the reset can be what ever you want, theres a setting inside a file where you can set it. Heres what data this stores about the person: Host (ip) Reseloved Host User Agent Port Referer Timestamp So if you wanted to could esily make a script that accesses this data for example for a list of referering sites and so on. Heres what varibles the counter uses and what they are used for: $counter_twentyfour - Gets the hits in the last 24 hours $counter_total - Gets the total hits $counter_today - Gets the total hits today $counter_uniquetwentyfour - Gets the unique hits in the last 24 hours $counter_uniquetotal - Gets the unique total hits $counter_uniquetoday - Gets the unique today hits $counter_lasthit - Gets the date and time of the last hit $counter_start - Gets the date and time of when the counter started Heres the query you need to run: CREATE TABLE hit_data ( hitid int(10) unsigned NOT NULL auto_increment, host varchar(20) NOT NULL default '', resolvedhost varchar(100) NOT NULL default '', useragent char(100) NOT NULL default '', port int(10) unsigned NOT NULL default '0', referer varchar(255) NOT NULL default '', timestamp int(10) unsigned NOT NULL default '0', PRIMARY KEY (hitid) ) TYPE=MyISAM; Note: The query and this info being posted are already located in the PHP file for future refrence. All you have to do is edited a few settings and upload and thats it, heres the settings: // Mysql Data $counter_server = "localhost"; $counter_database = "root"; $counter_user = "root"; $counter_password = ""; $counter_usepconnect = false; //------ $script_name = "counter.php"; //The actual script name of the counter $script_password = "default"; //Password used to reset the counter $date_time_format = "F j, Y, g:i:s a"; //The date format for the counter // See http://www.php.net/date If you have any questions or comments or need help feel free to post them. It can only be used as long as the copy right text isnt edited or removed from the php file and as long as you dont take credit for it. That is all. |
#2
|
||||
|
||||
![]()
Interesting idea - good to see you around again
![]() - miSt |
#3
|
||||
|
||||
![]()
there seems so be a error on line 43 $date_time_format
|
#4
|
|||
|
|||
![]()
Copy and paste your line 43 and I'll see whats wrong.
|
#5
|
||||
|
||||
![]()
$date_time_format = "F j, Y"; //The date format for the counter
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|