-
-
Notifications
You must be signed in to change notification settings - Fork 250
/
groups.php
136 lines (112 loc) · 4.26 KB
/
groups.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php include 'config/declare.php'; ?>
<!-- a universal file that has all the classes included -->
<?php include 'config/classesGetter.php'; ?>
<!-- creating objects -->
<?php
$universal = new universal;
$tags = new tags;
$avatar = new Avatar;
$follow = new follow_system;
$general = new general;
$post = new post;
$recommend = new recommend;
$settings = new settings;
$mutual = new mutual;
$noti = new notifications;
$message = new message;
$groups = new group;
?>
<?php
if ($universal->checkGet($_GET['grp']) == false) {
header('Location:'.DIR);
}
if ($groups->validGrp($_GET['grp']) == false) {
header('Location: '.DIR."/no_group");
}
if ($universal->isLoggedIn() == false) {
// header("Location:". DIR ."/login");
}
$grp = $_GET['grp'];
if (isset($_SESSION['id'])) {
$session = $_SESSION['id'];
}
?>
<?php
$title = "{$noti->titleNoti()} {$groups->GETgrp($grp, 'grp_name')} • Instagram";
$keywords = "Instagram, Share and capture world's moments";
$desc = "View group • Instagram";
?>
<?php include_once 'includes/header.php'; ?>
<link rel="stylesheet" type="text/css" href="<?php echo DIR; ?>/public/css/jquery-ui.css">
<?php include_once 'needs/heading.php'; ?>
<?php include_once 'needs/nav.php'; ?>
<div class="user_info" data-grpname='<?php echo $groups->GETgrp($grp, "grp_name"); ?>' data-grp='<?php echo $grp; ?>' data-userid='<?php echo $session; ?>' data-username='<?php echo $universal->GETsDetails($session, "username"); ?>'></div>
<div class="notify"><span></span></div>
<div class="overlay"></div>
<div class="badshah">
<?php include 'ajaxify/groups/grp_banner.php'; ?>
<?php if($groups->memberOrNot($grp, $session) == false && $groups->GETgrp($grp, "grp_privacy") == "private"){ ?>
<div class='home_last_mssg grp_last_mssg'><img src='<?php echo DIR; ?>/images/needs/large.jpg'>
<span>Group is private. Join to connect with this group and refresh.</span>
<span><?php if($groups->mutualGrpMemCount($grp) != 0){ echo $groups->mutualGrpMemCount($grp)." mutual members"; } ?></span></div>
<?php } else if($universal->isLoggedIn() == false) { ?>
<div class='home_last_mssg grp_logout_last_mssg'><img src='<?php echo DIR; ?>/images/needs/large.jpg'>
<span>You are not logged in. Login to connect with this group.</span></div>
<?php } else { ?>
<?php include 'ajaxify/groups/grp_hori_nav.php'; ?>
<div class="hmm">
<div class="spinner">
<span></span><span></span><span></span>
</div>
</div>
<?php } ?>
</div>
<?php include_once 'ajaxify/groups/view_profile.php'; ?>
<?php include_once 'needs/profile_avatars.php'; ?>
<?php include_once 'needs/display.php'; ?>
<?php include_once 'needs/prompt.php'; ?>
<?php include_once 'needs/emojis.php'; ?>
<?php include_once 'needs/image_show.php'; ?>
<?php include_once 'needs/stickers.php'; ?>
<?php include_once 'needs/create_group.php'; ?>
<?php include_once 'needs/post.php'; ?>
<?php include_once 'needs/search.php'; ?>
<?php include_once 'includes/footer.php'; ?>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript">
$(function(){
function fetch(elem){
var username = $('.user_info').data('grpname');
var grp = $('.user_info').data('grp');
$.ajax({
url: DIR+"/ajaxify/grp_sections/"+elem+".php",
method: "GET",
cache: false,
data: {grp: grp},
beforeSend: function(e){
$('.hmm > .spinner').fadeIn('fast');
},
success: function(data){
var link = $('.inst_grp_nav');
link.removeClass('pro_nav_active');
$(".inst_grp_nav[href='"+ elem +"']").addClass('pro_nav_active');
$('.hmm > .spinner').fadeOut('fast');
$('.hmm').html(data).hide().fadeIn(100);
// $('html, body').animate({scrollTop: 380}, "slow");
}
});
}
var get = checkGET("ask");
if (get.has) {
fetch(get.value);
} else {
fetch("grp_posts");
}
//Set it Draggable
$('.pro_crop_tool').draggable({containment: ".crop_img"});
$('a[href="grp_add_members"]').on('click', function(e){
e.preventDefault();
$('.a_m_input > input[type="text"]').focus();
});
});
</script>