Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-16-2005, 06:11 AM   #1
clickhappy
Confirmed User
 
Industry Role:
Join Date: Mar 2004
Posts: 4,027
is there a basic page counter script out there?

just a basic counter that tells me how many times a page is loaded?

I dont want a sex counter, just a basic barebones counter.
Theres got to be an easy way to do it with php, but when i look at counter scripts out there they have features and all these includes that i cant figure out how to install.
clickhappy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-16-2005, 06:15 AM   #2
Kapitan Ivanov II
Confirmed User
 
Join Date: Jan 2005
Posts: 763
php.net

LEARN IT, or you'll never make it in the biz.
__________________
Ivanov - The Original Russian Board Guy
Kapitan Ivanov II is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-16-2005, 09:28 AM   #3
celebx
Confirmed User
 
Join Date: Jul 2001
Location: The Netherlands
Posts: 197
PHP Code:
<?php

// SNT's Array2Txt Functions :)
function Array2Txt($array,$fill='',$tab=1,$compress=0) { 
    if (!
$fill) { 
        
$txt_return='array('
    } 
    
$n=rand(); 
    
$run[$n]=0
    for(
$i=0;$i<$tab;$i++) {$t.="\t";} 
    foreach (
$array as $key => $value) { 
        if (!
$run[$n]) { 
            
$c=''
        } else { 
            
$c=', '
        }
$run[$n]++; 
        if (
is_array($value)) { 
            
$txt_return.=$c."\n".$t.'''.$key.'' => array('.Array2Txt($value,'',1,$tab+1); 
            continue 
1
        } 
        
$txt_return.=$c."\n".$t.'''.$key.'' => ''.$value.'''
    } 
    if (!
$fill) { 
        
$txt_return.=');'
    } else { 
        
$txt_return.=')'
    }     
    if (
$compress) { 
        return 
gzcompress($txt_return9); 
    } else { 
        return 
$txt_return
    } 


function 
Txt2Array($arraytxt,$decompress=0) { 
    if (
$decompress) { 
        eval(
'$return_array = '.gzuncompress($arraytxt)); 
        return 
$return_array
    } else { 
        eval(
'$return_array = '.$arraytxt); 
        return 
$return_array
    } 
}

//register user and count pageviews per page
session_start();
if (!isset(
$_SESSION['count'])) {
   
$new_visitor=1;
   
$_SESSION['visitor'] = array();
   
$_SESSION['visitor'][$_SERVER["PHP_SELF"]]=1;
} else {
   
$_SESSION['visitor'][$_SERVER["PHP_SELF"]]++;
}

//create counter data array from counter data file
if (file_exists($counter_data_file)) {
$counter_data Txt2Array(file_get_contents($counter_data_file));
} else { 
// create counter data file (if not exist)
   
if (!$handle fopen($counter_data_file'a')) {
         print 
"Can not create counter data file.";
         exit;
   }
   print 
"<!--- New Counter Data File created on ".date("r").". ---/>";
   
fclose($handle);


$counter_data[$_SERVER["PHP_SELF"]]["views"]++;
if (
$new_visitor) {
$counter_data[$_SERVER["PHP_SELF"]]["visitors"]++;
}

if (
is_writable($counter_data_file)) {
   if (!
$handle fopen($counter_data_file'a')) {
         print 
"Can not open counter data file.";
         exit;
   }
   
$counter_data_txt Array2Txt($counter_data);
   if (!
fwrite($handle$counter_data_txt)) {
       print 
"Can not write to counter data file.";
       exit;
   }

   print 
"<!--- Successfully updated counter data file, this page has been visited ".$counter_data[$_SERVER["PHP_SELF"]]["views"]." times. ---/>"
   
fclose($handle);
} else {
   print 
"The counter data file is not writeable.";
}

/*
The Array2Txt using the compression functions and a MySQL DB for data storage enables storage of detailed per visitor traffic information for 1m+/day trafficed sites! It will enable you to create the easyest and fastest accessable, processless and optimum source of traffic information.
*/

?>
p.s. this code has not been tested
__________________
Message me for more info: ICQ 8322641 (@gmail.com).

Last edited by celebx; 01-16-2005 at 09:30 AM..
celebx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-16-2005, 10:16 AM   #4
celebx
Confirmed User
 
Join Date: Jul 2001
Location: The Netherlands
Posts: 197
the tested code:

http://www.phpbuilder.com/board/show...3#post10584993

If you run TheHun.com and would like to know every detail about your visitors over an unlimited period, use this counter for maximum possibilities and performance.
__________________
Message me for more info: ICQ 8322641 (@gmail.com).
celebx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-16-2005, 02:37 PM   #5
clickhappy
Confirmed User
 
Industry Role:
Join Date: Mar 2004
Posts: 4,027
Quote:
Originally Posted by celebx
the tested code:

http://www.phpbuilder.com/board/show...3#post10584993

If you run TheHun.com and would like to know every detail about your visitors over an unlimited period, use this counter for maximum possibilities and performance.

can it be done without a database?
clickhappy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-16-2005, 02:45 PM   #6
TheMob
Confirmed User
 
Join Date: Jan 2003
Location: 2006
Posts: 8,584
I love statcounter.

Really.

www.statcounter.com
TheMob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.