ich bin derzeit dabei unserer Homepage ein neues Gesicht zu verleihen und habe mich dafür u. a. an der Statistikbox zu schaffen gemacht. Das klappte auch wunderbar. Nach kurzer Zeit kam allerdings häufiger die Anmerkung, dass es wünschenswert wäre, die Onlinebox auch wieder sichtbar zu machen. Also habe ich mich öfters darin versucht die Onlinebox in die Statistikbox zu integrieren. Das Ergebnis war allerdings jedesmal, dass entweder die Tabelle der Onlinebox über der Statistik oder unter ihr aufgeführt war. Das Ziel sollte allerdings sein, dass sie rechts neben der aufgeführten Statistik zu sehen sein sollte.
Da ich absolut nicht weiß, wie ich den Inhalt der Onlinebox in die Statistikbox integrieren muss, damit sie an gewünschter Stelle erscheint, wende ich mich in der Hoffnung an euch, dass mir einer weiterhelfen kann.
der Inhalt der Onelinebox sieht folgendermaßen aus:
<?php if (!defined('main')) {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"; } ?> <table align="center" border="0" cellpadding="0" cellspacing="0" > <?php echo $content; ?> </table>
Und der Inhalt der Statistikbox so (Platzhalter für die Onlinebox ist in Zeile 110 bis 113):
<?php if (!defined('main')) {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"; } ?> <?php if (empty($_GET['sum'])) { $heute = date ('Y-m-d'); $bges = @db_count_query("SELECT COUNT(*) FROM prefix_gallery_imgs"); $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); $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); echo ' <table width="100%"> <tr> <td width="20%" align="center" valign="center" rowspan="2"> <div id="nocheat"></div> </td> <td width="12%" align="top" valign="top"> <span class="extrafont_normal_strong_underline_black">» Beiträge</span> <span class="extrafont_small_strong_black">• '.$lang['Gästebuch'].':</span> <span class="extrafont_small_strong_black">• '.$lang['Forumbeiträge'].':</span> <span class="extrafont_small_strong_black">• '.$lang['Forumthemen'].':</span> </td> <td width="8%" align="top" valign="top"> <span class="extrafont_normal_strong_black"> </span> <span class="extrafont_small_strong_black">'.$gbook.'</span> <span class="extrafont_small_strong_black">'.$posts.'</span> <span class="extrafont_small_strong_black">'.$topic.'</span> </td> <td width="10%" align="top" valign="top"> <span class="extrafont_normal_strong_underline_black">» '.$lang['Besucher'].'</span> <span class="extrafont_small_strong_black">• '.$lang['Gesamt'].':</span> <span class="extrafont_small_strong_black">• '.$lang['Heute'].':</span> <span class="extrafont_small_strong_black">• '.$lang['Gestern'].':</span> </td> <td width="8%" align="top" valign="top"> <span class="extrafont_normal_strong_black"> </span> <span class="extrafont_small_strong_black">'.$ges_visits.'</span> <span class="extrafont_small_strong_black">'.$ges_heute.'</span> <span class="extrafont_small_strong_black">'.$ges_gestern.'</span> </td> <td width="7%" align="top" valign="top"> <span class="extrafont_normal_strong_underline_black">» '.$lang['Online'].'</span> <span class="extrafont_small_strong_black">• '.$lang['Gesamt'].':</span> <span class="extrafont_small_strong_black">• '.$lang['User'].':</span> <span class="extrafont_small_strong_black">• '.$lang['Gäste'].':</span> </td> <td width="8%" align="top" valign="top"> <span class="extrafont_normal_strong_black"> </span> <span class="extrafont_small_strong_black">'.ges_online().'</span> <span class="extrafont_small_strong_black">'.ges_user_online().'</span> <span class="extrafont_small_strong_black">'.ges_gast_online().'</span> </td> <td width="22%" align="top" valign="top"> <span class="extrafont_small_strong_black">Hier soll die</span> <span class="extrafont_small_strong_black">Onlinebox hin</span> </td> </tr> <tr> <td width="100%" valign="top" colspan="8"> <span class="extrafont_normal_strong_inline_black">mehr Informationen zur Statistik findet man</span> <a href="index.php?statistik"><span class="extrafont_normal_strong_red">» hier «</span></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>'.$lang['Besucherzahlen der letzten 7 Tage'].'</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="javasript:window.close()">Fenster Schliesen</a> ]</td>'; echo '</tr></table></td></tr></table><br />'; $design->footer(); } ?>
Für eure Bemühungen bedanke ich mich schonmal im Vorraus.
betroffene Homepage: externer Link