Файл: modules/top/index.php
Строк: 53
<?php
require_once '../../incfiles/core.php';
require_once '../../incfiles/func.php';
require_once '../../incfiles/auth.php';
require_once '../../incfiles/user.php';
echo '<div class="title">'.lang('Хочу сюда — пусть меня увидят все!','Хочу сюди — нехай мене побачуть всі!').'?</div>';
echo '<a href="/modules/top/add.php" onclick="Window.Open(this.href); return false;"><img class="round_pict" src="'.URL.'/design/img/plus.png"></a>';
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `left_top` "),0)!=0)
{
$arr_comm = mysql_query("SELECT * FROM `left_top` ORDER BY `time` DESC LIMIT 12");
while ($arr = mysql_fetch_array($arr_comm))
{
$result = mysqli_query($dbi,"SELECT * FROM users where id = '$arr[user_id]' limit 1");
$r_user = $result->fetch_assoc();
if(!empty($r_user['avatar']))
echo'<a href="'.URL.'/?id='.$r_user['id'].'" onclick="Page.Go(this.href); return false"><img src="/files/avatars/'.$r_user['id'].'/'.$r_user['avatar'].'" alt="" class="round_pict"></a>';
}
}
echo '<div class="title">'.lang('Новые пользователи','Нові користувачі').'</div>';
//Вивід нового користувача)))
$res = mysqli_query($dbi,"SELECT * FROM `users` WHERE `ban` = 0 ORDER by `regtime` DESC LIMIT 3");
while ($array = mysqli_fetch_array($res)) echo '<div class="block" style="background:#FFFFFF;">'.user_name($array['id'],1,1).'</div>';
if (!empty($user_id)){
$res = mysql_query("SELECT * FROM `friends` WHERE `user_id` = '".$user_id."' ORDER by RAND() DESC LIMIT 1");
while ($array = mysql_fetch_array($res))$id_fr = $array['friend_id'];
$result = mysql_query("SELECT * FROM `users` WHERE `id` = '".$id_fr."' LIMIT 1");
if (mysql_num_rows($result) == true) $arr_user = mysql_fetch_array($result);
if($arr_user['count_friends'] > 2){
if (mysql_result(mysql_query(" SELECT COUNT(`id`) FROM `friends` WHERE `friend_id` = '".$id_fr."'"),0) > 1)
//Вивід нового користувача)))
$fr = mysqli_query($dbi,"SELECT * FROM `friends` WHERE `friend_id` = $id_fr ORDER by `time` DESC LIMIT 1");
while ($array = mysqli_fetch_array($fr))
{
if (!empty($user_id) && $user_id != $array['user_id'] && mysql_result(mysql_query("SELECT COUNT(`id`) FROM `friends` WHERE `user_id` = '".$array['user_id']."' AND `friend_id` = '".$user_id."' LIMIT 1"),0) == false &&
mysql_result(mysql_query("SELECT COUNT(`id`) FROM `notifications` WHERE `from_id` = '".$user_id."' AND `for_id` = '".$array['user_id']."' AND `mod` = 'friends' AND `type` = 'new_friend' LIMIT 1"),0) == false)
{
echo '<div class="title">'.$user['name'].','.lang('возможно вы знакомы','можливо ви знайомі').'?</div>';
echo '<div class="block">';
echo user_name($array['user_id']);
if ($user_id == $array['friend_id']) echo '<br/><br/>'; else echo '<ul><a href="'.URL.'/friends/new.php?new='.$array['user_id'].'" onclick="Page.Go(this.href); return false">'.lang('Добавить в друзья','Додати в друзі').'</a></ul>';
echo '</div>';
}
}
}
}
require_once '../../incfiles/foot.php';
?>