|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
There's no way we can tell that just by looking at it, you know
![]()
__________________
Adam Goossens |
|
#3
|
||||
|
||||
|
Bob wrote that.
---John Holmes... |
|
#4
|
||||
|
||||
|
Hey thats my code, you stole my code! j/k
|
|
#5
|
||||
|
||||
|
Dude... don't joke about Bob. He's big.
---John Holmes... |
|
#6
|
||||
|
||||
|
Bob doesn't scare me. Bring it on!
|
|
#7
|
||||
|
||||
|
I think Bob kicked your *** and wrote that for you so he'd have a reason to do it again!
---John Holmes... |
|
#8
|
||||
|
||||
|
Come-on where is he? I wanna take him on!
|
|
#9
|
||||
|
||||
|
No, seriously... who wrote that code? I need to know...
---John Holmes... |
|
#10
|
||||
|
||||
|
I DID! not write that code.
|
|
#11
|
||||
|
||||
|
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:
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 |
|
#12
|
||||
|
||||
|
Yes, i can see it now..... actually |