2018-09-18, 04:02 AM
Hey gang, so I'm trying to add last poster avatars to User CP latest thread thread,
What I have is this: lu.avatar
and this: LEFT JOIN ".TABLE_PREFIX."users lu ON (lu.uid = t.lastposteruid)
I add it like so
This works fine to show avatars using {$thread['avatar']} but it won't pull the avatars for users with default avatars, it just appears as <img src(unknown) for default avatars
any suggestion how I can fix this to show default avatars?
What I have is this: lu.avatar
and this: LEFT JOIN ".TABLE_PREFIX."users lu ON (lu.uid = t.lastposteruid)
I add it like so
SELECT t.*, t.username AS threadusername, u.username, lu.avatar
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
LEFT JOIN ".TABLE_PREFIX."users lu ON (lu.uid = t.lastposteruid)
WHERE t.uid='".$mybb->user['uid']."' AND t.firstpost != 0 AND t.visible >= 0 {$visible}{$f_perm_sql}
ORDER BY t.lastpost DESC
LIMIT 0, 5
");
This works fine to show avatars using {$thread['avatar']} but it won't pull the avatars for users with default avatars, it just appears as <img src(unknown) for default avatars
any suggestion how I can fix this to show default avatars?