-
Notifications
You must be signed in to change notification settings - Fork 1
/
home0.php
325 lines (320 loc) · 17.2 KB
/
home0.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<?php
error_reporting(E_ALL ^ E_NOTICE);
session_start();
include("config/connect.php");
include("includes/fetch_users_info.php");
include ("includes/time_function.php");
include ("includes/num_k_m_count.php");
if(!isset($_SESSION['Username'])){
header("location: index");
}
if (is_dir("imgs/")) {
$check_path = "";
}elseif (is_dir("../imgs/")) {
$check_path = "../";
}elseif (is_dir("../../imgs/")) {
$check_path = "../../";
}
?>
<html dir="<?php echo lang('html_dir'); ?>">
<head>
<title>Home | Discover</title>
<meta charset="UTF-8">
<meta name="description" content="Escape Routine. Explore Places. Expand Your Circle.">
<meta name="keywords" content="social network,social media,Discover,meet,free platform">
<meta name="author" content="apt321|msa530">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php include "includes/head_imports_main.php"; ?>
</head>
<body onload="fetchPosts_DB('home');">
<!--=============================[ NavBar ]========================================-->
<?php include "includes/navbar_main.php"; ?>
<!--=============================[ Div_Container ]========================================-->
<div class="main_container" align="center">
<!--====================================[ Center col's ]============================================-->
<div style="display: inline-flex" align="center">
<!--====================================[ Center col1 ]============================================-->
<div class="centerCol" align="left">
<div id="centerCol_Content">
<div class="homeLinks" style="text-align:<?php echo lang('homeLinks'); ?>">
<div align="center">
<div align="center" class="userinfo_homeLinks">
<a href="u/<?php echo $_SESSION['Username']; ?>">
<img src="<?php echo 'imgs/user_imgs/'.$_SESSION['Userphoto']; ?>">
</a>
</div>
<h3 style="margin:5px;font-size:18px;"><?php echo "<a href='u/".$_SESSION['Username']."'>".$_SESSION['Fullname']."</a>"; if ($_SESSION['verify'] == "1"){echo $verifyUser;} ?></h3>
<p align="center">@<?php echo $_SESSION['Username'];?></p>
<?php
echo "<span style='cursor:pointer;width:95%;display:inline-flex;margin:5px;'><a href='settings?tc=edit_profile' class=\"silver_flat_btn\" style='width:100%;'><span class=\"fa fa-cog\"></span> ".lang('edit_profile')."</a></span>";
?>
</div>
<a href="./u/<?php echo $_SESSION['Username']; ?>&ut=photos"><p class="<?php echo lang('HLP_b'); ?>"><img src="imgs/main_icons/photo-gallery.png" /> <?php echo lang('my_photos'); ?></p></a>
<a href="./settings"><p class="<?php echo lang('HLP_b'); ?>"><img src="imgs/main_icons/settings.png" /> <?php echo lang('settings'); ?></p></a>
<p class="homeLinks_title"><?php echo lang('my_notepad'); ?></p>
<a href="./mynotepad/new"><p class="<?php echo lang('HLP_b'); ?>"><img src="imgs/main_icons/new-note.jpg" /> <?php echo lang('new_note'); ?></p></a>
<?php
$msid = $_SESSION['id'];
$get_notes_sql="SELECT id,note_title FROM DiaryNotes WHERE author_id=:msid ORDER BY note_time DESC LIMIT 3";
$get_notes = $conn->prepare($get_notes_sql);
$get_notes->bindParam(':msid',$msid,PDO::PARAM_INT);
$get_notes->execute();
$notesCount = $get_notes->rowCount();
while($note_i = $get_notes->fetch(PDO::FETCH_ASSOC)){
$get_note_id = $note_i['id'];
$get_note_title = $note_i['note_title'];
?>
<a href="./mynotepad/"><p class="<?php echo lang('HLP_b'); ?>"><img src="imgs/main_icons/1f5d2.png" /> <?php if(strlen($get_note_title) > 20 ){$noteitem = substr($get_note_title, 0,20)."...";}else{$noteitem = $get_note_title;} echo $noteitem; ?></p></a>
<?php
}
?>
<a href="./mynotepad/"><p class="<?php echo lang('HLP_b'); ?>"><img src="imgs/main_icons/saved-notes.jpg" /> <?php echo lang('see_all_notes')."<span>".thousandsCurrencyFormat($notesCount)."</span>"; ?></p></a>
<p class="homeLinks_title"><?php echo lang('recently_starts_from'); ?></p>
<?php
$mYiD = $_SESSION['id'];
$getS_sql = "SELECT * FROM Favorite_Friend WHERE p_id =:mYiD ORDER BY id DESC LIMIT 5";
$getS = $conn->prepare($getS_sql);
$getS->bindParam(':mYiD',$mYiD,PDO::PARAM_INT);
$getS->execute();
while ($getS_row = $getS->fetch(PDO::FETCH_ASSOC)) {
$getuserid = $getS_row['u_id'];
$getuser_sql = "SELECT Username,Userphoto,Fullname FROM Users WHERE id=:getuserid";
$getuser = $conn->prepare($getuser_sql);
$getuser->bindParam(':getuserid',$getuserid,PDO::PARAM_INT);
$getuser->execute();
while ($getuser_row = $getuser->fetch(PDO::FETCH_ASSOC)) {
?>
<a href="u/<?php echo $getuser_row['Username']; ?>"><p class="<?php echo lang('HLP_b'); ?>"><img src="imgs/user_imgs/<?php echo $getuser_row['Userphoto']; ?>" style="border-radius: 100%;" /> <?php echo $getuser_row['Fullname']; ?></p></a>
<?php
}
}
?>
<a href="./u/<?php echo $_SESSION['Username']; ?>&ut=stars"><p class="<?php echo lang('HLP_b'); ?>"><img src="imgs/main_icons/all-activity.png" /> <?php echo lang('see_all_notes'); ?></p></a>
<p class="homeLinks_title"><?php echo lang('more'); ?></p>
<a href="./posts/saved"><p class="<?php echo lang('HLP_b'); ?>"><img src="imgs/main_icons/archive.png" /> <?php echo lang('saved_posts'); ?></p></a>
<a href="page/supportbox"><p class="<?php echo lang('HLP_b'); ?>"><img src="imgs/main_icons/support.png" /> <?php echo lang('supportBox'); ?></p></a>
<a href="page/report"><p class="<?php echo lang('HLP_b'); ?>"><img src="imgs/main_icons/feedback.png" /> <?php echo lang('Report_A_Problem'); ?></p></a>
</div>
</div>
</div>
<!--======================[ end Center col1 ]=============================-->
<!--========================[ Center col2 ]===============================-->
<div align="left">
<div class="centerCol_2">
<?php
$uid = $_SESSION['id'];
$sqlQ = "SELECT aSetup FROM Users WHERE id=:uid";
$sqlQ_check = $conn->prepare($sqlQ);
$sqlQ_check->bindParam(':uid',$uid,PDO::PARAM_INT);
$sqlQ_check->execute();
while ($aSetupDB = $sqlQ_check->fetch(PDO::FETCH_ASSOC)) {
$aSetupFromDb = $aSetupDB['aSetup'];
}
if ($aSetupFromDb != 100) {
?>
<!--==========[ Account Setup ]=========-->
<div id="AccountSetup">
<div class="post">
<p style="padding: 8px; color: #03A9F4; font-size: 16px; border-bottom: 1px solid #ececec; margin: 10 15;text-align:<?php echo lang('textAlign') ?>;"><?php echo lang('accountSetup') ?></p>
<div class="aSetup" align="center">
<div class="aSetup_item">
<?php
$aSetupVal = array();
if(empty($_SESSION['Userphoto']) or $_SESSION['Userphoto'] == "user-male.png" or $_SESSION['Userphoto'] == "user-female.png"){
$cUphotoClass = "aSetup_item_empty";
$cUphotoColor = "color: #c3c3c3;";
}else{
$cUphotoClass = "aSetup_item_done";
$cUphotoColor = "color: #4bd37b;";
if (!in_array('Userphoto', $aSetupVal)) {
array_push($aSetupVal,'Userphoto');
}
} ?>
<div class="<?php echo $cUphotoClass; ?>"></div>
<p style="<?php echo $cUphotoColor; ?>"><?php echo lang('as_userPhoto') ?></p>
<?php if(!in_array('Userphoto', $aSetupVal)){ ?><a href="u/<?php echo $_SESSION['Username'] ?>"><?php echo lang('complete') ?></a><?php } ?>
</div>
<div class="aSetup_item">
<?php if(empty($_SESSION['uCoverPhoto'])){
$cCphotoClass = "aSetup_item_empty";
$cCphotoColor = "color: #c3c3c3;";
}else{
$cCphotoClass = "aSetup_item_done";
$cCphotoColor = "color: #4bd37b;";
if (!in_array('uCoverPhoto', $aSetupVal)) {
array_push($aSetupVal,'uCoverPhoto');
}
} ?>
<div class="<?php echo $cCphotoClass; ?>"></div>
<p style="<?php echo $cCphotoColor; ?>"><?php echo lang('as_coverPhoto') ?></p>
<?php if(!in_array('uCoverPhoto', $aSetupVal)){ ?><a href="u/<?php echo $_SESSION['Username'] ?>"><?php echo lang('complete') ?></a><?php } ?>
</div>
<div class="aSetup_item">
<?php if(empty($_SESSION['school']) or empty($_SESSION['work0']) or empty($_SESSION['work']) or empty($_SESSION['country']) or empty($_SESSION['website']) or empty($_SESSION['bio']) or empty($_SESSION['birthday'])){
$cInfoClass = "aSetup_item_empty";
$cInfoColor = "color: #c3c3c3;";
}else{
$cInfoClass = "aSetup_item_done";
$cInfoColor = "color: #4bd37b;";
if (!in_array('CompleteInfo', $aSetupVal)) {
array_push($aSetupVal,'CompleteInfo');
}
} ?>
<div class="<?php echo $cInfoClass; ?>"></div>
<p style="<?php echo $cInfoColor; ?>"><?php echo lang('as_profileInfo') ?></p>
<?php if(!in_array('CompleteInfo', $aSetupVal)){ ?><a href="settings?tc=edit_profile"><?php echo lang('complete') ?></a><?php } ?>
</div>
<div class="aSetup_item">
<?php
$uid = $_SESSION['id'];
$sqlQ = "SELECT * FROM Following_Friends WHERE uf_one = :uid";
$sqlQ_check = $conn->prepare($sqlQ);
$sqlQ_check->bindParam(':uid',$uid,PDO::PARAM_INT);
$sqlQ_check->execute();
$sqlQ_checkCount = $sqlQ_check->rowCount();
if ($sqlQ_checkCount > 0) {
$cFollowClass = "aSetup_item_done";
$cFollowColor = "color: #4bd37b;";
if (!in_array('followPeople', $aSetupVal)) {
array_push($aSetupVal,'followPeople');
}
}else{
$cFollowClass = "aSetup_item_empty";
$cFollowColor = "color: #c3c3c3;";
}
?>
<div class="<?php echo $cFollowClass; ?>"></div>
<p style="<?php echo $cFollowColor; ?>"><?php echo lang('as_followPeople') ?></p>
<?php if(!in_array('followPeople', $aSetupVal)){ ?><a href="search"><?php echo lang('complete') ?></a><?php } ?>
</div>
</div>
<div class="aSetup_progrDiv" style="text-align: <?php echo lang('textAlign'); ?>">
<?php
$aSetupVal = count($aSetupVal);
switch ($aSetupVal) {
case '1':
$aSetupProg = "25";
break;
case '2':
$aSetupProg = "50";
break;
case '3':
$aSetupProg = "75";
break;
case '4':
$aSetupProg = "100";
break;
default:
$aSetupProg = "0";
break;
}
?>
<p style="width: <?php echo $aSetupProg; ?>%;"><?php if($aSetupProg > 0){echo $aSetupProg.'%';} ?></p>
</div>
</div>
</div>
<?php
if ($aSetupProg == 100 ) {
$uid = $_SESSION['id'];
$sqlQ = "UPDATE Users SET aSetup = :aSetupProg WHERE id = :uid";
$sqlQ_check = $conn->prepare($sqlQ);
$sqlQ_check->bindParam(':aSetupProg',$aSetupProg,PDO::PARAM_INT);
$sqlQ_check->bindParam(':uid',$uid,PDO::PARAM_INT);
$sqlQ_check->execute();
echo "<script>$('#AccountSetup').html('');</script>";
}
}
?>
<!--==========[ End Account Setup ]=========-->
<div class="write_post">
<?php echo $err_success_Msg; ?>
<?php include("includes/w_post_form.php"); ?>
</div>
<div id="FetchingPostsDiv">
</div>
<div class="post loading-info" id="LoadingPostsDiv" style="padding: 8px;padding-bottom: 100px;">
<div class="animated-background">
<div class="background-masker header-top"></div>
<div class="background-masker header-left"></div>
<div class="background-masker header-right"></div>
<div class="background-masker header-bottom"></div>
<div class="background-masker subheader-left"></div>
<div class="background-masker subheader-right"></div>
<div class="background-masker subheader-bottom"></div>
<div class="background-masker content-top"></div>
<div class="background-masker content-first-end"></div>
<div class="background-masker content-second-line"></div>
<div class="background-masker content-second-end"></div>
<div class="background-masker content-third-line"></div>
<div class="background-masker content-third-end"></div>
</div>
</div>
<div class="post loading-info" id="NoMorePostsDiv" style="display: none;">
<p style="color: #b1b1b1;text-align: center;padding: 15px;margin: 0px;font-size: 18px;"><?php echo lang('noMoreStories'); ?></p>
</div>
<div class="post loading-info" id="LoadMorePostsBtn" style="display: none;">
<button class="blue_flat_btn" style="width: 100%" onclick="fetchPosts_DB('home')"><?php echo lang('load_more'); ?></button>
</div>
<input type="hidden" id="GetLimitOfPosts" value="0">
</div>
</div>
<!--====================================[ end Center col2 ]============================================-->
<!--====================================[ Center col3 ]============================================-->
<div align="left">
<div id="centerCol3" style="width: 310px">
<div class="centerCol_3" style="text-align: <?php echo lang('textAlign'); ?>;">
<!--==================[Trending]===================-->
<div id="trendingWorldWide">
<p class="trendingTitle_CenterCol_3"><span class="fa fa-globe"></span> <?php echo lang('trending_worldWide'); ?></p>
<div class="trendingTitle_CenterCol_3" style="background: #e9ebee;"><a href="#" id="trPagesTab" style="background: #fff;"><?php echo lang('pages'); ?></a> <a href="#" id="trPostsTab"><?php echo lang('posts'); ?></a></div>
<div id="trendingPostsPagesLoading" style="display: none;background: url(imgs/loading_video.gif) center center no-repeat;width: 100%;height: 100px">
</div>
<div id="trendingPostsPages">
<script>
function trendingPostsPages() {
$.ajax({
url:'includes/fetchTrending.php',
type:'POST',
beforeSend:function(){
$("#trendingPostsPagesLoading").show();
},
success:function(results) {
$("#trendingPostsPagesLoading").hide();
$("#trendingPostsPages").html(results);
}
});
}
trendingPostsPages();
</script>
</div>
</div>
<!--==================[PeopleUMayKnow]===================-->
</div>
</div>
</div>
<!--====================================[ end Center col3 ]============================================-->
</div>
<!--===============================[ End ]==========================================-->
<script type="text/javascript">
$('.postContent_EditBox').each(function () {
this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;text-align:' + "<?php echo lang('post_textbox_align'); ?>;");
}).on('input', function () {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + 'px';
});
$("#trPagesTab").click(function(){
$("#trPagesTab").css({"background": "#fff"});
$("#trPostsTab").css({"background": "#e9ebee"});
$("#trPages").show();
$("#trPosts").hide();
});
$("#trPostsTab").click(function(){
$("#trPostsTab").css({"background": "#fff"});
$("#trPagesTab").css({"background": "#e9ebee"});
$("#trPosts").show();
$("#trPages").hide();
});
</script>
<?php include "includes/endJScodes.php"; ?>
</body>
</html>