Dev Shed Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDev Shed Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 6th, 2003, 05:08 PM
tiny12 tiny12 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 135 tiny12 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
who is the original writer of this counter script?

<?php

###########################################################################
# configuration
###########################################################################

# main script URL
$script_url = 'eklog/eklog.php';

# last-visit, count & log data files
$file_path = dirname(__FILE__);
$vst_file = "$file_path/visit.txt";
$cnt_file = "$file_path/count.txt";
$log_file = "$file_path/log.txt";

###########################################################################

# IP addresses to be excluded in access log (can exclude a whole sub-net)
# white IPs have access to all statistics
# black IPs have no access to any data
# e.g. $white_ip_list = array('xxx.xxx.xxx.xxx', 'yyy.yyy.yyy');
$white_ip_list = array();
$black_ip_list = array();

# length of time (minutes) before consecutive hits from an IP are counted
# use 0 to disable anti-reload feature
$anti_reload_period = 60;

###########################################################################

# count visible?
$visible_count = 1;

# show count digits as
# 0 - text
# 1 - images
$digit_type = 1;

# absolute number of digits to display
# (used when $digit_length >= count_digit_length)
$digit_length = 4;

# number of zeroes to prefix the count
# (used when $digit_length < count_digit_length)
$digit_pad = 1;

# show digits in what language?
# (used when showing digits as text)
$arabic_count = 1;
$chinese_count = 0;
$roman_count = 0;

if ($arabic_count) {
$bold = 0;
$italic = 0;
$cnt_color = '#ff0000';
$cnt_face = 'Comic Sans MS';
$cnt_size = '+1';
} elseif ($chinese_count) {
$bold = 1;
$italic = 0;
$cnt_color = '#ff0000';
$cnt_face = '';
$cnt_size = '+1';
} elseif ($roman_count) {
$bold = 0;
$italic = 0;
$cnt_color = '#ff0000';
$cnt_face = 'Comic Sans MS';
$cnt_size = '+1';
}

# digit images directory name & file extension
# directory can use absolute or relative path
# absolute paths start with "http://", "https://" or "/"
# all other paths are considered relative (to main script directory)
# (used when showing digits as images)
$img_dir = 'digit';
$img_ext = 'gif';

# individual digit image width & height
$img_width = 16;
$img_height = 21;

# digit images text alignment
# e.g. top, middle, bottom
$img_align = 'middle';

###########################################################################

# statistics visible?
$visible_stat = 1;

# statistics page window name
# use empty string for same window (as count page)
$stat_frame = '_blank';

# statistics summary visible?
# statistics detail visible?
$summary_stat = 1;
$detail_stat = 1;

# statistics background colours
$back_col_type = 'yellow';
$back_col_head = 'lightblue';
$back_col_body = 'lightcyan';

###########################################################################
# main programme
###########################################################################

$agent_stat = array();

# create initial data files during first run
if (! file_exists($vst_file)) {
$vst_fp = fopen($vst_file, 'w') or die("Can't open $vst_file\n");
flock($vst_fp, 2);
fwrite($vst_fp, '0.0.0.0|0');
fclose($vst_fp);
}

if (! file_exists($cnt_file)) {
$cnt_fp = fopen($cnt_file, 'w') or die("Can't open $cnt_file\n");
flock($cnt_fp, 2);
fwrite($cnt_fp, '0');
fclose($cnt_fp);
}

# run script
if (getenv('QUERY_STRING') == '') {
takeLog(); # take log
} elseif (strtolower(getenv('QUERY_STRING')) == 'stat') {
viewStat(); # view statistics
} else {
# exit when script is called with invalid parameter
print '[parameter invalid]';
}

###########################################################################
# functions
###########################################################################

