Hallo ich möchte mir eine User Onlie Box erstellen und habe mir mit php schon mal etwas zussammen gebastelt,aber es haut nicht so hin wie ich das möchte und hoffe nun das mir von den Profis jemand helfen kann.
Ich habe mir eine php datei gebastelt in der die User angezeigt werden,aber so wie sie ist werden die User komplett angezeigt jeder einzelne,ich bekomme es nicht hin das die User wie folgt angezeigt werden:
z.b.
11 Gäste
5 Kunden (Eventuell Name des Kunden)
3 Bots
Ich Poste mal das was ich gebastelt habe,in dem Script gibt es den abschnitt:
Dort soll/muss das ergebniss ausgegeben werden und auch dabei habe ich Probleme,ich wess icht wie ich es dort eintragen muss?
Hier die php datei:
Ich habe mir eine php datei gebastelt in der die User angezeigt werden,aber so wie sie ist werden die User komplett angezeigt jeder einzelne,ich bekomme es nicht hin das die User wie folgt angezeigt werden:
z.b.
11 Gäste
5 Kunden (Eventuell Name des Kunden)
3 Bots
Ich Poste mal das was ich gebastelt habe,in dem Script gibt es den abschnitt:
PHP-Code:
$box_content = '<div align="center">
</div>';
Hier die php datei:
PHP-Code:
<?php
/* --------------------------------------------------------------
online.php
--------------------------------------------------------------*/
$box_smarty = new smarty;
$box_smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
$box_content = '<div align="center">
</div>';
//BOF - DokuMan - 2010-06-28 - Added http_referer to whois online
$whos_online_query =xtc_db_query("select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, session_id, http_referer from " . TABLE_WHOS_ONLINE ." order by time_last_click desc");
//$whos_online_query = xtc_db_query("select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, session_id from " . TABLE_WHOS_ONLINE ." order by time_last_click desc");
//EOF - DokuMan - 2010-06-28 - Added http_referer to whois online
while ($whos_online = xtc_db_fetch_array($whos_online_query)) {
$time_online = (time() - $whos_online['time_entry']);
if ( ((!$_GET['info']) || (@$_GET['info'] == $whos_online['session_id'])) && (!$info) ) {
$info = $whos_online['session_id'];
}
if ($whos_online['session_id'] == $info) {
echo ' <tr class="dataTableRowSelected">' . "\n";
} else {
echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_WHOS_ONLINE, xtc_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online['session_id'], 'NONSSL') . '\'">' . "\n";
}
$box_smarty->assign('BOX_CONTENT', $box_content);
$box_smarty->assign('language', $_SESSION['language']);
$box_smarty->caching = 0;
$box_online = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_online.html');
$smarty->assign('box_ONLINE', $box_online);
?>
<td class="dataTableContent"><?php echo gmdate('H:i:s', $time_online); ?></td>
<td class="dataTableContent" align="center"><?php echo $whos_online['customer_id']; ?></td>
<td class="dataTableContent"><?php echo $whos_online['full_name']; ?></td>
<td class="dataTableContent" align="center"><a href="http://centralops.net/co/DomainDossier.aspx?dom_whois=1&net_whois=1&dom_dns=1&addr=<?php echo $whos_online['ip_address']; ?>" target="_blank"><?php echo $whos_online['ip_address'];echo " <em>(".@gethostbyaddr($whos_online['ip_address']).")</em>"; ?></a></td>
<td class="dataTableContent"><?php echo date('H:i:s', $whos_online['time_entry']); ?></td>
<td class="dataTableContent" align="center"><?php echo date('H:i:s', $whos_online['time_last_click']); ?></td>
<td class="dataTableContent"><?php
if (preg_match('/^(.*)' . xtc_session_name() . '=[a-f,0-9]+[&]*(.*)/i', $whos_online['last_page_url'], $array)) { // Hetfield - 2009-08-19 - replaced deprecated function eregi with preg_match to be ready for PHP >= 5.3
echo $array[1] . $array[2]; } else { echo $whos_online['last_page_url'];
}
?> </td>
<td class="dataTableContent"><?php echo $whos_online['http_referer']; ?></td>
</tr>
<?php
}
?>
</table></td>
Kommentar