-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
88 lines (63 loc) · 1.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
<?php
$page = 'profile';
require_once('includes/header.php');
$masterpiece= $_GET['mastid'];
$user_id = $_SESSION['user_id'];
?>
<section class="user cf">
<article>
<img src="<?php show_avatar($user_id); ?>">
<h1> <?php show_username($user_id) ?></h1>
<h2><a href="edit.php">Edit your profile</a></h2>
</article>
</section>
<main class="cf">
<h1>About Me:</h1>
<?php
$query = "SELECT body
FROM about
WHERE user_id = $user_id";
$result =$db-> query($query);
?>
<?php while ( $row = $result->fetch_assoc() ){
?>
<p> <?php echo $row['body']; ?></p>
<?php } ?>
<h1>Uploads</h1>
<section id="container">
<?php
$queryup = "SELECT masterpieces.images, master_id
FROM masterpieces
WHERE user_id = $user_id
ORDER BY date DESC";
$resultup = $db->query($queryup); ?>
<?php while ( $row=$resultup->fetch_assoc() ) {
?>
<a href="single.php?mastid=<?php echo $row['master_id']; ?>">
<figure class = "hfig">
<img src="<?php echo $row['images'] ?>">
</figure>
</a>
<?php } ?>
</section>
</main>
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="js/freewall.js"></script>
<script type="text/javascript">
$(function(){
var wall = new freewall("#container");
wall.reset({
selector: '.hfig',
animate: true,
cellW: 300,
cellH: 'auto',
onResize: function() {
wall.fitWidth();
}
});
wall.container.find('.hfig img').load(function() {
wall.fitWidth();
});
});
</script>
<?php include('includes/footer.php') ?>