function takeLog() {
global $script_url, $vst_file, $cnt_file, $log_file;
global $visible_count;
global $digit_type, $digit_length, $digit_pad;
global $arabic_count, $chinese_count, $roman_count;
global $bold, $italic, $cnt_color, $cnt_face, $cnt_size;
global $img_dir, $img_ext, $img_width, $img_height, $img_align;
global $visible_stat, $stat_frame;

# do access log
if (handleListedIP() || isReload()) { # no logging needed
$cnt_fp = fopen($cnt_file, 'r') or die("Can't open $cnt_file\n");
$cnt = fread($cnt_fp, filesize($cnt_file));
$cnt = chop($cnt);
fclose($cnt_fp);
} else { # logging needed
# process last-visit data
$vst_fp = fopen($vst_file, 'w') or die("Can't open $vst_file\n");
flock($vst_fp, 2);
$tm = time();
fwrite($vst_fp, getenv('REMOTE_ADDR')."|$tm");
fclose($vst_fp);

# process count data
$cnt_fp = fopen($cnt_file, 'r+') or die("Can't open $cnt_file\n");
flock($cnt_fp, 2);
$cnt = fread($cnt_fp, filesize($cnt_file));
$cnt = chop($cnt);
$cnt++;
rewind($cnt_fp);
fwrite($cnt_fp, $cnt);
ftruncate($cnt_fp, ftell($cnt_fp));
fclose($cnt_fp);

....... too long, cut away part of it

?>

who is the original writer of this counter script?

Reply With Quote
  #2  
Old May 6th, 2003, 06:15 PM
Jeb.'s Avatar
Jeb. Jeb. is offline
Gogo Google.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Adelaide, Australia
Posts: 226 Jeb. User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to Jeb.
There's no way we can tell that just by looking at it, you know
__________________
Adam Goossens

Reply With Quote
  #3  
Old May 6th, 2003, 09:09 PM
Sepodati's Avatar
Sepodati Sepodati is online now
Banned
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Dec 1999
Location: Afghanistan
Posts: 14,378 Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate Folder
Time spent in forums: 2 Months 3 Weeks 6 Days 22 h 12 m 4 sec
Reputation Power: 1784
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
Bob wrote that.

---John Holmes...

Reply With Quote
  #4  
Old May 6th, 2003, 09:15 PM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 8 m 45 sec
Reputation Power: 27
Hey thats my code, you stole my code! j/k

Reply With Quote
  #5  
Old May 6th, 2003, 09:19 PM
Sepodati's Avatar
Sepodati Sepodati is online now
Banned
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Dec 1999
Location: Afghanistan
Posts: 14,378 Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate Folder
Time spent in forums: 2 Months 3 Weeks 6 Days 22 h 12 m 4 sec
Reputation Power: 1784
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
Dude... don't joke about Bob. He's big.

---John Holmes...

Reply With Quote
  #6  
Old May 6th, 2003, 11:53 PM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 8 m 45 sec
Reputation Power: 27
Bob doesn't scare me. Bring it on!

Reply With Quote
  #7  
Old May 6th, 2003, 11:58 PM
Sepodati's Avatar
Sepodati Sepodati is online now
Banned
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Dec 1999
Location: Afghanistan
Posts: 14,378 Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate Folder
Time spent in forums: 2 Months 3 Weeks 6 Days 22 h 12 m 4 sec
Reputation Power: 1784
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
I think Bob kicked your *** and wrote that for you so he'd have a reason to do it again!

---John Holmes...

Reply With Quote
  #8  
Old May 7th, 2003, 12:03 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 8 m 45 sec
Reputation Power: 27
Come-on where is he? I wanna take him on!

Reply With Quote
  #9  
Old May 7th, 2003, 12:09 AM
Sepodati's Avatar
Sepodati Sepodati is online now
Banned
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Dec 1999
Location: Afghanistan
Posts: 14,378 Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate Folder
Time spent in forums: 2 Months 3 Weeks 6 Days 22 h 12 m 4 sec
Reputation Power: 1784
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
No, seriously... who wrote that code? I need to know...

---John Holmes...

Reply With Quote
  #10  
Old May 7th, 2003, 12:20 AM
SammyK's Avatar
SammyK SammyK is offline
Happy Monkey
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2001
Location: UK (University of Kentucky)
Posts: 1,810 SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 22 h 49 m 14 sec
Reputation Power: 41
I DID! not write that code.
__________________

Reply With Quote
  #11  
Old May 7th, 2003, 12:21 AM
manoloweb's Avatar
manoloweb manoloweb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Mexico
Posts: 116 manoloweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 17 sec
Reputation Power: 6
Seriously, that code is mine, and I can prove it...

Please see my counter code below, and you will notice that it is the same with some lines changed by the thief...

PHP Code:
<?
                $browser
=$HTTP_USER_AGENT;
                
$direccion=gethostbyaddr ($REMOTE_ADDR);
                
$lengua=$HTTP_ACCEPT_LANGUAGE;
                
conectar();
                if (!isset(
$ya))
                {
                    
$ya="si";
                    
session_register("ya");
                    
mysql_query("insert into contador (visitaID,fechahora,IP,browser,idioma) values(NULL,Now(),'$direccion','$browser','$lengua')");
                }
                    
$contar=mysql_query("select count(*) as cuantos from contador");
                    
$contar_lista=mysql_fetch_array($contar);
                    
$contador=$contar_lista['cuantos'];
                
?>


Can you see? It makes me so mad , why people don't just write their own code???

Greetings!
__________________
The best way to learn is:
read + try + ask (in that order)

Manolo

Reply With Quote
  #12  
Old May 7th, 2003, 12:30 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 8 m 45 sec
Reputation Power: 27
Yes, i can see it now..... actually