Besucherzähler

1. erstelle ein Verzeichnis _views im datadir
2. erstelle eine Datei inc/counter.php

<?php
global $ID,$ACT;
 
$file=realpath($conf['datadir']).'/_views/'.$ID;
 
if (file_exists($file)) {
  $views=FALSE;
  while ($views===FALSE) {
    $views=file_get_contents($file);
    if ($views===FALSE) {
      usleep(50000);
    }
  }
  $views=$views+1;
} else {
  $views=1;
}
 
if (($ACT == 'show') && ($INFO['exists'])) {
    if(!auth_isadmin()){
        while(!$written) {
            $written=file_put_contents($file,$views);
            if (!$written) {
                usleep(50000);
            }
        }
    }
}
 
$fn.=" ($views views) ";

3. füge include('counter.php'); in inc/template.php ein

function tpl_pageinfo(){
  global $conf;
  global $lang;
  global $INFO;
  global $REV;
 
  // prepare date and path
  $fn = $INFO['filepath'];
  if(!$conf['fullpath']){
    if($REV){
      $fn = str_replace(realpath($conf['olddir']).DIRECTORY_SEPARATOR,'',$fn);
    }else{
      $fn = str_replace(realpath($conf['datadir']).DIRECTORY_SEPARATOR,'',$fn);
    }
  }
  $fn = utf8_decodeFN($fn);
  $date = date($conf['dformat'],$INFO['lastmod']);
 
  include('counter.php');

Info: http://wiki.erazor-zone.de/doku.php?id=wiki:projects:php:dokuwiki:counter