Вход Регистрация
Файл: vsime.com/comm/inc/act_comm_journal.php
Строк: 166
<?
    
if(mysqli_num_rows(mysqli_query($dbi"SELECT * FROM `comm` WHERE `id` = '".intval($_GET['id'])."'"))!=0)
    {
        
$comm=mysqli_query($dbi"SELECT * FROM `comm` WHERE `id` = '".intval($_GET['id'])."'");
        
$comm=mysqli_fetch_array($comm);

        
$cat=mysqli_query($dbi"SELECT * FROM `comm_cat` WHERE `id` = '$comm[id_cat]'");
        
$cat=mysqli_fetch_array($cat);
        if (
mysqli_num_rows(mysqli_query($dbi"SELECT * FROM `comm_users` WHERE `id_comm` = '$comm[id]' AND `activate` = '1' AND `invite` = '0'"))==0)$comm['id_user']=0;
        
$ank=profile($comm['id_user']); // sozdak
        
$links_hist['name'] = "Сообщества / ".($comm['name'])." / Журнал";
        
$title .= ' - '.htmlspecialchars($comm['name']).' / Журнал'// Заголовок страницы
        
ex_head();
        if (isset(
$_GET['sort']))
        {
            
$sort htmlspecialchars($_GET['sort']);
            if (
$sort == 'sys')$querysort " AND (`type` = 'in_blist' OR `type` = 'out_blist' OR `type` = 'access')";
            elseif (
$sort == 'in_comm')$querysort " AND `type` = 'in_comm'";
            elseif (
$sort == 'out_comm')$querysort " AND `type` = 'out_comm'";
            else
            {
                
$sort "all";
                
$querysort NULL;
            }
        }
        else
        {
            
$sort "all";
            
$querysort NULL;
        }
        if(isset(
$_POST['nick']) && isset($_POST['submited']))
        {
            if (
hsc(@$_POST['mdp'])==$mdp)
            {
                
$ank2=mysqli_query($dbi"SELECT * FROM `user` WHERE `nick` = '".my_esc($_POST['nick'])."'");
                
$ank2=mysqli_fetch_array($ank2);

                if(
$ank2['id']!=0)
                {
                    
header("Location:?act=comm_journal&id=$comm[id]&user=$ank2[id]&sort=$sort");
                    exit();
                }
                else 
$error[]="Пользователь не найден.";
            } else 
hacked_by_Killer();
        }
        
show_errors();
        if (isset(
$_GET['user']) && mysqli_num_rows(mysqli_query($dbi"SELECT * FROM `user` WHERE `id` = '".intval($_GET['user'])."'"))!=0)$ank_act=profile(intval($_GET['user']));

        echo 
"<form method='post' action='?act=comm_journal&id=$comm[id]&sort=$sort'>n";
        echo 
"<input type='text' name='nick' value=''>n";
        echo 
"<input type='hidden' name='mdp' value='$mdp'>n";
        echo 
"<input type='submit' name='submited' value='Найти'>n";
        if (isset(
$ank_act))echo "<br />nАктивность <a href='$config[profile_page]?id=$ank_act[id]'>$ank_act[nick]</a> <a href='?act=comm_journal&id=$comm[id]&sort=$sort'>$config[code_delete]</a>n";
        echo 
"</form>";

        echo 
"<div class='grand_h'>n";
            echo 
"<table>n";
                echo 
"<td style='width: 25%;'>".($sort!='all'?"<a href='?act=comm_journal&id=$comm[id]".(isset($ank_act)?"&user=$ank_act[id]":NULL)."&sort=all'>":NULL)."<span class='block_l'>Все</span>".($sort!='all'?"</a>":NULL)."</td><td style='width: 25%;'>".($sort!='sys'?"<a href='?act=comm_journal&id=$comm[id]".(isset($ank_act)?"&user=$ank_act[id]":NULL)."&sort=sys'>":NULL)."<span class='block_l'>Служебные</span>".($sort!='sys'?"</a>":NULL)."</td><td style='width: 25%;'>".($sort!='in_comm'?"<a href='?act=comm_journal&id=$comm[id]".(isset($ank_act)?"&user=$ank_act[id]":NULL)."&sort=in_comm'>":NULL)."<span class='block_l'>Вступили</span>".($sort!='in_comm'?"</a>":NULL)."</td><td style='width: 25%;'>".($sort!='out_comm'?"<a href='?act=comm_journal&id=$comm[id]".(isset($ank_act)?"&user=$ank_act[id]":NULL)."&sort=out_comm'>":NULL)."<span class='block_l'>Покинули</span>".($sort!='out_comm'?"</a>":NULL)."</td>n";
            echo 
"</table>n";
        echo 
"</div>n";
        
$count_results=mysqli_num_rows(mysqli_query($dbi"SELECT * FROM `comm_journal` WHERE `id_comm` = '$comm[id]'".(isset($ank_act)?" AND (`id_ank` = '$ank_act[id]' OR (`id_user` = '$ank_act[id]' AND `type` != 'access'))":NULL)."$querysort"));
        
$count_pages=count_pages($count_results);
        
$page=page();
        
$start=start_pages();

        if (
$count_results==0)
        {
            echo 
"<div class='list'>n";
                echo 
"Нет записей.n";
            echo 
"</div>n";
        }
        
$query=mysqli_query($dbi"SELECT * FROM `comm_journal` WHERE `id_comm` = '$comm[id]'".(isset($ank_act)?" AND (`id_ank` = '$ank_act[id]' OR (`id_user` = '$ank_act[id]' AND `type` != 'access'))":NULL)."$querysort ORDER BY `time` DESC LIMIT $start$config[rop]");

        while(
$post=mysqli_fetch_array($query))
        {
            
$ank2=profile($post['id_user']);
            
$ank3=profile($post['id_ank']);
            if (
$post['type']=='in_blist')$t="<a href='?act=comm_journal&id=$comm[id]&user=$ank3[id]'>$ank3[nick]</a> занес в Черный список <a href='/info.php?id=$ank2[id]'>$ank2[nick]</a>n";
            elseif (
$post['type']=='out_blist')$t="<a href='?act=comm_journal&id=$comm[id]&user=$ank3[id]'>$ank3[nick]</a> удалил из Черного списка <a href='/info.php?id=$ank2[id]'>$ank2[nick]</a>n";
            elseif (
$post['type']=='in_comm')$t="<a href='?act=comm_journal&id=$comm[id]&user=$ank2[id]'>$ank2[nick]</a> вступил в сообществоn";
            elseif (
$post['type']=='out_comm')$t="<a href='?act=comm_journal&id=$comm[id]&user=$ank2[id]'>$ank2[nick]</a> покинул сообществоn";
            elseif (
$post['type']=='access')
            {
            if (
$post['access']=='user')$access_name="обычным участником";
            elseif (
$post['access']=='mod')$access_name="модератором";
            elseif (
$post['access']=='adm')$access_name="администратором";
            elseif (
$post['access']=='creator')$access_name="создателем";
            
$t="<a href='?act=comm_journal&id=$comm[id]&user=$ank3[id]'>$ank3[nick]</a> назначил <a href='/id$ank2[id]'>$ank2[nick]</a> $access_namen";
            }
            echo 
"<div class='list'>n";
                echo 
"<div class='left'>n";
                    
show_avatar($ank2['id'], 'small');
                echo 
"</div>n";
                echo 
"<div class='overfl_hid'>n";
                echo 
$t."n<span class='right'>".vremja($post['time'])."</span>n";
                echo 
"</div>n";
                echo 
"<div class='clear'></div>n";
            echo 
"</div>n";
        }

        
pages_show("?act=comm_journal&id=$comm[id]&sort=$sort&".(isset($ank_act)?"user=$ank_act[id]&":NULL)); // Вывод страниц

        
echo "<div class='foot'>n";
            echo 
image_back()." <a href='?act=comm&id=$comm[id]'>В сообщество</a>n";
        echo 
"</div>n";
    }
    else{
header("Location:/index/comm");exit;}
?>
Онлайн: 1
Реклама