Server IP : 51.89.169.208 / Your IP : 3.148.107.92 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/yellowleaf/public_html/stats/ |
Upload File : |
<?php $path = $_SERVER['DOCUMENT_ROOT']; include_once $path.'/connect_db.php'; $format = "M Y"; $sql = "SELECT * FROM ads ORDER BY postdate DESC limit 10000"; $q = $connect->query($sql); $total=0; while($row = $q->fetch_array()){ $date = intval($row['postdate']); $ads[date($format,$date)] +=1; } foreach($ads as $k=>$v){ $ads_data .= ',["'.$k.'",'.$v.']'; $total+=$v; } $tplbody = file_get_contents('index_tpl.html'); $tplbody = str_replace("{ads_data}", $ads_data, $tplbody); $tplbody = str_replace("{ads_total}", $total, $tplbody); echo $tplbody; function datemaker($time,$days = 0){ $time+=($days*86400); return date("m/d/Y",$time); } function unix($time2){ $time = explode('/',$time2); //$time3 = str_replace('/', '-', $time2); return array("day"=>$time[1],"month"=>$time[0],"year"=>$time[2],"unix"=>strtotime($time2),"format"=>$time2); } function format(){ global $to;global $from; $diff = ($to["unix"]-$from["unix"]); if($diff <= 86400){$format = "H:00";} else if(86400*30*3 <= $diff){$format = 'M y';} else if(86400*31 >= $diff){$format = 'D jS M';} else{$format = 'm/d/Y';} return $format; } ?>