-
-
Notifications
You must be signed in to change notification settings - Fork 251
/
profile.php
149 lines (126 loc) · 5.02 KB
/
profile.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
137
138
139
140
141
142
143
144
145
146
147
148
149
<?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;
$fav = new favourite;
$noti = new notifications;
$message = new message;
?>
<?php
if ($universal->checkGet($_GET['u']) == false) {
header('Location:'.DIR);
}
if ($universal->validGET($_GET['u']) == false) {
header('Location: '.DIR."/no_user");
}
if ($universal->isLoggedIn() == false) {
// header("Location:". DIR ."/login");
}
$get_id = $universal->getIdFromGet($_GET['u']);
if (isset($_SESSION['id'])) {
$session_id = $_SESSION['id'];
}
?>
<?php
if (isset($_SESSION['id'])) {
// FOR INCREMENTING PROFILE VIEWS
$follow->viewCounter($get_id);
// FOR DELETING EMPTY TAGS
$tags->filterTags();
// FOR DELETING FILES FROM TEMP FOLDERS
$general->deleteFiles();
}
?>
<?php
$title = "{$noti->titleNoti()} @{$universal->GETsDetails($get_id, "username")} ({$universal->GETsDetails($get_id, "firstname")} {$universal->GETsDetails($get_id, "surname")}) • Instagram";
$keywords = "{$universal->GETsDetails($get_id, "username")}, {$universal->GETsDetails($get_id, "firstname")}, {$universal->GETsDetails($get_id, "surname")}, Instagram, Share and capture world's moments";
$desc = "Connect with {$universal->GETsDetails($get_id, "username")}'s profile • 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-userid="<?php echo $get_id; ?>" data-sessionid="<?php if(isset($_SESSION['id'])){ echo $session_id; } ?>"
data-username="<?php echo $universal->GETsDetails($get_id, 'username'); ?>" data-firstname="<?php echo $universal->GETsDetails($get_id, "firstname");?>" data-surname="<?php echo $universal->GETsDetails($get_id, "surname") ?>" data-sessionname = "<?php echo $universal->getUsernameFromSession(); ?>"></div>
<div class="notify"><span></span></div>
<div class="overlay"></div>
<div class="badshah">
<?php include_once 'ajaxify/profile/profile_banner.php'; ?>
<?php
if($universal->isLoggedIn() == false){
echo "<div class='home_last_mssg private_last_mssg'><img src='". DIR ."/images/needs/large.jpg'>
<span>You are not logged in. Login to connect with {$universal->GETsDetails($get_id, "username")}</span></div>";
} else if ($universal->isPrivate($get_id)) {
echo "<div class='home_last_mssg private_last_mssg'><img src='". DIR ."/images/needs/large.jpg'>
<span>Account is private. Follow to connect with {$universal->GETsDetails($get_id, "username")} and refresh.</span>
<span>";
if ($mutual->mutualCount($get_id) != 0) {
echo $mutual->mutualCount($get_id)." mutual followers";
}
echo "</span></div>";
} else {
?>
<?php include_once 'ajaxify/profile/profile_hori_nav.php'; ?>
<div class="hmm">
<div class="spinner">
<span></span><span></span><span></span>
</div>
</div>
<?php } ?>
<input type="hidden" name="" value="" class="mn">
</div>
<?php include_once 'ajaxify/profile/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/image_show.php'; ?>
<?php include_once 'needs/stickers.php'; ?>
<?php include_once 'needs/search.php'; ?>
<?php include 'needs/create_group.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('username');
$.ajax({
url: DIR+"/ajaxify/profile_sections/"+elem+".php",
method: "GET",
cache: false,
data: {u: username},
beforeSend: function(e){
$('.hmm > .spinner').fadeIn('fast');
},
success: function(data){
var link = $('.inst_nav');
link.removeClass('pro_nav_active');
$(".inst_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("posts");
}
// $('.m_n_a').removeClass('active');
notMM();
//Set it Draggable
$('.pro_crop_tool').draggable({containment: ".crop_img"});
// var link = $('.inst_nav');
});
</script>