/
topic_copy.php
601 lines (475 loc) · 24.8 KB
/
topic_copy.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
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
<?php
require_once('auth.php');
include("connection.php");
$usern=$_SESSION['SESS_USERNAME'];
$firstn=$_SESSION['SESS_FIRST_NAME'];
$lastn=$_SESSION['SESS_LAST_NAME'];
$fulln=$firstn." ".$lastn;
$gender=$_SESSION['SESS_GENDER'];
$gender= strtolower($gender);
?>
<?php
function saveimage($name,$image)
{$usern=$_SESSION['SESS_USERNAME'];
$qry="UPDATE member SET picname='$name',picture='$image' WHERE username='$usern'";
$result=mysql_query($qry);
if($result)
{
//echo "<br/>Image uploaded.";
}
else
{
//echo "<br/>Image not uploaded.";
}
}
?>
<?php
$usern=$_SESSION['SESS_USERNAME'];
$qry7="SELECT picture FROM member WHERE username='$usern'";
$ppicture7=mysql_query($qry7);
$crow = mysql_fetch_row($ppicture7);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Welcome <?php echo $firstn ?></title>
<meta name="generator" content="Bootply" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="css/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="css/styles.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<style type="text/css">
.marq{font-family:Marquee;
font-size:120%;}
.cartoon{font-family:tnamefont;
font-size:170%;}
@font-face {
font-family:tnamefont;
src: url(fonts/tnamefont.ttf);
}
@font-face {font-family:"Marquee";src:url("fonts/MARQUEE_.eot?") format("eot"),url("fonts/MARQUEE_.woff") format("woff"),url("fonts/MARQUEE_.ttf") format("truetype"),url("fonts/MARQUEE_.svg#Marquee") format("svg");font-weight:normal;font-style:normal;}
.ubuntu{font-family:Ubuntu;}
#dropbox-back{
position:fixed;
margin:0;
padding:0;
height:100%;
width:100%;
z-index:1005;
cursor:pointer;
background-color:black;
opacity:0.8;
display:none;
}
#dropbox{
padding:0;
position:fixed;
opacity:1.5;
z-index:1009;
display:none;
}
.centered-form{
margin-top: 20px;
}
.centered-form .panel{
background: rgba(255, 255, 255, 1.5);
box-shadow: rgba(0, 0, 0, 0.3) 20px 20px 20px;
}
</style>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#profilepicture').click(function(){
$('#dropbox-back').fadeIn();
$('#dropbox').fadeIn();
return false;
})
$('#dropbox-back').click(function(){
$('#dropbox-back').fadeOut();
$('#dropbox').fadeOut();
return false;
})
$('#closeform').click(function(){
$('#dropbox-back').fadeOut();
$('#dropbox').fadeOut();
return false;
})
});
</script>
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'>
</head>
<body>
<!--ppic upload-->
<div id="dropbox" >
<div class="container">
<div class="row centered-form">
<div class="col-xs-14 col-sm-6 col-md-6 col-sm-offset-2 col-md-offset-6">
<div class="panel panel-success">
<div class="panel-heading">
<div id="closeform" ><button type="button" style="float:right;"class="btn btn-danger btn-md">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</button></div>
<h3 class="panel-title">Upload New Picture</h3>
</div>
<div class="panel-body">
<form enctype="multipart/form-data" action="home.php" method="post" >
<div class="form-group">
<?php
if(!($crow[0])){
if( ($_SESSION['SESS_GENDER'])!='Male' && !($_SESSION['SESS_PICTURE']) )
{$url='ppicdeff';}
else
{$url='ppicdefm';}
echo '<img class="img-thumbnail" height="100%" width="100%" src="$url.jpg"> ';
$dimage= "$url.jpg";
$name=$url.'.jpg';
$dimage= file_get_contents($dimage);
$dimage= base64_encode($dimage);
saveimage($name,$dimage);
}
else
{
function displayimage()
{$usern=$_SESSION['SESS_USERNAME'];
$qry9="select picture from member WHERE username='$usern' ";
$result9=mysql_query($qry9);
$row = mysql_fetch_row($result9);
echo '<img class="img-thumbnail" height="100%" width="100%" src="data:image;base64,'.$row[0].'"> ';
}
displayimage();
}
?>
</div>
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-6">
<div class="form-group">
<input type="file" name="propic" id="propic" class="form-control input-md"/>
</div>
</div>
<div class="col-xs-12 col-sm-4 col-md-6">
<div class="form-group">
<p class="text-primary">
<?php
if(isset($_POST['propicsubmit']))
{
if(getimagesize($_FILES['propic']['tmp_name']) == FALSE)
{
echo "Please select an image.";
}
else
{
$npropic= addslashes($_FILES['propic']['tmp_name']);
$npicname= addslashes($_FILES['propic']['name']);
$npropic= file_get_contents($npropic);
$npropic= base64_encode($npropic);
savemyimage($npicname,$npropic);
}
}
function savemyimage($mname,$mimage)
{$usern=$_SESSION['SESS_USERNAME'];
$qry5="UPDATE member SET picname='$mname',picture='$mimage' WHERE username='$usern'";
$result5=mysql_query($qry5);
if($result5)
{
echo'<i class="glyphicon glyphicon-ok"></i>';
//echo"success";
}
else
{//echo"Below 800kb please";
//echo"failed";
}
}
?>
</p>
</div>
</div>
</div>
<input type="submit" name="propicsubmit"value="Upload" class="btn btn-success btn-block">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="dropbox-back"></div>
<div class="wrapper">
<div class="box">
<div class="row row-offcanvas row-offcanvas-left">
<!-- sidebar -->
<div class="column col-sm-2 col-xs-1 sidebar-offcanvas" id="sidebar">
<ul class="nav">
<li><a href="#" data-toggle="offcanvas" class="visible-xs text-center"><i class="glyphicon glyphicon-chevron-right"></i></a></li>
</ul>
<ul class="nav hidden-xs" id="lg-menu">
<li ><a class="btn btn-sm" id="profilepicture" >
<?php
$usern=$_SESSION['SESS_USERNAME'];
$n2qry="select picture from member WHERE username='$usern' ";
$n2result=mysql_query($n2qry);
$n2row = mysql_fetch_row($n2result);
echo '<img class="img-rounded"width="80%" height="85%"alt="Cinque Terre" src="data:image;base64,'.$n2row[0].'"> ';
?>
</a></li>
<li class="ubuntu"><a style="background:#003d99;"href="#featured"><i class="fa fa-<?php echo $gender;?> fa-2x"></i><span style="font-size:25px;"> $<?php echo $usern ?></span></a></li>
<li class=" marq "><a style="color:white; background:#4d93ff;"href="#stories"><i class="glyphicon glyphicon-home"></i> <?php echo $fulln ?></a></li>
<li class="active"><a href="home.php"><i class="glyphicon glyphicon-paperclip"></i> Trending</a></li>
<li><a href="#"><i class="glyphicon glyphicon-film"></i> Favourites</a></li>
<li><a href="#"><i class="glyphicon glyphicon-euro"></i> Favourites</a></li>
<li><a href="#"><i class="glyphicon glyphicon-star"></i> Favourites</a></li>
<li><a href="#"><i class="glyphicon glyphicon-plus"></i> Favourites</a></li>
<li><a href=""><i class="glyphicon glyphicon-refresh"></i> Refresh</a></li>
</ul>
<ul class="list-unstyled hidden-xs" id="sidebar-footer">
<li>
<a href="http://www.bootply.com"><h3>Bootstrap</h3> <i class="glyphicon glyphicon-heart-empty"></i> Bootply</a>
</li>
</ul>
<!-- tiny only nav-->
<ul class="nav visible-xs" id="xs-menu">
<li><a href="#featured" class="text-center"><i class="glyphicon glyphicon-list-alt"></i></a></li>
<li><a href="#stories" class="text-center"><i class="glyphicon glyphicon-list"></i></a></li>
<li><a href="#" class="text-center"><i class="glyphicon glyphicon-paperclip"></i></a></li>
<li><a href="#" class="text-center"><i class="glyphicon glyphicon-refresh"></i></a></li>
</ul>
</div>
<!-- /sidebar -->
<!-- main right col -->
<div class="column col-sm-10 col-xs-11" id="main">
<!-- top nav -->
<div class="navbar navbar-blue navbar-static-top">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="#" class="navbar-brand logo">S</a>
</div>
<nav class="collapse navbar-collapse" role="navigation">
<form class="navbar-form navbar-left">
<div class="input-group input-group-sm" style="max-width:360px;">
<input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
<ul class="nav navbar-nav">
<li>
<a href="#"><i class="glyphicon glyphicon-home"></i> Home</a>
</li>
<li>
<a href="#postModal" role="button" data-toggle="modal"><i class="glyphicon glyphicon-plus"></i> Post</a>
</li>
<li>
<a href="#"><span class="badge">Trending</span></a>
</li>
<li>
<a href="#"><span class="badge">Favourites</span></a>
</li>
<li>
<a href="#"><i class="fa fa-database"></i></a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-user"></i></a>
<ul class="dropdown-menu">
<li><a href="">help</a></li>
<li><a href="">settings</a></li>
<li><a href="">privacy</a></li>
<li><a href="">profile</a></li>
<li><a href="index.php">logout</a></li>
</ul>
</li>
</ul>
</nav>
</div>
<!-- /top nav -->
<div class="padding">
<div class="full col-sm-9">
<!-- content -->
<div class="row">
<!-- main col left -->
<div class="col-sm-5">
<div class="panel panel-default">
<div class="panel-thumbnail"><img src="images/wallpaper.jpg" class="img-responsive"></div>
<div class="panel-body">
<p class="lead">Urbanization</p>
<p>45 Followers, 13 Posts</p>
<p>
<img src="images/pic09.jpg" width="28px" height="28px">
</p>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><a href="#" class="pull-right">View all</a> <h4>Bootstrap Examples</h4></div>
<div class="panel-body">
<div class="list-group">
<a href="http://bootply.com/tagged/modal" class="list-group-item">Modal / Dialog</a>
<a href="http://bootply.com/tagged/datetime" class="list-group-item">Datetime Examples</a>
<a href="http://bootply.com/tagged/datatable" class="list-group-item">Data Grids</a>
</div>
</div>
</div>
<div class="well">
<form class="form-horizontal" role="form">
<h4>What's New</h4>
<div class="form-group" style="padding:14px;">
<textarea class="form-control" placeholder="Update your status"></textarea>
</div>
<button class="btn btn-primary pull-right" type="button">Post</button><ul class="list-inline"><li><a href=""><i class="glyphicon glyphicon-upload"></i></a></li><li><a href=""><i class="glyphicon glyphicon-camera"></i></a></li><li><a href=""><i class="glyphicon glyphicon-map-marker"></i></a></li></ul>
</form>
</div>
<div class="panel panel-default">
<div class="panel-heading"><a href="#" class="pull-right">View all</a> <h4>More Templates</h4></div>
<div class="panel-body">
<img src="images/pic09.jpg" class="img-circle pull-right"> <a href="#">Free @Bootply</a>
<div class="clearfix"></div>
There<?php echo $src;?> a load of new free Bootstrap 3 ready templates at Bootply. All of these templates are free and don't require extensive customization to the Bootstrap baseline.
<hr>
<ul class="list-unstyled"><li><a href="http://www.bootply.com/templates">Dashboard</a></li><li><a href="http://www.bootply.com/templates">Darkside</a></li><li><a href="http://www.bootply.com/templates">Greenfield</a></li></ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>What Is Bootstrap?</h4></div>
<div class="panel-body">
Bootstrap is front end frameworkto build custom web applications that are fast, responsive & intuitive. It consist of CSS and HTML for typography, forms, buttons, tables, grids, and navigation along with custom-built jQuery plug-ins and support for responsive layouts. With dozens of reusable components for navigation, pagination, labels, alerts etc.. </div>
</div>
</div>
<?php
function otherdisplayimage()
{$usern=$_SESSION['SESS_USERNAME'];
$nqry="select picture from member WHERE username='$usern' ";
$nresult=mysql_query($nqry);
$nrow = mysql_fetch_row($nresult);
echo '<img class="img-circle pull-right" src="data:image;base64,'.$nrow[0].'"> ';
}
?>
<!-- main col right -->
<div class="col-sm-7">
<div class="well">
<form class="form">
<h4>Sign-up</h4>
<div class="input-group text-center">
<input type="text" class="form-control input-lg" placeholder="Enter your email address">
<span class="input-group-btn"><button class="btn btn-lg btn-primary" type="button">OK</button></span>
</div>
</form>
</div>
<div class="panel panel-default">
<div class="panel-heading"><a href="#" class="pull-right">View all</a> <h4>Bootply Editor & Code Library</h4></div>
<div class="panel-body">
<p><?php
otherdisplayimage();
?> <a href="#">The Bootstrap Playground</a></p>
<div class="clearfix"></div>
<hr>
Design, build, test, and prototype using Bootstrap in real-time from your Web browser. Bootply combines the power of hand-coded HTML, CSS and JavaScript with the benefits of responsive design using Bootstrap. Find and showcase Bootstrap-ready snippets in the 100% free Bootply.com code repository.
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><a href="#" class="pull-right">View all</a> <h4>Stackoverflow</h4></div>
<div class="panel-body">
<img src="//placehold.it/150x150" class="img-circle pull-right"> <a href="#">Keyword: Bootstrap</a>
<div class="clearfix"></div>
<hr>
<p>If you're looking for help with Bootstrap code, the <code>twitter-bootstrap</code> tag at <a href="http://stackoverflow.com/questions/tagged/twitter-bootstrap">Stackoverflow</a> is a good place to find answers.</p>
<hr>
<form>
<div class="input-group">
<div class="input-group-btn">
<button class="btn btn-default">+1</button><button class="btn btn-default"><i class="glyphicon glyphicon-share"></i></button>
</div>
<input type="text" class="form-control" placeholder="Add a comment..">
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><a href="#" class="pull-right">View all</a> <h4>Portlet Heading</h4></div>
<div class="panel-body">
<ul class="list-group">
<li class="list-group-item">Modals</li>
<li class="list-group-item">Sliders / Carousel</li>
<li class="list-group-item">Thumbnails</li>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-thumbnail"><img src="images/wallpaper.jpg" class="img-responsive"></div>
<div class="panel-body">
<p class="lead">Social Good</p>
<p>1,200 Followers, 83 Posts</p>
<p>
<img src="https://lh6.googleusercontent.com/-5cTTMHjjnzs/AAAAAAAAAAI/AAAAAAAAAFk/vgza68M4p2s/s28-c-k-no/photo.jpg" width="28px" height="28px">
<img src="https://lh4.googleusercontent.com/-6aFMDiaLg5M/AAAAAAAAAAI/AAAAAAAABdM/XjnG8z60Ug0/s28-c-k-no/photo.jpg" width="28px" height="28px">
<img src="https://lh4.googleusercontent.com/-9Yw2jNffJlE/AAAAAAAAAAI/AAAAAAAAAAA/u3WcFXvK-g8/s28-c-k-no/photo.jpg" width="28px" height="28px">
</p>
</div>
</div>
</div>
</div><!--/row-->
<div class="row">
<div class="col-sm-6">
<a href="#">Twitter</a> <small class="text-muted">|</small> <a href="#">Facebook</a> <small class="text-muted">|</small> <a href="#">Google+</a>
</div>
</div>
<div class="row" id="footer">
<div class="col-sm-6">
</div>
<div class="col-sm-6">
<p>
<a href="#" class="pull-right">©Copyright 2013</a>
</p>
</div>
</div>
<hr>
<h4 class="text-center">
<a href="http://bootply.com/96266" target="ext">Download this Template @Bootply</a>
</h4>
<hr>
</div><!-- /col-9 -->
</div><!-- /padding -->
</div>
<!-- /main -->
</div>
</div>
</div>
<!--post modal-->
<div id="postModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
Update Status
</div>
<div class="modal-body">
<form class="form center-block">
<div class="form-group">
<textarea class="form-control input-lg" autofocus="" placeholder="What do you want to share?"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<div>
<button class="btn btn-primary btn-sm" data-dismiss="modal" aria-hidden="true">Post</button>
<ul class="pull-left list-inline"><li><a href=""><i class="glyphicon glyphicon-upload"></i></a></li><li><a href=""><i class="glyphicon glyphicon-camera"></i></a></li><li><a href=""><i class="glyphicon glyphicon-map-marker"></i></a></li></ul>
</div>
</div>
</div>
</div>
</div>
<!-- script references -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/scripts.js"></script>
</body>
</html>