Вот так лучше...
define('_IN_JOHNCMS', 1);
$rootpath = '';
require_once('incfiles/core.php');
if ($user_id) {
$list = array();
$new_mail = mysql_result(mysql_query("SELECT COUNT(*) FROM `privat` WHERE `user` = '$login' AND `type` = 'in' AND `chit` = 'no'"), 0);
if ($new_mail) $list[] = '<a href="' . core::$system_set['homeurl'] . '/users/pradd.php?act=in&new">' . $new_mail . '</a>';
if ($datauser['comm_count'] > $datauser['comm_old']) $list[] = '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=guestbook&user=' . $user_id . '">' . ($datauser['comm_count'] - $datauser['comm_old']) . '</a>';
$new_album_comm = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `user_id` = '" . core::$user_id . "' AND `unread_comments` = 1"), 0);
if ($new_album_comm) $list[] = '<a href="' . core::$system_set['homeurl'] . '/users/album.php?act=top&mod=my_new_comm">++</a>';
if (!empty($list)) echo '<div id=stаtus>'.functions::display_menu($list, ', ').'</div>';
}