/
home.php
68 lines (53 loc) · 1.41 KB
/
home.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
<?php
$page = 'home';
require_once('includes/header.php');
$masterpiece= $_GET['mastid'];
$query="SELECT masterpieces.images, master_id
FROM masterpieces
ORDER BY date DESC";
$result=$db->query($query);
$user_id = $_SESSION['user_id'];
?>
<section class="user cf">
<article>
<a href="profile.php"><img src="<?php show_avatar($user_id); ?>" alt="profile picture"></a>
<h1> Welcome <?php show_username($user_id) ?>!</h1>
<h2>Click your profile picture to view your profile</h2>
</article>
</section>
<main class="cf">
<h1>Welcome to Inspire!</h1>
<h2>Enjoy our latest inspirations</h2>
<h3>Latest Inspirations</h3>
<section id="container">
<?php while ( $row=$result->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 src="js/jquery.balanced-gallery.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') ?>