usercp_viewprofile.php
$sql = DB()->fetch_rowset("SELECT v.*, v.profile_id as user_id, u.username, u.user_opt, u.user_rank, u.user_avatar, u.user_avatar_type
FROM bb_user_view v
LEFT JOIN ". BB_USERS ." u ON(u.user_id = v.profile_id)
WHERE v.user_id = {$profiledata['user_id']}
ORDER BY v.time...