Hier mal die gesamte contentstatistic.php
<?php
defined ('main') or die ( 'no direct access' );
function wiw($tmp)
{
if($tmp == "liste")
{
$wiwstring = '';
$dif = date('Y-m-d H:i:s', time() - USERUPTIME);
$erg = db_query("SELECT DISTINCT uid, name, page, prefix_ranks.bez, spezrank FROM `prefix_online` left join prefix_user on prefix_user.id = prefix_online.uid left join prefix_ranks ON prefix_ranks.id = prefix_user.spezrank WHERE uid > 0 and uptime > '". $dif."'");
while($row = db_fetch_object($erg))
{
$wiwstring .= '<a title="Aufenthaltsort: '.$row->page.'" href="index.php?user-details-'.$row->uid.'">'.$row->name.'</a> , ';
}
$wiwstring = substr($wiwstring,0,strlen($wiwstring) - 3);
}
else
{
$wiwstring = "offline";
$dif = date('Y-m-d H:i:s', time() - USERUPTIME);
$erg = db_query("SELECT DISTINCT uid, name, page, prefix_ranks.bez, spezrank FROM `prefix_online` left join prefix_user on prefix_user.id = prefix_online.uid left join prefix_ranks ON prefix_ranks.id = prefix_user.spezrank WHERE uid = '".$tmp."' and uptime > '". $dif."'");
while($row = db_fetch_object($erg))
{
$wiwstring = '<a title="Aufenthaltsort: '.$row->page.'" href="index.php?'.$row->page.'">'.$row->page.'</a>';
}
}
return($wiwstring);
}
function wiwb($tmp)
{
$wiwstring = "offline";
$dif = date('Y-m-d H:i:s', time() - USERUPTIME);
$erg = db_query("SELECT DISTINCT uid, name, page, prefix_ranks.bez, spezrank FROM `prefix_online` left join prefix_user on prefix_user.id = prefix_online.uid left join prefix_ranks ON prefix_ranks.id = prefix_user.spezrank WHERE uid = '".$tmp."' and uptime > '". $dif."'");
while($row = db_fetch_object($erg))
{
$wiwstring = $row->page;
}
return($wiwstring);
}
function contentstatistic()
{
$log = 0; // Auf 1 Setzen wenn alles in der log.txt gespeichert werden soll(log.txt im Verzeichniss wo die index.php ist erstellen und Recht 77 geben.)
if($_SERVER['QUERY_STRING']=="")$_SERVER['QUERY_STRING']="start";
db_query('UPDATE `prefix_online` SET `page` = "'.$_SERVER['QUERY_STRING'].'" WHERE `sid` = "'.session_id().'"');
$dummy = 0;
$erg = db_query("SELECT * FROM prefix_pagestat");
while ($row = db_fetch_object($erg))
{
if ($row->page == $_SERVER['QUERY_STRING']) $dummy = 1;
}
if ($dummy == 0)
{
db_query('INSERT INTO prefix_pagestat (page , counter) VALUES ("'.$_SERVER['QUERY_STRING'].'" , "0")');
}
db_query('UPDATE `prefix_pagestat` SET `counter`= `counter` +1 WHERE `page`= "'.$_SERVER['QUERY_STRING'].'"');
if ($log == 1)
{
$authname = $_SESSION['authname'];
$ip = $_SERVER['REMOTE_ADDR'];
$qs = $_SERVER['QUERY_STRING'];
$datei = fopen("log.txt", "a");
fwrite($datei, "Nick:$authname Seite:$qs IP:$ip\n");
fclose($datei);
}
}
?>
Die richtige Formulierung eines Problems ist nicht selten bereits die halbe Lösung.
»Albert Einstein«