-
Notifications
You must be signed in to change notification settings - Fork 0
/
gallery.php
203 lines (202 loc) · 9.02 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
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
<?php
include 'assets/php/db_connect.php';
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Club MS8</title>
<link rel="icon" href="assets/img/favicon.png" sizes="16x16">
<meta name="author" content="Samartha">
<meta name="description" content="ClubMS8 is a group of auto-mototive enthusiast in the town of sagar. To be specific, we are the group of proud MS800 owners.">
<!-- fontICONS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/styles.css">
<!-- jquery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- aos -->
<link type="text/css" rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
</head>
<body>
<?php include 'header.php'; ?>
<div class="content">
<section id="hero" class="full-page-section bg-image" data-aos="fade">
<div class="container hero-con">
<div class="row" data-aos="fade-right">
<div class="col-md-12">
<h1 class="big-text">GALLERY</h1>
<h4 class="tag">Showcase of our culture</h4>
</div>
</div>
</div>
</section>
<br>
<section data-aos="fade-up">
<div class="container">
<div class="row" data-aos="fade-up">
<div class="col-md-12 text-center">
<h3 class="heading">Gallery</h3>
</div>
</div>
<div class="row gallery no-gutters" data-aos="fade-up" data-aos-delay="600">
<?php
$gal_query="SELECT a.*, b.username from gallery a, users b where a.active=1 and a.author_id=b.id order by a.date desc ";
// echo $gal_query;
$gal_exec=mysqli_query($conn,$gal_query);
while($gal_rows=mysqli_fetch_array($gal_exec)){
$args=$gal_rows['image'].'%'.$gal_rows['username'].'%'.$gal_rows['caption'].'%'.$gal_rows['date'].'%'.$gal_rows['tag'].'%'.$gal_rows['id'];
// echo $args;
?>
<div class="col-md-3 bg-black align-items-center">
<div class="thumbnail" onclick="openGalleryModel('<?php echo $args; ?>')">
<img src="assets/img/gallery/<?php echo $gal_rows['image'];?>" >
<div class="thumbnail-overlay">
<p class="para-more"><?php echo $gal_rows['caption']; ?></p>
</div>
</div>
</div><?php } ?>
</div>
</div>
</section>
<section class="overlay-model" id="overlay-model">
<div class="container-fluid">
<div class="row justify-content-center">
<div class="">
<div class="" >
<i class="fa fa-close closebtn2" onclick="closeGalleryModel()"></i>
<div class="gallery-card" id="<?php echo $gal_rows['image'] ?>">
<div class="gallery-card-image">
<img id="image" src="">
</div>
<div class="gallery-card-body">
<div class="like-panel">
<!-- <i class="fa fa-heart" id=like onclick="like_gal()"></i> -->
<!-- <a href="" id="dlLink" download><i class="fa fa-download"></i> </a> -->
<div class="share-panel share-panel-2" id="share-panel">
<input type="hidden" id='gid' value="">
<i class="fa fa-facebook" onclick="share('facebook')"></i>
<i class="fa fa-whatsapp" onclick="share('whatsapp')"></i>
<i class="fa fa-link" onclick="share('link')"></i>
</div>
</div>
<div class="row">
<div class="col-10">
<h5 class="heading" id="caption"></h5>
</div>
<div class="col-2 text-right">
<i class="fa fa-share" onclick="openShare()"></i>
</div>
</div>
<p><small class="text-muted" id="author"></small> | <small class="text-muted text-primary" id="tag"></small></p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<?php
if (isset($_GET['gid'])) {
$gid=$_GET['gid'];
echo $gid;
$gal_query2="SELECT a.*, b.username from gallery a, users b where a.active=1 and a.author_id=b.id and a.id='$gid' order by a.date desc";
// echo $gal_query;
$gal_exec2=mysqli_query($conn,$gal_query2);
while($gal_rows2=mysqli_fetch_array($gal_exec2)){
$args2=$gal_rows2['image'].'%'.$gal_rows2['username'].'%'.$gal_rows2['caption'].'%'.$gal_rows2['date'].'%'.$gal_rows2['tag'].'%'.$gal_rows2['id'];
echo $args2;
?>
<script type="text/javascript">
$( document ).ready(function() {
openGalleryModel( "<?php echo $args2; ?>" );
}); </script>
<?php
}
} ?>
<br>
<?php include 'footer.php'; ?>
<script type="text/javascript">
document.getElementById('gallery').classList.add('active2');
</script>
<script type="text/javascript">
function openGalleryModel(args) {
document.getElementById('overlay-model').style.display='block';
args=args.split('%');
image_src="assets/img/gallery/"+args[0];
document.getElementById('image').setAttribute("src",image_src);
document.getElementById('caption').innerHTML=args[2];
document.getElementById('author').innerHTML="by "+args[1]+" "+args[3].split('-')[1]+'/'+args[3].split('-')[2];
document.getElementById('tag').innerHTML="<a style='font-size:12px;' href='https://instagram.com/"+args[4]+"' target='_blank'>"+args[4]+"</a>";
document.getElementById('gid').setAttribute("value",args[5]);
// document.getElementById('dlLink').setAttribute("href",image_src);
}
function closeGalleryModel() {
document.getElementById('overlay-model').style.display='none';
var sharepanel=document.getElementById('share-panel');
sharepanel.style.height="0px";
sharepanel.style.opacity="0";
sharepanel.style.visibility="hidden";
}
</script>
<script type="text/javascript">
function openShare(){
var sharepanel=document.getElementById('share-panel');
if(sharepanel.style.visibility=="visible"){
sharepanel.style.height="0px";
sharepanel.style.opacity="0";
sharepanel.style.visibility="hidden";
}
else{
sharepanel.style.visibility="visible";
sharepanel.style.height="45px";
sharepanel.style.opacity="1";
}
}
function share(arg){
// alert(window.location);
// link=window.location;
gid=document.getElementById('gid').value;
link="http://ms800hub.rf.gd/gallery.php?gid="+gid;
if(arg=='facebook'){
window.open('https://www.facebook.com/sharer/sharer.php?u=' + link, 'facebook-popup', 'height=350,width=600');
}
if(arg=='whatsapp'){
link='https://api.whatsapp.com/send?text=%20' + link;
window.open(link);
}
if(arg=='link'){
var x=document.createElement('input');
x.value=link;
x.style.position = 'absolute';
x.style.left = '-9999px';
document.body.appendChild(x);
x.select();
document.execCommand('copy');
document.body.removeChild(x);
window.alert('link copied : '+ link);
// window.prompt("Copy to clipboard: Ctrl+C, Enter", link);
}
openShare();
}
function like_gal(){
// console.log(window.this);
document.getElementById('like').style.color="#00e4ff";
}
</script>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script>
AOS.init({
once: true,
duration: 1000,
});
</script>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body>
</html>