Hallo
ich habe kleine problem
ich möchte der modul mx_ma_useronline load foto aus modul user_fotogalerie
ich habe im modul your_account so
echo"</table>";
echo"</td><td width=\"230\"><center><br>";
if(file_exists("modules/User_Fotoalbum/album/".$uname."1.jpg")) {
$pic = "".$uname."1.jpg";
$size = getimagesize("modules/User_Fotoalbum/album/".$uname."1.jpg");
$width=$size[0]; // image width
$height=$size[1]; // image height
echo "<image src=\"modules/User_Fotoalbum/album/".$uname."1.jpg\" alt=\"$uname\" width=\"155\" border=\"0\"></a>";
}
elseif(file_exists("modules/User_Fotoalbum/album/".$uname."1.gif")) {
$pic = "".$uname."1.gif";
$size = getimagesize("modules/User_Fotoalbum/album/".$uname."1.gif");
$width=$size[0]; // image width
$height=$size[1]; // image height
echo "<image src=\"modules/User_Fotoalbum/album/".$uname."1.gif\" alt=\"$uname\" width=\"155\" border=\"0\"></a>";
}
else{
echo "<image src=\"modules/User_Fotoalbum/album/nopic.jpg\" alt=\"\" width=\"155\" border=\"0\">";
}
echo"</center></td></tr></table>";
diese code load erste foto aus modul user_fotoalbum nach modul your_acount (User Profil)
Etwas wie das ich möchte so im modul user_online .
Code aus modul Mx_ma_useronline
function fnc_bildgroesse ($widthMax, $heightMax, $darfKleiner, $picpath, $bild, $uname, $pic_no_avatar)
{
if (!empty($bild))
{
// ermittle Daten aus der Originalbilddatei
$ServerPfad = "$picpath/$bild";
$imgsize = getimagesize("$ServerPfad");
// ermittle Originalgröße
$widthOrg = $imgsize[0];
$heightOrg = $imgsize[1];
// Berechnung, wenn Variablen für $widthMax und $heightMax (maximale Bildgrössen) gesetzt sind
if (!empty($widthMax))
{
if (!empty($heightMax))
{
// Beginn der Berechnung und Größenzuweisung
// Überprüfung, ob Bild kleiner sein kann
if ($darfKleiner == 1)
{
// Ermitteln des Multiplikationsfaktors anhand des größeren Wertes
// wenn Bild kleiner sein kann
if ($widthOrg > $widthMax)
{
// Berechnung des Teilungsfaktors
$Faktor = $widthMax / $widthOrg;
}
else if ($heightOrg > $heightMax)
{
// Berechnung des Teilungsfaktors
$Faktor = $heightMax / $heightOrg;
}
else
{
// wenn Bild kleiner ist
$Faktor = 1;
}
}
else
{
// Ermitteln des Multiplikationsfaktors anhand des größeren Wertes
// wenn Bild nicht kleiner sein darf
if ($widthOrg < $heightOrg)
{
// Berechnung des Teilungsfaktors
$Faktor = $heightMax / $heightOrg;
}
else
{
// Berechnung des Teilungsfaktors
$Faktor = $widthMax / $widthOrg;
}
}
// Berechnung der Werte
$widthBerechnet = $Faktor * $widthOrg;
$heightBerechnet = $Faktor * $heightOrg;
// Zuweisung und Rundung der Werte
$width = round($widthBerechnet);
$height = round($heightBerechnet);
// Ende der Berechnung und Zuweisung
$bild = "$picpath/$bild";
// Ausgabe des Bildes
$ausgabe_pic_berechnet = "<img src=\"$bild\" alt=\"".$uname."\" width=\"$width\" height=\"$height\" border=\"0\" >\n";
}
else
{
$bild = "$picpath/$bild";
// "Keine maximale Höhe für Bild gesetzt!";
// Ausgabe des Bildes
$ausgabe_pic_berechnet = "<img src=\"$bild\" alt=\"".$uname."\" width=\"$widthMax\" border=\"0\" >\n";
}
}
else
{
if (!empty($heightMax))
{
$bild = "$picpath/$bild";
// "Keine maximale Breite für Bild gesetzt!";
// Ausgabe des Bildes
$ausgabe_pic_berechnet = "<img src=\"$bild\" alt=\"".$uname."\" height=\"$heightMax\" border=\"0\" >\n";
}
else
{
$bild = "$picpath/$bild";
// "Keine maximale Höhe und Breite für Bild gesetzt!";
// Ausgabe des Bildes
$ausgabe_pic_berechnet = "<img src=\"$bild\" alt=\"".$uname."\" border=\"0\" >\n";
}
}
}
else
{
// Kein Bild vorhanden...
$bild = "$pic_no_avatar";
// Ausgabe des Bildes
$ausgabe_pic_berechnet = "<img src=\"$bild\" alt=\"\" border=\"0\" >\n";
}
return "$ausgabe_pic_berechnet";
};
if ($pic_on == 1)
{
// stelle Userbild/Avatar zur Verfügung
$avatarFile = mxIsAvatarUploaded ($uname);
// Wenn ein Avatar hochgeladen wurde
if (!empty($avatarFile))
{
//echo mxCreateImage (MX_PATH_MEMBERAVATAR."/".$avatarFile["werist"]);
$picpath = MX_PATH_MEMBERAVATAR;
// prüfe, ob die Datei auch wirklich vorhanden ist
if (@file_exists("$picpath/$avatarFile"))
{
$avatar = $avatarFile;
}
else
{
$avatar = "";
}
}
else
{
// für alte Version des Avatar Upload Moduls
if (@file_exists("$picpath/$uname.jpg"))
{
$avatar = "$uname.jpg";
}
elseif (@file_exists("$picpath/$uname.jpeg"))
{
$avatar = "$uname.jpeg";
}
elseif (@file_exists("$picpath/$uname.gif"))
{
$avatar = "$uname.gif";
}
elseif (@file_exists("$picpath/$uname.png"))
{
$avatar = "$uname.png";
}
else
{
$avatar = "";
}
}
}
// Bereich: Userpic
$lasts2_inhalt_tab .= " <td align=\"right\" rowspan=\"2\">\n";
$lasts2_inhalt_tab .= " <div align=\"right\">\n";
if ($pic_on == 1)
{
if ($pic_beschraenkt == 1)
{
$lasts2_inhalt_tab .= fnc_bildgroesse ($widthMax, $heightMax, $darfKleiner, $picpath, $avatar, $uname, $pic_no_avatar);
}
else
{
if (!empty($bild))
{
$lasts2_inhalt_tab .= " <img src=\"".$picpath."/".$avatar."\" alt=\"".$uname."\" border=\"0\">\n";
}
else
{
$bild = "$pic_no_avatar";
// Ausgabe des Bildes
$lasts2_inhalt_tab .= " <img src=\"$bild\" alt=\"\" border=\"0\" >\n";
}
}
}
else
{
$lasts2_inhalt_tab .= " \n";
}
$lasts2_inhalt_tab .= " </div>\n";
$lasts2_inhalt_tab .= " </td>\n";
$lasts2_inhalt_tab .= " </tr>\n";
Das problem ist ,diese modul load foto aus $picpath/$bild
ich machen andere , ich mache von $picpath/$bild ==> modules/User_Fotoalbum/album/".$uname."1.jpg
aber funkction nicht
Habt jemand idee was ich must machen ?
Viel Dank Tomas
hi Alteaffe ;)
eihentlich ist dieses modul nicht für das User Fotoalbum gedacht, sondern für das aktuelle Avatar Modul, welche direkt für pragmamx geeignet ist.
allerdings könnte es mit dieser änderung doch funktionieren:
also zuerst änderst du in zeile 42 der index.php den pfad zu deinen bildern.
bsp:
aus: $picpath = "images/forum/member_avatar";
mache: $picpath = "modules/User_Fotoalbum/album";
dann machst du aus (zeilen 145 bis 188) if ($pic_on == 1)
{
// stelle Userbild/Avatar zur Verfügung
$avatarFile = mxIsAvatarUploaded ($uname);
// Wenn ein Avatar hochgeladen wurde
if (!empty($avatarFile))
{
//echo mxCreateImage (MX_PATH_MEMBERAVATAR."/".$avatarFile["werist"]);
$picpath = MX_PATH_MEMBERAVATAR;
// prüfe, ob die Datei auch wirklich vorhanden ist
if (@file_exists("$picpath/$avatarFile"))
{
$avatar = $avatarFile;
}
else
{
$avatar = "";
}
}
else
{
// für alte Version des Avatar Upload Moduls
if (@file_exists("$picpath/$uname.jpg"))
{
$avatar = "$uname.jpg";
}
elseif (@file_exists("$picpath/$uname.jpeg"))
{
$avatar = "$uname.jpeg";
}
elseif (@file_exists("$picpath/$uname.gif"))
{
$avatar = "$uname.gif";
}
elseif (@file_exists("$picpath/$uname.png"))
{
$avatar = "$uname.png";
}
else
{
$avatar = "";
}
}
}
dies if ($pic_on == 1)
{
// stelle Userbild/Avatar zur Verfügung
$avatarFile = mxIsAvatarUploaded ($uname);
// Wenn ein Avatar hochgeladen wurde
if (!empty($avatarFile))
{
//echo mxCreateImage (MX_PATH_MEMBERAVATAR."/".$avatarFile["werist"]);
$picpath = MX_PATH_MEMBERAVATAR;
// prüfe, ob die Datei auch wirklich vorhanden ist
if (@file_exists("$picpath/$avatarFile"))
{
$avatar = $avatarFile;
}
else
{
$avatar = "";
}
}
else
{
// für alte Version des Avatar Upload Moduls
if (@file_exists("$picpath/".$uname."1.jpg"))
{
$avatar = "".$uname."1.jpg";
}
elseif (@file_exists("$picpath/".$uname."1.jpeg"))
{
$avatar = "".$uname."1.jpeg";
}
elseif (@file_exists("$picpath/".$uname."1.gif"))
{
$avatar = "".$uname."1.gif";
}
elseif (@file_exists("$picpath/".$uname."1.png"))
{
$avatar = "".$uname."1.png";
}
else
{
$avatar = "";
}
}
} um die richtige datei anzusprechen (dabei ist ja die "1" am ende des dateinamens wohl die von dir gewünschte änderung)
:idea: diese änderungen in dieser datei solltest du dir allerdings merken und neu ausführen, wenn du ein irgendwann einmal ein update dieses modul fährst ;)
ich hoffe, dir ein wenig geholfen zu haben ;)
bye
MarcoA
Supeer
Viel Dank :thumbup: :) ;)
hi ;)
hat das geklappt???
MarcoA