Hallo,
wie kann ich mir anstatt der gruenen Online Maennchen in der Online Box die Avatare der Leute die Online sind anzeigen lassen?
So das man das Avatar sieht und darunter den Namen.
betroffene Homepage: localhost
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
$ergavatar = @db_result(db_query('SELECT avatar FROM prefix_user WHERE id='.$row->uid),0); if (file_exists($ergavatar)) { $avatar = '<img src="'.$ergavatar.'" border="0">'; } else { $avatar = '<img src="include/images/avatars/noavatar.jpg" border="0">'; }
<?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) { $ergavatar = @db_result(db_query('SELECT avatar FROM prefix_user WHERE id='.$row->uid),0); if (file_exists($ergavatar)) { $avatar = '<img src="'.$ergavatar.'" border="0" height="40" width="40">'; } else { $avatar = '<img src="include/images/avatars/noavatar.jpg" border="0" height="40" width="40">'; } $name=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$row->uid),0); $content.= '<tr><td><a href="index.php?user-details-'.$row->uid.'"><img src="'.$ergavatar.'" border="0" height="40" width="40" a ></td>'; $content.='<td><a href="index.php?user-details-'.$row->uid.'">'.$name.'</a></td></tr>'."\n"; $uid[] = $row->uid; } } ?> <table align="center" border="0" cellpadding="4" cellspacing="5" > <?php echo $content; ?> </table>
$content.= '<tr><td><a href="index.php?user-details-'.$row->uid.'">'.$avatar.'<br>'.$name.'</a></td></tr>'."\n";
<?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) { $ergavatar = @db_result(db_query('SELECT avatar FROM prefix_user WHERE id='.$row->uid),0); if (file_exists($ergavatar)) { $avatar = '<img src="'.$ergavatar.'" border="0" width="40" height="40" >'; } else { $avatar = '<img src="include/images/avatars/noavatar.jpg" border="0" width="40" height="40" >'; } $name=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$row->uid),0); $content.= '<tr><td><a href="index.php?user-details-'.$row->uid.'" >'.$avatar.'<br>'.$name.'</a></td></tr>'."\n"; $uid[] = $row->uid; } } ?> <table align="center" border="0" cellpadding="4" cellspacing="5" > <?php echo $content; ?> </table>
<?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=''; $u = 0; while ($row = db_fetch_object($resultID)) { if ($row->uid != 0 AND $brk!=$row->uid) { $ergavatar = @db_result(db_query('SELECT avatar FROM prefix_user WHERE id='.$row->uid),0); if (file_exists($ergavatar)) { $avatar = '<img src="'.$ergavatar.'" border="0" width="40" height="40" >'; } else { $avatar = '<img src="include/images/avatars/noavatar.jpg" border="0" width="40" height="40" >'; } $name=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$row->uid),0); $content.= '<div style="float:left;margin:2px;"><a href="index.php?user-details-'.$row->uid.'" title="'.$name.'">'.$avatar.'</a></div>'; $u++; if ($u % 4 == 0) {$content.= "<br>";} $uid[] = $row->uid; } } ?> <table align="center" border="0"><tr><td><?php echo $content; ?></td></tr></table>
<?php defined('main') or die('no direct access'); if (loggedin()) { $dif = date('Y-m-d H:i:s', time() - 60); $sql = db_query("SELECT a.fid as aktfid, b.name, IF(MAX(c.uptime) > '$dif','online','offline') as status FROM `prefix_friends` a LEFT JOIN `prefix_user` b ON a.fid = b.id LEFT JOIN `prefix_online` c ON a.fid = c.uid WHERE a.uid = {$_SESSION['authid']} GROUP BY a.fid, b.name ORDER BY status DESC"); while ($r = db_fetch_object($sql)) { echo '<img src="include/images/icons/'.$r->status.'.gif" alt="'.$r->status.'" border="0" /><a href="index.php?forum-privmsg-new=0&empfid='.$r->aktfid.'">'.$r->name.'</a> <br />'; } echo '<br /><a href="index.php?freunde">Freundeliste bearbeiten</a><br />'; } else { echo 'Nur für angemeldete User.<br />'; } ?>
<?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=''; $u = 0; while ($row = db_fetch_object($resultID)) { if ($row->uid != 0 AND $brk!=$row->uid) { $ergavatar = @db_result(db_query('SELECT avatar FROM prefix_user WHERE id='.$row->uid),0); if (file_exists($ergavatar)) { $avatar = '<img src="'.$ergavatar.'" border="0" width="40" height="40" >'; } else { $avatar = '<img src="include/images/avatars/noavatar.jpg" border="0" width="40" height="40" >'; } $name=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$row->uid),0); $content.= '<div style="float:left;margin:4px;"><a href="index.php?user-details-'.$row->uid.'" title="'.$name.'">'.$avatar.'</a></div>'; $u++; if ($u % 4 == 0) {$content.= "<br>";} $uid[] = $row->uid; } } ?> <table align="center" border="0"><tr><td><?php echo $content; ?></td></tr></table>
<?php defined('main') or die('no direct access'); if (loggedin()) { $dif = date('Y-m-d H:i:s', time() - 60); $sql = db_query("SELECT a.fid as aktfid, b.name, b.avatar, IF(MAX(c.uptime) > '$dif','online','offline') as status FROM `prefix_friends` a LEFT JOIN `prefix_user` b ON a.fid = b.id LEFT JOIN `prefix_online` c ON a.fid = c.uid WHERE a.uid = {$_SESSION['authid']} GROUP BY a.fid, b.name ORDER BY status DESC"); while ($r = db_fetch_object($sql)) { if (file_exists($r->avatar)) { $avatar = '<img src="'.$ergavatar.'" border="0" width="40" height="40" title="'.$r->name.'">'; } else { $avatar = '<img src="include/images/avatars/noavatar.jpg" border="0" width="40" height="40" >'; } echo '<img src="include/images/icons/'.$r->status.'.gif" alt="'.$r->status.'" border="0" /><a href="index.php?forum-privmsg-new=0&empfid='.$r->aktfid.'">'.$avatar.'</a> <br />'; } echo '<br /><a href="index.php?freunde">Freundeliste bearbeiten</a><br />'; } else { echo 'Nur für angemeldete User.<br />'; } ?>
<?php defined('main') or die('no direct access'); if (loggedin()) { $dif = date('Y-m-d H:i:s', time() - 60); $sql = db_query("SELECT a.fid as aktfid, b.name, b.avatar, IF(MAX(c.uptime) > '$dif','online','offline') as status FROM `prefix_friends` a LEFT JOIN `prefix_user` b ON a.fid = b.id LEFT JOIN `prefix_online` c ON a.fid = c.uid WHERE a.uid = {$_SESSION['authid']} GROUP BY a.fid, b.name ORDER BY status DESC"); echo '<table>'; while ($r = db_fetch_object($sql)) { if (file_exists($r->avatar)) { $avatar = '<img src="'.$r->avatar.'" border="0" width="40" height="40" title="'.$r->name.'">'; } else { $avatar = '<img src="include/images/avatars/noavatar.jpg" border="0" width="40" height="40" >'; } echo '<tr><td>'.$avatar.'</td>' .'<td><a href="index.php?user-details-'.$r->aktfid.'">'.$r->name.'</a></td><td>' .'<a href="index.php?forum-privmsg-new=0&empfid='.$r->aktfid.'">PM</a>' .'<img src="include/images/icons/'.$r->status.'.gif" alt="'.$r->status.'" border="0" />' .'</td></tr>'; } echo '</table><br /><a href="index.php?freunde">Freundeliste bearbeiten</a><br />'; } else { echo 'Nur für angemeldete User.<br />'; } ?>
Geschlossen | ||
Zurück zu HTML, PHP, SQL,... |