File size: 5.94Kb
<?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 include (dirname(__FILE__).'/include/header.php'); ?>
<div id="block_left">
<?php include (dirname(__FILE__).'/include/lider.php'); ?>
</div>
<div id="content_page">
<div class="tit_zag">Популярные анкеты</div>
<div class="clear"></div>
<div class="tit_zag_hr"></div>
<?php
if (isset($_GET['popul_sort'])) $_SESSION['popul_sort'] = intval($_GET['popul_sort']);
else $_SESSION['popul_sort'] = 2;
if ($_SESSION['popul_sort'] < 1 or $_SESSION['popul_sort'] > 2) $_SESSION['popul_sort'] = 2;
if ($_SESSION['popul_sort'] == 2)
{
$_SESSION['popul_sort'] = 2;
$sort = '<li class="act">Девушки</li><li><a href="http://'.$_SERVER['HTTP_HOST'].'/popular/boys/">Парни</a></li>';
}
else
{
$_SESSION['popul_sort'] = 1;
$sort = '<li><a href="http://'.$_SERVER['HTTP_HOST'].'/popular/girls/">Девушки</a></li><li class="act">Парни</li>';
}
?>
<div style="padding: 15px 0;">
<ul class="top100">
<?php echo $sort; ?>
</ul>
</div>
<?php
$col = USERS_ALL_PAGE;
if (isset($_GET['start'])) $start = abs(intval($_GET['start']));
else $start = 0;
$count_p = mysql_num_rows(mysql_query("SELECT `q_guest`.`uid_user`, `q_users`.*, COUNT(`q_guest`.`id_user`) AS `c` FROM `q_guest`, `q_users` WHERE `q_guest`.`uid_user` = `q_users`.`id_user` AND `q_users`.`pol` = '".$_SESSION['popul_sort']."' GROUP BY `q_guest`.`uid_user` ORDER BY `c` DESC LIMIT 100;"));
if ($count_p > 0) {
if ($start >= $count_p) $start = 0;
$q = mysql_query("SELECT `q_guest`.`uid_user`, `q_users`.*, COUNT(`q_guest`.`id_user`) AS `c` FROM `q_guest`, `q_users` WHERE `q_guest`.`uid_user` = `q_users`.`id_user` AND `q_users`.`pol` = '".$_SESSION['popul_sort']."' GROUP BY `q_guest`.`uid_user` ORDER BY `c` DESC LIMIT ".$start.", ".$col);
?>
<?php $i = 1; ?>
<?php $n = 1; ?>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<?php while ($array = mysql_fetch_array($q)) { ?>
<td width="50%" valign="top" style="padding-top: 10px; padding-left: 15px; padding-right: 15px; <?php echo ($i == 1 ? 'border-right: 1px solid #ccc;' : ''); ?>">
<!-- info user -->
<table width="100%" cellspacing="0" cellpadding="0" style="<?php echo ($array['vip_status'] == 1 ? 'background: url(../images/user-vip-bg.gif); border: 1px solid #ff8800;' : 'background: url(../images/user-bg.jpg); border: 1px solid #ccc;'); ?> padding: 6px 10px; border-radius: 10px;">
<tr>
<td><?php echo $n + $start; ?>)</td>
<td width="125" valign="top" align="left">
<a href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/id<?php echo $array['id_user']; ?>">
<div style="<?php echo (!empty($array['avatar']) ? "background: url('http://".$_SERVER['HTTP_HOST']."/".DIR_PHOTOS."/".$array['id_user']."/".str_replace('_s', '_p', $array['avatar'])."') no-repeat; width: 110px; height: 146px; ".($array['vip_status'] == 1 ? 'border: 3px solid #ff8800;' : 'border: 3px solid #ccc;') : "background: url('http://".$_SERVER['HTTP_HOST']."/images/no_photo_norm.png'); width: 110px; height: 146px; ".($array['vip_status'] == 1 ? 'border: 3px solid #ff8800;' : 'border: 3px solid #ccc;')); ?>">
<div style="margin-top: -25px; margin-left: -15px; position: absolute;">
<?php if ($array['vip_status'] == 1) { ?><img class="title_help" src="/images/vip.png" alt="" width="52" height="52" title="VIP-пользователь" /> <?php } ?>
<?php if (function_online($array['online']) == TRUE) { ?>
<div style="left: 20px; top: 155px; position: absolute;">
<img class="title_help" src="/images/on.gif" alt="Сейчас на сайте" title="Сейчас на сайте" />
</div>
<?php } ?>
</div>
</div>
</a>
</td>
<td valign="top" align="left">
<a class="<?php echo ($array['pol'] == 1 ? 'm_color' : 'zh_color'); ?>" href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/id<?php echo $array['id_user']; ?>"><?php echo htmlspecialchars($array['name'], ENT_QUOTES); ?></a><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/>
<br/>
Просмотров: <span class="prosmotr_color"><?php echo $array['c']; ?></span><br/>
<?php if (!empty($array['photo'])) { ?>
<div style="padding-top: 50px;">
<span class="photos"><span class="photos_ico"></span> <?php echo $array['photo']; ?></span>
</div>
<?php } ?>
</td>
<td valign="top" align="right">
<?php if (!empty($array['top_up'])) { ?>
<img class="title_help" src="/images/up_small.png" alt="" width="16" height="16" title="Поднимал<?php echo ($array['pol'] == 1 ? '' : 'а'); ?> анкету «наверх» <?php echo function_vizit($array['top_up']); ?>" />
<?php } ?>
</td>
</tr>
</table>
<!-- /info user -->
<div class="hr"></div>
<?php if ($i == 1) { ?>
</td>
<?php } else { ?>
</td></tr><tr>
<?php $i = 0; ?>
<?php } ?>
<?php $i++; ?>
<?php $n++; ?>
<?php } ?>
</tr>
</table>
<div class="clear"></div>
<?php page('/popular/page', $col, $start, $count_p, $end_url = ''); ?>
<?php } else { ?>
<div style="text-align: center;">Популярных анкет пока нет.</div>
<?php } ?>
</div>
<div class="clear"></div>
<?php include (dirname(__FILE__).'/include/footer.php'); ?>