Файл: modules/tophashtag/index.php
Строк: 68
<?php
require_once '../../incfiles/core.php';
require_once '../../incfiles/func.php';
require_once '../../incfiles/auth.php';
require_once '../../incfiles/user.php';
$tags = check($_GET['hashtag']);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `hashtags` WHERE `text` = '$tags'"),0)==0)
{
mysqli_query($dbi, "INSERT INTO `hashtags` SET `user_id` = '$user_id', `text` = '$tags', `time` = '".time()."'");
}else{
$view=mysql_fetch_array(mysql_query("SELECT * FROM `hashtags` WHERE `text` = '$tags' LIMIT 1"));
mysqli_query($dbi, "UPDATE `hashtags` SET `view` = '".($view['view']+1)."', `time` = '".time()."' where `text` = '$tags'");
}
$title = $tags;
if(isset($_GET['hashtag']) && $_GET['hashtag'] != '') {
$act = htmlentities(trim($_GET['act']));
switch($act)
{
default:
$all = mysql_query("SELECT * FROM `wall` WHERE hashtag LIKE '$tags'");
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `wall` WHERE `hashtag` LIKE '%$tags%'"),0)!=0)
{
require_once '../../incfiles/head.php';
echo '<div class="title"><span style="border-radius:6px; background:#009933; padding:5px; color:#f2f4f5;">'.lang('Стена','Стіна').'</span>
<a '. ($act == false?'class="title_a_hover"':'') .' href="'.URL.'/modules/hashtag?hashtag='.$tags.'&act=group" onclick="Page.Go(this.href); return false">'.lang('Группы','Групи').'</a></div>';
$cp = ceil($all/30);
$p = (isset($_GET['p']) and is_numeric($_GET['p']) and $_GET['p']>1 and $_GET['p']<=$cp) ? $_GET['p'] : 1;
$start = $p*10-10;
$arr_comm = mysql_query("SELECT * FROM `wall` WHERE hashtag LIKE '%$tags%' ORDER BY `id` DESC LIMIT $start,10");
require_once '../../incfiles/head.php';
while ($arr = mysql_fetch_array($arr_comm))
{
echo '<div class="block">';
echo wall_post($arr);
echo '</div>';
}
navi($p,$cp,''.URL.'/modules/hashtag/?hashtag='.$tags.'&');
}else{
go(URL.'/modules/hashtag?hashtag='.$tags.'&act=group');
}
break;
case 'group':
$all = mysql_query("SELECT * FROM `groups_wall` WHERE hashtag LIKE '$tags'");
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `groups_wall` WHERE `hashtag` LIKE '%$tags%'"),0)!=0)
{
require_once '../../incfiles/head.php';
echo '<div class="title"><a '. ($act == true?'class="title_a_hover"':'') .' href="'.URL.'/modules/hashtag?hashtag='.$tags.'&" onclick="Page.Go(this.href); return false">'.lang('Стена','Стіна').'</a>
<span style="border-radius:6px; background:#009933; padding:5px; color:#f2f4f5;">'.lang('Группы','Групи').'</span></div>';
$title = ''.lang('Ищем','Шукаємо').' <font color="red">'.$tags.'</font> ';
$cp = ceil($all/30);
$p = (isset($_GET['p']) and is_numeric($_GET['p']) and $_GET['p']>1 and $_GET['p']<=$cp) ? $_GET['p'] : 1;
$start = $p*10-10;
$arr_comm = mysql_query("SELECT * FROM `groups_wall` WHERE hashtag LIKE '%$tags%' ORDER BY `id` DESC LIMIT $start,10");
while ($arr = mysql_fetch_array($arr_comm))
{
/* echo '<div class="block">';
if (!empty($user_id)) if ($user_id == $arr_post['wall_id'] || $user_id == $arr_post['user_id'] || $user_id == $arr['user_id']) echo '<div class="right"><a href="'.URL.'/groups/wall/post.php?id='.$id.'&p='.$p.'&del_comm='.$arr['id'].'" onclick="Form.delPost(this.href); return false"><img src="'.URL.'/design/img/closed.png"/></a></div>';
echo user_name($arr['user_id']).'<br/>'.vtime($arr['time']).'<div class="clear"></div>';
echo '<p>'.text_view($arr['text']).'</p>';
if ($window == false)
{
echo '<div class="post_panel">';
echo group_repost('wall',$arr['id'],$arr['urepost'],$arr['crepost'],$arr['user_id']);
echo group_like('wall',$arr['id'],$arr['ulike'],$arr['clike'],$arr['user_id']);
echo '</div>';*/
group_wall_post($arr);
// }
// echo '</div>';
}
navi($p,$cp,''.URL.'/modules/hashtag/?hashtag='.$tags.'&');
}else{
go(URL.'/modules/hashtag?hashtag='.$tags.'&act=no');
}
break;
case 'no':
require_once '../../incfiles/head.php';
echo '<div class="title"><a '. ($act == true?'class="title_a_hover"':'') .' href="'.URL.'/modules/hashtag?hashtag='.$tags.'&" onclick="Page.Go(this.href); return false">'.lang('Стена','Стіна').'</a>
<span style="border-radius:6px; background:#009933; padding:5px; color:#f2f4f5;">'.lang('Группы','Групи').'</span></div>';
$title = '</br>'.lang('По вашему запросу ничего не найдено','Нічого не знайдено :(').' ';
echo $title;
break;
}
}else go();
require_once '../../incfiles/foot.php';
?>