/
gallery.php
executable file
·81 lines (65 loc) · 2.27 KB
/
gallery.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
<?php
include 'includes/core.php';
include('database/connect.php');
if(isset($_REQUEST['id'])){
$id=$_REQUEST['id'];
}
else{
$id=0;
}
$post_date=date('d-m-Y');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php $active_nav="gallery"; $page_title = "Photo Gallery"; include 'includes/head.php' ?>
<link href="css/animate.css" rel="stylesheet">
<link href="css/lightbox.css" rel="stylesheet">
<script src="js/wow.min.js"></script>
<script src="js/lightbox.min.js"></script>
</head>
<body>
<?php include 'includes/header.php'; ?>
<!------------Content Section (Add Your Code From Here)------------>
<div class="container">
<div class="myGallery">
<?php
$test=0;
$img=mysql_query("select * from gallery order by id desc");
while($getImg=mysql_fetch_array($img)){
$n=$getImg['img_file'];
$test++;
?>
<?php if($test==1){ ?>
<div class="row">
<div class="col-md-4">
<a href="gallery/<?php echo $n;?>" data-lightbox="vacation">
<img src="gallery/<?php echo $n;?>" width="353px" height="250px" class="thumbnail"/>
</a>
</div>
<?php } else if($test==2){ ?>
<div class="col-md-4">
<a href="gallery/<?php echo $n;?>" data-lightbox="Vacation">
<img src="gallery/<?php echo $n;?>" width="353px" height="250px" class="thumbnail"/>
</a>
</div>
<?php } else if($test==3){ ?>
<div class="col-md-4">
<a href="gallery/<?php echo $n;?>" data-lightbox="Vacation">
<img src="gallery/<?php echo $n; $test=0; ?>" width="353px" height="250px" class="thumbnail"/>
</a>
</div>
</div>
<?php } ?>
<?php
} // end of while
?>
<?php
//for the last row of gallery, if row does not have 3 pictures, add closing tag for the row
if($test!==0) echo "</div>";
?>
</div>
</div>
<?php include 'includes/footer.php' ?>
</body>
</html>