差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版前次修改
footer [2026/06/17 06:12] hostfooter [2026/06/17 06:12] (目前版本) host
行 1: 行 1:
-<section> +<details><summary>Summary</summary>hello 
-<div class="pageviews text-end text-muted small mt-2"> +Details 
-  <?php +</details>
-  global $ID; +
-  $counter_dir = DOKU_CONF . 'pagecounters/'; +
-  if (!is_dir($counter_dir)) { +
-      @mkdir($counter_dir, 0755, true); +
-  } +
- +
-  $counter_file = $counter_dir . md5($ID) . '.txt'; +
-  $count = file_exists($counter_file) ? (int)file_get_contents($counter_file) : 0; +
- +
-  // Increment only for real users +
-  $ua = $_SERVER['HTTP_USER_AGENT'] ?? ''; +
-  if (!preg_match('/bot|crawl|spider|slurp|pingdom|semrush|ahrefs|mj12bot|googlebot/i', $ua)) { +
-      $count++; +
-      file_put_contents($counter_file, $count); +
-  } +
- +
-  echo 'Views: ' . number_format($count); +
-  ?+
-</div> +
-</section>+