das ist die statistik.php wo ich dran hänge. das was ich versuche nennt sich einmal test und warswin
<?
defined ('main') or die ( 'no direct access' );
$dif = date('Y-m-d H:i:s', time() - 60);
$abf = "SELECT uid FROM `prefix_online` WHERE uptime > '". $dif."'";
$resultID = db_query($abf);
$brk='';
$uid = array();
$guests = 0;
$guestn = $lang['guests'];
$content='';
while ($row = db_fetch_object($resultID)) {
if ($row->uid != 0 AND $brk!=$row->uid) {
$name=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$row->uid),0);
$content.= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"></td>';
$content.='<td><a href="index.php?user-details-'.$row->uid.'">'.$name.'</a></td></tr>'."\n";
$uid[] = $row->uid;
}
if ($row->uid == 0) { $guests++; }
$brk=$row->uid;
}
if ($guests == 1) { $guestn = $lang['guest']; }
if (empty($content)) { $content.='<tr><td><img src="include/images/icons/offline.gif" border="0" alt="offline"></td><td><font color="#003366">0 User </font></td><tr>'."\n"; }
$content.='<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px;"></td></tr>'."\n";
$where = (count($uid)>0) ? 'WHERE id NOT IN ('.implode(', ', $uid).')' : '';
$abf2 = 'SELECT * FROM prefix_user '.$where.' ORDER BY llogin DESC LIMIT 0,5';
$erg2 = db_query($abf2);
while ($row2 = db_fetch_object($erg2)) {
$datum = date('H:i d.m.y',$row2->llogin);
$user = $row2->name;
$content.='<tr><td><img src="include/images/icons/offline.gif" border="0" alt="offline"></td><td><a href="index.php?user-details-'.$row2->id.'" title="'.$lang['lasttimeonline'].$datum.'">'.$user.'</a></td></tr>'."\n";
}
if ($guests == 0) {
$content.= '<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px";></td></tr>'."\n".'
<tr><td><img src="include/images/icons/offline.gif" border="0" alt="offline"></td><td><font size="-1" color="#003366">0 '.$lang['guests'].'</td></tr>'."\n";
} else {
$content.= '<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px;"></td></tr>'."\n".'
<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"></td><td><font size=-1>'.$guests.' '.$guestn.'</font></td></tr>'."\n";
}
if (empty($_GET['sum'])) {
$heute = date ('Y-m-d');
$ges_visits = db_result(db_query("SELECT SUM(count) FROM prefix_counter"),0);
$ges_heute = @db_result(db_query("SELECT count FROM prefix_counter WHERE date = '".$heute."'"),0);
$ges_gestern = @db_result(db_query('SELECT count FROM prefix_counter WHERE date < "'.$heute.'" ORDER BY date DESC LIMIT 1'),0);
$gbook = @db_result(db_query("SELECT count(ID) FROM prefix_gbook"),0);
$warswin = @db_result(db_query("SELECT count(wlp) FROM prefix_wars"),0);
$gallery = @db_result(db_query("SELECT count(ID) FROM prefix_gallery_imgs"),0);
$posts = @db_result(db_query("SELECT count(ID) FROM prefix_posts"),0);
$topic = @db_result(db_query("SELECT count(ID) FROM prefix_topics"),0);
$gesuser = @db_result(db_query("SELECT count(ID) FROM prefix_user"),0);
$timestamp = time();
$datum = date("d.m.Y", $timestamp);
$timestamp = time();
$zeit = date("H:i", $timestamp);
echo '<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="text_klein">Uhrzeit: '.$zeit.'</td>
</tr>
<tr>
<td align="center" class="text_klein">Datum: '.$datum.'</td>
</tr>
<tr>
<td align="center" class="text_klein"> </td>
</tr>
<tr>
<td align="center" class="text_klein">Gesamt: '.$ges_visits.'</td>
</tr>
<tr>
<td align="center" class="text_klein">Heute: '.$ges_heute.'</td>
</tr>
<tr>
<td align="center" class="text_klein">Gestern: '.$ges_gestern.'</td>
</tr>
<tr>
<td align="center" class="text_klein">Online: '.ges_online().'</td>
</tr>
<tr>
<td align="center" class="text_klein"> </td>
</tr>
<tr>
<td align="center" class="text_klein">Angemeldete User: '.$gesuser.'</td>
</tr>
<tr>
<td align="center" class="text_klein"> </td>
</tr>
<tr>
<td align="center" class="text_klein">Gbook einträge: '.$gbook.'</td>
</tr>
<tr>
<td align="center" class="text_klein">Forum Threads: '.$topic.'</td>
</tr>
<tr>
<td align="center" class="text_klein">Forum Posts: '.$posts.'</td>
</tr>
<tr>
<td align="center" class="text_klein">Gallerybilder: '.$gallery.'</td>
</tr>
<tr>
<td align="center" class="text_klein">test: '.$warswin.'</td>
</tr>
';
#{
#$gesOnBesucher = ges_online();
#if ($gesOnBesucher > 1 ) {
#$MOI = 'sind';
#} else {
#$MOI = 'ist';
#}
#echo '<br>Online '.$MOI.': <br />';
#$erg = db_query('SELECT DISTINCT * FROM `prefix_online` WHERE uid > "0"');
#while ($row = db_fetch_object($erg) ) {
#echo ''.$row->name.' <br>';
#}
#}
#echo '<table align="center" border="0" cellpadding="0" cellspacing="0" >'.$content.'</table>';
echo '<tr>
<td align="center" class="text_klein"> </td>
</tr>
<tr>
<td align="center" class="text_klein"><a href="index.php?statistik"><b>... '.$lang['more'].'</b></a></td>
</tr>
</table>';
} else {
$title = $allgAr['title'].' :: Statistik';
$hmenu = 'Statistik';
$design = new design ( $title , $hmenu , 0 );
$design->header();
$anzahlShownTage = 7;
echo '<br /><table width=90%" align="center" class="border" cellpadding="0" cellspacing="1" border="0"><tr><td>';
echo '<table width="100%" border="0" cellpadding="5" cellspacing="0">';
echo '<tr class="Chead"><td colspan="3" align="center"><b>Site Statistik</b></td></tr>';
$max_in = 0;
$ges = 0;
$dat = array();
$max_width = 200;
$maxErg = db_query('SELECT MAX(count) FROM `prefix_counter`');
$max_in = db_result($maxErg,0);
$erg = db_query ("SELECT count, DATE_FORMAT(date,'%a der %d. %b') as datum FROM `prefix_counter` ORDER BY date DESC LIMIT ".$anzahlShownTage);
while ($row = db_fetch_row($erg) ) {
$value = $row[0];
if ( empty($value) ) {
$bwidth = 0;
} else {
$bwidth = $value/$max_in * $max_width;
$bwidth = round($bwidth,0);
}
echo '<tr class="Cnorm">';
echo '<td>'.$row[1].'</td>';
echo '<td><table width="'.$bwidth.'" border="0" cellpadding="0" cellspacing="0">';
echo '<tr><td height="2" class="border"></td></tr></table>';
echo '</td><td align="right">'.$value.'</td></tr>';
$ges += $value;
}
$gesBesucher = db_query('SELECT SUM(count) FROM prefix_counter');
$gesBesucher = @db_result($gesBesucher,0);
echo '<tr class="Cmite"><td colspan="3"><div align="right">';
echo 'Wochen Summe: '.$ges.'</div>';
echo 'Besucher Gesamt '.$gesBesucher.' Maximal '.$max_in.'<br /><br />';
echo '</td></tr><tr class="Cdark">';
echo '<td colspan="3" align="center">[ <a href="javascript:window.close()">Fenster Schliesen</a> ]</td>';
echo '</tr></table></td></tr></table><br />';
$design->footer();
}
?>