MārisL Posted August 9, 2007 Report Share Posted August 9, 2007 Sveicināti. Vēletos pavaicāt kā ir iespējas no ši koda <? $dir = 'statistika_/'; $filedata = file($dir."stats.txt"); $data = explode('|~|',$filedata[0]); $today_hits = $data[0]; $unique_hits = $data[2]; $file_date = $data[4]; $times_visited = $_COOKIE['visited']; $today = date('Ymd'); if($file_date != $today){ $today_hits = 0; }; $page_hits = $page_hits + 1; if(!session_is_registered('statlogged')){ if(empty($times_visited)){ $unique_hits = $unique_hits + 1; }; $total_hits = $total_hits + 1; $today_hits = $today_hits + 1; $times_visited = $times_visited + 1; setcookie('visited',$times_visited,time()+12000000); session_register('statlogged'); }; $fp = fopen($dir."stats.txt","w"); $string = $today_hits.'|~|'.$total_hits.'|~|'.$unique_hits.'|~|'.$page_hits.'|~|'.$today; fwrite($fp,$string); fclose($fp); ?> dabūt ārā tā, lai arī tiek skaitīti netikai kopējais apmeklētāju skaits, bet dienas. Vispār labi būtu, ja tas dienas skaitītais katru dienu dzēstos un skaitītos pa jaunu... Link to comment Share on other sites More sharing options...
andrisp Posted August 9, 2007 Report Share Posted August 9, 2007 Iipashi neiedziljinaajos, bet izskataas, ka tur jau tiek daliits pa dienaam. Link to comment Share on other sites More sharing options...
MārisL Posted August 9, 2007 Author Report Share Posted August 9, 2007 tur pa dienām tiek dalīti 'hits' - respektīvi uzspiežu F5 (refresh) un man pieskaitas 1 hits Link to comment Share on other sites More sharing options...
Delfins Posted August 9, 2007 Report Share Posted August 9, 2007 nu bet tā jau arī ir. Ko tu vēl gribi? Link to comment Share on other sites More sharing options...
MārisL Posted August 9, 2007 Author Report Share Posted August 9, 2007 (edited) man ir vajadzīgs lai uzzinātu cik dienā cilvēki ir bijuši webā (VAJAG NEVIS HITS BET IP) SLĒDZAT CIET. Visu dabuju Edited August 10, 2007 by MārisL Link to comment Share on other sites More sharing options...
Recommended Posts