-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
505 lines (411 loc) · 20.5 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
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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<?php error_reporting(0);
if (session_id() == null || session_id() == "") {
session_start();
}
require("config/config.php");
include("admin/includes/phpfunction.php");
$id="";
if(isset($_SESSION['id']) && $_SESSION['id']!="")
{
$id=trim($_SESSION['id']);
}
if(isset($_GET['id'])&& $_GET['id']!="")
{
$id=trim($_GET['id']);
}
if(isset($_SESSION['id']) && $_SESSION['id']!="")
{
if(trim($_SESSION['id'])!=trim($id))
{
setview($id);
}
}
$profile_img=SITE_URL."images/temp120.jpg";
if($id!="")
{
$row=getUserById($id);
if(trim($row['id'])!="" && trim($row['photo'])!="" )
{ $coverimage=IMAGE_URL."coverimage/org/".trim($row['coverImage']);
$profile_img=IMAGE_URL."profile/120/".trim($row['photo']);
if(!file_exists($profile_img))
{
$profile_img=SITE_URL."images/temp120.jpg";
}else{
$profile_img=SITE_URL."uploades/profile/120/".$row['photo'];
}
if(!file_exists($coverimage))
{
$coverimage="#ff";
// $profile_img=SITE_URL."images/temp120.jpg";
}else{//coverimage\org
$coverimage="url('".SITE_URL."uploades/coverimage/org/".$row['coverImage']."')";
}
}else
{
$msg=encrypt_decrypt('There is Some Error.!!',true);
// echo "<script>location.href='404.php?i=".$msg."';</script>";
}
}else{
$msg=encrypt_decrypt('There is Some Error.!!',true);
// echo "<script>location.href='404.php?i=".$msg."';</script>";
}?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>MITSIM</title>
<?php include("includes/maincss.php"); ?>
<!-- Custom styles for this template -->
<!-- <script src="js/jquery-1.3.0.min.js" type="text/javascript"></script>-->
<link rel="stylesheet" href="<?=SITE_URL?>assets/crop-avatar/css/cropper.min.css">
<link rel="stylesheet" href="<?=SITE_URL?>assets/crop-avatar/css/crop-avatar.css">
<link rel="stylesheet" href="<?=SITE_URL?>css/uploadimage.css">
<link rel="stylesheet" href="<?=SITE_URL?>css/bootstrap-lightbox.min.css">
<link href="<?=SITE_URL?>css/profile.css" rel="stylesheet" type="text/css" />
<style>
a{
cursor:pointer;
}
.tree2 ul {
list-style: none;
margin-left:-40px;
}
.tree2 li a {
line-height: 25px;
}
.tree2 ul li ul li p{color:Black; font-family:Century Gothic; font-size:13px;}
.tree2 > ul > li > a {
color: #027EA2;
display: block;
font-weight: normal;
position: relative;
text-decoration: none;
font-family:Century Gothic;
}
.tree2 li.parent > a {
padding: 0 0 0 28px;
}
.tree2 li.parent > a:before {
background-image: url("<?=SITE_URL?>images/plus_minus_icons2.png");
background-position: 25px center;
content: "";
display: block;
height: 21px;
left: 0;
position: absolute;
top: 2px;
vertical-align: middle;
width: 23px;
}
.tree2 ul li.active > a:before {
background-position: 0 center;
}
.tree2 ul li ul {
/*border-left: 1px solid #D9DADB;*/
display: none;
margin: 0 0 0 12px;
overflow: hidden;
padding: 0 0 0 25px;
}
.tree2 ul li ul li {
position: relative;
}
.tree2 ul li ul li:before {
/*border-bottom: 1px dashed #E2E2E3;*/
content: "";
left: -20px;
position: absolute;
top: 12px;
width: 15px;
}
#wrapper {
margin: 0 auto;
width: 300px;
}
</style>
</head>
<body>
<div class='backdiv'>
<div class='backl' style=""></div>
<div class='backR' style=""></div>
</div>
<div style="" class='main-body-div'>
<div class="main">
<?php include("includes/header_menu.php"); ?>
<!-- <a href="includes/logout.php">Logout</a>-->
<div class="main-div">
<div class="div-prf-body" style="width:1000px; background: #fff;">
<div class="div-align" id="crop-avatar">
<div class="div-profile" id="coverimage-div" style=" background-size:cover !important; background:<?php echo $coverimage;?>"><?php //background:url('images/wall-img.png') center;?>
<div class="profile-image <?php if(isset($_SESSION['id'])&& $_SESSION['id']==$row['id']){?> avatar-view" title="Change the Profile<?php }else{ echo '"';} ?> " ><img src="<?=$profile_img;?>"/></div>
<?php if(isset($_SESSION['id'])&& $_SESSION['id']==$row['id']){?>
<!-- Cropping modal -->
<div class="modal fade" id="avatar-modal" tabindex="-1" role="dialog" aria-labelledby="avatar-modal-label" aria-hidden="true">
<div class="modal-dialog modal-lg" style="width:800px;">
<div class="modal-content">
<form id="uploadfrm" class="avatar-form" method="post" action="<?=SITE_URL?>assets/crop-avatar/crop-avatar.php" enctype="multipart/form-data">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title" id="avatar-modal-label">Change Profile Image</h4>
</div>
<div class="modal-body">
<div class="avatar-body">
<!-- Upload image and data -->
<div class="avatar-upload">
<input class="avatar-src" name="avatar_src" type="hidden">
<input class="avatar-data" name="avatar_data" type="hidden">
<label for="avatarInput">Local upload</label>
<input class="avatar-input" id="avatarInput" name="avatar_file" type="file">
</div>
<!-- Crop and preview -->
<div class="row">
<div class="col-md-9">
<div class="avatar-wrapper"></div>
</div>
<div class="col-md-3">
<div class="avatar-preview preview-lg"></div>
<div class="avatar-preview preview-md"></div>
<div class="avatar-preview preview-sm"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default" type="button" data-dismiss="modal">Close</button>
<button class="btn btn-primary avatar-save" type="submit">Save</button>
</div>
</form>
</div>
</div>
</div><!-- /.modal -->
<!-- Loading state -->
<div class="loading" tabindex="-1" role="img" aria-label="Loading"></div>
<?php }
?>
</div>
<div class="div-prfname">
<div class="div-prf-name">
<div class="div-name"><?= sentence_cap(" ",$row['f_name']." ".$row['l_name']);?></div>
<div class="div-name-center"><i class="fa fa-star clr"></i> <i class="fa fa-star clr"></i> <i class="fa fa-star clr"></i> <i class="fa fa-star-half-empty clr"></i> <i class="fa fa-star-o clr"></i></div>
<div class="div-name-right">
<?php
$str=' <a class="prf-follow" id=\'followid\' ';
if(isset($_SESSION['id']) && $_SESSION['id']!="" )
{
$ro=getisfollow('users',$row['id']);
if($ro['id']!="")
{
$str.= ' href="javascript:" >Following '; //' onclick="homefollows(\'0\',\''.$row['id'].'\',\'users\',\'users'.$i.'\')" ';
}else{
$str.= ' href="javascript:" onclick="homefollows(\'1\',\''.$row['id'].'\',\'users\',\'followid\')">Follow ';
}
}else{
$str.= 'href="#login" data-toggle="modal">Follow ' ;
}
$str.=' </a >';
if(isset($_SESSION['id']) && $_SESSION['id']!="" && $_SESSION['id'] ==$row['id'] )
{
$str='<a class="prf-follow" id="" href="#cover-modal" data-toggle="modal" >Change Cover</a>';
//cover image uploader modal
?>
<div class="modal fade" id="cover-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" style="width:400px;">
<div class="modal-content">
<form enctype="multipart/form-data" name='coverform' role="form" id="coverform" method="post" action="<?=SITE_URL?>includes/ajax/coverimageupload.php">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title" id="avatar-modal-label">Change Cover Image</h4>
</div>
<div class="modal-body">
<div class="form-group">
<input class='file' type="file" class="form-control" name="image" id="images" placeholder="Please choose your image">
<span class="help-block"></span>
</div>
<div id="loader" style="display: none;">
Please wait image uploading to server....
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default" type="button" data-dismiss="modal">Close</button>
<input type="submit" value="Upload" name="image_upload" id="image_upload" class="btn btn-info"/>
</div>
</form>
</div>
</div>
</div>
<?php
}
echo $str;
?>
<!-- <div class="prf-follow">Follow</div>-->
<div class="prf-follow-edit"></div>
</div>
</div>
</div>
</div>
<div class="div-profile-body">
<div class="div-profile-body-left">
<ul>
<li id="m1" class="" onclick="activeProfile(this,0);"> <i class="fa fa-home nm"></i> <a href="javascript:" onclick="showprofileGeneral('<?=$row['id'];?>')" >General</a></li>
<li id="m6" class="" onclick="activeProfile(this,1);"> <i class="fa fa-image nm"></i> <a href="javascript:" onclick="showprofileImages('<?=$row['id'];?>')" >Images</a></li>
<li id="m2" onclick="activeProfile(this,0);" > <i class="fa fa-thumbs-o-up nm"></i> <a href="javascript:" onclick="showProfilelike('<?=$row['id'];?>','1')"> Likes (<?=getalllikeUserID($row['id'])?>)</a></li>
<li id="m3" onclick="activeProfile(this,0);"> <i class="fa fa-heart nm"></i> <a href="javascript:" onclick="showfavouritelike('<?=$row['id'];?>','1')"> Favourites(<?=getallfavouriteUserID($row['id'])?>)</a></li>
<li id="m4" onclick="activeProfile(this,0);"> <i class="fa fa-location-arrow nm"></i> <a href="javascript:" onclick="showProfileFollow('<?=$row['id'];?>','1')"> Following</a></li>
<li id="m5" onclick="activeProfile(this,0);"> <i class="fa fa-eye nm"></i> <a href="javascript:" onclick="showProfileViewes('<?=$row['id'];?>','1')">Viewed (<?=getallviewesUserID($row['id'])?>)</a></li>
</ul>
</div>
<?php if(isset($_SESSION['id']) && $_SESSION['id']!="" && $_SESSION['id'] ==$row['id'] )
{?>
<div class="div-profile-body-right" id="dispX" style="display: none !important; visibility: hidden; min-height:170px; height: 120px;">
<div class="content" >
<h4>Image Gallery</h4>
<form enctype="multipart/form-data" name='imageform' role="form" id="imageform" method="post" action="<?=SITE_URL?>includes/ajax/profileGImage.php">
<div class="row">
<hr>
<div class="col-lg-3">Upload New Image:</div>
<div class="col-lg-6" style="background-color: #FFF;
border: 1px solid #CCC;
border-radius: 4px;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.075) inset;
transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s; height: 33px; padding-left: 1px;" >
<input type="file" class="form-control file" id="gimages" name="image"style=" border: none;box-shadow: none; margin: 0px; height: 30px; padding: 0px 0px 1px 0px !important">
</div>
<div class="col-lg-3"><input type="submit" id="upbtn" class="btn btn-info" value="Upload"><span id="upbtnlod"></span></div>
</div>
</form>
<hr>
</div>
</div>
<?php } else {
echo '<span id="dispX"></span>';
} ?>
<div class="div-profile-body-right" id="disp">
<input type="hidden" id="counter" value="26">
<?php
$per_page=25;
$start=0;
if(isset($_GET['start']))
{
$start=$_GET['start'];
}
$sqlfollow="SELECT id,created FROM `follows` where status='1' And user_id='".$id."' order By id desc LIMIT ".$start." , ". $per_page ;
$sqlrecommend="SELECT id,created FROM `recommend` where status='1' And user_id='".$id."' order By id desc LIMIT ".$start." , ". $per_page ;
$sqlusers_post="SELECT id,created FROM `users_post` where status='1' And userid='".$id."' order By id desc LIMIT ".$start." , ". $per_page ;
// $sqlcomment="SELECT * FROM `comment` where status='1' And comment_by_id='".$id."' order By id desc LIMIT ".$start." , ". $per_page ;
$displayArr=array();
$i=0;
//$sqlfollow
$result = mysql_query($sqlfollow);
while($row=mysql_fetch_array($result))
{
$tim= strtotime($row['created']);
$displayArr[$tim]['type']='follow';
$data=getfollowbox($i,$row['id']);
$displayArr[$tim]['data']=$data;
$i++;
}
//$sqlrecommend
//
$result = mysql_query($sqlrecommend);
while ($row = mysql_fetch_array($result)) {
$tim= strtotime($row['created']);
$displayArr[$tim]['type'] = 'recommend';
$data = getRecommendbox($i, $row['id']);
$displayArr[$tim]['data'] = $data;
$displayArr[$tim]['dt'] = $row['created'];
$i++;
}
// $sqlusers_post
$result = mysql_query($sqlusers_post);
while ($row = mysql_fetch_array($result)) {
$tim= strtotime($row['created']);
$displayArr[$tim]['type'] = 'users_post';
$data = getUsers_postbox($i, $row['id']);
$displayArr[$tim]['data'] = $data;
$displayArr[$tim]['dt'] = $row['created'];
$i++;
}
// $sqlcomment
// $result = mysql_query($sqlcomment);
// while($row=mysql_fetch_array($result))
// {
// $displayArr[$i]['type']='users_post';
// $data=getcommentbox($i,$row['id']);
// $displayArr[$i]['data']=$data;
// $i++;
//
// }
// foreach($displayArr as $data)
// {
// echo $data['data'];
// }
$count = count($displayArr);
/* $randarr=array();
for ($i = 0; $i <= $count; $i++) {
$x = rand(0, $count);
if(in_array($x, $randarr))
{
continue;
}else{$randarr[$i]=$x;
if($x<$count)
{
echo $displayArr[$x]['data'];
}
}
}*/
krsort($displayArr);
//printarray( $displayArr );
//echo '<pre>';
foreach ($displayArr as $i => $row)
{
//printarray($row);
echo $row['data'];
}
intbm();
if($count>"30"){
echo ' <input type="button" id="morebtn" class="btn btn-info" onclick="showProfilemore(0,'.$id.')" style="width: 100%;" value="View More">';
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<!--<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>-->
<?php include('includes/mainjs.php');?>
<script src="<?=SITE_URL?>assets/crop-avatar/js/cropper.min.js"></script>
<script src="<?=SITE_URL?>assets/crop-avatar/js/crop-avatar.js"></script>
<script src="<?=SITE_URL?>js/jquery.form.min.js"></script>
<script src="<?=SITE_URL?>js/ajaximageupload.js"></script>
<script src="<?=SITE_URL?>js/profieimage.js"></script>
<script src="<?=SITE_URL?>js/bootstrap-lightbox.min.js"></script>
<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="js/jquery.mousewheel-3.0.6.pack.js"></script>
<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="<?=SITE_URL?>assets/fancy/jquery.fancybox.js?v=2.1.5"></script>
<link rel="stylesheet" type="text/css" href="<?=SITE_URL?>assets/fancy/jquery.fancybox.css?v=2.1.5" media="screen" />
<!-- Add Button helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="<?=SITE_URL?>assets/fancy/helpers/jquery.fancybox-buttons.css?v=1.0.5" />
<script type="text/javascript" src="<?=SITE_URL?>assets/fancy/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
<!-- Add Thumbnail helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="<?=SITE_URL?>assets/fancy/helpers/jquery.fancybox-thumbs.css?v=1.0.7" />
<script type="text/javascript" src="<?=SITE_URL?>assets/fancy/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
<!-- Add Media helper (this is optional) -->
<script type="text/javascript" src="<?=SITE_URL?>assets/fancy/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".fancybox-button").fancybox({
prevEffect : 'none',
nextEffect : 'none',
closeBtn : false,
helpers : {
title : { type : 'inside' },
buttons : {}
}
});
});
</script>
</body>
</html>