if you want to get link for using in Profile, creat a collumn in users table and save link to view
Sir you see. The code & SQL Calling to 4,Top Views Photo in Random 4 Limit,
$req = mysql_query("
SELECT `cms_album_files`.*, `users`.`name` AS `user_name`, `cms_album_cat`.`name` AS `album_name` $select
FROM `cms_album_files`
LEFT JOIN `users` ON `cms_album_files`.`user_id` = `users`.`id`
LEFT JOIN `cms_album_cat` ON `cms_album_files`.`album_id` = `cms_album_cat`.`id`
$join
WHERE $where
ORDER BY RAND() LIMIT 4");
and The Link Call to Direct in from users Comments & Voting menu,
echo '<a href="/users/album.php?act=show&al=' . $res['album_id'] . '&img=' . $res['id'] . '&user=' . $res['user_id'] . '&view"><img src="../files/users/album/' . $res['user_id'] . '/' . $res['tmb_name'] . '" width="60" height="60"/></a>';
i need same Caling URL link in User Profile 