Просмотр файла blacklist.php

Размер файла: 4.79Kb
<?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 = USERS_ALL_PAGE;
if (isset($_GET['start'])) $start = abs(intval($_GET['start']));
else $start = 0;
$count_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `q_black_list` INNER JOIN `q_users` ON `q_users`.`id_user` = `q_black_list`.`user_uid` WHERE `q_black_list`.`user_id` = '".$_SESSION['auth_id']."';"), 0);
if ($count_p > 0) {
if ($start >= $count_p) $start = 0;
$q = mysql_query("SELECT * FROM `q_black_list` INNER JOIN `q_users` ON `q_users`.`id_user` = `q_black_list`.`user_uid` WHERE `q_black_list`.`user_id` = '".$_SESSION['auth_id']."' ORDER BY `q_black_list`.`user_id` DESC LIMIT ".$start.", ".$col);
?>
<table cellspacing="5" cellpadding="0" width="100%">
<tr>
<?php
$i = 1;
while ($array = mysql_fetch_array($q)) { ?>
<td width="50%">
<table align="left" cellspacing="5" cellpadding="0">
<tr>
<td width="60" valign="top">
<a href="user.php?id=<?php echo $array['id_user']; ?>">
<?php if (!empty($array['avatar'])) { ?>
<img class="<?php echo ($array['vip_status'] == 1 ? 'photo_bor_vip' : 'photo_bor'); ?>" src="<?php echo DIR_PHOTOS; ?>/<?php echo $array['id_user']; ?>/<?php echo $array['avatar']; ?>" alt="" />
<?php } else { ?>
<img class="<?php echo ($array['vip_status'] == 1 ? 'photo_bor_vip' : 'photo_bor'); ?>" src="/images/no_photo_small.png" alt="" />
<?php } ?>
</a>
</td>
<td valign="top">
<?php if ($array['vip_status'] == 1) { ?><img src="/images/vip.gif" alt="" width="16" height="16" title="VIP-пользователь" /> <?php } ?>
<a class="<?php echo ($array['pol'] == 1 ? 'm_color' : 'zh_color'); ?>" href="user.php?id=<?php echo $array['id_user']; ?>"><?php echo htmlspecialchars($array['name'], ENT_QUOTES); ?></a>
<?php if (function_online($array['online']) == TRUE) { ?> <img src="/images/on.gif" alt="Онлайн" title="Онлайн" /><?php } ?><br/>
<span class="vozrast">Возраст: <?php echo function_vozrast_n($array['god'].'-'.$array['mes'].'-'.$array['day']); ?></span><br/>
<span class="city"><?php echo htmlspecialchars($array['city'], ENT_QUOTES); ?>, <?php echo htmlspecialchars($array['country'], ENT_QUOTES); ?></span><br/>
<a href="javascript:void(0)" onclick="javascript:blacklist_del('<?php echo $array['id_user']; ?>')">Разблокировать</a>
</td>
</tr>
</table>
<?php
if ($i == 2) {
echo '</td><tr>';
$i = 0;
} else echo '</td>';
$i++;
}
?>
</tr>
</table>
<?php
function_page($_SERVER['PHP_SELF'].'?', $col, $start, $count_p);
} else { ?>
<div style="text-align: center;">Ваш черный список пуст.</div>
<?php } ?>
<script type="text/javascript">
function blacklist_del(uid) {
$(document).ready(function() {
     $.arcticmodal({
     type: 'ajax',
     url: '/moduls/blacklist_del.php',
     ajax: {
          type: 'POST',
          data: { user_id: <?php echo $_SESSION['auth_id']; ?>, uid: uid },
          dataType: 'html',
          success: function(data, el, responce) {
               var h = $(responce);
               $('B', h).html(responce.title);
               $('P:last', h).html(responce.text);
               data.body.html(h);
          }
     }
});
});
}

function blacklist_del_update(uid) {
$(document).ready(function() {
$.ajax({
     type: "POST",
     url: "/moduls/blacklist_del.php?page=update",
     data: { user_id: <?php echo $_SESSION['auth_id']; ?>, uid: uid },
     beforeSend: function()
     {
          $("#blacklist_del_status").html('<img src="/images/ajax.gif" alt="" />');
     },
     success: function(data)
     {
          $("#blacklist_del_status").html(data);
          setTimeout('location="<?php echo $_SERVER["REQUEST_URI"]; ?>"', 1000);
     }
});
});
}
</script>
</div>
<div id="block_right">
<?php include (dirname(__FILE__).'/include/chat.php'); ?>
</div>
<div class="clear"></div>
<?php include (dirname(__FILE__).'/include/footer.php'); ?>