Ok try this, it worked for me...
The location of profile photos are different in 5.6. But the main difference is database structure.
What i did was, to query users primary photo from "profiles" table using his/her nick, than use that pic id to get the name of the image from "media" table...
The code also allows you to use a avatar for admin.
If there is no primary photo for the user, the avatar would be female.jpg or male.jpg [attached] depending on users sex...
Hope that helps.. A bit drunk rightnow...
Code:
$profileQuery = $db->sql_query("SELECT `ID`,`PrimPhoto`,`Picture`,`Sex` FROM `Profiles` WHERE `NickName` = '$poster'");
$profile_id = $db->sql_fetchfield('ID');
$mainpic = $db->sql_fetchfield('PrimPhoto');
$sexx = $db->sql_fetchfield('Sex');
$gotpic = $db->sql_fetchfield('Picture');
$picquery = $db->sql_query("SELECT `med_file` FROM `media` WHERE `med_id` = '$mainpic'");
$picAddon = $db->sql_fetchfield('med_file');
if ($gotpic == 1) {
$poster_avatar = '<a href="../profile.php?ID=' . $profile_id . '">' . '<img src="http://www.yourdomain.com/media/images/profile/'. $profile_id . '/thumb_'. $picAddon .'" alt="'. $poster . '" border="0" /></a>';
} elseif ($poster == "admin") {
$poster_avatar = '<img src="http://www.yourdomain.com/forum/admin.gif" alt="Admin" border="0" />';
} else {
$poster_avatar = '<a href="../profile.php?ID=' . $profile_id . '">' . '<img src="http://www.yourdomain.com/forum/'. $sexx . '.jpg" alt="'. $poster . '" border="0" /></a>';
}
Bookmarks