Vor gut 5 Jahren hast du diesen Code für die Topicansicht geschrieben:
Das habe ich wie folgt angepasst:oxpus hat geschrieben:In viewtopic.php:durchCode: Alles auswählen
$album_img = '<a href="'.append_sid("album_personal.$phpEx?user_id=$poster_id&").'"><img border=0 src=templates/subSilver/images/icon_photo.gif alt="'.$lang['Personal_Gallery'].'"></a>';
ersetzen und der Link erscheint nun nur noch bei den Usern, die eine persönliche Gallerie haben. Im Quickinfo ist dabei auch noch die Anzahl der enthaltenen Bilder angegeben.Code: Alles auswählen
$sql = "SELECT COUNT(pic_id) AS count FROM ". ALBUM_TABLE ." WHERE pic_cat_id = 0 AND pic_user_id = " . $poster_id; $album_img = ''; if( ($result = $db->sql_query($sql)) ) { $row = $db->sql_fetchrow($result); $total_pics = $row['count']; if ( $total_pics <> 0 ) { $album_img = '<a href="'.append_sid("album_personal.$phpEx?user_id=$poster_id&").'"><img border=0 src=templates/subSilver/images/icon_photo.gif alt="'.$lang['Personal_Gallery'].' ('.$total_pics.')"></a>'; } }
Code: Alles auswählen
$sql = "SELECT COUNT(pic_id) AS count
FROM ". ALBUM_TABLE ."
WHERE pic_cat_id = 0
AND pic_user_id = " . $poster_id;
$album_img = '';
if( ($result = $db->sql_query($sql)) )
{
$row = $db->sql_fetchrow($result);
$total_pics = $row['count'];
if ( $total_pics <> 0 )
{
$album_img = '<a href="'.append_sid("album_personal.$phpEx?user_id=$poster_id").'"><img border="0" src="'. $images['icon_gallery'] .'" alt="'.$lang['Personal_Gallery'].' ('.$total_pics.')" title="'.$lang['Personal_Gallery'].' ('.$total_pics.')" /></a>';
}
}
Code: Alles auswählen
$images['icon_gallery'] = "$current_template_images/{LANG}/icon_gallery.gif" width="$topic_iw" height="$topic_ih" class="imgtopic";
Code: Alles auswählen
$album_img = '<a href="'.append_sid("album_personal.$phpEx?user_id=$poster_id").'"><img border="0" src="'. $images['icon_gallery'] .'" alt="'.$lang['Personal_Gallery'].' ('.$total_pics.')" title="'.$lang['Personal_Gallery'].' ('.$total_pics.')" /></a>';
Wo muss ich diesen Code in der profile.php einfügen?
Nachtrag:
Ich mache es wohl wieder komplizierter als notwendig.
Mit diesem Eintrag in die usercp_viewprofile.php geht es viel einfacher:
Code: Alles auswählen
$album_img = '<a href="'.append_sid("album_personal.$phpEx?user_id=$user_id").'"><img border="0" src="'. $images['icon_gallery'] .'" alt="'.$lang['Personal_Gallery'].'" title="'.$lang['Personal_Gallery'].'" /></a>';
$album = $album_img;