Hallo
habe das Avatar Upload Modul V.2.4.3 modul installiert,wie kann ich jetzt die letzten aktiven mitglieder auf der startseite mit avatar anzeigen lassen.
und noch ein problem.Das Avatar das hochgeladen wurde,erhsceint zwar im smf profil bereich aber nicht in den foren?
MFg
also eine Möglichkeit wäre es den Last_Seen block zu nehemn da noch die avatar abfrage rein und gut ist das dann...
ich hab das nicht getestet könnte aber funktionieren...
<?php
/**
* This file is part of
* pragmaMx - Web Content Management System.
* Copyright by pragmaMx Developer Team - http://www.pragmamx.org
*
* pragmaMx is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* $Revision: 1.16.6.2 $
* $Author: tora60 $
* $Date: 2009/04/06 17:58:03 $
*/
defined('mxMainFileLoaded') or die('access denied');
/* Anzahl der User im Block */
$numusers = 20;
/* User, die nicht angezeigt werden sollen
* Namen mit Komma trennen!
*/
$excludedusers = 'Knalxler ,Dertzui';
/* maximale Hoehe des Blocks in Pixel. 0 um die Hoehe nicht zu beschränken */
$blockheigth = 100;
$mxblockcache = false;
/* Variablen initialisieren */
global $prefix, $user_prefix;
if (@file_exists("language/whoonline/lang-" . $GLOBALS['currentlang'] . ".php")) {
include_once("language/whoonline/lang-" . $GLOBALS['currentlang'] . ".php");
} else {
include_once("language/whoonline/lang-english.php");
}
$blockheigth = (int)$blockheigth;
/* SQL-bedingung fuer excluded Users erstellen */
$exusers = explode(',', $excludedusers);
if (!MX_IS_ADMIN) {
while (list($key, $val) = each($exusers)) {
$xexusers[] = trim($val);
}
}
$xexusers[] = $GLOBALS['anonymous'];
if (MX_IS_USER) {
$usersession = mxGetUserSession();
$xexusers[] = $usersession[1];
}
$excludedusers = "'" . implode("','", mxAddSlashesForSQL($xexusers)) . "'";
$days = 0;
$hours = 0;
$mins = 0;
$result = sql_query("SELECT uname, user_lastvisit FROM ${user_prefix}_users where (uname not in(" . $excludedusers . ")) AND (user_stat=1) ORDER BY user_lastvisit DESC limit 0,$numusers");
$pic = sql_fetch_array(sql_query("SELECT aid, foto, werist FROM ".$prefix."_avatar WHERE ((aid='$uname')) "));
if (!empty($pic["foto"]))
{
$avatarFile = $pic["foto"];
}else{
$avatarFile = $pic["werist"];
}
// Wenn ein Avatar hochgeladen wurde
if (!empty($avatarFile))
{
$avatar = $avatarFile;
}
else
{
$avatar = "kein_bild.jpg";
}
$picpath = MX_PATH_MEMBERAVATAR;
$bild = "<img src=\"".$picpath."/".$avatar."\" width=\"75px\">";
$list = "";
while (list($uname, $date) = sql_fetch_row($result)) {
$realtime = time() - $date;
$dont = false;
/* how many days ago? */
if ($realtime >= (60 * 60 * 24 * 2)) { // if it's been more than 2 days
$days = mxValueToString(floor($realtime / (60 * 60 * 24)), 0);
$dont = true;
} else if ($realtime >= (60 * 60 * 24)) { // if it's been less than 2 days
$days = 1;
$realtime -= (60 * 60 * 24);
}
if (!$dont) {
/* how many hours ago? */
if ($realtime >= (60 * 60)) {
$hours = floor($realtime / (60 * 60));
$realtime -= (60 * 60 * $hours);
}
// how many minutes ago?
if ($realtime >= 60) {
$mins = floor($realtime / 60);
$realtime -= (60 * $mins);
}
/* just a little precation, although I don't *think* mins will ever be 60... */
if ($mins == 60) {
$mins = 0;
$hours += 1;
}
}
$list .= '<li>'.$bild.'<br>' . mxCreateUserprofileLink($uname) . ': ';
if ($dont) {
$list .= $days . " " . _LASTSEENDAYS;
} else {
if ($days > 0) {
$list .= $days . " " . _LASTSEENDAY . (($hours == 0 && $mins == 0)?(""):(","));
}
if ($hours > 0) {
$list .= $hours . " " . (($hours > 1)?(_LASTSEENHOURS):(_LASTSEENHOUR)) . (($mins == 0)?(''):(','));
}
if ($mins > 0) {
$list .= $mins . " " . (($mins > 1)?(_LASTSEENMINUTES):(_LASTSEENMINUTE));
} else { // less than a minute :)
$list .= $realtime . " " . _LASTSEENSECONDS;
}
}
$list .= " " . _LASTSEENAGO . "</li>";
$days = 0;
$hours = 0;
$mins = 0;
$dont = false;
}
if ($list) {
$content = ($blockheigth == 0) ? $list : '<ul class="list" style="height: ' . $blockheigth . 'px; overflow: auto;">' . $list . '</ul>';
}
/* Blocktitel aus Sprachdatei auslesen */
$blockfiletitle = _LASTSEENTITLE;
?>
danke.Funktionier aber leider nicht.
Achso diese Meldung kommt:
Parse error: syntax error, unexpected T_VARIABLE in .... lock-Last_Seen.php on line 162
Line 162 wäre ?> ???
Zitatund noch ein problem.Das Avatar das hochgeladen wurde,erhsceint zwar im smf profil bereich aber nicht in den foren?
Forum-->Administration-->aktuelles Theme --- Benutzerbild im Beitrag anzeigen? musst du ein Häckchen setzten. Dann werden die Avatare in den Forenbeiträgen angezeigt.
gruß
thorsten
danke lausbub :thumbup:
Ich habe das mit den avataran in dem last seen block immer noch nicht hingekriegt :mad2: :mad2: