Problem on johncms shoutbox/guestbook

1.06K
.
I put the code like this in a file i names sb but it show blank
<?php // form 

echo ' <div class="phdr"><div class="icon-chat"></div><a href="/guestbook/index.php">Shout box</a>';
if ($rights >= 3) {
echo '  <a href="/guestbook/index.php?act=clean">[Del]</a>';
}
echo '</div>';

if($user_id){
echo '<div class="gmenu">';
$refer = base64_encode($_SERVER['REQUEST_URI']);
$token = mt_rand(1000, 100000);
$_SESSION['token'] = $token;
echo '<div class="newsx"><form name="shoutbox" id="shoutbox" action="/guestbook/index.php?act=say" method="post">'.bbcode::auto_bb('shoutbox', 'msg').'
<textarea placeholder=" " id="msg" name="msg">
</textarea><input type="hidden" name="ref" value="'.$refer.'"/>
<input type="hidden" name="token" value="'.$token.'"><br />
<input type="submit" name="submit" value="Comment"></form></div></div>';
}

//display msg 


if (isset($_POST['msg'])) {
   $msg = isset($_POST['msg']) ? mb_substr(trim($_POST['msg']), 0, 5000) : '';
   $flood = functions::antiflood();
   if ($ban['1'] || $ban['13'])
       $error[] = $lng['access_forbidden'];
   if ($flood)
       $error = $lng['error_flood'] . ' ' . $flood . '&#160;' . $lng['seconds'];
   if (!$error) {
       $req = mysql_query("SELECT * FROM `guest` WHERE `user_id` = '$user_id' ORDER BY `time` DESC");
       $res = mysql_fetch_array($req);
       if ($res['text'] == $msg) {
           exit;
       }
   }
   if (!$error) {
   
   
    // Вставляем сообщение в базу

mysql_query("INSERT INTO `guest` SET
`adm` = '$admset',
`time` = '" . time() . "',
`user_id` = '$user_id',
`name` = '$from',
`text` = '" . mysql_real_escape_string($msg) . "',
`ip` = '" . core::$ip . "',
`browser` = '" . mysql_real_escape_string($agn) . "'
");
       if ($user_id) {
          $postguest = $datauser['postguest'] + 1;
          mysql_query("UPDATE `users` SET `postguest` = '$postguest', `lastpost` = '" . time() . "' WHERE `id` = '$user_id'");
       }
	   
   }
}
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `adm`='0'"), 0);
  if ($total) {
        $req = mysql_query("SELECT `guest`.*, `guest`.`id` AS `gid`, `users`.`lastdate`, `users`.`id`, `users`.`rights`, `users`.`name`
                    FROM `guest` LEFT JOIN `users` ON `guest`.`user_id` = `users`.`id`
                    WHERE `guest`.`adm`='0' ORDER BY `time` DESC LIMIT ".(!$is_mobile ? 6 : 6).""); 
echo '<div class="forumtxt">';
        while ($gres = mysql_fetch_assoc($req)) {
        $post = $gres['text'];
		$post = str_replace(':v', ':pacman:', $post);
        $post = functions::checkout($gres['text'], 1, 1);
        if ($set_user['smileys'])
          $post = functions::smileys($post, $gres['rights'] ? 1 : 0);
          $outputhtml .= (time() > $gres['lastdate'] + 600 ? ' 

<div class="list1"><img src="/images/offline.png" /> ' : ' 

<div class="list1"><img src="/images/online.png" /> ').'<a href="/users/'.$gres['name'].'_'.$gres['id'].'.html"><b>'. nick($gres['id']).'</b></a>: '.$post.'</div>';
          ++$i;
        }
      echo $outputhtml;

echo '</div>';
  }
?>
Всего: 11