-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGENERATE_ALBUM_DYNAMICALLY.php
More file actions
433 lines (333 loc) · 18.6 KB
/
GENERATE_ALBUM_DYNAMICALLY.php
File metadata and controls
433 lines (333 loc) · 18.6 KB
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
<?php
include_once('jcart/jcart.php');
session_start();
?>
<!DOCTYPE html>
<html class="no-js">
<head>
<style>
* {
padding:0;
margin:0;
}
#container2 {
color: #333;
font: 14px Sans-Serif;
padding: 50px;
//background: #eee;
}
h1 {
text-align: center;
padding: 20px 0 12px 0;
margin: 0;
}
h2 {
font-size: 16px;
text-align: center;
padding: 0 0 12px 0;
}
#container {
box-shadow: 0 5px 10px -5px rgba(0,0,0,0.5);
position: relative;
background: white;
}
</style>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1,requiresActiveX=true">
<title> Photography by Pablo Fernandez :: The Young Entrepreneur :: Professional Resume </title>
<meta name="description" content="Born in Pasadena, CA, Pablo Fernandez is known as a young entrepreneur and web developer because of his passion for designing websites and turning his ideas into startup companies.">
<!-- /// Favicons //////// -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="hhttps://cdn3.iconfinder.com/data/icons/buttons/512/Icon_13-512.png">
<link rel="shortcut icon" href="https://cdn3.iconfinder.com/data/icons/buttons/512/Icon_13-512.png">
<!-- /// Template CSS //////// -->
<link rel="stylesheet" href="http://www.pablofernandez.com/_layout/css/base.css">
<link rel="stylesheet" href="http://www.pablofernandez.com/_layout/css/grid.css">
<link rel="stylesheet" href="http://www.pablofernandez.com/_layout/css/elements.css">
<link rel="stylesheet" href="http://www.pablofernandez.com/_layout/css/layout.css">
<!-- /// JS Plugins CSS //////// -->
<link rel="stylesheet" href="http://www.pablofernandez.com/_layout/js/bxslider/jquery.bxslider.css">
<link rel="stylesheet" href="http://www.pablofernandez.com/_layout/js/magnificpopup/magnific-popup.css">
<!-- /// Skin CSS //////// -->
<!-- <link rel="stylesheet" href="http://www.pablofernandez.com/_layout/css/skins/default.css"> -->
<!-- /// Google Fonts //////// -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,700">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Oswald:400,300,700">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700">
<!-- /// FontAwesome Icons 4.0.3 //////// -->
<link rel="stylesheet" href="http://www.pablofernandez.com/_layout/css/fontawesome/font-awesome.min.css">
<!-- /// Custom Icon Font //////// -->
<link rel="stylesheet" href="http://www.pablofernandez.com/_layout/css/iconfontcustom/icon-font-custom.css">
<!-- /// Cross-browser CSS3 animations //////// -->
<link rel="stylesheet" href="http://www.pablofernandez.com/_layout/css/animate/animate.min.css">
<!-- /// Modernizr //////// -->
<script src="http://www.pablofernandez.com/_layout/js/modernizr-2.6.2.min.js"></script>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="http://www.pablofernandez.com/photography/admin-image-processing/gallery/css/style.css"/>
<script src="http://www.pablofernandez.com/js/modernizr.custom.70736.js"></script>
<noscript><link rel="stylesheet" type="text/css" href="http://www.pablofernandez.com/photography/admin-image-processing/gallery/css/noJS.css"/></noscript>
<!--[if lte IE 7]><style>.main{display:none;} .support-note .note-ie{display:block;}</style><![endif]-->
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gamma Gallery - A Responsive Image Gallery Experiment</title>
<meta name="description" content="Gamma Gallery - A Responsive Image Gallery Experiment"/>
<meta name="keywords" content="html5, responsive, image gallery, masonry, picture, images, sizes, fluid, history api, visibility api"/>
<meta name="author" content="Codrops"/>
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="http://www.pablofernandez.com/photography/admin-image-processing/gallery/css/style.css"/>
<script src="http://www.pablofernandez.com/js/modernizr.custom.70736.js"></script>
<noscript><link rel="stylesheet" type="text/css" href="http://www.pablofernandez.com/photography/admin-image-processing/gallery/css/noJS.css"/></noscript>
<!--[if lte IE 7]><style>.main{display:none;} .support-note .note-ie{display:block;}</style><![endif]-->
</head>
<div id="wrap">
<div id="header">
<div id="nav">
<div class="row">
<div class="span3">
<!-- // Logo // -->
<a href="http://pablofernandez.com/photography/" id="logo">
Pablo Fernandez <font size="0"><i>Photography</i></font>
</a>
</div><!-- end .span3 -->
<div class="span9">
<a href="#" id="mobile-menu-trigger">
<i class="fa fa-bars"></i>
</a>
<!-- // Menu // -->
<ul class="sf-menu" id="menu">
<li>
<a href="http://pablofernandez.com">Home</a>
</li>
<li>
<a href="http://pablofernandez.com/photography/">Galleries</a>
</li>
<li>
<a href="http://pablofernandez.com/photography/view_cart.php">Licensing</a>
</li>
<li>
<a href="http://pablofernandez.com">Contact</a>
</li>
<li>
<a href="http://pablofernandez.com/photography/view_cart.php" style="height: 55px;"><img src="http://22.uniflix.com/download.png" style="width: 40px;" /><a>
</li>
</div>
</ul>
</div><!-- end .span9 -->
</div><!-- end .row -->
</div><!-- end #nav -->
<!-- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
</div><!-- end #header -->
<body>
<div id="sidebar" style="display:none;">
<div id="jcart"><?php $jcart->display_cart();?></div>
</div>
<div class="container">
<div class="codrops-top clearfix">
<?php
function truncateString($str, $chars, $to_space, $replacement="") {
if($chars > strlen($str)) return $str;
$str = substr($str, 0, $chars);
$space_pos = strrpos($str, " ");
if($to_space && $space_pos >= 0) {
$str = substr($str, 0, strrpos($str, " "));
}
return($str . $replacement);
}
// GRAB DIRECTORY CONTENTS
$directory = "../";
$local = glob($directory . "*", GLOB_ONLYDIR);
$randDirect = $local[array_rand($local)];
// REMOVE RESTRICTED DIRECTORIES
while(($randDirect=="../admin-image-processing") || ($randDirect=="../cinematography") || ($randDirect=="../jcart") || ($randDirect=="../family-locked") || ($randDirect=="../non-published") || ($randDirect=="../original") || ($randDirect=="../large") || ($randDirect=="../thumbnails") || ($randDirect=="../nasa-internship-locked") || ($randDirect=="../high-school-locked") || ($randDirect=="../non-published"))
{
$randDirect = $local[array_rand($local)];
}
// REMOVE DIRECTORY IDENTIFIERS
$shortenDirect = explode("&",$randDirect);
$shortenDirect = $shortenDirect['0'];
$shortenDirect = str_replace("-", " ", $shortenDirect);
$shortenDirect = ucwords(strtolower($shortenDirect));
$shortenDirect = str_replace("../", " ", $shortenDirect);
?>
<a href="<?php echo $randDirect; ?>">
<strong>« Previous: </strong><?php echo $shortenDirect; ?>
</a>
<span class="right">
<!--<a href="#">Images by Pablo</a>-->
<?php
$directory = "../";
$local = glob($directory . "*", GLOB_ONLYDIR);
$randDirect = $local[array_rand($local)];
while(($randDirect=="../admin-image-processing") || ($randDirect=="../cinematography") || ($randDirect=="../jcart") || ($randDirect=="../family-locked") || ($randDirect=="../non-published") || ($randDirect=="../original") || ($randDirect=="../large") || ($randDirect=="../thumbnails") || ($randDirect=="../nasa-internship-locked") || ($randDirect=="../high-school-locked") || ($randDirect=="../non-published"))
{
$randDirect = $local[array_rand($local)];
}
$shortenDirect = explode("&",$randDirect);
$shortenDirect = $shortenDirect['0'];
$shortenDirect = str_replace("-", " ", $shortenDirect);
$shortenDirect = ucwords(strtolower($shortenDirect));
$shortenDirect = str_replace("../", " ", $shortenDirect);
?>
<a href="<?php echo $randDirect; ?>">
<strong>Next: </strong><?php echo $shortenDirect; ?> «
</a>
</span>
</div>
<div class="main">
<header class="clearfix">
<center><h1>
<?php
$PULL_TITLE = str_replace('/home/pablofernandez/public_html/', '', getcwd());
$PULL_TITLE = str_replace('photography/', '',$PULL_TITLE);
$PULL_DATE = substr($PULL_TITLE, strpos($PULL_TITLE, "date-") + 5);
$PULL_DATE = str_replace('Date', '',$PULL_DATE);
$PULL_TITLE = str_replace('-', ' ',$PULL_TITLE);
$PULL_DATE = str_replace('-', ' ',$PULL_DATE);
$PULL_TITLE = str_replace('&', ' - ',$PULL_TITLE);
$PULL_TITLE = str_replace($PULL_DATE, '',$PULL_TITLE);
$PULL_TITLE = ucwords($PULL_TITLE);
$PULL_DATE = ucfirst($PULL_DATE);
$PULL_TITLE = str_replace('Date', '',$PULL_TITLE);
$PULL_DATE = ucwords($PULL_DATE);
?>
<?php echo $PULL_TITLE; ?></h1></center>
<div class="support-note">
<span class="note-ie">Sorry, only modern browsers.</span>
</div>
<br><br><?php echo $PULL_DATE; ?>
</header>
<div class="gamma-container gamma-loading" id="gamma-container">
<ul class="gamma-gallery">
<?php
$files = glob("thumbnails/*.*");
shuffle($files);
$counter = "0";
for ($i=1; $i<count($files); $i++)
{
if($counter>="200") { } else {
$image = $files[$i];
$supported_file = array(
'gif',
'jpg',
'jpeg',
'png'
);
$ext = strtolower(pathinfo($image, PATHINFO_EXTENSION));
if (in_array($ext, $supported_file)) {
$counter ++;
?>
<li>
<div data-alt="img<?php echo $counter; ?>" data-description="<h3></h3>" data-max-width="1800" data-max-height="1350">
<div data-src="large/<?php echo $trimmed = trim($image, "thumbnails/"); ?>" data-min-width="1300"></div>
<div data-src="large/<?php echo $trimmed = trim($image, "thumbnails/"); ?>" data-min-width="1000"></div>
<div data-src="large/<?php echo $trimmed = trim($image, "thumbnails/"); ?>" data-min-width="700"></div>
<div data-src="large/<?php echo $trimmed = trim($image, "thumbnails/"); ?>" data-min-width="300"></div>
<div data-src="<?php echo $image; ?>" data-min-width="200"></div>
<div data-src="<?php echo $image; ?>" data-min-width="140"></div>
<div data-src="<?php echo $image; ?>"></div>
<noscript>
<img src="<?php echo $image; ?>" alt="img<?php echo $counter; ?>"/>
</noscript>
</div>
</li>
<?php
} else {
continue;
}
}
// ***************
}
?>
</ul>
<div class="gamma-overlay"></div>
<input id="tok" type="hidden" name="jcartToken" value="<?php echo $_SESSION['jcartToken'];?>" />
<div id="loadmore" class="loadmore" onclick="window.location='index.php';">Load more images...</div>
</div>
</div><!--/main-->
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://www.pablofernandez.com/photography/admin-image-processing/gallery/js/jquery.masonry.min.js"></script>
<script type="text/javascript" src="jcart/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="jcart/js/jcart.min.js"></script>
<script src="http://www.pablofernandez.com/photography/admin-image-processing/gallery/js/jquery.history.js"></script>
<script src="http://www.pablofernandez.com/photography/admin-image-processing/gallery/js/js-url.min.js"></script>
<script src="http://www.pablofernandez.com/photography/admin-image-processing/gallery/js/jquerypp.custom.js"></script>
<script src="http://www.pablofernandez.com/photography/admin-image-processing/gallery/js/gamma.js"></script>
<script type="text/javascript">
$(function() {
var GammaSettings = {
// order is important!
viewport : [ {
width : 1200,
columns : 5
}, {
width : 900,
columns : 4
}, {
width : 500,
columns : 3
}, {
width : 320,
columns : 2
}, {
width : 0,
columns : 2
} ]
};
Gamma.init( GammaSettings, fncallback );
// Example how to add more items (just a dummy):
var page = 0,
items = ['<li><div data-alt="img03" data-description="<h3>Sky high</h3>" data-max-width="1800" data-max-height="1350"><div data-src="images/xxxlarge/3.jpg" data-min-width="1300"></div><div data-src="images/xxlarge/3.jpg" data-min-width="1000"></div><div data-src="images/xlarge/3.jpg" data-min-width="700"></div><div data-src="images/large/3.jpg" data-min-width="300"></div><div data-src="images/medium/3.jpg" data-min-width="200"></div><div data-src="images/small/3.jpg" data-min-width="140"></div><div data-src="images/xsmall/3.jpg"></div><noscript><img src="images/xsmall/3.jpg" alt="img03"/></noscript></div></li><li><div data-alt="img03" data-description="<h3>Sky high</h3>" data-max-width="1800" data-max-height="1350"><div data-src="images/xxxlarge/3.jpg" data-min-width="1300"></div><div data-src="images/xxlarge/3.jpg" data-min-width="1000"></div><div data-src="images/xlarge/3.jpg" data-min-width="700"></div><div data-src="images/large/3.jpg" data-min-width="300"></div><div data-src="images/medium/3.jpg" data-min-width="200"></div><div data-src="images/small/3.jpg" data-min-width="140"></div><div data-src="images/xsmall/3.jpg"></div><noscript><img src="images/xsmall/3.jpg" alt="img03"/></noscript></div></li><li><div data-alt="img03" data-description="<h3>Sky high</h3>" data-max-width="1800" data-max-height="1350"><div data-src="images/xxxlarge/3.jpg" data-min-width="1300"></div><div data-src="images/xxlarge/3.jpg" data-min-width="1000"></div><div data-src="images/xlarge/3.jpg" data-min-width="700"></div><div data-src="images/large/3.jpg" data-min-width="300"></div><div data-src="images/medium/3.jpg" data-min-width="200"></div><div data-src="images/small/3.jpg" data-min-width="140"></div><div data-src="images/xsmall/3.jpg"></div><noscript><img src="images/xsmall/3.jpg" alt="img03"/></noscript></div></li><li><div data-alt="img03" data-description="<h3>Sky high</h3>" data-max-width="1800" data-max-height="1350"><div data-src="images/xxxlarge/3.jpg" data-min-width="1300"></div><div data-src="images/xxlarge/3.jpg" data-min-width="1000"></div><div data-src="images/xlarge/3.jpg" data-min-width="700"></div><div data-src="images/large/3.jpg" data-min-width="300"></div><div data-src="images/medium/3.jpg" data-min-width="200"></div><div data-src="images/small/3.jpg" data-min-width="140"></div><div data-src="images/xsmall/3.jpg"></div><noscript><img src="images/xsmall/3.jpg" alt="img03"/></noscript></div></li><li><div data-alt="img03" data-description="<h3>Sky high</h3>" data-max-width="1800" data-max-height="1350"><div data-src="images/xxxlarge/3.jpg" data-min-width="1300"></div><div data-src="images/xxlarge/3.jpg" data-min-width="1000"></div><div data-src="images/xlarge/3.jpg" data-min-width="700"></div><div data-src="images/large/3.jpg" data-min-width="300"></div><div data-src="images/medium/3.jpg" data-min-width="200"></div><div data-src="images/small/3.jpg" data-min-width="140"></div><div data-src="images/xsmall/3.jpg"></div><noscript><img src="images/xsmall/3.jpg" alt="img03"/></noscript></div></li>']
function fncallback() {
$( '#loadmore' ).show().on( 'click', function() {
++page;
var newitems = items[page-1]
if( page <= 1 ) {
Gamma.add( $( newitems ) );
}
if( page === 1 ) {
$( this ).remove();
}
} );
}
});
</script>
<script>
$(".gamma-description-wrapper img").ready(function(){
$(".gamma-options-single a").html('<br><div id="buyb"><strong>License Photograph</strong></div>');
$(".gamma-options-single a").attr("href","#");
//$(".gamma-options-single").append('<font color="white"><form method="post" action="" class="jcart"><fieldset><input type="hidden" name="jcartToken" value="'+token+'" /><input type="hidden" name="my-item-id" value="'+ x +'" /><input type="hidden" name="my-item-name" value="'+ cimg +'" /><input type="hidden" name="my-item-price" value="5.00" /><input type="hidden" name="my-item-url" value="" />License Price: $5.00<br><label> <input type="hidden" name="my-item-qty" value="1" size="3" /></label><center><input id="cartbutt" type="submit" name="my-add-button" value="add to cart" class="button" /></center></fieldset></form></font>');
});
</script>
<script>
$(document).ready(function(){
//$(".gamma-btn-close").click(function(){
var test=0;
//});
$( "#buyb" ).click(function() {
if(test==0){
var x = Math.floor((Math.random() * 1000) + 1);
var cimg = $('.gamma-single-view img').attr('src');
var token= $('#tok').val();
if (cimg === undefined){ alert("Page Loading. Please wait...");
}
else{
$(".gamma-description-wrapper .gamma-description").append('<font color="white"><form method="post" action="" class="jcart"><fieldset><input type="hidden" name="jcartToken" value="'+token+'" /><input type="hidden" name="my-item-id" value="'+ x +'" /><input type="hidden" name="my-item-name" value="'+ cimg +'" /><input type="hidden" name="my-item-price" value="5.00" /><input type="hidden" name="my-item-url" value="" />License Price: $5.00<label><br> <input type="hidden" name="my-item-qty" value="1" size="3" /></label></li></ul><center><input id="cartbutt" type="submit" name="my-add-button" value=" Add To Cart " class="button" /></center></fieldset></form></font>');
//test=1;
}
}
});
});
</script>
<script>/*
$(document).ready(function(){
$(".gamma-btn-close").click(function(){
window.location="index.php";
});
});*/
</script>
</body>
</html>