Вход Регистрация
Файл: groups/index.php
Строк: 196
<?php

require_once '../incfiles/core.php';
require_once 
'../incfiles/func.php';
require_once 
'../incfiles/auth.php';
require_once 
'../incfiles/user.php';

if (!empty(
$_GET['id']) && is_numeric($_GET['id']))
{
    
$id abs(intval($_GET['id']));
    
$result mysql_query("SELECT * FROM `groups` WHERE `id` = '".$id."' LIMIT 1");
    if (
mysql_num_rows($result) == true$arr_group mysql_fetch_array($result);
        else 
go(URL);

    
$title checkout($arr_group['name']);
    require_once 
'../incfiles/head.php';
    
    echo 
'<div class="title">'.$arr_group['name'].'</a></div>';
    
    if (
in_array($user_idexplode("||"substr($arr_group['blacklist'], 1, -1)))) {echo err(lang('Вы занесены в черный список сообщества','Ви занесені у чорний список спільноти')); require_once '../incfiles/foot.php';exit;}
    else if (
in_array($user_idexplode("||"substr($arr_group['banlist'], 1, -1))))
    {
        
$arr_group_ban mysql_fetch_array(mysql_query("SELECT * FROM `groups_ban` WHERE `group_id` = '".$id."' AND  `ban_id` = '".$user_id."' LIMIT 1"));
        echo 
err(lang('Вы заблокированы администрацией сообщества<br/>Причина: <b>'.$arr_group_ban['text'].'</b><br/>Розблок через: '.($arr_group_ban['do']-time()),'Ви заблоковані адміністрацією спільноти до <b>'.date('d'$arr_group_ban['do']).' '.hb(date('m'$arr_group_ban['do'])).' '.date('H:i'$arr_group_ban['do']).'</b>'.(!empty($arr_group_ban['text'])?'<br/>Причина: <b>'.$arr_group_ban['text'].'</b>':'')));
    }

    require_once 
'handler/group_user.php';

    echo 
'<div class="block_left">'.(!empty($arr_group['avatar'])?'<a href="'.URL.'/groups/avatars/preview.php?fname='.$arr_group['avatar'].'" onclick="Page.Go(this.href); return false"><img width="150" src="'.URL.'/files/groups/avatars/'.$id.'/mini/'.$arr_group['avatar'].'"/></a>':'<img class="avatar" width="150" src="'.URL.'/design/img/noavatar.png"/>').'</div>
    <div class="block_right">
    '
.(!empty($arr_group['status'])?'<div class="status" style="border-bottom:1px solid #E4E5E6;">'.smiles($arr_group['status']).'</div>':'').'
    <div class="block" style="border-bottom:0;">'
;
    if (!empty(
$arr_group['city']))
    {
        
$array mysql_fetch_array(mysql_query("SELECT * FROM `region` WHERE `id` = '".$arr_group['region']."' LIMIT 1")); 
        echo 
'<li>Місто:</li> '.$arr_group['city'].' ('.lang($array['ru_name'],$array['ua_name']).' обл.)<br/>';
    }
    echo (!empty(
$arr_group['url'])?'<li>Веб-сайт:</li> <a href="'.$arr_group['url'].'">'.$arr_group['url'].'</a><br/>':'').'
    '
.(!empty($arr_group['about'])?smiles(cut($arr_group['about'],URL.'/groups/info.php?id='.$id)):'').'
    </div>
    </div>
    <div class="clear"></div>
    <div class="content_block">
    <a href="'
.URL.'/groups/users.php?id='.$id.'" onclick="Page.Go(this.href); return false"><li><div class="right">'.$arr_group['count_users'].'</div>'.lang('Участники','Учасники').'</li></a>
    <a href="'
.URL.'/groups/users_adm.php?id='.$id.'" onclick="Page.Go(this.href); return false"><li>'.lang('Администрация','Адміністрація').'</li></a>';
    if (!empty(
$user_id) && $user_id != $arr_group['user_id'] && !in_array($user_idexplode("||"substr($arr_group['users'], 1, -1)))) echo '<a href="'.URL.'/groups/?id='.$id.'&group=in" onclick="Page.Go(this.href); return false"><li>'.lang('Вступиить в сообщество','Вступити в спільноту').'</li></a>';
    else if (!empty(
$user_id) && $user_id != $arr_group['user_id'] && in_array($user_idexplode("||"substr($arr_group['users'], 1, -1)))) echo '<a href="'.URL.'/groups/?id='.$id.'&group=out" onclick="Page.Go(this.href); return false"><li>'.lang('Покинуть сообщество','Покинути спільноту').'</li></a>';
    if (!empty(
$user_id) && in_array($user_idexplode("||"substr($arr_group['admins'], 1, -1)))) echo '<a href="'.URL.'/groups/adm/?id='.$id.'" onclick="Page.Go(this.href); return false"><li>'.lang('Управление сообществом','Керування спільнотою').'</li></a>';
    echo 
'</div>';

    if (
$arr_group['type'] == && !in_array($user_idexplode("||"substr($arr_group['users'], 1, -1)))) {echo err(lang('Сообщество доступно только для участников сообщества','Спільнота доступна тільки для учасників спільноти')); require_once '../incfiles/foot.php';exit;}

    if (!empty(
$user_id) && $arr_group['access_wall'] == || !empty($user_id) && $arr_group['access_wall'] == && in_array($user_idexplode("||"substr($arr_group['users'], 1, -1))) || !empty($user_id) && $arr_group['access_wall'] == && in_array($user_idexplode("||"substr($arr_group['admins'], 1, -1))))
    {
        if (!
in_array($user_idexplode("||"substr($arr_group['banlist'], 1, -1))))
        {
            require_once 
'wall/handler/del_post.php';
            require_once 
'wall/handler/wall.php';
        }
    
?>
    <script type="text/javascript">
    $(function(){
            $('#form').on('submit', function(e){
             e.preventDefault();
            var $that = $(this),
                formData = new FormData($that.get(0));
            $.ajax({
              url: $that.attr('action'),
                type: $that.attr('method'),
              contentType: false,
              processData: false,
              data: formData,
              success: function(response){
                if(response){
                     $('#content_wall').load($that.attr('action')+ '#content_wall .wall');
                    $('#textarea').val('');
                    $("#cache_photos").html('');
                    $("#cache_audio").html('');
              }
            }
            });
          });
        });
        
        $('input:file').remove();
        $(document).ready(function() {
            new AjaxUpload('upload', {
        action: "/groups/wall/upload.php?from=<?echo $id;?>",
        name: "file",
        data: {ajax: "yes"},
        onSubmit: function(file, ext) {
            if(! (ext && /^(jpg|gif|png|jpeg)$/.test(ext))) {
                return false;
            }
             $('#cache_photos').append('<img id="preview_loading" src="/design/img/preview_loading.gif" style="width:48px;height:48px;"/>');
        },
      onComplete: function(file, res) {
      $('#preview_loading').remove();
            if(res)
                $("#cache_photos").append(res);
                }
            });
        });
    </script>
    <?

    $arr_wall_cache 
false;
    if (
mysql_result(mysql_query("SELECT COUNT(`id`) FROM `wall_cache` WHERE `user_id` = '".$user_id."' LIMIT 1"),0) == true$arr_wall_cache mysql_fetch_array(mysql_query("SELECT * FROM `wall_cache` WHERE `user_id` = '".$user_id."' LIMIT 1"));
    
        echo 
'<div class="block2">
        <form id="form" action="'
.URL.'/groups/?id='.$id.'" method="post">
        <textarea id="textarea" class="input" name="wall_post" rows="4"></textarea>
        <p><div id="cache_photos">'
;
        if (
$arr_wall_cache == true && !empty($arr_wall_cache['photos']))
        {
            
$q explode("||"substr($arr_wall_cache['photos'], 1, -1));
            
$count count($q);
            for (
$i 0$i $count$i++)
            {
                echo 
'<a id="'.($i+1).'" class="del_cache" href="'.URL.'/groups/wall/upload.php?del_photo='.$q[$i].'&from='.$id.'" onclick="FormContent.DelCache(this.id,this.href); return false"><img class="preview_icons" src="'.URL.'/files/wall/'.$user_id.'/photos/icons/'.$q[$i].'"/></a>';
            }
        }
        echo 
'</div></p><div id="cache_audio">';
        if (
$arr_wall_cache == true && !empty($arr_wall_cache['audio']))
        {
            
$q explode("||"substr($arr_wall_cache['audio'], 1, -1));
            
$count count($q);
            for (
$i 0$i $count$i++)
            {
                echo 
'<div id="'.($i+1).'"><p>';
                echo 
track($q[$i]);
                echo 
' <a id="'.($i+1).'" href="'.URL.'/groups/wall/upload.php?del_audio='.$q[$i].'" onclick="FormContent.DelCache(this.id,this.href); return false"> <img src="'.URL.'/design/img/closed.png"/></a>
                </p></div>'
;
            }
        }    
        echo 
'</div><input type="hidden" name="form_wall" value="1"/>
        <input class="button2" type="submit" value="'
.lang('Написать','Написати').'">
        <div class="button3 for_pc" id="upload" style="float: right; cursor: pointer;"><img src="'
.URL.'/design/img/photo.png"/></div>
        <a class="button3" href="'
.URL.'/ajax/smiles.php" onclick="FormContent.Smiles(this.href); return false"><img src="'.URL.'/design/img/smile.png"/></a>
        <a class="button3" href="'
.URL.'/groups/wall/upload.php?from='.$id.'" onclick="Page.Go(this.href); return false"><img src="'.URL.'/design/img/scrp.png"/></a>';
        if (
in_array($user_idexplode("||"substr($arr_group['admins'], 1, -1)))) echo '<div class"clear" style="margin-top:6px;"><a id="checkbox_on" href="" onclick="Form.Checkbox_off(); return false"><img style="margin:3px;" src="'.URL.'/design/img/checkbox_on.gif"/> '.lang('От имени сообщества','Від імені спільноти').'</a>
        <a id="checkbox_off" href="" style="display:none;" onclick="Form.Checkbox_on('
from_group'); return false"><img style="margin:3px;" src="'.URL.'/design/img/checkbox_off.gif"/> '.lang('От имени сообщества','Від імені спільноти').'</a></div>
        <div id="checkbox"><input type="hidden" name="from_group" value="1"/></div>'
;
        echo 
'</form>
        </div><div id="form_content"></div>'
;
    }
    
    require_once 
'wall/handler/index.php'// Стіна
    
    
require_once '../incfiles/foot.php';

}
else 
go(URL);

?>
Онлайн: 2
Реклама