Hallo Leute,
Habe folgende Frage zu Advanced online Panel.
Wie kriege ich es hin das das Avatarbild (naturlich kleiner zB. 15 x 15) direkt neben dem Namen rechts oder links angezeigt wird.
Versuche mich seit ein paar Tagen da rein zudenken aber blicke da nicht richtig durch.
Ich denke das die Lösung wohl möglich in diesem Bereich des Codes liegt:
if($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar'])) {
$avatar = "<img src=\'".IMAGES."avatars/".$data['user_avatar']."\' width=\'50px\' height=\'50px\' alt=\'\' border=\'0\' />";
} else {
$avatar = "<img src=\'".INFUSIONS."advanced_online_panel/images/noav.gif\' alt=\'\' border=\'0\' />";
}
if($data['user_web'] != "") $user_web = trimlink(str_replace("http://", "", $data['user_web']), 30); else $user_web = "<span class=\'small\'>keine Angabe</span>";
echo "<li class='small' style='margin-bottom: 2px;'>";
echo "<span class=\"online_hotspot\" onmouseover=\"online_tooltip.show('".$avatar."<div align=\'right\' style=\'float: right; color: #".$color."\'><u>".$data['user_name']."</u><br /><span class=\'small\'>".getuserlevel($data['user_level'])."</span></div><hr /><span class=\'small\'>Status:</span><span class=\'small\' style=\'float: right;\'>".$lastseen."</span><br /><span class=\'small\'>Website:</span><span class=\'small\' style=\'float: right;\'>".$user_web."</span><hr /><span class=\'small\'>Mitglied seit:</small><span class=\'small\' style=\'float: right;\'>".date("d.m.Y - H:i", $data['user_joined'])."</span><br /><span class=\'small\'>Letzte Aktivität:</span><span class=\'small\' style=\'float: right;\'>".date("d.m.Y - H:i", $data['user_lastvisit'])."</span>');\" onmouseout=\"online_tooltip.hide();\">";
echo THEME_BULLET." <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' style='color: #".$color."'>";
echo trimlink($data['user_name'],13)."</span><span class='small2' style='float: right;'>".str_replace("\'", "'", $lastseen)."</span></a></li>\n";
}
Kann mir einer diesbezüglich helfen.
Hier auch der komplette Code von Advanced_online_panel:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: advanced_online_panel.php
| Copyright © 2009-2011 ptown67
| http://www.ptown67.de
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
include INFUSIONS."advanced_online_panel/infusion_db.php";
if (file_exists(INFUSIONS."advanced_online_panel/locale/".$settings['locale'].".php")) {
include INFUSIONS."advanced_online_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."advanced_online_panel/locale/German.php";
}
add_to_head("<script type='text/javascript' language='javascript' src='".INFUSIONS."advanced_online_panel/includes/tooltip.js'></script>");
add_to_head("<style type='text/css'>
.online_hotspot { color:#666; cursor: pointer; }
#ot { position: absolute; display: block; }
#otcont { width: 250px; padding: 10px; box-shadow: 2px 2px 2px #888; background-image: url('".INFUSIONS."advanced_online_panel/images/bg.gif'); color: #666; border: 1px solid #888; }
#otcont hr { height: 1px; background: #888; border: 0px; }
</style>");
$trackUserAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
$bots = array(
'archiver' => 'alexa',
'exabot' => 'exalead',
'fast' => 'fast',
'firefly' => 'fireball',
'googlebot' => 'google',
'msnbot' => 'msn',
'architextspider' => 'excite',
'lycos_spider' => 'lycos',
'slurp' => 'yahoo'
);
foreach ($bots as $bot_ua => $bot_db) {
if (stristr($trackUserAgent, $bot_ua)) { $result = dbquery("UPDATE ".DB_ONLINE_SETTINGS." SET online_".$bot_db."='".time()."'"); }
}
$result = dbquery("SELECT * FROM ".DB_ONLINE_SETTINGS);
$online = dbarray($result);
$result = dbquery("SELECT * FROM ".DB_ONLINE." WHERE online_user=".($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'"));
if (dbrows($result)) $result = dbquery("UPDATE ".DB_ONLINE." SET online_lastactive='".time()."' WHERE online_user=".($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'")."");
else $result = dbquery("INSERT INTO ".DB_ONLINE." (online_user, online_ip, online_lastactive) VALUES ('".($userdata['user_level'] != 0 ? $userdata['user_id'] : "0")."', '".USER_IP."', '".time()."')");
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_lastactive<".(time()-300)."");
$result = dbquery("SELECT ton.*, tu.user_id,user_name FROM ".DB_ONLINE." ton LEFT JOIN ".DB_USERS." tu ON ton.online_user=tu.user_id");
$guests = 0; $members = array();
while ($data = dbarray($result)) {
if ($data['online_user'] == "0") {
$guests++;
} else {
array_push($members, array($data['user_id'], $data['user_name']));
}
}
openside($locale['aou300']);
echo "<ul style='padding-left: 0px; margin: 0px; list-style-type: none;'>\n";
if ($online['online_showguests'] == 1) echo "<li class='small' style='margin-bottom: 2px;'>".THEME_BULLET." ".$locale['aou301'].":<span class='small2' style='float: right;'>".$guests."</span></li>\n";
if ($online['online_showmembers'] == 1) echo "<li class='small' style='margin-bottom: 2px;'>".THEME_BULLET." ".$locale['aou302'].":<span class='small2' style='float: right;'>".count($members)."</span></li>\n";
if ($online['online_showguests'] == 0 && $online['online_showmembers'] == 0 && $online['online_showmembersnum'] != 0) echo "";
elseif ($online['online_showmembersnum'] != 0) {
echo "<hr class='side' />\n";
$result = dbquery("SELECT * FROM ".$db_prefix."users ORDER BY user_lastvisit DESC LIMIT 0,".$online['online_showmembersnum']);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
$lastseen = time() - $data['user_lastvisit'];
$iW=sprintf("%2d",floor($lastseen/604800));
$iD=sprintf("%2d",floor($lastseen/(60*60*24)));
$iH=sprintf("%02d",floor((($lastseen%604800)%86400)/3600));
$iM=sprintf("%02d",floor(((($lastseen%604800)%86400)%3600)/60));
$iS=sprintf("%02d",floor((((($lastseen%604800)%86400)%3600)%60)));
if ($lastseen < 300) $lastseen = "<img src=\'".INFUSIONS."advanced_online_panel/images/online.png\' border=\'0\' alt=\'Online\' />";
elseif ($lastseen < 600) $lastseen = "<img src=\'".INFUSIONS."advanced_online_panel/images/10min.png\' border=\'0\' alt=\'10Min\' />";
elseif ($lastseen < 1800) $lastseen = "<img src=\'".INFUSIONS."advanced_online_panel/images/30min.png\' border=\'0\' alt=\'30Min\' />";
elseif ($lastseen < 3600) $lastseen = "<img src=\'".INFUSIONS."advanced_online_panel/images/60min.png\' border=\'0\' alt=\'60Min\' />";
else $lastseen = "<img src=\'".INFUSIONS."advanced_online_panel/images/offline.png\' border=\'0\' alt=\'Offline\' />";
if ($data['user_level'] == 103) { $color = $online['online_superadmincolor']; }
if ($data['user_level'] == 102) { $color = $online['online_admincolor']; }
if ($data['user_level'] == 101) { $color = $online['online_usercolor']; }
if($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar'])) {
$avatar = "<img src=\'".IMAGES."avatars/".$data['user_avatar']."\' width=\'50px\' height=\'50px\' alt=\'\' border=\'0\' />";
} else {
$avatar = "<img src=\'".INFUSIONS."advanced_online_panel/images/noav.gif\' alt=\'\' border=\'0\' />";
}
if($data['user_web'] != "") $user_web = trimlink(str_replace("http://", "", $data['user_web']), 30); else $user_web = "<span class=\'small\'>keine Angabe</span>";
echo "<li class='small' style='margin-bottom: 2px;'>";
echo "<span class=\"online_hotspot\" onmouseover=\"online_tooltip.show('".$avatar."<div align=\'right\' style=\'float: right; color: #".$color."\'><u>".$data['user_name']."</u><br /><span class=\'small\'>".getuserlevel($data['user_level'])."</span></div><hr /><span class=\'small\'>Status:</span><span class=\'small\' style=\'float: right;\'>".$lastseen."</span><br /><span class=\'small\'>Website:</span><span class=\'small\' style=\'float: right;\'>".$user_web."</span><hr /><span class=\'small\'>Mitglied seit:</small><span class=\'small\' style=\'float: right;\'>".date("d.m.Y - H:i", $data['user_joined'])."</span><br /><span class=\'small\'>Letzte Aktivität:</span><span class=\'small\' style=\'float: right;\'>".date("d.m.Y - H:i", $data['user_lastvisit'])."</span>');\" onmouseout=\"online_tooltip.hide();\">";
echo THEME_BULLET." <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' style='color: #".$color."'>";
echo trimlink($data['user_name'],13)."</span><span class='small2' style='float: right;'>".str_replace("\'", "'", $lastseen)."</span></a></li>\n";
}
}
}
if ($online['online_showbots'] == 1) {
$bot_list = array(
$online['online_alexa'] => 'Alexa',
$online['online_exalead'] => 'Exalead',
$online['online_excite'] => 'Excite',
$online['online_fast'] => 'Fast',
$online['online_fireball'] => 'Fireball',
$online['online_google'] => 'Google',
$online['online_lycos'] => 'Lycos',
$online['online_msn'] => 'MSN',
$online['online_yahoo'] => 'Yahoo'
);
foreach ($bot_list as $bot_time => $bot_name) {
if ((time() - $online['online_showbotstime']) <= $bot_time) echo "<li class='small2' style='margin-bottom: 2px;'>".THEME_BULLET." ".$bot_name."<span class='small2' style='float: right;'><img src='".INFUSIONS."advanced_online_panel/images/robot.png' border='0' alt='Robot' /></span></li>\n";
}
}
if ($online['online_showguests'] == 0 && $online['online_showmembers'] == 0 && $online['online_showmembersnum'] == 0) echo "";
elseif ($online['online_showallmembers'] != 0 || $online['online_shownewmember'] != 0) echo "<hr />\n";
# Mitglieder
if ($online['online_showallmembers'] == 1) echo "<li class='small' style='margin-bottom: 2px;'>".THEME_BULLET." ".$locale['aou303'].":<span class='small2' style='float: right;'>".number_format(dbcount("(user_id)", DB_USERS, "user_status<='1'"))."</span></li>\n";
# Aktivierung
if (iADMIN && checkrights("M") && $settings['admin_activation'] == "1") {
echo "<li class='small2' style='margin-bottom: 2px;'><a href='".ADMIN."members.php".$aidlink."&status=2'>".THEME_BULLET." ".$locale['global_015']."</a>";
echo ":<span class='small' style='float: right;'>".dbcount("(user_id)", DB_USERS, "user_status='2'")."</span></a></li>\n";
}
# Neustes Mitglied
if ($online['online_shownewmember'] == 1) {
$data = dbarray(dbquery("SELECT user_id,user_name FROM ".DB_USERS." WHERE user_status='0' ORDER BY user_joined DESC LIMIT 0,1"));
echo "<li class='small' style='margin-bottom: 2px;'>".THEME_BULLET." ".$locale['aou304'].":<span class='small2' style='float: right;'><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".trimlink($data['user_name'],15)."</a></span></li>\n";
}
echo "</ul>\n";
closeside();
?>
mfg
Eddie |