差異處
這裏顯示兩個版本的差異處。
| id_contentfooter [2026/06/17 05:51] – 建立 host | id_contentfooter [2026/06/17 06:04] (目前版本) – host | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | <div class=" | + | <div class=" |
| Views: | Views: | ||
| <?php | <?php | ||
| global $ID; | global $ID; | ||
| $counter_dir = DOKU_CONF . ' | $counter_dir = DOKU_CONF . ' | ||
| - | if (!is_dir($counter_dir)) @mkdir($counter_dir, | + | if (!is_dir($counter_dir)) |
| + | | ||
| + | } | ||
| $counter_file = $counter_dir . md5($ID) . ' | $counter_file = $counter_dir . md5($ID) . ' | ||
| $count = file_exists($counter_file) ? (int)file_get_contents($counter_file) : 0; | $count = file_exists($counter_file) ? (int)file_get_contents($counter_file) : 0; | ||
| - | // Increment only for real users (ignore | + | // Increment only for real visitors |
| - | | + | |
| - | !preg_match('/ | + | if (!preg_match('/ |
| $count++; | $count++; | ||
| file_put_contents($counter_file, | file_put_contents($counter_file, | ||
| } | } | ||
| - | echo $count; | + | echo number_format($count); |
| ?> | ?> | ||
| </ | </ | ||