<?



include_once '../../sys/inc/start.php';



include_once '../../sys/inc/compress.php';



include_once '../../sys/inc/sess.php';



include_once '../../sys/inc/home.php';



include_once '../../sys/inc/settings.php';



include_once '../../sys/inc/db_connect.php';



include_once '../../sys/inc/ipua.php';



include_once '../../sys/inc/fnc.php';



include_once '../../sys/inc/user.php';











if (isset($user))$ank['id'] = $user['id'];



if (isset($_GET['id']))$ank['id'] = intval($_GET['id']);



$ank = get_user($ank['id']);







mysql_query("DELETE FROM `mark_comm` WHERE `id` = '" . intval($_GET['delete']) . "' AND `id_user` = '$user[id]' LIMIT 1");
if ($ank['id'] == 0)



{



	header("Location: /index.php?" . SID);exit;



	exit;



}







if (isset($user) && isset($_GET['delete']) && $user['id'] == $ank['id'])



{



	



	$_SESSION['message'] = 'Закладка удалена';



	header("Location: ?page=" . intval($_GET['page']) . "" . SID);exit;



	exit;



}







if( !$ank ){ header("Location: /index.php?".SID); exit; }



$set['title'] = 'Закладки - Сообщества - ' . $ank['nick']; // заголовок страницы




include_once '../../sys/inc/thead.php';



title();











err();



aut(); // форма авторизации







echo '<div class="foot">';



echo '<img src="/style/icons/str2.gif" alt="*" /> <a href="/user/bookmark/index.php?id=' . $ank['id'] . '">Закладки</a> | <b>Сообщества</b>';
echo '</div>';



















$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `mark_comm` WHERE `id_user` = '$ank[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);



$page=page($k_page);



$start=$set['p_str']*$page-$set['p_str'];



echo '<table class="post">';







if ($k_post == 0)



{



	echo '<div class="mess">';



echo 'Нет сообществ в закладках';
	echo '</div>';



}







$q=mysql_query("SELECT * FROM `mark_comm` WHERE `id_user` = '$ank[id]' ORDER BY id DESC LIMIT $start, $set[p_str]");




while ($post = mysql_fetch_assoc($q))



{







/*-----------зебра-----------*/ 



if ($num==0){



	echo '<div class="nav1">';



	$num=1;



}



elseif ($num==1){



	echo '<div class="nav2">';



	$num=0;



}



/*---------------------------*/















$comm=mysql_query("SELECT * FROM `comm` WHERE `id` = '$post[id_comm]'");
$comm=mysql_fetch_array($comm);
echo "<img src='/comm/img/comm_".($comm['read_rule']==1?"open":"closed").".png' /> \n";
echo '<a href="/comm/?act=comm&id=' . $comm['id'] . '">' . htmlspecialchars($comm['name']) . '</a>';




echo " (".mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_users` WHERE `id_comm` = '$comm[id]' AND `invite` = '0' AND `activate` = '1'"),0).")<br/>";




if ($ank['id'] == $user['id'])







echo '<div style="text-align:right;"><a href="?delete=' . $post['id'] . '&amp;page=' . $page . '"><img src="/style/icons/delete.gif" alt="*" /></a></div>';







echo '</div>';



}



echo '</table>';











if ($k_page>1)str('?',$k_page,$page); // Вывод страниц







echo '<div class="foot">';



echo '<img src="/style/icons/str2.gif" alt="*" /> <a href="/user/bookmark/index.php?id=' . $ank['id'] . '">Закладки</a> | <b>Сообщества</b>';
echo '</div>';



include_once '../../sys/inc/tfoot.php';



?>



