[Help] This Guestbook code

741
.
Azhar-Ali
Wapmasters i am pasting the code in my mainpage.php
Code (+/-)

i dont understand to it. The code why not show to user album phot.
if (file_exists('../files/users/photo/' . $res['id'] . '_small.jpg'))
  {                  echo '<img src="../files/users/photo/' . $res['id'] . '_small.jpg" width="60" height="60"/>';
}

Please help me.
.
Менделеев
Try this
if (file_exists('../files/users/photo/' . $user['id'] . '_small.jpg'))
  {                  echo '<img src="../files/users/photo/' . $user['id'] . '_small.jpg" width="60" height="60"/>';
}
.
Not working with ' . $user['id'] . '
sir i am already try with user[id] or res[id] but its not working. I hope in mysql not added call of user[id] or res[id] ?
.
(\/)____o_O____(\/)
$res['user_id'] maybe
.
' . $res['user_id'] . ' not working.
.
Jane
Блиносвёрт ?
$req = mysql_query("SELECT `guest`.*, `guest`.`id` AS `gid`, `users`.`rights`, `users`.`lastdate`, `users`.`sex`, `users`.`datereg`, `users`.`id` as `uid`

FROM `guest` LEFT JOIN `users` ON `guest`.`user_id` = `users`.`id`

WHERE `guest`.`adm`='0' ORDER BY `time` DESC LIMIT 5"

then try $res['uid']
.
(\/)____o_O____(\/)
Jane, `guest`.`id` AS `gid` => not id , not exists image
if they match , it will not be his picture
.
Jane
Блиносвёрт ?
Koenig, we are searching for user id to show his photo
.
fanatos
Менделеев
if (file_exists($_SERVER['DOCUMENT_ROOT'].'/files/users/photo/' . $user_id . '_small.jpg') && $user_id)
echo '<a href="' . $home . '/files/users/photo/' . $user_id . '.jpg"><img src="' . $home . '/files/users/photo/' . $user_id . '_small.jpg" width="60" height="60"/></a>';
.
Менделеев
but for functions::display_user avatar will also appear
Всего: 13