*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
$I[fallback]
"; } echo '$I[when] | $I[count] | $I[unique] |
---|---|---|
$I[lasthour] | "; $num=fetch_numbers($id, $update_time-3600, $update_time); echo "$num[0] | $num[1] |
$I[lastday] | "; $num=fetch_numbers($id, $update_time-86400, $update_time); echo "$num[0] | $num[1] |
$I[lastweek] | "; $num=fetch_numbers($id, $update_time-604800, $update_time); echo "$num[0] | $num[1] |
$I[lastmonth] | "; $num=fetch_numbers($id, $update_time-2592000, $update_time); echo "$num[0] | $num[1] |
$I[overall] | "; $num=fetch_numbers($id, 0, $time); echo "$num[0] | $num[1] |
$I[graphs]
"; echo "$I[lastday]
"; $visits=[]; $unvisits=[]; $highest=1; for($i=24; $i>0; --$i){ $stmt->execute([$id, $time-3600*($i+1), $time-3600*$i]); $tmp=$stmt->fetch(PDO::FETCH_NUM); $stmt2->execute([$id, $time-3600*($i+1), $time-3600*$i]); $tmp2=$stmt2->fetch(PDO::FETCH_NUM); $visits[]=$tmp[0]; $unvisits[]=$tmp2[0]; if($highest<$tmp[0]){ $highest=$tmp[0]; } } $im=imagecreate(230, 100); $bg=imagecolorallocate($im, 0, 0, 0); imagefill($im, 0, 0, $bg); $color=imagecolorallocate($im, 255, 0, 0); $uncolor=imagecolorallocate($im, 0, 0, 255); for($i=0; $i<23; ++$i){ imageline($im, $i*10, 100-($visits[$i]/$highest)*100, ($i+1)*10, 100-($visits[$i+1]/$highest)*100, $color); imageline($im, $i*10, 100-($unvisits[$i]/$highest)*100, ($i+1)*10, 100-($unvisits[$i+1]/$highest)*100, $uncolor); } echo '$I[lastweek]
"; $visits=[]; $unvisits=[]; $highest=1; for($i=28; $i>0; --$i){ $stmt->execute([$id, $time-21600*($i+1), $time-21600*$i]); $tmp=$stmt->fetch(PDO::FETCH_NUM); $stmt2->execute([$id, $time-21600*($i+1), $time-21600*$i]); $tmp2=$stmt2->fetch(PDO::FETCH_NUM); $visits[]=$tmp[0]; $unvisits[]=$tmp2[0]; if($highest<$tmp[0]){ $highest=$tmp[0]; } } $im=imagecreate(270, 100); $bg=imagecolorallocate($im, 0, 0, 0); imagefill($im, 0, 0, $bg); $color=imagecolorallocate($im, 255, 0, 0); $uncolor=imagecolorallocate($im, 0, 0, 255); for($i=0; $i<27; ++$i){ imageline($im, $i*10, 100-($visits[$i]/$highest)*100, ($i+1)*10, 100-($visits[$i+1]/$highest)*100, $color); imageline($im, $i*10, 100-($unvisits[$i]/$highest)*100, ($i+1)*10, 100-($unvisits[$i+1]/$highest)*100, $uncolor); } echo '$I[lastmonth]
"; $visits=[]; $unvisits=[]; $highest=1; for($i=30; $i>0; --$i){ $stmt->execute([$id, $time-86400*($i+1), $time-86400*$i]); $tmp=$stmt->fetch(PDO::FETCH_NUM); $stmt2->execute([$id, $time-86400*($i+1), $time-86400*$i]); $tmp2=$stmt2->fetch(PDO::FETCH_NUM); $visits[]=$tmp[0]; $unvisits[]=$tmp2[0]; if($highest<$tmp[0]){ $highest=$tmp[0]; } } $im=imagecreate(290, 100); $bg=imagecolorallocate($im, 0, 0, 0); imagefill($im, 0, 0, $bg); $color=imagecolorallocate($im, 255, 0, 0); $uncolor=imagecolorallocate($im, 0, 0, 255); for($i=0; $i<29; ++$i){ imageline($im, $i*10, 100-($visits[$i]/$highest)*100, ($i+1)*10, 100-($visits[$i+1]/$highest)*100, $color); imageline($im, $i*10, 100-($unvisits[$i]/$highest)*100, ($i+1)*10, 100-($unvisits[$i+1]/$highest)*100, $uncolor); } echo '