Code (+/-)
defined('_IN_JOHNCMS') or die('Error: restricted access');
$r=rand(1000,9999);
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `adm`='0'"), 0);
if ($user_id && !$ban['13']) {
echo '<div class="title">site - ShoutBox</div> <form action="/guestbook/index.php" method="post"> <div style="display:none"><textarea rows="3" cols="20" name="text" style="width:auto"></textarea></div>
<input type="submit" value="Add Shout Message"/></form><br/>';
if ($total) {
$req = mysql_query("SELECT `guest`.*, `guest`.`id` AS `gid`, `users`.`rights`, `users`.`lastdate`, `users`.`sex`, `users`.`datereg`, `users`.`id`
FROM `guest` LEFT JOIN `users` ON `guest`.`user_id` = `users`.`id`
WHERE `guest`.`adm`='0' ORDER BY `time` DESC LIMIT 5");
while ($res = mysql_fetch_array($req)) {
echo $i % 2 ? '<div class="list1">' : '<div class="list2">';
if (!$res['id']) {
// Запрос по гостям
$req_g = mysql_query("SELECT `lastdate` FROM `cms_sessions` WHERE `session_id` = '" . md5($res['ip'] . $res['browser']) . "' LIMIT 1");
$res_g = mysql_fetch_assoc($req_g);
$res['lastdate'] = $res_g['lastdate'];
}
if (file_exists('../files/users/photo/' . $res['id'] . '_small.jpg'))
{ echo '<img src="../files/users/photo/' . $res['id'] . '_small.jpg" width="60" height="60"/><br/>';
}
$arg = array(
'iphide' => 1,
'header' =>
'<br/>(<i>' . functions::display_date($res['time']) . '</i>)'
);
echo functions::display_user($res, $arg);
$text = htmlentities($res['text'], ENT_QUOTES, 'UTF-8');
$post = bbcode::tags($post);
$post = str_replace("\r\n","<br />", $post);
if ($res['user_id']) {
$post = functions::checkout(mb_substr($res['text'], 0, 250), 1, 1);
$post = functions::smileys($post, $res['rights'] >= 1 ? 1 :0);
}
echo $post;
if (mb_strlen($res['text']) > 250) {
echo '<br/><a href="../guestbook/index.php">Read more...</a>';
}
echo '</div>';
$i ;
}
} else {
echo '<div class="bg">Shoutbox Cleared...</div>';
}
}
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.