Файл: forum/forum/inc/bookmarks2.php
Строк: 15
<?
if (empty($fid)||($fid==0)){
if (isset($page))$db->sql_query("delete from forum_b where id='".$page."' and user_id = '".$user['id']."' limit 1;");
echo "<a href="".F."">Форумы</a><br /><dl><dt></dt></dl>";
echo $fs1;
$q2 = @$db->sql_query("SELECT * from `forum_b` where user_id = '".$user['id']."' order by time desc;" );
$k = $db->sql_numrows( $q2 );
if ($k==0)echo "<br /><b>У вас нет закладок</b><br />";
$post_k=$start+1;
while($mess = @$db->sql_fetchrow(@$q2)){
$q1 = @$db->sql_query( @"select * from `forum_t` where `id`='".$mess['t_id']."' ;" );
$tem = @$db->sql_fetchrow(@$q1);
$forum=$db->sql_fetchrow($db->sql_query("SELECT * FROM `forum_f` WHERE `id` = '$tem[f_id]' LIMIT 1"));
$razdel=$db->sql_fetchrow($db->sql_query("SELECT * FROM `forum_r` WHERE `id` = '$tem[r_id]' LIMIT 1"));
if ($tem['close'] == 1) $gif = "zakr";
else if ($tem['zak'] == 1) $gif = "lock";
else $gif = "tem";
echo links;
echo "<img src="".H."img/".$gif.".gif" alt="*"/> <a href='tema_".$tem['id']."'>$tem[name]</a> <a href='tema_".$tem['id']."_end'>(".$db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `forum_msg` WHERE `t_id` = '$tem[id]'"),0).")</a> | <a href='bookmarks_0_".$mess['id']."'>[удал]</a>n";
echo div;
echo "<a href='razdel_".$tem['f_id']."'>$forum[name]</a> > <a href='temes_".$tem['r_id']."'>$razdel[name]</a><br />n";
echo '<small>';
echo 'Автор: '.user($tem['user_id'],1).'<br />';
$post = @$db->sql_fetchrow($db->sql_query("select * from `forum_msg` WHERE t_id = '".$tem['id']."' order by time desc limit 1;"));
echo 'Сообщение: '.user($post['user_id'],1).'';
echo '('.times($post['time']).')';
echo '</small>';
echo '<br/>';
}
echo $fs2;
}else{
$q1 = @$db->sql_query( @"select * from `forum_t` where `id`='".$fid."' ;" );
$tem = @$db->sql_fetchrow(@$q1);
if (mysql_affected_rows() == 0){
echo '<b>Такой темы не существует! Возможно она была удалена модератором.</b>';
echo '<br />';
echo gb.'<a href="./">Форум</a>'.div;
foot();
}
if ($db->sql_query("Insert into forum_b set t_id='".$fid."',time='".$time."',user_id = '".$user['id']."'")){
echo "<b>Закладка создана</b>n";
header("Location: bookmarks_0?".SID);
}else{
echo "Ошибкаn";
}
}
echo '<br /><dl><dt></dt></dl>';
?>