File size: 2.68Kb
<?php
/**********************************************/
/* Автор скрипта: Александр Есин */
/* E-Mail: [email protected] ([email protected]) */
/* ICQ: 6464729 */
/* Site: http://ticlove.ru */
/**********************************************/
?>
<?php define ('SECURED', true); ?>
<?php require (dirname(__FILE__).'/_inc/sql.php'); ?>
<?php require (dirname(__FILE__).'/_inc/config.php'); ?>
<?php require (dirname(__FILE__).'/_inc/function.php'); ?>
<?php $title_page = 'Мои комментарии'; ?>
<?php $description_page = 'Мои комментарии'; ?>
<?php $keywords_page = 'Мои комментарии'; ?>
<?php
if (!isset($_SESSION['auth_id']))
{
header('Location: /');
exit;
}
?>
<?php include (dirname(__FILE__).'/include/header.php'); ?>
<div id="block_left">
<?php include (dirname(__FILE__).'/include/lider.php'); ?>
</div>
<div id="block_center">
<h3>Мои комментарии</h3>
<?php
$col = 6;
if (isset($_GET['start'])) $start = abs(intval($_GET['start']));
else $start = 0;
$count_p = mysql_result(mysql_query("SELECT COUNT(DISTINCT(`id_foto`)) FROM `q_photo_comm` WHERE `uid_user` = '".$_SESSION['auth_id']."' AND `new` = '0';"), 0);
if ($count_p > 0) {
if ($start >= $count_p) $start = 0;
$q = mysql_query("SELECT `q_photo_comm`.*, `q_photo`.*, COUNT(`q_photo_comm`.`new`) AS `all_new` FROM `q_photo_comm`, `q_photo` WHERE `q_photo_comm`.`id_foto` = `q_photo`.`id_photo` AND `uid_user` = '".$_SESSION['auth_id']."' AND `new` = '0' GROUP BY `q_photo_comm`.`id_foto` ORDER BY `all_new` DESC LIMIT ".$start.", ".$col);
echo '<table cellspacing="5" cellpadding="0" width="100%">';
echo '<tr>';
$i = 1;
while ($array = mysql_fetch_array($q)) {
echo '<td align="left" width="33%">';
$name_foto = explode('.', $array['name']);
$name_foto_p = str_replace($name_foto[0], $name_foto[0].'_p', $array['name']);
echo '<a href="/album.php?mode=comments&photo_id='.$array['id_foto'].'"><img class="photo_bor" src="'.DIR_PHOTOS.'/'.$array['id_user'].'/'.$name_foto_p.'" alt="" /></a><br/>';
echo '<a href="/album.php?mode=comments&photo_id='.$array['id_foto'].'">Новых комментариев:</a> '.$array['all_new'];
if ($i == 3) {
echo '</td><tr>';
$i = 0;
} else echo '</td>';
$i++;
}
echo '</tr>';
echo '</table>';
function_page($_SERVER['PHP_SELF'].'?', $col, $start, $count_p);
} else echo 'К Вашим фотографиям нет новых комментариев';
?>
</div>
<div id="block_right">
<?php include (dirname(__FILE__).'/include/chat.php'); ?>
</div>
<div class="clear"></div>
<?php include (dirname(__FILE__).'/include/footer.php'); ?>