Version Description
- Updated all PHP code within the plugin to meet the WordPress.org security and coding standards.
Download this release
Release Info
Developer | simonpedge |
Plugin | Slide Anything – Responsive Content / HTML Slider and Carousel |
Version | 2.4.0 |
Comparing to | |
See all releases |
Code changes from version 2.3.47 to 2.4.0
- css/slide-anything-admin.css +13 -0
- php/single-page.php +25 -21
- php/slide-anything-admin.php +3721 -3381
- php/slide-anything-frontend.php +1241 -1322
- readme.txt +6 -0
- slide-anything.php +49 -44
css/slide-anything-admin.css
CHANGED
@@ -63,6 +63,7 @@
|
|
63 |
#sa_slider_settings .jquery_ui_slider {
|
64 |
margin:0px 5px 5px !important;
|
65 |
background-color:#007fff !important;
|
|
|
66 |
border-radius:0px !important;
|
67 |
}
|
68 |
#sa_slider_settings .jquery_ui_slider .ui-slider-handle {
|
@@ -663,6 +664,12 @@ input.sa_slide_popup_imagetitle:-ms-input-placeholder { color:#c0c0c0 !important
|
|
663 |
font-size:13px !important;
|
664 |
line-height:26px !important;
|
665 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
666 |
.html_popup_wrapper .slide_popup_settings_line em,
|
667 |
.html_popup_wrapper .slide_popup_settings_line strong {
|
668 |
display: inline-block;
|
@@ -1339,6 +1346,12 @@ input.sa_slide_popup_imagetitle:-ms-input-placeholder { color:#c0c0c0 !important
|
|
1339 |
font-weight:600;
|
1340 |
line-height:18px;
|
1341 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1342 |
#sa_thumbs_settings .sa_thumbs_line input[type=text] {
|
1343 |
box-sizing:border-box !important;
|
1344 |
height:auto !important;
|
63 |
#sa_slider_settings .jquery_ui_slider {
|
64 |
margin:0px 5px 5px !important;
|
65 |
background-color:#007fff !important;
|
66 |
+
border-width:0px !important;
|
67 |
border-radius:0px !important;
|
68 |
}
|
69 |
#sa_slider_settings .jquery_ui_slider .ui-slider-handle {
|
664 |
font-size:13px !important;
|
665 |
line-height:26px !important;
|
666 |
}
|
667 |
+
.html_popup_wrapper .slide_popup_settings_line a span {
|
668 |
+
position:relative !important;
|
669 |
+
top:0px !important;
|
670 |
+
left:0px !important;
|
671 |
+
margin:-2px 0px 0px !important;
|
672 |
+
}
|
673 |
.html_popup_wrapper .slide_popup_settings_line em,
|
674 |
.html_popup_wrapper .slide_popup_settings_line strong {
|
675 |
display: inline-block;
|
1346 |
font-weight:600;
|
1347 |
line-height:18px;
|
1348 |
}
|
1349 |
+
#cpt_slider_thumbs .ui-spinner a.ui-button span {
|
1350 |
+
position:relative !important;
|
1351 |
+
top:0px !important;
|
1352 |
+
left:0px !important;
|
1353 |
+
margin:-2px 0px 0px !important;
|
1354 |
+
}
|
1355 |
#sa_thumbs_settings .sa_thumbs_line input[type=text] {
|
1356 |
box-sizing:border-box !important;
|
1357 |
height:auto !important;
|
php/single-page.php
CHANGED
@@ -1,22 +1,26 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Template Name: Slide Anything Preview Page
|
4 |
-
* This template will only display the page content (and no header, footer or sidebar)
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
11 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
12 |
-
<?php wp_head(); ?>
|
13 |
-
</head>
|
14 |
-
<body class="cleanpage">
|
15 |
-
<?php
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
</
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template Name: Slide Anything Preview Page
|
4 |
+
* This template will only display the page content (and no header, footer or sidebar)
|
5 |
+
*
|
6 |
+
* @package WordPress_Slide_Anything
|
7 |
+
*/
|
8 |
+
|
9 |
+
?>
|
10 |
+
<!DOCTYPE html>
|
11 |
+
<html <?php language_attributes(); ?>>
|
12 |
+
<head>
|
13 |
+
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
14 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
15 |
+
<?php wp_head(); ?>
|
16 |
+
</head>
|
17 |
+
<body class="cleanpage">
|
18 |
+
<?php
|
19 |
+
while ( have_posts() ) :
|
20 |
+
the_post();
|
21 |
+
the_content();
|
22 |
+
endwhile;
|
23 |
+
?>
|
24 |
+
<?php wp_footer(); ?>
|
25 |
+
</body>
|
26 |
+
</html>
|
php/slide-anything-admin.php
CHANGED
@@ -1,3381 +1,3721 @@
|
|
1 |
-
<?php
|
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 |
-
} elseif ($i
|
42 |
-
$color =
|
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 |
-
update_post_meta($cpt_id, '
|
86 |
-
update_post_meta($cpt_id, '
|
87 |
-
update_post_meta($cpt_id, '
|
88 |
-
update_post_meta($cpt_id, '
|
89 |
-
update_post_meta($cpt_id, '
|
90 |
-
update_post_meta($cpt_id, '
|
91 |
-
update_post_meta($cpt_id, '
|
92 |
-
update_post_meta($cpt_id, '
|
93 |
-
update_post_meta($cpt_id, '
|
94 |
-
update_post_meta($cpt_id, '
|
95 |
-
update_post_meta($cpt_id, '
|
96 |
-
update_post_meta($cpt_id, '
|
97 |
-
update_post_meta($cpt_id, '
|
98 |
-
update_post_meta($cpt_id, '
|
99 |
-
update_post_meta($cpt_id, '
|
100 |
-
update_post_meta($cpt_id, '
|
101 |
-
update_post_meta($cpt_id, '
|
102 |
-
update_post_meta($cpt_id, '
|
103 |
-
update_post_meta($cpt_id, '
|
104 |
-
update_post_meta($cpt_id, '
|
105 |
-
update_post_meta($cpt_id, '
|
106 |
-
update_post_meta($cpt_id, '
|
107 |
-
update_post_meta($cpt_id, '
|
108 |
-
update_post_meta($cpt_id, '
|
109 |
-
update_post_meta($cpt_id, '
|
110 |
-
update_post_meta($cpt_id, '
|
111 |
-
update_post_meta($cpt_id, '
|
112 |
-
update_post_meta($cpt_id, '
|
113 |
-
update_post_meta($cpt_id, '
|
114 |
-
update_post_meta($cpt_id, '
|
115 |
-
update_post_meta($cpt_id, '
|
116 |
-
update_post_meta($cpt_id, '
|
117 |
-
update_post_meta($cpt_id, '
|
118 |
-
update_post_meta($cpt_id, '
|
119 |
-
update_post_meta($cpt_id, '
|
120 |
-
update_post_meta($cpt_id, '
|
121 |
-
update_post_meta($cpt_id, '
|
122 |
-
update_post_meta($cpt_id, '
|
123 |
-
update_post_meta($cpt_id, '
|
124 |
-
update_post_meta($cpt_id, '
|
125 |
-
update_post_meta($cpt_id, '
|
126 |
-
update_post_meta($cpt_id, '
|
127 |
-
update_post_meta($cpt_id, '
|
128 |
-
update_post_meta($cpt_id, '
|
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 |
-
echo "
|
164 |
-
echo "
|
165 |
-
|
166 |
-
echo "<p style='margin:0px !important;'>
|
167 |
-
echo
|
168 |
-
echo
|
169 |
-
|
170 |
-
echo "<a href='https://edgewebpages.com/
|
171 |
-
|
172 |
-
echo
|
173 |
-
echo
|
174 |
-
|
175 |
-
echo "<
|
176 |
-
|
177 |
-
echo
|
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 |
-
return $
|
404 |
-
}
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
echo
|
428 |
-
}
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
}
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
}
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
}
|
457 |
-
if
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
$
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
echo "<
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
echo "<
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
echo "<input type='
|
621 |
-
}
|
622 |
-
|
623 |
-
echo "
|
624 |
-
//
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
echo "<
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
echo "<
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
echo "<div class='
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
}
|
663 |
-
echo "<
|
664 |
-
echo "</
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
echo "<input type='checkbox' id='
|
689 |
-
}
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
echo "<input type='checkbox' id='
|
702 |
-
}
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
echo "<input type='checkbox' id='
|
715 |
-
}
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
echo "<input type='checkbox' id='
|
728 |
-
}
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
echo "<input type='checkbox' id='
|
741 |
-
}
|
742 |
-
|
743 |
-
|
744 |
-
echo "
|
745 |
-
echo "
|
746 |
-
echo "</div>\n";
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
$
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
$
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
$
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
$
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
$
|
894 |
-
$
|
895 |
-
$
|
896 |
-
$
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
$
|
921 |
-
|
922 |
-
|
923 |
-
$
|
924 |
-
|
925 |
-
$
|
926 |
-
|
927 |
-
|
928 |
-
$
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
//
|
964 |
-
$
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
$
|
969 |
-
$
|
970 |
-
$
|
971 |
-
$
|
972 |
-
|
973 |
-
$
|
974 |
-
$
|
975 |
-
$
|
976 |
-
$
|
977 |
-
$
|
978 |
-
|
979 |
-
|
980 |
-
$
|
981 |
-
|
982 |
-
|
983 |
-
$
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
$
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
}
|
1013 |
-
}
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
echo "<div class='
|
1068 |
-
echo "<
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
}
|
1108 |
-
|
1109 |
-
echo "
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
$
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
//
|
1146 |
-
$
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
echo "</
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
$option_arr[
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
$
|
1240 |
-
|
1241 |
-
|
1242 |
-
echo "<
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
echo "</
|
1304 |
-
|
1305 |
-
|
1306 |
-
echo "
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
if ($slide_popup_type
|
1328 |
-
|
1329 |
-
}
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
//
|
1341 |
-
echo "<div
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
echo
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
echo "<
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
}
|
1417 |
-
echo "
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
echo "<
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
echo "
|
1430 |
-
|
1431 |
-
echo "
|
1432 |
-
echo "
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
echo "
|
1438 |
-
echo "
|
1439 |
-
echo "
|
1440 |
-
|
1441 |
-
echo "
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
//
|
1446 |
-
echo "<
|
1447 |
-
echo "
|
1448 |
-
echo "
|
1449 |
-
|
1450 |
-
echo "<
|
1451 |
-
echo
|
1452 |
-
|
1453 |
-
echo "<
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
echo "
|
1458 |
-
echo "</div>\n";
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
echo "<div
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
}
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
);
|
1562 |
-
|
1563 |
-
if (
|
1564 |
-
$
|
1565 |
-
}
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
echo "<div
|
1576 |
-
echo
|
1577 |
-
echo "<
|
1578 |
-
echo "
|
1579 |
-
echo "
|
1580 |
-
|
1581 |
-
echo "</div>\n";
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
echo "<
|
1635 |
-
}
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
echo "
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
echo "</
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
$
|
1674 |
-
|
1675 |
-
|
1676 |
-
$
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
$
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
echo "<div id='
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
$
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
if ($
|
1770 |
-
|
1771 |
-
}
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
echo "<
|
1783 |
-
}
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
if ($
|
1790 |
-
|
1791 |
-
}
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
echo "<
|
1803 |
-
}
|
1804 |
-
|
1805 |
-
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
if ($
|
1810 |
-
|
1811 |
-
}
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
}
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
$
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
echo "<
|
1849 |
-
echo "<
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
echo
|
1871 |
-
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
|
1880 |
-
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
echo "<
|
1887 |
-
|
1888 |
-
echo "<
|
1889 |
-
}
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
|
1913 |
-
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
1923 |
-
|
1924 |
-
|
1925 |
-
|
1926 |
-
|
1927 |
-
|
1928 |
-
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
1937 |
-
|
1938 |
-
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
echo "<
|
1953 |
-
echo "<input type='
|
1954 |
-
echo "<
|
1955 |
-
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
echo "<
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
echo "<
|
1978 |
-
echo "<
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
echo
|
1988 |
-
echo "<
|
1989 |
-
echo
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
echo "<div
|
2010 |
-
echo "<
|
2011 |
-
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
-
|
2021 |
-
$
|
2022 |
-
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
echo "<
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
echo "<
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
2089 |
-
$
|
2090 |
-
|
2091 |
-
|
2092 |
-
|
2093 |
-
|
2094 |
-
|
2095 |
-
|
2096 |
-
|
2097 |
-
|
2098 |
-
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
2120 |
-
|
2121 |
-
|
2122 |
-
|
2123 |
-
|
2124 |
-
|
2125 |
-
|
2126 |
-
|
2127 |
-
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
} else {
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
-
}
|
2140 |
-
|
2141 |
-
if (
|
2142 |
-
$
|
2143 |
-
|
2144 |
-
|
2145 |
-
|
2146 |
-
|
2147 |
-
|
2148 |
-
$
|
2149 |
-
|
2150 |
-
|
2151 |
-
|
2152 |
-
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
2156 |
-
|
2157 |
-
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
$tooltip =
|
2168 |
-
|
2169 |
-
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
|
2176 |
-
|
2177 |
-
echo "
|
2178 |
-
|
2179 |
-
|
2180 |
-
|
2181 |
-
$
|
2182 |
-
|
2183 |
-
|
2184 |
-
|
2185 |
-
|
2186 |
-
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
|
2191 |
-
|
2192 |
-
//
|
2193 |
-
|
2194 |
-
|
2195 |
-
|
2196 |
-
|
2197 |
-
echo "<
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
|
2222 |
-
echo "<div class='
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
echo "<
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
echo "
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
}
|
2251 |
-
echo "</
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
}
|
2276 |
-
|
2277 |
-
|
2278 |
-
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
$
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
-
$
|
2288 |
-
}
|
2289 |
-
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
-
|
2294 |
-
|
2295 |
-
|
2296 |
-
|
2297 |
-
|
2298 |
-
|
2299 |
-
|
2300 |
-
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
|
2310 |
-
|
2311 |
-
}
|
2312 |
-
|
2313 |
-
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
//
|
2321 |
-
|
2322 |
-
$
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
2342 |
-
|
2343 |
-
|
2344 |
-
|
2345 |
-
|
2346 |
-
|
2347 |
-
|
2348 |
-
|
2349 |
-
|
2350 |
-
|
2351 |
-
|
2352 |
-
|
2353 |
-
|
2354 |
-
|
2355 |
-
|
2356 |
-
|
2357 |
-
|
2358 |
-
|
2359 |
-
|
2360 |
-
|
2361 |
-
|
2362 |
-
|
2363 |
-
|
2364 |
-
|
2365 |
-
|
2366 |
-
|
2367 |
-
|
2368 |
-
|
2369 |
-
echo "<
|
2370 |
-
|
2371 |
-
|
2372 |
-
|
2373 |
-
|
2374 |
-
|
2375 |
-
|
2376 |
-
|
2377 |
-
|
2378 |
-
|
2379 |
-
|
2380 |
-
|
2381 |
-
|
2382 |
-
|
2383 |
-
|
2384 |
-
|
2385 |
-
|
2386 |
-
|
2387 |
-
|
2388 |
-
|
2389 |
-
|
2390 |
-
|
2391 |
-
echo "<
|
2392 |
-
|
2393 |
-
|
2394 |
-
|
2395 |
-
|
2396 |
-
|
2397 |
-
|
2398 |
-
|
2399 |
-
|
2400 |
-
|
2401 |
-
|
2402 |
-
|
2403 |
-
|
2404 |
-
|
2405 |
-
|
2406 |
-
|
2407 |
-
echo "<
|
2408 |
-
|
2409 |
-
|
2410 |
-
|
2411 |
-
|
2412 |
-
|
2413 |
-
|
2414 |
-
|
2415 |
-
|
2416 |
-
echo "
|
2417 |
-
|
2418 |
-
|
2419 |
-
|
2420 |
-
|
2421 |
-
|
2422 |
-
|
2423 |
-
|
2424 |
-
|
2425 |
-
|
2426 |
-
|
2427 |
-
|
2428 |
-
|
2429 |
-
|
2430 |
-
|
2431 |
-
|
2432 |
-
$
|
2433 |
-
}
|
2434 |
-
|
2435 |
-
|
2436 |
-
|
2437 |
-
|
2438 |
-
|
2439 |
-
|
2440 |
-
|
2441 |
-
|
2442 |
-
|
2443 |
-
|
2444 |
-
|
2445 |
-
|
2446 |
-
|
2447 |
-
|
2448 |
-
|
2449 |
-
|
2450 |
-
|
2451 |
-
|
2452 |
-
|
2453 |
-
}
|
2454 |
-
|
2455 |
-
|
2456 |
-
|
2457 |
-
|
2458 |
-
|
2459 |
-
|
2460 |
-
|
2461 |
-
|
2462 |
-
|
2463 |
-
|
2464 |
-
|
2465 |
-
|
2466 |
-
|
2467 |
-
|
2468 |
-
|
2469 |
-
|
2470 |
-
|
2471 |
-
|
2472 |
-
|
2473 |
-
|
2474 |
-
|
2475 |
-
|
2476 |
-
|
2477 |
-
|
2478 |
-
|
2479 |
-
|
2480 |
-
|
2481 |
-
|
2482 |
-
|
2483 |
-
|
2484 |
-
|
2485 |
-
|
2486 |
-
|
2487 |
-
|
2488 |
-
|
2489 |
-
}
|
2490 |
-
|
2491 |
-
|
2492 |
-
|
2493 |
-
|
2494 |
-
|
2495 |
-
|
2496 |
-
|
2497 |
-
|
2498 |
-
|
2499 |
-
|
2500 |
-
|
2501 |
-
|
2502 |
-
|
2503 |
-
|
2504 |
-
|
2505 |
-
|
2506 |
-
|
2507 |
-
|
2508 |
-
|
2509 |
-
|
2510 |
-
|
2511 |
-
|
2512 |
-
|
2513 |
-
|
2514 |
-
|
2515 |
-
|
2516 |
-
|
2517 |
-
|
2518 |
-
|
2519 |
-
|
2520 |
-
|
2521 |
-
|
2522 |
-
|
2523 |
-
$
|
2524 |
-
$
|
2525 |
-
|
2526 |
-
|
2527 |
-
|
2528 |
-
|
2529 |
-
|
2530 |
-
|
2531 |
-
|
2532 |
-
|
2533 |
-
|
2534 |
-
|
2535 |
-
|
2536 |
-
|
2537 |
-
$
|
2538 |
-
}
|
2539 |
-
|
2540 |
-
|
2541 |
-
|
2542 |
-
|
2543 |
-
|
2544 |
-
|
2545 |
-
|
2546 |
-
|
2547 |
-
|
2548 |
-
|
2549 |
-
|
2550 |
-
|
2551 |
-
|
2552 |
-
|
2553 |
-
|
2554 |
-
$
|
2555 |
-
|
2556 |
-
|
2557 |
-
|
2558 |
-
|
2559 |
-
|
2560 |
-
|
2561 |
-
|
2562 |
-
|
2563 |
-
|
2564 |
-
|
2565 |
-
|
2566 |
-
|
2567 |
-
|
2568 |
-
|
2569 |
-
|
2570 |
-
|
2571 |
-
|
2572 |
-
$
|
2573 |
-
|
2574 |
-
|
2575 |
-
|
2576 |
-
|
2577 |
-
|
2578 |
-
|
2579 |
-
|
2580 |
-
|
2581 |
-
|
2582 |
-
|
2583 |
-
|
2584 |
-
|
2585 |
-
|
2586 |
-
|
2587 |
-
|
2588 |
-
|
2589 |
-
|
2590 |
-
|
2591 |
-
|
2592 |
-
|
2593 |
-
|
2594 |
-
|
2595 |
-
|
2596 |
-
|
2597 |
-
|
2598 |
-
|
2599 |
-
|
2600 |
-
|
2601 |
-
|
2602 |
-
|
2603 |
-
|
2604 |
-
|
2605 |
-
|
2606 |
-
|
2607 |
-
|
2608 |
-
|
2609 |
-
|
2610 |
-
|
2611 |
-
|
2612 |
-
|
2613 |
-
|
2614 |
-
|
2615 |
-
|
2616 |
-
|
2617 |
-
|
2618 |
-
|
2619 |
-
|
2620 |
-
|
2621 |
-
|
2622 |
-
|
2623 |
-
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
-
|
2629 |
-
|
2630 |
-
|
2631 |
-
|
2632 |
-
|
2633 |
-
|
2634 |
-
|
2635 |
-
|
2636 |
-
|
2637 |
-
|
2638 |
-
|
2639 |
-
|
2640 |
-
|
2641 |
-
|
2642 |
-
|
2643 |
-
|
2644 |
-
|
2645 |
-
|
2646 |
-
|
2647 |
-
|
2648 |
-
|
2649 |
-
|
2650 |
-
|
2651 |
-
|
2652 |
-
|
2653 |
-
|
2654 |
-
|
2655 |
-
|
2656 |
-
|
2657 |
-
|
2658 |
-
|
2659 |
-
|
2660 |
-
|
2661 |
-
|
2662 |
-
|
2663 |
-
|
2664 |
-
|
2665 |
-
|
2666 |
-
|
2667 |
-
|
2668 |
-
|
2669 |
-
|
2670 |
-
|
2671 |
-
|
2672 |
-
|
2673 |
-
|
2674 |
-
|
2675 |
-
|
2676 |
-
|
2677 |
-
|
2678 |
-
|
2679 |
-
|
2680 |
-
|
2681 |
-
|
2682 |
-
|
2683 |
-
|
2684 |
-
|
2685 |
-
|
2686 |
-
|
2687 |
-
|
2688 |
-
|
2689 |
-
$
|
2690 |
-
|
2691 |
-
$
|
2692 |
-
|
2693 |
-
|
2694 |
-
|
2695 |
-
$
|
2696 |
-
|
2697 |
-
|
2698 |
-
$
|
2699 |
-
|
2700 |
-
|
2701 |
-
|
2702 |
-
|
2703 |
-
|
2704 |
-
|
2705 |
-
|
2706 |
-
|
2707 |
-
|
2708 |
-
|
2709 |
-
|
2710 |
-
|
2711 |
-
$
|
2712 |
-
|
2713 |
-
|
2714 |
-
|
2715 |
-
|
2716 |
-
|
2717 |
-
|
2718 |
-
|
2719 |
-
|
2720 |
-
|
2721 |
-
|
2722 |
-
|
2723 |
-
|
2724 |
-
|
2725 |
-
|
2726 |
-
|
2727 |
-
|
2728 |
-
|
2729 |
-
|
2730 |
-
|
2731 |
-
|
2732 |
-
|
2733 |
-
|
2734 |
-
|
2735 |
-
|
2736 |
-
|
2737 |
-
|
2738 |
-
|
2739 |
-
|
2740 |
-
|
2741 |
-
|
2742 |
-
|
2743 |
-
|
2744 |
-
$
|
2745 |
-
|
2746 |
-
|
2747 |
-
|
2748 |
-
if ($
|
2749 |
-
|
2750 |
-
|
2751 |
-
|
2752 |
-
|
2753 |
-
|
2754 |
-
|
2755 |
-
|
2756 |
-
|
2757 |
-
|
2758 |
-
|
2759 |
-
}
|
2760 |
-
|
2761 |
-
|
2762 |
-
|
2763 |
-
|
2764 |
-
|
2765 |
-
|
2766 |
-
|
2767 |
-
|
2768 |
-
|
2769 |
-
|
2770 |
-
|
2771 |
-
|
2772 |
-
|
2773 |
-
|
2774 |
-
|
2775 |
-
|
2776 |
-
|
2777 |
-
|
2778 |
-
|
2779 |
-
|
2780 |
-
|
2781 |
-
|
2782 |
-
|
2783 |
-
|
2784 |
-
|
2785 |
-
|
2786 |
-
|
2787 |
-
|
2788 |
-
|
2789 |
-
|
2790 |
-
|
2791 |
-
|
2792 |
-
|
2793 |
-
|
2794 |
-
|
2795 |
-
|
2796 |
-
|
2797 |
-
|
2798 |
-
|
2799 |
-
|
2800 |
-
|
2801 |
-
|
2802 |
-
|
2803 |
-
|
2804 |
-
|
2805 |
-
|
2806 |
-
|
2807 |
-
|
2808 |
-
|
2809 |
-
|
2810 |
-
|
2811 |
-
|
2812 |
-
|
2813 |
-
|
2814 |
-
|
2815 |
-
|
2816 |
-
|
2817 |
-
|
2818 |
-
|
2819 |
-
|
2820 |
-
|
2821 |
-
|
2822 |
-
|
2823 |
-
|
2824 |
-
|
2825 |
-
|
2826 |
-
|
2827 |
-
|
2828 |
-
|
2829 |
-
|
2830 |
-
|
2831 |
-
|
2832 |
-
|
2833 |
-
|
2834 |
-
|
2835 |
-
|
2836 |
-
|
2837 |
-
|
2838 |
-
|
2839 |
-
|
2840 |
-
|
2841 |
-
|
2842 |
-
|
2843 |
-
|
2844 |
-
|
2845 |
-
|
2846 |
-
|
2847 |
-
|
2848 |
-
|
2849 |
-
|
2850 |
-
|
2851 |
-
|
2852 |
-
|
2853 |
-
|
2854 |
-
|
2855 |
-
|
2856 |
-
|
2857 |
-
|
2858 |
-
|
2859 |
-
|
2860 |
-
|
2861 |
-
|
2862 |
-
|
2863 |
-
|
2864 |
-
|
2865 |
-
|
2866 |
-
|
2867 |
-
|
2868 |
-
|
2869 |
-
|
2870 |
-
|
2871 |
-
|
2872 |
-
|
2873 |
-
|
2874 |
-
|
2875 |
-
|
2876 |
-
|
2877 |
-
|
2878 |
-
|
2879 |
-
|
2880 |
-
|
2881 |
-
|
2882 |
-
|
2883 |
-
|
2884 |
-
|
2885 |
-
|
2886 |
-
|
2887 |
-
|
2888 |
-
|
2889 |
-
|
2890 |
-
|
2891 |
-
|
2892 |
-
|
2893 |
-
|
2894 |
-
|
2895 |
-
|
2896 |
-
|
2897 |
-
|
2898 |
-
|
2899 |
-
|
2900 |
-
|
2901 |
-
|
2902 |
-
|
2903 |
-
|
2904 |
-
|
2905 |
-
|
2906 |
-
|
2907 |
-
|
2908 |
-
|
2909 |
-
|
2910 |
-
|
2911 |
-
|
2912 |
-
|
2913 |
-
|
2914 |
-
|
2915 |
-
|
2916 |
-
|
2917 |
-
|
2918 |
-
|
2919 |
-
|
2920 |
-
|
2921 |
-
|
2922 |
-
|
2923 |
-
|
2924 |
-
|
2925 |
-
|
2926 |
-
|
2927 |
-
|
2928 |
-
|
2929 |
-
|
2930 |
-
|
2931 |
-
|
2932 |
-
|
2933 |
-
|
2934 |
-
|
2935 |
-
|
2936 |
-
|
2937 |
-
|
2938 |
-
|
2939 |
-
|
2940 |
-
|
2941 |
-
|
2942 |
-
|
2943 |
-
|
2944 |
-
|
2945 |
-
|
2946 |
-
|
2947 |
-
|
2948 |
-
|
2949 |
-
|
2950 |
-
|
2951 |
-
|
2952 |
-
|
2953 |
-
|
2954 |
-
|
2955 |
-
|
2956 |
-
|
2957 |
-
|
2958 |
-
|
2959 |
-
|
2960 |
-
|
2961 |
-
|
2962 |
-
|
2963 |
-
|
2964 |
-
|
2965 |
-
|
2966 |
-
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
|
2972 |
-
|
2973 |
-
|
2974 |
-
|
2975 |
-
|
2976 |
-
|
2977 |
-
|
2978 |
-
|
2979 |
-
|
2980 |
-
|
2981 |
-
|
2982 |
-
|
2983 |
-
|
2984 |
-
|
2985 |
-
|
2986 |
-
|
2987 |
-
|
2988 |
-
|
2989 |
-
|
2990 |
-
|
2991 |
-
|
2992 |
-
|
2993 |
-
|
2994 |
-
|
2995 |
-
|
2996 |
-
|
2997 |
-
|
2998 |
-
|
2999 |
-
|
3000 |
-
|
3001 |
-
|
3002 |
-
|
3003 |
-
|
3004 |
-
|
3005 |
-
|
3006 |
-
|
3007 |
-
|
3008 |
-
|
3009 |
-
|
3010 |
-
|
3011 |
-
|
3012 |
-
|
3013 |
-
|
3014 |
-
|
3015 |
-
|
3016 |
-
|
3017 |
-
|
3018 |
-
|
3019 |
-
|
3020 |
-
|
3021 |
-
|
3022 |
-
|
3023 |
-
|
3024 |
-
|
3025 |
-
|
3026 |
-
|
3027 |
-
|
3028 |
-
|
3029 |
-
|
3030 |
-
|
3031 |
-
|
3032 |
-
|
3033 |
-
|
3034 |
-
|
3035 |
-
|
3036 |
-
|
3037 |
-
|
3038 |
-
|
3039 |
-
|
3040 |
-
|
3041 |
-
|
3042 |
-
|
3043 |
-
|
3044 |
-
|
3045 |
-
|
3046 |
-
|
3047 |
-
|
3048 |
-
|
3049 |
-
'
|
3050 |
-
|
3051 |
-
'
|
3052 |
-
|
3053 |
-
|
3054 |
-
|
3055 |
-
|
3056 |
-
|
3057 |
-
|
3058 |
-
|
3059 |
-
|
3060 |
-
|
3061 |
-
|
3062 |
-
|
3063 |
-
|
3064 |
-
|
3065 |
-
|
3066 |
-
|
3067 |
-
$
|
3068 |
-
|
3069 |
-
|
3070 |
-
|
3071 |
-
$
|
3072 |
-
$
|
3073 |
-
|
3074 |
-
|
3075 |
-
|
3076 |
-
|
3077 |
-
);
|
3078 |
-
|
3079 |
-
|
3080 |
-
|
3081 |
-
|
3082 |
-
|
3083 |
-
|
3084 |
-
|
3085 |
-
|
3086 |
-
|
3087 |
-
|
3088 |
-
|
3089 |
-
|
3090 |
-
}
|
3091 |
-
|
3092 |
-
|
3093 |
-
|
3094 |
-
|
3095 |
-
|
3096 |
-
|
3097 |
-
|
3098 |
-
|
3099 |
-
|
3100 |
-
|
3101 |
-
|
3102 |
-
|
3103 |
-
|
3104 |
-
|
3105 |
-
|
3106 |
-
|
3107 |
-
|
3108 |
-
|
3109 |
-
|
3110 |
-
|
3111 |
-
|
3112 |
-
|
3113 |
-
|
3114 |
-
'
|
3115 |
-
|
3116 |
-
}
|
3117 |
-
|
3118 |
-
|
3119 |
-
|
3120 |
-
|
3121 |
-
|
3122 |
-
|
3123 |
-
|
3124 |
-
|
3125 |
-
|
3126 |
-
|
3127 |
-
|
3128 |
-
|
3129 |
-
|
3130 |
-
|
3131 |
-
if (isset($_POST['
|
3132 |
-
|
3133 |
-
|
3134 |
-
$
|
3135 |
-
|
3136 |
-
|
3137 |
-
|
3138 |
-
|
3139 |
-
$
|
3140 |
-
|
3141 |
-
|
3142 |
-
|
3143 |
-
|
3144 |
-
|
3145 |
-
|
3146 |
-
|
3147 |
-
|
3148 |
-
|
3149 |
-
|
3150 |
-
|
3151 |
-
|
3152 |
-
$
|
3153 |
-
|
3154 |
-
|
3155 |
-
|
3156 |
-
|
3157 |
-
|
3158 |
-
|
3159 |
-
|
3160 |
-
|
3161 |
-
|
3162 |
-
|
3163 |
-
|
3164 |
-
|
3165 |
-
|
3166 |
-
|
3167 |
-
|
3168 |
-
|
3169 |
-
|
3170 |
-
|
3171 |
-
|
3172 |
-
|
3173 |
-
|
3174 |
-
|
3175 |
-
|
3176 |
-
|
3177 |
-
|
3178 |
-
|
3179 |
-
|
3180 |
-
|
3181 |
-
|
3182 |
-
|
3183 |
-
|
3184 |
-
|
3185 |
-
|
3186 |
-
|
3187 |
-
|
3188 |
-
|
3189 |
-
|
3190 |
-
|
3191 |
-
|
3192 |
-
|
3193 |
-
|
3194 |
-
|
3195 |
-
|
3196 |
-
|
3197 |
-
|
3198 |
-
|
3199 |
-
|
3200 |
-
|
3201 |
-
|
3202 |
-
|
3203 |
-
|
3204 |
-
|
3205 |
-
|
3206 |
-
|
3207 |
-
|
3208 |
-
|
3209 |
-
|
3210 |
-
|
3211 |
-
|
3212 |
-
|
3213 |
-
|
3214 |
-
|
3215 |
-
|
3216 |
-
|
3217 |
-
|
3218 |
-
|
3219 |
-
|
3220 |
-
|
3221 |
-
|
3222 |
-
|
3223 |
-
|
3224 |
-
|
3225 |
-
|
3226 |
-
|
3227 |
-
|
3228 |
-
|
3229 |
-
}
|
3230 |
-
|
3231 |
-
|
3232 |
-
$
|
3233 |
-
|
3234 |
-
|
3235 |
-
if (
|
3236 |
-
$
|
3237 |
-
}
|
3238 |
-
|
3239 |
-
|
3240 |
-
|
3241 |
-
|
3242 |
-
|
3243 |
-
|
3244 |
-
|
3245 |
-
|
3246 |
-
|
3247 |
-
|
3248 |
-
|
3249 |
-
|
3250 |
-
|
3251 |
-
|
3252 |
-
|
3253 |
-
|
3254 |
-
|
3255 |
-
|
3256 |
-
|
3257 |
-
|
3258 |
-
|
3259 |
-
|
3260 |
-
|
3261 |
-
|
3262 |
-
|
3263 |
-
|
3264 |
-
|
3265 |
-
|
3266 |
-
|
3267 |
-
|
3268 |
-
|
3269 |
-
|
3270 |
-
|
3271 |
-
|
3272 |
-
|
3273 |
-
|
3274 |
-
|
3275 |
-
|
3276 |
-
|
3277 |
-
|
3278 |
-
|
3279 |
-
|
3280 |
-
|
3281 |
-
|
3282 |
-
|
3283 |
-
|
3284 |
-
|
3285 |
-
|
3286 |
-
|
3287 |
-
|
3288 |
-
|
3289 |
-
|
3290 |
-
|
3291 |
-
|
3292 |
-
|
3293 |
-
|
3294 |
-
}
|
3295 |
-
|
3296 |
-
|
3297 |
-
|
3298 |
-
|
3299 |
-
|
3300 |
-
|
3301 |
-
|
3302 |
-
|
3303 |
-
|
3304 |
-
|
3305 |
-
$
|
3306 |
-
'
|
3307 |
-
|
3308 |
-
'
|
3309 |
-
|
3310 |
-
|
3311 |
-
|
3312 |
-
|
3313 |
-
|
3314 |
-
|
3315 |
-
|
3316 |
-
|
3317 |
-
|
3318 |
-
|
3319 |
-
|
3320 |
-
}
|
3321 |
-
|
3322 |
-
|
3323 |
-
|
3324 |
-
|
3325 |
-
|
3326 |
-
|
3327 |
-
|
3328 |
-
|
3329 |
-
|
3330 |
-
|
3331 |
-
|
3332 |
-
|
3333 |
-
|
3334 |
-
|
3335 |
-
|
3336 |
-
|
3337 |
-
|
3338 |
-
|
3339 |
-
|
3340 |
-
|
3341 |
-
|
3342 |
-
|
3343 |
-
|
3344 |
-
|
3345 |
-
|
3346 |
-
|
3347 |
-
|
3348 |
-
|
3349 |
-
|
3350 |
-
|
3351 |
-
|
3352 |
-
|
3353 |
-
}
|
3354 |
-
|
3355 |
-
|
3356 |
-
|
3357 |
-
|
3358 |
-
|
3359 |
-
|
3360 |
-
|
3361 |
-
|
3362 |
-
|
3363 |
-
|
3364 |
-
|
3365 |
-
|
3366 |
-
|
3367 |
-
|
3368 |
-
|
3369 |
-
|
3370 |
-
|
3371 |
-
|
3372 |
-
|
3373 |
-
|
3374 |
-
|
3375 |
-
|
3376 |
-
|
3377 |
-
|
3378 |
-
|
3379 |
-
|
3380 |
-
}
|
3381 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* #####################################################################
|
4 |
+
* ### SLIDE ANYTHING PLUGIN - PHP FUNCTIONS FOR WordPress DASHBOARD ###
|
5 |
+
* #####################################################################
|
6 |
+
*
|
7 |
+
* @package WordPress_Slide_Anything
|
8 |
+
* @author Simon Edge
|
9 |
+
* @copyright EdgeWebPages
|
10 |
+
* @license GPLv2 or later
|
11 |
+
*/
|
12 |
+
|
13 |
+
/**
|
14 |
+
* ##### PLUGIN REGISTRATION HOOK - RUN WHEN THE PLUGIN IS ACTIVATED #####
|
15 |
+
*/
|
16 |
+
function cpt_slider_plugin_activation() {
|
17 |
+
$sa_pro_version = validate_slide_anything_pro_registration();
|
18 |
+
|
19 |
+
// INSERT A 'SAMPLE SLIDER' CUSTOM POST INTO THE DATABASE.
|
20 |
+
$sample_post_title = 'Sample Slider';
|
21 |
+
|
22 |
+
// check if the 'sample slider' already exists (plugin has been activated before).
|
23 |
+
$cpt_post = get_page_by_title( $sample_post_title, 'OBJECT', 'sa_slider' );
|
24 |
+
|
25 |
+
if ( is_null( $cpt_post ) ) {
|
26 |
+
// create the post object.
|
27 |
+
$sample_post = array(
|
28 |
+
'post_title' => $sample_post_title,
|
29 |
+
'post_content' => '',
|
30 |
+
'post_status' => 'publish',
|
31 |
+
'post_type' => 'sa_slider',
|
32 |
+
);
|
33 |
+
// insert the post into the database.
|
34 |
+
$cpt_id = wp_insert_post( $sample_post );
|
35 |
+
|
36 |
+
// insert meta data for the 'sample slider' slides.
|
37 |
+
for ( $i = 1; $i <= 8; $i++ ) {
|
38 |
+
if ( 1 === $i ) {
|
39 |
+
$color = '#f4cccc';
|
40 |
+
$image = 'sample_logo1.png';
|
41 |
+
} elseif ( 2 === $i ) {
|
42 |
+
$color = '#d9ead3';
|
43 |
+
$image = 'sample_logo2.png';
|
44 |
+
} elseif ( 3 === $i ) {
|
45 |
+
$color = '#fce5cd';
|
46 |
+
$image = 'sample_logo3.png';
|
47 |
+
} elseif ( 4 === $i ) {
|
48 |
+
$color = '#d0e0e3';
|
49 |
+
$image = 'sample_logo4.png';
|
50 |
+
} elseif ( 5 === $i ) {
|
51 |
+
$color = '#fff2cc';
|
52 |
+
$image = 'sample_logo5.png';
|
53 |
+
} elseif ( 6 === $i ) {
|
54 |
+
$color = '#cfe2f3';
|
55 |
+
$image = 'sample_logo6.png';
|
56 |
+
} elseif ( 7 === $i ) {
|
57 |
+
$color = '#d9d2e9';
|
58 |
+
$image = 'sample_logo7.png';
|
59 |
+
} elseif ( 8 === $i ) {
|
60 |
+
$color = '#ead1dc';
|
61 |
+
$image = 'sample_logo8.png';
|
62 |
+
}
|
63 |
+
$content = "<div style='text-align: center; padding-bottom: 10px;'>\n";
|
64 |
+
$content .= "<div><img src='" . plugins_url() . '/slide-anything/images/' . $image . "' alt='Logo " . $i . "' /></div>\n";
|
65 |
+
$content .= "<h3>Company Name</h3>\n";
|
66 |
+
$content .= "<p>Lorem ipsum dolor sit amet, cu usu cibo vituperata, id ius probo maiestatis inciderint, sit eu vide volutpat.</p>\n";
|
67 |
+
$content .= "</div>\n";
|
68 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_content', $content );
|
69 |
+
$image_data = '~left top~contain~no-repeat~' . $color;
|
70 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_image_data', $image_data );
|
71 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_link_url', '' );
|
72 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_link_target', '_self' );
|
73 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_popup_type', 'NONE' );
|
74 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_popup_imageid', '' );
|
75 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_popup_imagetitle', '' );
|
76 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_popup_video_id', '' );
|
77 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_popup_video_type', '' );
|
78 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_popup_background', 'no' );
|
79 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_popup_html', '' );
|
80 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_popup_shortcode', '0' );
|
81 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_popup_bgcol', '#ffffff' );
|
82 |
+
update_post_meta( $cpt_id, 'sa_slide' . $i . '_popup_width', '600' );
|
83 |
+
}
|
84 |
+
// insert meta data for the 'sample slider' configuration.
|
85 |
+
update_post_meta( $cpt_id, 'sa_disable_visual_editor', '0' );
|
86 |
+
update_post_meta( $cpt_id, 'sa_num_slides', 8 );
|
87 |
+
update_post_meta( $cpt_id, 'sa_slide_duration', 4 );
|
88 |
+
update_post_meta( $cpt_id, 'sa_slide_transition', 0.3 );
|
89 |
+
update_post_meta( $cpt_id, 'sa_slide_by', 1 );
|
90 |
+
update_post_meta( $cpt_id, 'sa_loop_slider', '1' );
|
91 |
+
update_post_meta( $cpt_id, 'sa_stop_hover', '1' );
|
92 |
+
update_post_meta( $cpt_id, 'sa_nav_arrows', '1' );
|
93 |
+
update_post_meta( $cpt_id, 'sa_pagination', '1' );
|
94 |
+
update_post_meta( $cpt_id, 'sa_shortcodes', '0' );
|
95 |
+
update_post_meta( $cpt_id, 'sa_random_order', '1' );
|
96 |
+
update_post_meta( $cpt_id, 'sa_reverse_order', '0' );
|
97 |
+
update_post_meta( $cpt_id, 'sa_mouse_drag', '0' );
|
98 |
+
update_post_meta( $cpt_id, 'sa_touch_drag', '1' );
|
99 |
+
update_post_meta( $cpt_id, 'sa_mousewheel', '0' );
|
100 |
+
update_post_meta( $cpt_id, 'sa_click_advance', '0' );
|
101 |
+
update_post_meta( $cpt_id, 'sa_auto_height', '0' );
|
102 |
+
update_post_meta( $cpt_id, 'sa_vert_center', '0' );
|
103 |
+
update_post_meta( $cpt_id, 'sa_items_width1', 1 );
|
104 |
+
update_post_meta( $cpt_id, 'sa_items_width2', 2 );
|
105 |
+
update_post_meta( $cpt_id, 'sa_items_width3', 3 );
|
106 |
+
update_post_meta( $cpt_id, 'sa_items_width4', 4 );
|
107 |
+
update_post_meta( $cpt_id, 'sa_items_width5', 4 );
|
108 |
+
update_post_meta( $cpt_id, 'sa_items_width6', 4 );
|
109 |
+
update_post_meta( $cpt_id, 'sa_transition', 'fade' );
|
110 |
+
update_post_meta( $cpt_id, 'sa_hero_slider', '0' );
|
111 |
+
update_post_meta( $cpt_id, 'sa_showcase_slider', '0' );
|
112 |
+
update_post_meta( $cpt_id, 'sa_showcase_width', '120' );
|
113 |
+
update_post_meta( $cpt_id, 'sa_showcase_tablet', '1' );
|
114 |
+
update_post_meta( $cpt_id, 'sa_showcase_width_tab', '130' );
|
115 |
+
update_post_meta( $cpt_id, 'sa_showcase_mobile', '0' );
|
116 |
+
update_post_meta( $cpt_id, 'sa_showcase_width_mob', '140' );
|
117 |
+
update_post_meta( $cpt_id, 'sa_css_id', 'sample_slider' );
|
118 |
+
update_post_meta( $cpt_id, 'sa_background_color', '#fafafa' );
|
119 |
+
update_post_meta( $cpt_id, 'sa_border_width', 1 );
|
120 |
+
update_post_meta( $cpt_id, 'sa_border_color', '#f0f0f0' );
|
121 |
+
update_post_meta( $cpt_id, 'sa_border_radius', 5 );
|
122 |
+
update_post_meta( $cpt_id, 'sa_wrapper_padd_top', 8 );
|
123 |
+
update_post_meta( $cpt_id, 'sa_wrapper_padd_right', 8 );
|
124 |
+
update_post_meta( $cpt_id, 'sa_wrapper_padd_bottom', 8 );
|
125 |
+
update_post_meta( $cpt_id, 'sa_wrapper_padd_left', 8 );
|
126 |
+
update_post_meta( $cpt_id, 'sa_slide_min_height_perc', 50 );
|
127 |
+
update_post_meta( $cpt_id, 'sa_slide_padding_tb', 5 );
|
128 |
+
update_post_meta( $cpt_id, 'sa_slide_padding_lr', 5 );
|
129 |
+
update_post_meta( $cpt_id, 'sa_slide_margin_lr', 0 );
|
130 |
+
update_post_meta( $cpt_id, 'sa_autohide_arrows', '1' );
|
131 |
+
update_post_meta( $cpt_id, 'sa_dot_per_slide', '0' );
|
132 |
+
update_post_meta( $cpt_id, 'sa_slide_icons_location', 'Center Center' );
|
133 |
+
update_post_meta( $cpt_id, 'sa_slide_icons_visible', '0' );
|
134 |
+
update_post_meta( $cpt_id, 'sa_slide_icons_color', 'white' );
|
135 |
+
update_post_meta( $cpt_id, 'sa_thumbs_active', '0' );
|
136 |
+
update_post_meta( $cpt_id, 'sa_thumbs_location', 'Inside Bottom' );
|
137 |
+
update_post_meta( $cpt_id, 'sa_thumbs_image_size', 'thumbnail' );
|
138 |
+
update_post_meta( $cpt_id, 'sa_thumbs_padding', 3 );
|
139 |
+
update_post_meta( $cpt_id, 'sa_thumbs_width', 150 );
|
140 |
+
update_post_meta( $cpt_id, 'sa_thumbs_height', 85 );
|
141 |
+
update_post_meta( $cpt_id, 'sa_thumbs_opacity', 50 );
|
142 |
+
update_post_meta( $cpt_id, 'sa_thumbs_border_width', 0 );
|
143 |
+
update_post_meta( $cpt_id, 'sa_thumbs_border_color', '#ffffff' );
|
144 |
+
update_post_meta( $cpt_id, 'sa_thumbs_resp_tablet', 75 );
|
145 |
+
update_post_meta( $cpt_id, 'sa_thumbs_resp_mobile', 50 );
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* ##### SLIDE ANYTHING PRO NOTICE #####
|
151 |
+
*/
|
152 |
+
function version_20_upgrade_notice() {
|
153 |
+
global $current_user;
|
154 |
+
$user_id = $current_user->ID;
|
155 |
+
$sa_pro_version = validate_slide_anything_pro_registration();
|
156 |
+
|
157 |
+
if ( ! $sa_pro_version ) {
|
158 |
+
if ( current_user_can( 'administrator' ) ) {
|
159 |
+
/* Check that the user hasn't already clicked to ignore the message */
|
160 |
+
if ( ! get_user_meta( $user_id, 'sa_ignore_notice' ) ) {
|
161 |
+
echo "<div class='notice notice-info' style='padding-top:10px;'>";
|
162 |
+
|
163 |
+
echo "<div style='float:left; width:170px; margin-right:15px;'><a href='https://edgewebpages.com/' target='_blank'>";
|
164 |
+
echo "<img style='width:100%;' src='" . esc_url( get_site_url() ) . "/wp-content/plugins/slide-anything/images/slide_anything_pro_product_image.png' /></a></div>";
|
165 |
+
echo "<h3 style='margin:0px !important; padding:10px 0px !important;'>SLIDE ANYTHING PRO</h3>";
|
166 |
+
echo "<p style='margin:0px 0px 10px !important;'><strong>SLIDE ANYTHING PRO</strong> adds POPUPS into the mix!!";
|
167 |
+
echo '<br/><strong>SLIDE ANYTHING PRO</strong> also adds Hero Sliders & Thumbnail Pagination!!';
|
168 |
+
echo '<br/><strong>SLIDE ANYTHING PRO</strong> allows you to create Showcase Carousels!!</p>';
|
169 |
+
|
170 |
+
echo "<p style='margin:0px 0px 10px !important;'>With <a href='https://edgewebpages.com/' target='_blank'>SLIDE ANYTHING PRO</a> ";
|
171 |
+
echo 'each slide can now open a MODAL POPUP, which can be an IMAGE popup, a VIDEO EMBED popup (YouTube/Vimeo), a popup ';
|
172 |
+
echo 'containing HTML CODE or a popup displaying a WordPress SHORTCODE. This can be a very useful addition to ';
|
173 |
+
echo 'Slide Anything, if you are wanting to create Image or Video galleries for your websites.</p>';
|
174 |
+
|
175 |
+
echo "<p style='margin:0px 0px 10px !important;'>With <a href='https://edgewebpages.com/' target='_blank'>SLIDE ANYTHING PRO</a> ";
|
176 |
+
echo "you can now create a HERO SLIDER, which is a slider that always is 100% of the width/height of the device it's ";
|
177 |
+
echo 'being viewed on. You can now also add THUMBNAIL PAGINATION to your sliders. Thumbnail Pagination are small ';
|
178 |
+
echo 'clickable thumbnail images, with each thumbnail representing a single slide which can be clicked in order to ';
|
179 |
+
echo 'navigate to.</p>';
|
180 |
+
|
181 |
+
echo "<p style='margin:0px 0px 10px !important;'>With <a href='https://edgewebpages.com/' target='_blank'>SLIDE ANYTHING PRO</a> ";
|
182 |
+
echo 'you can also create a SHOWCASE CAROUSEL, which has a container width that exceeds the screen/window width. ';
|
183 |
+
echo 'The leftmost/rightmost visible slides therefore become partially visible.</p>';
|
184 |
+
|
185 |
+
echo "<p style='margin:0px !important;'>For more information, click on the DEMO links below:</p>";
|
186 |
+
echo "<p style='margin:0px !important;'>";
|
187 |
+
echo "<a href='https://edgewebpages.com/' target='_blank'>MODAL POPUPS DEMO</a> | ";
|
188 |
+
echo "<a href='https://edgewebpages.com/hero-slider-with-thumbnails/' target='_blank'>HERO SLIDER WITH THUMBNAILS</a> | ";
|
189 |
+
echo "<a href='https://edgewebpages.com/showcase-carousel-demo/' target='_blank'>SHOWCASE CAROUSEL</a></p>";
|
190 |
+
|
191 |
+
echo "<div style='clear:both; float:none; width:100%; height:10px;'></div>";
|
192 |
+
echo "<a style='display:inline-block; float:right; padding:7px 10px; background:crimson; color:white; text-decoration:none; ";
|
193 |
+
$button_url = get_site_url() . '/wp-admin/edit.php?post_type=sa_slider&sa_nag_ignore=0';
|
194 |
+
$button_url = wp_nonce_url( $button_url );
|
195 |
+
echo "border-radius:5px; font-size:16px;' href='" . esc_url( $button_url ) . "'>Hide this notice</a>";
|
196 |
+
echo "<div style='clear:both; float:none; width:100%; height:10px;'></div>";
|
197 |
+
|
198 |
+
echo '</div>';
|
199 |
+
}
|
200 |
+
}
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* ##### SET THE SLIDE ANYTHING PRO NOTICE TO BE IGNORED FOR THIS USER #####
|
206 |
+
*/
|
207 |
+
function slide_anything_notice_ignore() {
|
208 |
+
global $current_user;
|
209 |
+
$user_id = $current_user->ID;
|
210 |
+
if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ) ) ) {
|
211 |
+
// If user clicks to ignore the Slide Anything PRO notice, add that to their user meta.
|
212 |
+
if ( isset( $_GET['sa_nag_ignore'] ) && ( sanitize_text_field( wp_unslash( $_GET['sa_nag_ignore'] ) ) === '0' ) ) {
|
213 |
+
add_user_meta( $user_id, 'sa_ignore_notice', 'true', true );
|
214 |
+
}
|
215 |
+
// If user clicks to ignore the Slide Any Post notice, add that to their user meta.
|
216 |
+
if ( isset( $_GET['sapost_ignore'] ) && ( sanitize_text_field( wp_unslash( $_GET['sapost_ignore'] ) ) === '0' ) ) {
|
217 |
+
add_user_meta( $user_id, 'sa_ignore_sapost_notice', 'true', true );
|
218 |
+
}
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* ##### ADD CHECKBOX OPTION UNDER "Settings -> Writing" CALLED "Disable TinyMCE Button" #####
|
224 |
+
*/
|
225 |
+
function slide_anything_disable_tinymce_button_setting() {
|
226 |
+
// REGISTER WordPress SETTING.
|
227 |
+
register_setting(
|
228 |
+
'writing',
|
229 |
+
'sa-disable-tinymce-button',
|
230 |
+
'sa_settings_sanitize'
|
231 |
+
);
|
232 |
+
// CREATE SETTINGS SECTION (within "Settings->Writing").
|
233 |
+
add_settings_section(
|
234 |
+
'sa-writing-settings-section',
|
235 |
+
'Slide Anything Settings',
|
236 |
+
'sa_writing_settings_section_description',
|
237 |
+
'writing'
|
238 |
+
);
|
239 |
+
// CREATE SETTINGS INPUT FIELD.
|
240 |
+
add_settings_field(
|
241 |
+
'sa-settings-field1',
|
242 |
+
'Disable TinyMCE Button',
|
243 |
+
'sa_settings_field1_callback',
|
244 |
+
'writing',
|
245 |
+
'sa-writing-settings-section'
|
246 |
+
);
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* ##### SANATIZE SETTINGS CALLBACK FUNCTION #####
|
251 |
+
*
|
252 |
+
* @param string $input Disable TinyMCE Button checkbox.
|
253 |
+
*/
|
254 |
+
function sa_settings_sanitize( $input ) {
|
255 |
+
return isset( $input ) ? true : false;
|
256 |
+
}
|
257 |
+
/**
|
258 |
+
* ##### SETTING SECTION DESCRIPTION #####
|
259 |
+
*/
|
260 |
+
function sa_writing_settings_section_description() {
|
261 |
+
echo esc_html( "Disable the 'Slide Anything Sliders' button within the toolbar of the WordPress Classic Editor when editing pages and posts." );
|
262 |
+
}
|
263 |
+
/**
|
264 |
+
* ##### SETTINGS INPUT FIELD CALLBACK #####
|
265 |
+
*/
|
266 |
+
function sa_settings_field1_callback() {
|
267 |
+
?>
|
268 |
+
<label for="sa-disable-tinymce-input">
|
269 |
+
<input id="sa-disable-tinymce-input" type="checkbox" value="1" name="sa-disable-tinymce-button" <?php checked( get_option( 'sa-disable-tinymce-button', false ) ); ?>>
|
270 |
+
</label>
|
271 |
+
<?php
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* ##### ACTION HOOK - REGISTER SCRIPTS (JS AND CSS) FOR WordPress DASHBOARD ONLY #####
|
276 |
+
*/
|
277 |
+
function cpt_register_admin_scripts() {
|
278 |
+
$sa_pro_version = validate_slide_anything_pro_registration();
|
279 |
+
$screen = get_current_screen();
|
280 |
+
$plugin_path = dirname( __FILE__ ) . '/../slide-anything.php';
|
281 |
+
$plugin_data = get_plugin_data( $plugin_path, false, false );
|
282 |
+
$plugin_ver = $plugin_data['Version'];
|
283 |
+
if ( 'sa_slider' === $screen->post_type ) {
|
284 |
+
// ONLY LOAD SCRIPTS (JS & CSS) WITHIN 'Slide Anything' SCREENS IN WordPress DASHBOARD.
|
285 |
+
// enqueues all scripts, styles & settings required in order to use the WordPress Media JS APIs.
|
286 |
+
wp_enqueue_media();
|
287 |
+
// load 'WordPress jquery-ui' scripts.
|
288 |
+
wp_enqueue_script( 'jquery-ui-core' );
|
289 |
+
wp_enqueue_script( 'jquery-ui-accordion' );
|
290 |
+
wp_enqueue_script( 'jquery-ui-tabs' );
|
291 |
+
wp_enqueue_script( 'jquery-ui-slider' );
|
292 |
+
wp_enqueue_script( 'jquery-ui-sortable' );
|
293 |
+
wp_enqueue_script( 'jquery-ui-draggable' );
|
294 |
+
wp_enqueue_script( 'jquery-ui-droppable' );
|
295 |
+
wp_enqueue_script( 'jquery-ui-resize' );
|
296 |
+
wp_enqueue_script( 'jquery-ui-dialog' );
|
297 |
+
wp_enqueue_script( 'jquery-ui-button' );
|
298 |
+
wp_enqueue_script( 'jquery-ui-tooltip' );
|
299 |
+
wp_enqueue_script( 'jquery-ui-spinner' );
|
300 |
+
// load 'spectrum colorpicker' script and css.
|
301 |
+
wp_register_script( 'spectrum_js', SA_PLUGIN_PATH . 'spectrum/spectrum.js', array( 'jquery' ), '1.8.0', true );
|
302 |
+
wp_enqueue_script( 'spectrum_js' );
|
303 |
+
wp_register_style( 'spectrum_css', SA_PLUGIN_PATH . 'spectrum/spectrum.css', array(), '1.8.0' );
|
304 |
+
wp_enqueue_style( 'spectrum_css' );
|
305 |
+
// load 'jquery-ui' css.
|
306 |
+
wp_register_style( 'admin_ui_css', SA_PLUGIN_PATH . 'css/admin-user-interface.min.css', array(), '1.11.4' );
|
307 |
+
wp_enqueue_style( 'admin_ui_css' );
|
308 |
+
// load 'slide-anything' custom javasript and css for WordPress admin.
|
309 |
+
wp_register_script( 'sa-slider-admin-script', SA_PLUGIN_PATH . 'js/slide-anything-admin.js', array( 'jquery' ), $plugin_ver, true );
|
310 |
+
wp_enqueue_script( 'sa-slider-admin-script' );
|
311 |
+
wp_register_style( 'sa-slider-admin-css', SA_PLUGIN_PATH . 'css/slide-anything-admin.css', array(), $plugin_ver );
|
312 |
+
wp_enqueue_style( 'sa-slider-admin-css' );
|
313 |
+
if ( $sa_pro_version ) {
|
314 |
+
// load 'magnific popup' script and css.
|
315 |
+
wp_register_script( 'magnific-popup_js', SA_PLUGIN_PATH . 'magnific-popup/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );
|
316 |
+
wp_enqueue_script( 'magnific-popup_js' );
|
317 |
+
wp_register_style( 'magnific-popup_css', SA_PLUGIN_PATH . 'magnific-popup/magnific-popup.css', array(), '1.1.0' );
|
318 |
+
wp_enqueue_style( 'magnific-popup_css' );
|
319 |
+
}
|
320 |
+
// DISABLE AUTOSAVE FOR THIS CUSTOM POST TYPE (causes issues with preview modal popup).
|
321 |
+
wp_dequeue_script( 'autosave' );
|
322 |
+
}
|
323 |
+
if ( 'settings_page_sa-settings-page' === $screen->id ) {
|
324 |
+
// SLIDE ANYTHING SETTINGS PAGE - load custom css script.
|
325 |
+
wp_register_style( 'sa-slider-admin-css', SA_PLUGIN_PATH . 'css/slide-anything-admin.css', array(), $plugin_ver );
|
326 |
+
wp_enqueue_style( 'sa-slider-admin-css' );
|
327 |
+
}
|
328 |
+
// style for TINYMCE editor 'Slide Anything sliders' button.
|
329 |
+
wp_register_style( 'tinymce-css', SA_PLUGIN_PATH . 'css/tinymce_style.css', array(), $plugin_ver );
|
330 |
+
wp_enqueue_style( 'tinymce-css' );
|
331 |
+
}
|
332 |
+
|
333 |
+
|
334 |
+
|
335 |
+
/**
|
336 |
+
* ##### ACTION HOOK - REGISTER THE 'Slide Anything' CUSTOM POST TYPE #####
|
337 |
+
*/
|
338 |
+
function cpt_slider_register() {
|
339 |
+
$labels = array(
|
340 |
+
'name' => _x( 'SA Sliders', 'post type general name', 'sa_slider_textdomain' ),
|
341 |
+
'singular_name' => _x( 'Slider', 'post type singular name', 'sa_slider_textdomain' ),
|
342 |
+
'menu_name' => __( 'SA Sliders', 'sa_slider_textdomain' ),
|
343 |
+
'add_new' => __( 'Add New Slider', 'sa_slider_textdomain' ),
|
344 |
+
'add_new_item' => __( 'Add New Slider', 'sa_slider_textdomain' ),
|
345 |
+
'edit_item' => __( 'Edit Slider', 'sa_slider_textdomain' ),
|
346 |
+
'new_item' => __( 'New Slider', 'sa_slider_textdomain' ),
|
347 |
+
'view_item' => __( 'View Slider', 'sa_slider_textdomain' ),
|
348 |
+
'not_found' => __( 'No sliders found', 'sa_slider_textdomain' ),
|
349 |
+
'not_found_in_trash' => __( 'No sliders found in Trash', 'sa_slider_textdomain' ),
|
350 |
+
);
|
351 |
+
$args = array(
|
352 |
+
'labels' => $labels,
|
353 |
+
'description' => __( 'Slide Anything carousel/slider', 'sa_slider_textdomain' ),
|
354 |
+
'public' => false,
|
355 |
+
'exclude_from_search' => true,
|
356 |
+
'publicly_queryable' => false,
|
357 |
+
'show_ui' => true,
|
358 |
+
'show_in_nav_menus' => false,
|
359 |
+
'show_in_menu' => true,
|
360 |
+
'menu_position' => 10,
|
361 |
+
'menu_icon' => 'dashicons-images-alt2',
|
362 |
+
'hierarchical' => false,
|
363 |
+
'supports' => array( 'title' ),
|
364 |
+
'has_archive' => false,
|
365 |
+
'query_var' => false,
|
366 |
+
'can_export' => true,
|
367 |
+
'rewrite' => true,
|
368 |
+
'capability_type' => 'post',
|
369 |
+
);
|
370 |
+
register_post_type( 'sa_slider', $args );
|
371 |
+
}
|
372 |
+
|
373 |
+
|
374 |
+
|
375 |
+
/**
|
376 |
+
* ##### WP DASHBOARD - SLIDER LIST PAGE #####
|
377 |
+
* ACTION HOOK - ADD/REMOVE (HOVER-OVER) ROW ACTIONS WHEN THIS CUSTOM POST TYPE IS LISTED IN DASHBOARD
|
378 |
+
*
|
379 |
+
* @param array $actions Row Actions.
|
380 |
+
* @param array $post Post Type.
|
381 |
+
*/
|
382 |
+
function cpt_slider_row_actions( $actions, $post ) {
|
383 |
+
if ( 'sa_slider' === $post->post_type ) {
|
384 |
+
// REMOVE 'Quick Edit' ROW ACTION.
|
385 |
+
unset( $actions['inline hide-if-no-js'] );
|
386 |
+
}
|
387 |
+
return $actions;
|
388 |
+
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* ##### FILTER TO ADD/REMOVE COLUMNS DISPLAYED FOR THIS CUSTOM POST TYPE IN DASHBOARD #####
|
392 |
+
*
|
393 |
+
* @param array $columns Post List Columns.
|
394 |
+
*/
|
395 |
+
function cpt_slider_modify_columns( $columns ) {
|
396 |
+
// new columns to be added.
|
397 |
+
$new_columns = array(
|
398 |
+
'slides' => 'Slides',
|
399 |
+
'shortcode' => 'Shortcode',
|
400 |
+
'css-id' => 'CSS ID',
|
401 |
+
);
|
402 |
+
$columns = array_slice( $columns, 0, 2, true ) + $new_columns + array_slice( $columns, 2, null, true );
|
403 |
+
return $columns;
|
404 |
+
}
|
405 |
+
|
406 |
+
/**
|
407 |
+
* ##### DEFINE OUTPUT FOR EACH CUSTOM COLUMN DISPLAYED FOR THIS POST TYPE IN THE DASHBOARD #####
|
408 |
+
*
|
409 |
+
* @param array $column Post List Column.
|
410 |
+
*/
|
411 |
+
function cpt_slider_custom_column_content( $column ) {
|
412 |
+
// get post object for this row.
|
413 |
+
global $post;
|
414 |
+
|
415 |
+
// output for the 'Slides' column.
|
416 |
+
if ( 'slides' === $column ) {
|
417 |
+
$num_slides = get_post_meta( $post->ID, 'sa_num_slides', true );
|
418 |
+
if ( '' === $num_slides ) {
|
419 |
+
$num_slides = '-';
|
420 |
+
}
|
421 |
+
echo esc_html( $num_slides );
|
422 |
+
}
|
423 |
+
|
424 |
+
// output for the 'Shortcode' column.
|
425 |
+
if ( 'shortcode' === $column ) {
|
426 |
+
$shortcode = "[slide-anything id='" . $post->ID . "']";
|
427 |
+
echo esc_html( $shortcode );
|
428 |
+
}
|
429 |
+
|
430 |
+
// output for the 'CSS ID' column.
|
431 |
+
if ( 'css-id' === $column ) {
|
432 |
+
$css_id = get_post_meta( $post->ID, 'sa_css_id', true );
|
433 |
+
if ( '' === $css_id ) {
|
434 |
+
$css_id = '-';
|
435 |
+
} else {
|
436 |
+
$css_id = '#' . $css_id;
|
437 |
+
}
|
438 |
+
echo esc_html( $css_id );
|
439 |
+
}
|
440 |
+
}
|
441 |
+
|
442 |
+
|
443 |
+
|
444 |
+
/**
|
445 |
+
* ##### ADD A CUSTOM BUTTON TO WordPress TINYMCE EDITOR (ON PAGES AND POSTS ONLY) #####
|
446 |
+
*/
|
447 |
+
function add_tinymce_button() {
|
448 |
+
global $typenow;
|
449 |
+
// check user permissions.
|
450 |
+
if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {
|
451 |
+
return;
|
452 |
+
}
|
453 |
+
// verify the post type - only display button on posts and pages.
|
454 |
+
if ( ! in_array( $typenow, array( 'post', 'page' ), true ) ) {
|
455 |
+
return;
|
456 |
+
}
|
457 |
+
// check if WYSIWYG is enabled.
|
458 |
+
if ( 'true' === get_user_option( 'rich_editing' ) ) {
|
459 |
+
add_filter( 'mce_external_plugins', 'add_tinymce_plugin' );
|
460 |
+
add_filter( 'mce_buttons', 'register_tinymce_button' );
|
461 |
+
}
|
462 |
+
}
|
463 |
+
|
464 |
+
/**
|
465 |
+
* ##### FILTER HOOK: mce_external_plugins #####
|
466 |
+
*
|
467 |
+
* @param array $plugin_array Plugin Array.
|
468 |
+
*/
|
469 |
+
function add_tinymce_plugin( $plugin_array ) {
|
470 |
+
$plugin_array['tinymce_button'] = SA_PLUGIN_PATH . 'js/add_tinymce_button.js';
|
471 |
+
return $plugin_array;
|
472 |
+
}
|
473 |
+
|
474 |
+
/**
|
475 |
+
* ##### FILTER HOOK: mce_buttons #####
|
476 |
+
*
|
477 |
+
* @param array $buttons TinyMCE buttons.
|
478 |
+
*/
|
479 |
+
function register_tinymce_button( $buttons ) {
|
480 |
+
array_push( $buttons, 'tinymce_button' );
|
481 |
+
return $buttons;
|
482 |
+
}
|
483 |
+
|
484 |
+
/**
|
485 |
+
* ##### ACTION HOOK: admin_footer #####
|
486 |
+
*/
|
487 |
+
function get_tinymce_shortcode_array() {
|
488 |
+
$screen = get_current_screen();
|
489 |
+
if ( 'envira' !== $screen->post_type ) { // ### BUG FIX - CLASHING WITH ENVIRA GALLERY (VER 2.0.13) ###.
|
490 |
+
// display 2 javascript arrays (in footer) containing all the slide anything post titles and post ids.
|
491 |
+
// these 2 arrays are used to display the shortcode options by the TinyMCE button.
|
492 |
+
echo "<script type='text/javascript'>\n";
|
493 |
+
echo "var sa_title_arr = new Array();\n";
|
494 |
+
echo "var sa_id_arr = new Array();\n";
|
495 |
+
|
496 |
+
$args = array(
|
497 |
+
'post_type' => 'sa_slider',
|
498 |
+
'post_status' => 'publish',
|
499 |
+
'posts_per_page' => -1,
|
500 |
+
);
|
501 |
+
$sa_slider_query = new WP_Query( $args );
|
502 |
+
$count = 0;
|
503 |
+
foreach ( $sa_slider_query->posts as $sa_post ) {
|
504 |
+
$title = $sa_post->post_title;
|
505 |
+
echo 'sa_title_arr[' . esc_js( $count ) . "] = '" . esc_js( $title ) . "';\n";
|
506 |
+
echo 'sa_id_arr[' . esc_js( $count ) . "] = '" . esc_js( $sa_post->ID ) . "';\n";
|
507 |
+
$count++;
|
508 |
+
}
|
509 |
+
echo "</script>\n";
|
510 |
+
}
|
511 |
+
}
|
512 |
+
|
513 |
+
|
514 |
+
|
515 |
+
/**
|
516 |
+
* ##### ACTION HOOK - ADD META BOXES TO THE 'Slide Anything' CUSTOM POST TYPE #####
|
517 |
+
*/
|
518 |
+
function cpt_slider_add_meta_boxes() {
|
519 |
+
global $post;
|
520 |
+
global $current_user;
|
521 |
+
if ( ! is_object( $post ) ) {
|
522 |
+
return;
|
523 |
+
}
|
524 |
+
|
525 |
+
$info_added = get_post_meta( $post->ID, 'sa_info_added', true );
|
526 |
+
$info_deleted = get_post_meta( $post->ID, 'sa_info_deleted', true );
|
527 |
+
$info_duplicated = get_post_meta( $post->ID, 'sa_info_duplicated', true );
|
528 |
+
$info_moved = get_post_meta( $post->ID, 'sa_info_moved', true );
|
529 |
+
if ( '1' === $info_added ) {
|
530 |
+
add_meta_box( 'cpt_slide_added', __( 'Information' ), 'cpt_slide_added_content', 'sa_slider', 'normal', 'high' );
|
531 |
+
update_post_meta( $post->ID, 'sa_info_added', '0' );
|
532 |
+
}
|
533 |
+
if ( '1' === $info_deleted ) {
|
534 |
+
add_meta_box( 'cpt_slide_deleted', __( 'Information' ), 'cpt_slide_deleted_content', 'sa_slider', 'normal', 'high' );
|
535 |
+
update_post_meta( $post->ID, 'sa_info_deleted', '0' );
|
536 |
+
}
|
537 |
+
if ( '1' === $info_duplicated ) {
|
538 |
+
add_meta_box( 'cpt_slide_duplicated', __( 'Information' ), 'cpt_slide_duplicated_content', 'sa_slider', 'normal', 'high' );
|
539 |
+
update_post_meta( $post->ID, 'sa_info_duplicated', '0' );
|
540 |
+
}
|
541 |
+
if ( '1' === $info_moved ) {
|
542 |
+
add_meta_box( 'cpt_slide_moved', __( 'Information' ), 'cpt_slide_moved_content', 'sa_slider', 'normal', 'high' );
|
543 |
+
update_post_meta( $post->ID, 'sa_info_moved', '0' );
|
544 |
+
}
|
545 |
+
add_meta_box( 'cpt_slider_settings', __( 'Slider Settings' ), 'cpt_slider_settings_content', 'sa_slider', 'normal', 'high' );
|
546 |
+
add_meta_box( 'cpt_slider_slides', __( 'Slides' ), 'cpt_slider_slides_content', 'sa_slider', 'normal', 'high' );
|
547 |
+
add_meta_box( 'cpt_slider_shortcode', __( 'Shortcode / Preview' ), 'cpt_slider_shortcode_content', 'sa_slider', 'side', 'high' );
|
548 |
+
add_meta_box( 'cpt_slider_items', __( 'Items Displayed' ), 'cpt_slider_items_content', 'sa_slider', 'side', 'default' );
|
549 |
+
add_meta_box( 'cpt_slider_style', __( 'Slider Style' ), 'cpt_slider_style_content', 'sa_slider', 'side', 'default' );
|
550 |
+
add_meta_box( 'cpt_slider_thumbs', __( 'Thumbnail Pagination' ), 'cpt_slider_thumbs_content', 'sa_slider', 'side', 'default' );
|
551 |
+
remove_meta_box( 'mymetabox_revslider_0', 'sa_slider', 'normal' ); // remove revolution slider meta box
|
552 |
+
// SLIDE ANY POST PROMOTIONAL META BOX.
|
553 |
+
$sa_pro_version = validate_slide_anything_pro_registration();
|
554 |
+
if ( ! $sa_pro_version ) {
|
555 |
+
$user_id = $current_user->ID;
|
556 |
+
if ( ! get_user_meta( $user_id, 'sa_ignore_sapost_notice' ) ) {
|
557 |
+
add_meta_box( 'cpt_slide_any_post', __( 'Slide Any Post Plugin - Just Launched!' ), 'cpt_slide_any_post_content', 'sa_slider', 'normal', 'default' );
|
558 |
+
}
|
559 |
+
}
|
560 |
+
}
|
561 |
+
|
562 |
+
|
563 |
+
|
564 |
+
/**
|
565 |
+
* ##### META BOX CONTENT - 'Information' (slide added) BOX #####
|
566 |
+
*/
|
567 |
+
function cpt_slide_added_content() {
|
568 |
+
echo "<h3 id='sa_slide_added_mess'>A new slide has been added to this slider.</h3>";
|
569 |
+
}
|
570 |
+
|
571 |
+
|
572 |
+
|
573 |
+
/**
|
574 |
+
* ##### META BOX CONTENT - 'Information' (slide deleted) BOX #####
|
575 |
+
*/
|
576 |
+
function cpt_slide_deleted_content() {
|
577 |
+
echo "<h3 id='sa_slide_deleted_mess'>A slide has been deleted from this slider.</h3>";
|
578 |
+
}
|
579 |
+
|
580 |
+
|
581 |
+
|
582 |
+
/**
|
583 |
+
* ##### META BOX CONTENT - 'Information' (slide duplicated) BOX #####
|
584 |
+
*/
|
585 |
+
function cpt_slide_duplicated_content() {
|
586 |
+
echo "<h3 id='sa_slide_duplicated_mess'>A slide has been duplicated (copied) within this slider.</h3>";
|
587 |
+
}
|
588 |
+
|
589 |
+
|
590 |
+
|
591 |
+
/**
|
592 |
+
* ##### META BOX CONTENT - 'Information' (slide moved) BOX #####
|
593 |
+
*/
|
594 |
+
function cpt_slide_moved_content() {
|
595 |
+
echo "<h3 id='sa_slide_moved_mess'>The slide order of this slider has been has changed.</h3>";
|
596 |
+
}
|
597 |
+
|
598 |
+
|
599 |
+
|
600 |
+
/**
|
601 |
+
* // ##### META BOX CONTENT - 'Slider Settings' BOX #####
|
602 |
+
*
|
603 |
+
* @param array $post Custom Post 'sa_slider'.
|
604 |
+
*/
|
605 |
+
function cpt_slider_settings_content( $post ) {
|
606 |
+
$num_slides = get_post_meta( $post->ID, 'sa_num_slides', true );
|
607 |
+
$sa_pro_version = validate_slide_anything_pro_registration();
|
608 |
+
echo "<div id='sa_slider_settings'>\n";
|
609 |
+
|
610 |
+
// NONCE TO PREVENT CSRF SECURITY ATTACKS.
|
611 |
+
wp_nonce_field( basename( __FILE__ ), 'nonce_save_slider' );
|
612 |
+
|
613 |
+
// HIDDEN FIELD - NUMBER OF SLIDES.
|
614 |
+
if ( '' === $num_slides ) {
|
615 |
+
// new slider is being created.
|
616 |
+
echo "<input type='hidden' id='num_slides_id' name='sa_num_slides' value='3'/>\n";
|
617 |
+
} else {
|
618 |
+
// existing slider.
|
619 |
+
$num_slides = intval( $num_slides );
|
620 |
+
echo "<input type='hidden' id='num_slides_id' name='sa_num_slides' value='" . esc_attr( $num_slides ) . "'/>\n";
|
621 |
+
}
|
622 |
+
// HIDDEN FIELD - SLIDE ADDED INDICATOR.
|
623 |
+
echo "<input type='hidden' id='sa_info_added' name='sa_info_added' value='0'/>\n";
|
624 |
+
// HIDDEN FIELD - SLIDE DELETED INDICATOR.
|
625 |
+
echo "<input type='hidden' id='sa_info_deleted' name='sa_info_deleted' value='0'/>\n";
|
626 |
+
// HIDDEN FIELD - SLIDE DUPLICATED INDICATOR.
|
627 |
+
echo "<input type='hidden' id='sa_info_duplicated' name='sa_info_duplicated' value='0'/>\n";
|
628 |
+
// HIDDEN FIELD - SLIDE MOVED UP INDICATOR.
|
629 |
+
echo "<input type='hidden' id='sa_info_moved' name='sa_info_moved' value='0'/>\n";
|
630 |
+
// HIDDEN FIELD - DUPLICATE SLIDE NUMBER.
|
631 |
+
echo "<input type='hidden' id='sa_duplicate_slide' name='sa_duplicate_slide' value='0'/>\n";
|
632 |
+
// HIDDEN FIELD - MOVE SLIDE UP (SLIDE NUMBER).
|
633 |
+
echo "<input type='hidden' id='sa_move_slide_up' name='sa_move_slide_up' value='0'/>\n";
|
634 |
+
// HIDDEN FIELD - PRO VERSION.
|
635 |
+
if ( $sa_pro_version ) {
|
636 |
+
echo "<input type='hidden' id='sa_pro_version' name='sa_pro_version' value='1'/>\n";
|
637 |
+
} else {
|
638 |
+
echo "<input type='hidden' id='sa_pro_version' name='sa_pro_version' value='0'/>\n";
|
639 |
+
}
|
640 |
+
// SLIDE DURATION.
|
641 |
+
$slide_duration = get_post_meta( $post->ID, 'sa_slide_duration', true );
|
642 |
+
if ( '' === $slide_duration ) {
|
643 |
+
$slide_duration = 5;
|
644 |
+
}
|
645 |
+
echo "<div class='sa_slider_value'><span>Slide Duration:</span>";
|
646 |
+
echo "<input type='text' id='sa_slide_duration' name='sa_slide_duration' readonly value='" . esc_attr( $slide_duration ) . "'><em>seconds (0 = manual navigation)</em>";
|
647 |
+
echo "<em class='sa_tooltip' href='' title='Set to 0 to disable slider autoplay (manual slider navigation only)'></em></div>\n";
|
648 |
+
echo "<div class='jquery_ui_slider' id='jq_slider_duration'></div><hr/>\n";
|
649 |
+
// SLIDE TRANSITION.
|
650 |
+
$slide_transition = get_post_meta( $post->ID, 'sa_slide_transition', true );
|
651 |
+
if ( '' === $slide_transition ) {
|
652 |
+
$slide_transition = 0.2;
|
653 |
+
}
|
654 |
+
echo "<div class='sa_slider_value'><span>Slide Transition:</span>";
|
655 |
+
echo "<input type='text' id='sa_slide_transition' name='sa_slide_transition' readonly value='" . esc_attr( $slide_transition ) . "'><em>seconds</em>\n";
|
656 |
+
echo "<em class='sa_tooltip' href='' title='The time it takes to change from one slide to the next slide'></em></div>\n";
|
657 |
+
echo "<div class='jquery_ui_slider' id='jq_slider_transition'></div><hr/>\n";
|
658 |
+
// SLIDE BY.
|
659 |
+
$slide_by = get_post_meta( $post->ID, 'sa_slide_by', true );
|
660 |
+
if ( '' === $slide_by ) {
|
661 |
+
$slide_by = 1;
|
662 |
+
}
|
663 |
+
echo "<div class='sa_slider_value'><span>Slide By:</span>";
|
664 |
+
echo "<input type='text' id='sa_slide_by' name='sa_slide_by' readonly value='" . esc_attr( $slide_by ) . "'><em>slides (0 = slide by page)</em>";
|
665 |
+
echo "<em class='sa_tooltip' href='' title='The number of slides to slide per transition. Set to 0 to enable the Slide by Page option.'></em></div>\n";
|
666 |
+
echo "<div class='jquery_ui_slider' id='jq_slider_by'></div><hr/>\n";
|
667 |
+
echo "<div class='half_width_column'>\n";
|
668 |
+
// LOOP SLIDER.
|
669 |
+
$loop_slider = get_post_meta( $post->ID, 'sa_loop_slider', true );
|
670 |
+
if ( '' === $loop_slider ) {
|
671 |
+
$loop_slider = '1';
|
672 |
+
}
|
673 |
+
echo "<div class='sa_setting_checkbox'><span>Loop Slider:</span>";
|
674 |
+
if ( '1' === $loop_slider ) {
|
675 |
+
echo "<input type='checkbox' id='sa_loop_slider' name='sa_loop_slider' value='1' checked/>";
|
676 |
+
} else {
|
677 |
+
echo "<input type='checkbox' id='sa_loop_slider' name='sa_loop_slider' value='1'/>";
|
678 |
+
}
|
679 |
+
echo "<em class='sa_tooltip' href='' title='Only applies when slide duration is NOT zero (loops back to first slide after last slide is displayed)'></em>";
|
680 |
+
echo "</div>\n";
|
681 |
+
// STOP ON HOVER.
|
682 |
+
$stop_hover = get_post_meta( $post->ID, 'sa_stop_hover', true );
|
683 |
+
if ( '' === $stop_hover ) {
|
684 |
+
$stop_hover = '1';
|
685 |
+
}
|
686 |
+
echo "<div class='sa_setting_checkbox'><span>Stop on Hover:</span>";
|
687 |
+
if ( '1' === $stop_hover ) {
|
688 |
+
echo "<input type='checkbox' id='sa_stop_hover' name='sa_stop_hover' value='1' checked/>";
|
689 |
+
} else {
|
690 |
+
echo "<input type='checkbox' id='sa_stop_hover' name='sa_stop_hover' value='1'/>";
|
691 |
+
}
|
692 |
+
echo "<em class='sa_tooltip' href='' title='Only applies when slide duration is NOT zero (slideshow is paused when hovering over a slide)'></em>";
|
693 |
+
echo "</div>\n";
|
694 |
+
// RANDOM ORDER.
|
695 |
+
$random_order = get_post_meta( $post->ID, 'sa_random_order', true );
|
696 |
+
if ( '' === $random_order ) {
|
697 |
+
$random_order = '0';
|
698 |
+
}
|
699 |
+
echo "<div class='sa_setting_checkbox'><span>Random Order:</span>";
|
700 |
+
if ( '1' === $random_order ) {
|
701 |
+
echo "<input type='checkbox' id='sa_random_order' name='sa_random_order' value='1' checked/>";
|
702 |
+
} else {
|
703 |
+
echo "<input type='checkbox' id='sa_random_order' name='sa_random_order' value='1'/>";
|
704 |
+
}
|
705 |
+
echo "<em class='sa_tooltip' title='When checked slides will be randomly re-ordered whenever the slider is displayed'></em>";
|
706 |
+
echo "</div>\n";
|
707 |
+
// REVERSE ORDER.
|
708 |
+
$reverse_order = get_post_meta( $post->ID, 'sa_reverse_order', true );
|
709 |
+
if ( '' === $reverse_order ) {
|
710 |
+
$reverse_order = '0';
|
711 |
+
}
|
712 |
+
echo "<div class='sa_setting_checkbox'><span>Reverse Order:</span>";
|
713 |
+
if ( '1' === $reverse_order ) {
|
714 |
+
echo "<input type='checkbox' id='sa_reverse_order' name='sa_reverse_order' value='1' checked/>";
|
715 |
+
} else {
|
716 |
+
echo "<input type='checkbox' id='sa_reverse_order' name='sa_reverse_order' value='1'/>";
|
717 |
+
}
|
718 |
+
echo "<em class='sa_tooltip' title='When checked your slides will be shown in the reverse order (i.e. last slide first)'></em>";
|
719 |
+
echo "</div>\n";
|
720 |
+
// ALLOW SHORTCODES.
|
721 |
+
$shortcodes = get_post_meta( $post->ID, 'sa_shortcodes', true );
|
722 |
+
if ( '' === $shortcodes ) {
|
723 |
+
$shortcodes = '0';
|
724 |
+
}
|
725 |
+
echo "<div class='sa_setting_checkbox'><span>Allow Shortcodes:</span>";
|
726 |
+
if ( '1' === $shortcodes ) {
|
727 |
+
echo "<input type='checkbox' id='sa_shortcodes' name='sa_shortcodes' value='1' checked/>";
|
728 |
+
} else {
|
729 |
+
echo "<input type='checkbox' id='sa_shortcodes' name='sa_shortcodes' value='1'/>";
|
730 |
+
}
|
731 |
+
echo "<em class='sa_tooltip' href='' title='Include WordPree shorcodes within slide content. NOTE: Running shortcodes in Slide Anything may cause issues with some WordPress Page Builders'></em>\n";
|
732 |
+
echo "</div>\n";
|
733 |
+
// VERTICAL CENTER.
|
734 |
+
$vert_center = get_post_meta( $post->ID, 'sa_vert_center', true );
|
735 |
+
if ( '' === $vert_center ) {
|
736 |
+
$vert_center = '0';
|
737 |
+
}
|
738 |
+
echo "<div class='sa_setting_checkbox'><span>Vertical Center:</span>";
|
739 |
+
if ( '1' === $vert_center ) {
|
740 |
+
echo "<input type='checkbox' id='sa_vert_center' name='sa_vert_center' value='1' checked/>";
|
741 |
+
} else {
|
742 |
+
echo "<input type='checkbox' id='sa_vert_center' name='sa_vert_center' value='1'/>";
|
743 |
+
}
|
744 |
+
echo "<em class='sa_tooltip' title='Vertically center content within slides. Only use this setting if you have set a Min Height for your slider (which sets a minimum height for each slide).'></em>";
|
745 |
+
echo "</div>\n";
|
746 |
+
echo "</div>\n";
|
747 |
+
echo "<div class='half_width_column'>\n";
|
748 |
+
// NAVIGATE ARROWS.
|
749 |
+
$nav_arrows = get_post_meta( $post->ID, 'sa_nav_arrows', true );
|
750 |
+
if ( '' === $nav_arrows ) {
|
751 |
+
$nav_arrows = '1';
|
752 |
+
}
|
753 |
+
echo "<div class='sa_setting_checkbox'><span>Navigate Arrows:</span>";
|
754 |
+
if ( '1' === $nav_arrows ) {
|
755 |
+
echo "<input type='checkbox' id='sa_nav_arrows' name='sa_nav_arrows' value='1' checked/>";
|
756 |
+
} else {
|
757 |
+
echo "<input type='checkbox' id='sa_nav_arrows' name='sa_nav_arrows' value='1'/>";
|
758 |
+
}
|
759 |
+
echo "<em class='sa_tooltip' href='' title='Display the \"next slide\" amd \"previous slide\" buttons'></em>\n";
|
760 |
+
echo "</div>\n";
|
761 |
+
// SHOW PAGINATION.
|
762 |
+
$pagination = get_post_meta( $post->ID, 'sa_pagination', true );
|
763 |
+
if ( '' === $pagination ) {
|
764 |
+
$pagination = '1';
|
765 |
+
}
|
766 |
+
echo "<div class='sa_setting_checkbox'><span>Show Pagination:</span>";
|
767 |
+
if ( '1' === $pagination ) {
|
768 |
+
echo "<input type='checkbox' id='sa_pagination' name='sa_pagination' value='1' checked/>";
|
769 |
+
} else {
|
770 |
+
echo "<input type='checkbox' id='sa_pagination' name='sa_pagination' value='1'/>";
|
771 |
+
}
|
772 |
+
echo "<em class='sa_tooltip' href='' title='Display slider pagination below the slider'></em>\n";
|
773 |
+
echo "</div>\n";
|
774 |
+
|
775 |
+
// MOUSE DRAG.
|
776 |
+
$mouse_drag = get_post_meta( $post->ID, 'sa_mouse_drag', true );
|
777 |
+
if ( '' === $mouse_drag ) {
|
778 |
+
$mouse_drag = '0';
|
779 |
+
}
|
780 |
+
echo "<div class='sa_setting_checkbox'><span>Mouse Drag:</span>";
|
781 |
+
if ( '1' === $mouse_drag ) {
|
782 |
+
echo "<input type='checkbox' id='sa_mouse_drag' name='sa_mouse_drag' value='1' checked/>";
|
783 |
+
} else {
|
784 |
+
echo "<input type='checkbox' id='sa_mouse_drag' name='sa_mouse_drag' value='1'/>";
|
785 |
+
}
|
786 |
+
echo "<em class='sa_tooltip' href='' title='Allow navigation to previous/next slides by holding down left mouse button and dragging left/right. (NOTE: Enabling this option will disable vertical touch-drag scrolling on mobile devices)'></em>\n";
|
787 |
+
echo "</div>\n";
|
788 |
+
// TOUCH DRAG.
|
789 |
+
$touch_drag = get_post_meta( $post->ID, 'sa_touch_drag', true );
|
790 |
+
if ( '' === $touch_drag ) {
|
791 |
+
$touch_drag = '1';
|
792 |
+
}
|
793 |
+
echo "<div class='sa_setting_checkbox'><span>Touch Drag:</span>";
|
794 |
+
if ( '1' === $touch_drag ) {
|
795 |
+
echo "<input type='checkbox' id='sa_touch_drag' name='sa_touch_drag' value='1' checked/>";
|
796 |
+
} else {
|
797 |
+
echo "<input type='checkbox' id='sa_touch_drag' name='sa_touch_drag' value='1'/>";
|
798 |
+
}
|
799 |
+
echo "<em class='sa_tooltip' href='' title='Allow navigation to previous/next slides on mobile devices by touching screen and dragging left/right'></em>\n";
|
800 |
+
echo "</div>\n";
|
801 |
+
// MOUSEWHEEL NAV.
|
802 |
+
$mousewheel = get_post_meta( $post->ID, 'sa_mousewheel', true );
|
803 |
+
if ( '' === $mousewheel ) {
|
804 |
+
$mousewheel = '0';
|
805 |
+
}
|
806 |
+
echo "<div class='sa_setting_checkbox'><span>Mousewheel Nav:</span>";
|
807 |
+
if ( '1' === $mousewheel ) {
|
808 |
+
echo "<input type='checkbox' id='sa_mousewheel' name='sa_mousewheel' value='1' checked/>";
|
809 |
+
} else {
|
810 |
+
echo "<input type='checkbox' id='sa_mousewheel' name='sa_mousewheel' value='1'/>";
|
811 |
+
}
|
812 |
+
echo "<em class='sa_tooltip' href='' title='Allow previous/next slide navigation using the mousewheel (NOTE: does not work well with the Apple Mac touchpad scroll wheel mimic)'></em>\n";
|
813 |
+
echo "</div>\n";
|
814 |
+
// CLICK TO ADVANCE.
|
815 |
+
$click_advance = get_post_meta( $post->ID, 'sa_click_advance', true );
|
816 |
+
if ( '' === $click_advance ) {
|
817 |
+
$click_advance = '0';
|
818 |
+
}
|
819 |
+
echo "<div class='sa_setting_checkbox'><span>Click to Advance:</span>";
|
820 |
+
if ( '1' === $click_advance ) {
|
821 |
+
echo "<input type='checkbox' id='sa_click_advance' name='sa_click_advance' value='1' checked/>";
|
822 |
+
} else {
|
823 |
+
echo "<input type='checkbox' id='sa_click_advance' name='sa_click_advance' value='1'/>";
|
824 |
+
}
|
825 |
+
echo "<em class='sa_tooltip' href='' title='Clicking on the slider advances to the next slide. NOTE: Only works when the Mouse Drag and Touch Drag options are NOT checked.'></em>\n";
|
826 |
+
echo "</div>\n";
|
827 |
+
// AUTO HEIGHT.
|
828 |
+
$auto_height = get_post_meta( $post->ID, 'sa_auto_height', true );
|
829 |
+
if ( '' === $auto_height ) {
|
830 |
+
$auto_height = '0';
|
831 |
+
}
|
832 |
+
echo "<div class='sa_setting_checkbox'><span>Auto Height:</span>";
|
833 |
+
if ( '1' === $auto_height ) {
|
834 |
+
echo "<input type='checkbox' id='sa_auto_height' name='sa_auto_height' value='1' checked/>";
|
835 |
+
} else {
|
836 |
+
echo "<input type='checkbox' id='sa_auto_height' name='sa_auto_height' value='1'/>";
|
837 |
+
}
|
838 |
+
echo "<em class='sa_tooltip' title='Only works with 1 item on the screen. When checked the height of slider is automatically changed to match the height for each slide.'></em>";
|
839 |
+
echo "</div>\n";
|
840 |
+
echo "</div>\n";
|
841 |
+
echo "<div style='clear:both; float:none; width:100%; height:1px;'></div>\n";
|
842 |
+
echo "</div>\n";
|
843 |
+
}
|
844 |
+
|
845 |
+
|
846 |
+
|
847 |
+
/**
|
848 |
+
* ##### META BOX CONTENT - 'Slides' BOX #####
|
849 |
+
*
|
850 |
+
* @param array $post Custom Post 'sa_slider'.
|
851 |
+
*/
|
852 |
+
function cpt_slider_slides_content( $post ) {
|
853 |
+
$num_slides = get_post_meta( $post->ID, 'sa_num_slides', true );
|
854 |
+
$slider_css_id = get_post_meta( $post->ID, 'sa_css_id', true );
|
855 |
+
$sa_pro_version = validate_slide_anything_pro_registration();
|
856 |
+
// DISABLE VISUAL EDITOR CHECKBOX.
|
857 |
+
$disable_visual_editor = get_post_meta( $post->ID, 'sa_disable_visual_editor', true );
|
858 |
+
if ( '' === $disable_visual_editor ) {
|
859 |
+
$disable_visual_editor = '0';
|
860 |
+
}
|
861 |
+
echo "<div id='sa_visual_editor_checkbox'><span>Disable Visual Editor:</span>";
|
862 |
+
if ( '1' === $disable_visual_editor ) {
|
863 |
+
echo "<input type='checkbox' id='sa_disable_visual_editor' name='sa_disable_visual_editor' value='1' checked/></div>\n";
|
864 |
+
} else {
|
865 |
+
echo "<input type='checkbox' id='sa_disable_visual_editor' name='sa_disable_visual_editor' value='1'/></div>\n";
|
866 |
+
}
|
867 |
+
// SLIDER EDITOR BOX SETTINGS.
|
868 |
+
if ( '1' === $disable_visual_editor ) {
|
869 |
+
$editor_args = array(
|
870 |
+
'tinymce' => false,
|
871 |
+
'wpautop' => false,
|
872 |
+
'media_buttons' => true,
|
873 |
+
'editor_class' => 'sa_slide_content',
|
874 |
+
'editor_height' => '250',
|
875 |
+
);
|
876 |
+
} else {
|
877 |
+
$editor_args = array(
|
878 |
+
'tinymce' => true,
|
879 |
+
'wpautop' => false,
|
880 |
+
'media_buttons' => true,
|
881 |
+
'editor_class' => 'sa_slide_content',
|
882 |
+
'editor_height' => '250',
|
883 |
+
);
|
884 |
+
}
|
885 |
+
if ( '' === $num_slides ) {
|
886 |
+
// A NEW SLIDER IS BEING CREATED - ADD 3 INITIAL SLIDES.
|
887 |
+
$num_slides = 3;
|
888 |
+
$slide_data[0]['edit_id'] = 'sa_slide1_content';
|
889 |
+
$slide_data[0]['content'] = 'Slide content';
|
890 |
+
$slide_data[0]['del_id'] = 'sa_slide1_delete';
|
891 |
+
$slide_data[0]['image_data'] = 'sa_slide1_image_data';
|
892 |
+
$slide_data[0]['image_id'] = 'sa_slide1_image_id';
|
893 |
+
$slide_data[0]['thumb'] = 'slide1_thumb';
|
894 |
+
$slide_data[0]['image_del'] = 'slide1_image_del';
|
895 |
+
$slide_data[0]['image_pos'] = 'sa_slide1_image_pos';
|
896 |
+
$slide_data[0]['image_size'] = 'sa_slide1_image_size';
|
897 |
+
$slide_data[0]['image_repeat'] = 'sa_slide1_image_repeat';
|
898 |
+
$slide_data[0]['image_color'] = 'sa_slide1_image_color';
|
899 |
+
$slide_data[0]['link_url'] = 'sa_slide1_link_url';
|
900 |
+
$slide_data[0]['link_target'] = 'sa_slide1_link_target';
|
901 |
+
$slide_data[0]['slide_no'] = 1;
|
902 |
+
$slide_data[1]['edit_id'] = 'sa_slide2_content';
|
903 |
+
$slide_data[1]['content'] = 'Slide content';
|
904 |
+
$slide_data[1]['del_id'] = 'sa_slide2_delete';
|
905 |
+
$slide_data[1]['image_data'] = 'sa_slide2_image_data';
|
906 |
+
$slide_data[1]['image_id'] = 'sa_slide2_image_id';
|
907 |
+
$slide_data[1]['thumb'] = 'slide2_thumb';
|
908 |
+
$slide_data[1]['image_del'] = 'slide2_image_del';
|
909 |
+
$slide_data[1]['image_pos'] = 'sa_slide2_image_pos';
|
910 |
+
$slide_data[1]['image_size'] = 'sa_slide2_image_size';
|
911 |
+
$slide_data[1]['image_repeat'] = 'sa_slide2_image_repeat';
|
912 |
+
$slide_data[1]['image_color'] = 'sa_slide2_image_color';
|
913 |
+
$slide_data[1]['link_url'] = 'sa_slide2_link_url';
|
914 |
+
$slide_data[1]['link_target'] = 'sa_slide2_link_target';
|
915 |
+
$slide_data[1]['slide_no'] = 2;
|
916 |
+
$slide_data[2]['edit_id'] = 'sa_slide3_content';
|
917 |
+
$slide_data[2]['content'] = 'Slide content';
|
918 |
+
$slide_data[2]['del_id'] = 'sa_slide3_delete';
|
919 |
+
$slide_data[2]['image_data'] = 'sa_slide3_image_data';
|
920 |
+
$slide_data[2]['image_id'] = 'sa_slide3_image_id';
|
921 |
+
$slide_data[2]['thumb'] = 'slide3_thumb';
|
922 |
+
$slide_data[2]['image_del'] = 'slide3_image_del';
|
923 |
+
$slide_data[2]['image_pos'] = 'sa_slide3_image_pos';
|
924 |
+
$slide_data[2]['image_size'] = 'sa_slide3_image_size';
|
925 |
+
$slide_data[2]['image_repeat'] = 'sa_slide3_image_repeat';
|
926 |
+
$slide_data[2]['image_color'] = 'sa_slide3_image_color';
|
927 |
+
$slide_data[2]['link_url'] = 'sa_slide3_link_url';
|
928 |
+
$slide_data[2]['link_target'] = 'sa_slide3_link_target';
|
929 |
+
$slide_data[2]['slide_no'] = 3;
|
930 |
+
if ( $sa_pro_version ) {
|
931 |
+
$slide_data[0]['popup_type'] = 'sa_slide1_popup_type';
|
932 |
+
$slide_data[0]['popup_imageid'] = 'sa_slide1_popup_imageid';
|
933 |
+
$slide_data[0]['popup_imagetitle'] = 'sa_slide1_popup_imagetitle';
|
934 |
+
$slide_data[0]['popup_video_id'] = 'sa_slide1_popup_video_id';
|
935 |
+
$slide_data[0]['popup_video_type'] = 'sa_slide1_popup_video_type';
|
936 |
+
$slide_data[0]['popup_background'] = 'sa_slide1_popup_background';
|
937 |
+
$slide_data[0]['popup_html'] = 'sa_slide1_popup_html';
|
938 |
+
$slide_data[0]['popup_shortcode'] = 'sa_slide1_popup_shortcode';
|
939 |
+
$slide_data[0]['popup_bgcol'] = 'sa_slide1_popup_bgcol';
|
940 |
+
$slide_data[0]['popup_width'] = 'sa_slide1_popup_width';
|
941 |
+
$slide_data[1]['popup_type'] = 'sa_slide2_popup_type';
|
942 |
+
$slide_data[1]['popup_imageid'] = 'sa_slide2_popup_imageid';
|
943 |
+
$slide_data[1]['popup_imagetitle'] = 'sa_slide2_popup_imagetitle';
|
944 |
+
$slide_data[1]['popup_video_id'] = 'sa_slide2_popup_video_id';
|
945 |
+
$slide_data[1]['popup_video_type'] = 'sa_slide2_popup_video_type';
|
946 |
+
$slide_data[1]['popup_background'] = 'sa_slide2_popup_background';
|
947 |
+
$slide_data[1]['popup_html'] = 'sa_slide2_popup_html';
|
948 |
+
$slide_data[1]['popup_shortcode'] = 'sa_slide2_popup_shortcode';
|
949 |
+
$slide_data[1]['popup_bgcol'] = 'sa_slide2_popup_bgcol';
|
950 |
+
$slide_data[1]['popup_width'] = 'sa_slide2_popup_width';
|
951 |
+
$slide_data[2]['popup_type'] = 'sa_slide3_popup_type';
|
952 |
+
$slide_data[2]['popup_imageid'] = 'sa_slide3_popup_imageid';
|
953 |
+
$slide_data[2]['popup_imagetitle'] = 'sa_slide3_popup_imagetitle';
|
954 |
+
$slide_data[2]['popup_video_id'] = 'sa_slide3_popup_video_id';
|
955 |
+
$slide_data[2]['popup_video_type'] = 'sa_slide3_popup_video_type';
|
956 |
+
$slide_data[2]['popup_background'] = 'sa_slide3_popup_background';
|
957 |
+
$slide_data[2]['popup_html'] = 'sa_slide3_popup_html';
|
958 |
+
$slide_data[2]['popup_shortcode'] = 'sa_slide3_popup_shortcode';
|
959 |
+
$slide_data[2]['popup_bgcol'] = 'sa_slide3_popup_bgcol';
|
960 |
+
$slide_data[2]['popup_width'] = 'sa_slide3_popup_width';
|
961 |
+
}
|
962 |
+
} else {
|
963 |
+
// AN EXISTING SLIDER - GET SLIDE DATA FROM THE DATABASE AND SAVE WITHIN AN ARRAY.
|
964 |
+
$num_slides = intval( $num_slides );
|
965 |
+
$slide_data = array();
|
966 |
+
$count = 0;
|
967 |
+
for ( $i = 1; $i <= $num_slides; $i++ ) {
|
968 |
+
$slide_edit_id = 'sa_slide' . $i . '_content';
|
969 |
+
$slide_char_count = 'sa_slide' . $i . '_char_count';
|
970 |
+
$slide_data[ $count ]['edit_id'] = $slide_edit_id;
|
971 |
+
$slide_data[ $count ]['content'] = get_post_meta( $post->ID, $slide_edit_id, true );
|
972 |
+
$slide_data[ $count ]['char_count'] = get_post_meta( $post->ID, $slide_char_count, true );
|
973 |
+
$slide_data[ $count ]['del_id'] = 'sa_slide' . $i . '_delete';
|
974 |
+
$slide_data[ $count ]['thumb'] = 'slide' . $i . '_thumb';
|
975 |
+
$slide_data[ $count ]['image_del'] = 'slide' . $i . '_image_del';
|
976 |
+
$slide_data[ $count ]['image_data'] = 'sa_slide' . $i . '_image_data';
|
977 |
+
$slide_data[ $count ]['image_id'] = 'sa_slide' . $i . '_image_id';
|
978 |
+
$slide_data[ $count ]['image_pos'] = 'sa_slide' . $i . '_image_pos';
|
979 |
+
$slide_data[ $count ]['image_size'] = 'sa_slide' . $i . '_image_size';
|
980 |
+
$slide_data[ $count ]['image_repeat'] = 'sa_slide' . $i . '_image_repeat';
|
981 |
+
$slide_data[ $count ]['image_color'] = 'sa_slide' . $i . '_image_color';
|
982 |
+
$slide_data[ $count ]['image_data'] = 'sa_slide' . $i . '_image_data';
|
983 |
+
$slide_data[ $count ]['link_url'] = 'sa_slide' . $i . '_link_url';
|
984 |
+
$slide_data[ $count ]['link_target'] = 'sa_slide' . $i . '_link_target';
|
985 |
+
if ( $sa_pro_version ) {
|
986 |
+
$slide_data[ $count ]['popup_type'] = 'sa_slide' . $i . '_popup_type';
|
987 |
+
$slide_data[ $count ]['popup_imageid'] = 'sa_slide' . $i . '_popup_imageid';
|
988 |
+
$slide_data[ $count ]['popup_imagetitle'] = 'sa_slide' . $i . '_popup_imagetitle';
|
989 |
+
$slide_data[ $count ]['popup_video_id'] = 'sa_slide' . $i . '_popup_video_id';
|
990 |
+
$slide_data[ $count ]['popup_video_type'] = 'sa_slide' . $i . '_popup_video_type';
|
991 |
+
$slide_data[ $count ]['popup_background'] = 'sa_slide' . $i . '_popup_background';
|
992 |
+
$slide_data[ $count ]['popup_html'] = 'sa_slide' . $i . '_popup_html';
|
993 |
+
$slide_data[ $count ]['popup_shortcode'] = 'sa_slide' . $i . '_popup_shortcode';
|
994 |
+
$slide_data[ $count ]['popup_bgcol'] = 'sa_slide' . $i . '_popup_bgcol';
|
995 |
+
$slide_data[ $count ]['popup_width'] = 'sa_slide' . $i . '_popup_width';
|
996 |
+
}
|
997 |
+
$slide_data[ $count ]['slide_no'] = $i;
|
998 |
+
$count++;
|
999 |
+
}
|
1000 |
+
}
|
1001 |
+
// GET AVAILABLE WordPress IMAGE SIZES AND SAVE WITHIN AN ARRAY.
|
1002 |
+
if ( $sa_pro_version ) {
|
1003 |
+
// SLIDE ANYTHING PRO VERSION ONLY.
|
1004 |
+
global $_wp_additional_image_sizes;
|
1005 |
+
$image_size_arr = array();
|
1006 |
+
$image_size_arr[0]['value'] = 'no';
|
1007 |
+
$image_size_arr[0]['desc'] = 'NO';
|
1008 |
+
$count = 1;
|
1009 |
+
foreach ( get_intermediate_image_sizes() as $image_size ) {
|
1010 |
+
if ( in_array( $image_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ), true ) ) {
|
1011 |
+
$width = get_option( "{$image_size}_size_w" );
|
1012 |
+
$height = get_option( "{$image_size}_size_h" );
|
1013 |
+
} elseif ( isset( $_wp_additional_image_sizes[ $image_size ] ) ) {
|
1014 |
+
$width = $_wp_additional_image_sizes[ $image_size ]['width'];
|
1015 |
+
$height = $_wp_additional_image_sizes[ $image_size ]['height'];
|
1016 |
+
}
|
1017 |
+
if ( ( 0 !== $width ) && ( 0 !== $height ) ) {
|
1018 |
+
$image_size_arr[ $count ]['value'] = $image_size;
|
1019 |
+
$image_size_arr[ $count ]['desc'] = $image_size . ' (' . $width . '×' . $height . ')';
|
1020 |
+
$count++;
|
1021 |
+
}
|
1022 |
+
}
|
1023 |
+
}
|
1024 |
+
/**
|
1025 |
+
* ###### LOOP TO DISPLAY INPUT ELEMENTS FOR EACH SLIDE ######
|
1026 |
+
*/
|
1027 |
+
echo "<div id='slider_accordion'>\n";
|
1028 |
+
|
1029 |
+
// determine whether to use css classes instead of csss ids.
|
1030 |
+
$use_classes = 0;
|
1031 |
+
$other_settings = get_post_meta( $post->ID, 'sa_other_settings', true );
|
1032 |
+
if ( '' !== $other_settings ) {
|
1033 |
+
$other_settings_arr = explode( '|', $other_settings );
|
1034 |
+
}
|
1035 |
+
if ( isset( $other_settings_arr ) && ( count( $other_settings_arr ) > 7 ) ) {
|
1036 |
+
$disable_slide_ids = $other_settings_arr[7];
|
1037 |
+
} else {
|
1038 |
+
$disable_slide_ids = '0';
|
1039 |
+
}
|
1040 |
+
if ( '1' === $disable_slide_ids ) {
|
1041 |
+
$use_classes = 1;
|
1042 |
+
}
|
1043 |
+
|
1044 |
+
$tot = count( $slide_data );
|
1045 |
+
for ( $i = 0; $i < $tot; $i++ ) {
|
1046 |
+
// DISPLAY ACCORDION HEADING.
|
1047 |
+
echo '<h3>Slide ' . esc_html( $slide_data[ $i ]['slide_no'] );
|
1048 |
+
$css_id = $slider_css_id . '_slide' . sprintf( '%02d', $slide_data[ $i ]['slide_no'] );
|
1049 |
+
// display CSS ID/CLASS for the current slide.
|
1050 |
+
if ( 1 === $use_classes ) {
|
1051 |
+
echo '<span>.' . esc_html( $css_id ) . '</span>';
|
1052 |
+
} else {
|
1053 |
+
echo '<span>#' . esc_html( $css_id ) . '</span>';
|
1054 |
+
}
|
1055 |
+
echo "</h3>\n";
|
1056 |
+
echo "<div>\n";
|
1057 |
+
|
1058 |
+
// ### DISPLAY THE SLIDE CONTENT EDITOR (textarea field) ###
|
1059 |
+
wp_editor( $slide_data[ $i ]['content'], $slide_data[ $i ]['edit_id'], $editor_args );
|
1060 |
+
|
1061 |
+
/**
|
1062 |
+
* ##############################
|
1063 |
+
* ##### SLIDE TABS - START #####
|
1064 |
+
* ##############################
|
1065 |
+
*/
|
1066 |
+
$tabs_num = $i + 1;
|
1067 |
+
echo "<div id='slide_" . esc_html( $tabs_num ) . "_tabs' class='sa_slide_tabs'>\n";
|
1068 |
+
echo "<ul>\n";
|
1069 |
+
echo "<li><a href='#slide" . esc_html( $tabs_num ) . "_background_tab'>Slide Background</a></li>\n";
|
1070 |
+
echo "<li><a href='#slide" . esc_html( $tabs_num ) . "_link_tab'>Slide Link</a></li>\n";
|
1071 |
+
echo "<li><a href='#slide" . esc_html( $tabs_num ) . "_popup_tab'>Slide Popup</a></li>\n";
|
1072 |
+
echo "<li><a href='#slide" . esc_html( $tabs_num ) . "_goto_tab'>Slide Goto Link</a></li>\n";
|
1073 |
+
echo "</ul>\n";
|
1074 |
+
|
1075 |
+
/**
|
1076 |
+
* ####### SLIDE TAB 1 - SLIDE BACKGROUND #######
|
1077 |
+
*/
|
1078 |
+
echo "<div id='slide" . esc_html( $tabs_num ) . "_background_tab' class='sa_slide_tab'>\n";
|
1079 |
+
|
1080 |
+
// GET BACKGROUND IMAGE DATA FOR THIS SLIDE (image id, position, size, repeat and color) FROM DATABASE.
|
1081 |
+
$slide_image_data = get_post_meta( $post->ID, $slide_data[ $i ]['image_data'], true );
|
1082 |
+
if ( isset( $slide_image_data ) && ( '' !== $slide_image_data ) ) {
|
1083 |
+
$data_arr = explode( '~', $slide_image_data );
|
1084 |
+
$slide_image_id = $data_arr[0];
|
1085 |
+
$slide_image_pos = $data_arr[1];
|
1086 |
+
$slide_image_size = $data_arr[2];
|
1087 |
+
$slide_image_repeat = $data_arr[3];
|
1088 |
+
$slide_image_color = $data_arr[4];
|
1089 |
+
} else {
|
1090 |
+
$slide_image_id = get_post_meta( $post->ID, $slide_data[ $i ]['image_id'], true );
|
1091 |
+
$slide_image_pos = get_post_meta( $post->ID, $slide_data[ $i ]['image_pos'], true );
|
1092 |
+
$slide_image_size = get_post_meta( $post->ID, $slide_data[ $i ]['image_size'], true );
|
1093 |
+
$slide_image_repeat = get_post_meta( $post->ID, $slide_data[ $i ]['image_repeat'], true );
|
1094 |
+
$slide_image_color = get_post_meta( $post->ID, $slide_data[ $i ]['image_color'], true );
|
1095 |
+
}
|
1096 |
+
if ( '' === $slide_image_pos ) {
|
1097 |
+
$slide_image_pos = 'left top';
|
1098 |
+
}
|
1099 |
+
if ( '' === $slide_image_size ) {
|
1100 |
+
$slide_image_size = 'contain';
|
1101 |
+
}
|
1102 |
+
if ( '' === $slide_image_repeat ) {
|
1103 |
+
$slide_image_repeat = 'no-repeat';
|
1104 |
+
}
|
1105 |
+
if ( '' === $slide_image_color ) {
|
1106 |
+
$slide_image_color = 'rgba(0,0,0,0)';
|
1107 |
+
}
|
1108 |
+
|
1109 |
+
echo "<div class='sa_slide_bg_wrapper'>\n";
|
1110 |
+
|
1111 |
+
/**
|
1112 |
+
* ### 'USE POPUP IMAGE AS SLIDE BACKGROUND' SETTING ###
|
1113 |
+
*/
|
1114 |
+
if ( $sa_pro_version ) {
|
1115 |
+
// SLIDE ANYTHING PRO VERSION ONLY.
|
1116 |
+
$slide_popup_background = get_post_meta( $post->ID, $slide_data[ $i ]['popup_background'], true );
|
1117 |
+
if ( '' === $slide_popup_background ) {
|
1118 |
+
$slide_popup_background = 'no';
|
1119 |
+
}
|
1120 |
+
echo "<div class='popup_background_wrapper'>\n";
|
1121 |
+
echo '<div>Use Popup Image as Slide Background:';
|
1122 |
+
$tooltip = 'Allows you to use the same image you defined as the popup image as the slide background image. You can use a smaller version of the popup image.';
|
1123 |
+
echo "<em class='sa_tooltip' href='' title='" . esc_attr( $tooltip ) . "'></em></div>\n";
|
1124 |
+
echo "<select id='" . esc_attr( $slide_data[ $i ]['popup_background'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_background'] ) . "' ";
|
1125 |
+
echo "onChange='change_slide_popup_background(" . esc_attr( $slide_data[ $i ]['slide_no'] ) . ");'>";
|
1126 |
+
$tot_loop = count( $image_size_arr );
|
1127 |
+
for ( $j = 0; $j < $tot_loop; $j++ ) {
|
1128 |
+
if ( $slide_popup_background === $image_size_arr[ $j ]['value'] ) {
|
1129 |
+
echo "<option value='" . esc_attr( $image_size_arr[ $j ]['value'] ) . "' selected>" . esc_html( $image_size_arr[ $j ]['desc'] ) . '</option>';
|
1130 |
+
} else {
|
1131 |
+
echo "<option value='" . esc_attr( $image_size_arr[ $j ]['value'] ) . "'>" . esc_html( $image_size_arr[ $j ]['desc'] ) . '</option>';
|
1132 |
+
}
|
1133 |
+
}
|
1134 |
+
echo '</select>';
|
1135 |
+
echo "</div>\n"; // .popup_background_wrapper
|
1136 |
+
echo "<div style='clear:both; float:none; width:100%; height:1px;'></div>\n";
|
1137 |
+
echo "<div id='slide" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "_imagebg_popup' class='sa_slide_bg_popup'><div></div></div>\n";
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
// SLIDE BACKGROUND IMAGE - THUMBNAIL AND 'SET IMAGE' BUTTON.
|
1141 |
+
// get WordPress media upload frame url.
|
1142 |
+
$upload_frame_url = esc_url( get_upload_iframe_src( 'image', $post->ID ) . '&slide=' . $slide_data[ $i ]['slide_no'] );
|
1143 |
+
// Get image src for slide background image.
|
1144 |
+
$slide_image_src = wp_get_attachment_image_src( $slide_image_id, 'medium' );
|
1145 |
+
// check if the slide background image id already exists.
|
1146 |
+
$image_exists = is_array( $slide_image_src );
|
1147 |
+
// slide backround image - thumbnail (and delete button).
|
1148 |
+
echo "<div id='" . esc_attr( $slide_data[ $i ]['thumb'] ) . "' class='sa_slide_thumb'>\n";
|
1149 |
+
if ( $image_exists ) {
|
1150 |
+
echo "<div style='background-image:url(\"" . esc_attr( $slide_image_src[0] ) . '"); background-size:' . esc_attr( $slide_image_size ) . '; ';
|
1151 |
+
echo 'background-repeat:' . esc_attr( $slide_image_repeat ) . '; background-color:' . esc_attr( $slide_image_color ) . '; ';
|
1152 |
+
echo 'background-position:' . esc_attr( $slide_image_pos ) . ";'></div>\n";
|
1153 |
+
echo "<span id='" . esc_attr( $slide_data[ $i ]['image_del'] ) . "' onClick='remove_slide_bg_image(\"" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "\");' title='Delete the background image for this slide'>X</span>\n";
|
1154 |
+
echo "</div>\n";
|
1155 |
+
} else {
|
1156 |
+
if ( isset( $slide_data[ $i ]['popup_type'] ) ) {
|
1157 |
+
$slide_popup_type = get_post_meta( $post->ID, $slide_data[ $i ]['popup_type'], true );
|
1158 |
+
$popup_video_type = get_post_meta( $post->ID, $slide_data[ $i ]['popup_video_type'], true );
|
1159 |
+
$popup_video_id = get_post_meta( $post->ID, $slide_data[ $i ]['popup_video_id'], true );
|
1160 |
+
} else {
|
1161 |
+
$slide_popup_type = 'NONE';
|
1162 |
+
$popup_video_type = '';
|
1163 |
+
$popup_video_id = '';
|
1164 |
+
}
|
1165 |
+
if ( ( '99999999' === $slide_image_id ) && ( 'VIDEO' === $slide_popup_type ) && ( 'youtube' === $popup_video_type ) ) {
|
1166 |
+
$youtube_thumb = 'https://img.youtube.com/vi/' . $popup_video_id . '/hqdefault.jpg';
|
1167 |
+
echo "<div style='background-image:url(\"" . esc_attr( $youtube_thumb ) . '"); background-size:' . esc_attr( $slide_image_size ) . '; ';
|
1168 |
+
echo 'background-repeat:' . esc_attr( $slide_image_repeat ) . '; background-color:' . esc_attr( $slide_image_color ) . '; ';
|
1169 |
+
echo 'background-position:' . esc_attr( $slide_image_pos ) . ";'></div>\n";
|
1170 |
+
echo "<span id='" . esc_attr( $slide_data[ $i ]['image_del'] ) . "' onClick='remove_slide_bg_image(\"" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "\");' title='Delete the background image for this slide'>X</span>\n";
|
1171 |
+
echo "</div>\n";
|
1172 |
+
} else {
|
1173 |
+
echo "<div style='background-color:#ffffff; background-size:" . esc_attr( $slide_image_size ) . '; ';
|
1174 |
+
echo 'background-repeat:' . esc_attr( $slide_image_repeat ) . '; background-color:' . esc_attr( $slide_image_color ) . '; ';
|
1175 |
+
echo 'background-position:' . esc_attr( $slide_image_pos ) . ";'></div>\n";
|
1176 |
+
echo "<span id='" . esc_attr( $slide_data[ $i ]['image_del'] ) . "' class='sa_hidden' onClick='remove_slide_bg_image(\"" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "\");' title='Delete the background image for this slide'>X</span>\n";
|
1177 |
+
echo "</div>\n";
|
1178 |
+
}
|
1179 |
+
}
|
1180 |
+
// slide background image - 'set image' button.
|
1181 |
+
echo "<a class='button button-secondary slide_image_add' id='slide" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "_image_add' ";
|
1182 |
+
echo "href='" . esc_attr( $upload_frame_url ) . "' title='Set the background image for this slide'>Set Image</a>\n";
|
1183 |
+
// slide background image - image id hidden field.
|
1184 |
+
echo "<input type='hidden' id='" . esc_attr( $slide_data[ $i ]['image_id'] ) . "' name='" . esc_attr( $slide_data[ $i ]['image_id'] ) . "' value='" . esc_attr( $slide_image_id ) . "'/>\n";
|
1185 |
+
|
1186 |
+
// SLIDE BACKGROUND IMAGE - BACKGROUND POSITION (dropdown box).
|
1187 |
+
echo "<div class='slide_image_settings_line'>";
|
1188 |
+
echo '<span>Background Position:</span>';
|
1189 |
+
$option_arr = array();
|
1190 |
+
$option_arr[0]['desc'] = 'Top Left';
|
1191 |
+
$option_arr[0]['value'] = 'left top';
|
1192 |
+
$option_arr[1]['desc'] = 'Top Center';
|
1193 |
+
$option_arr[1]['value'] = 'center top';
|
1194 |
+
$option_arr[2]['desc'] = 'Top Right';
|
1195 |
+
$option_arr[2]['value'] = 'right top';
|
1196 |
+
$option_arr[3]['desc'] = 'Center Left';
|
1197 |
+
$option_arr[3]['value'] = 'left center';
|
1198 |
+
$option_arr[4]['desc'] = 'Center';
|
1199 |
+
$option_arr[4]['value'] = 'center center';
|
1200 |
+
$option_arr[5]['desc'] = 'Center Right';
|
1201 |
+
$option_arr[5]['value'] = 'right center';
|
1202 |
+
$option_arr[6]['desc'] = 'Bottom Left';
|
1203 |
+
$option_arr[6]['value'] = 'left bottom';
|
1204 |
+
$option_arr[7]['desc'] = 'Bottom Center';
|
1205 |
+
$option_arr[7]['value'] = 'center bottom';
|
1206 |
+
$option_arr[8]['desc'] = 'Bottom Right';
|
1207 |
+
$option_arr[8]['value'] = 'right bottom';
|
1208 |
+
echo "<select id='" . esc_attr( $slide_data[ $i ]['image_pos'] ) . "' name='" . esc_attr( $slide_data[ $i ]['image_pos'] ) . "' onChange='change_slide_image_pos(" . esc_attr( $slide_data[ $i ]['slide_no'] ) . ");'>";
|
1209 |
+
$tot_loop = count( $option_arr );
|
1210 |
+
for ( $j = 0; $j < $tot_loop; $j++ ) {
|
1211 |
+
if ( $slide_image_pos === $option_arr[ $j ]['value'] ) {
|
1212 |
+
echo "<option value='" . esc_attr( $option_arr[ $j ]['value'] ) . "' selected>" . esc_html( $option_arr[ $j ]['desc'] ) . '</option>';
|
1213 |
+
} else {
|
1214 |
+
echo "<option value='" . esc_attr( $option_arr[ $j ]['value'] ) . "'>" . esc_html( $option_arr[ $j ]['desc'] ) . '</option>';
|
1215 |
+
}
|
1216 |
+
}
|
1217 |
+
echo '</select>';
|
1218 |
+
echo "</div>\n";
|
1219 |
+
|
1220 |
+
// SLIDE BACKGROUND IMAGE - BACKGROUND SIZE (dropdown box).
|
1221 |
+
echo "<div class='slide_image_settings_line'>";
|
1222 |
+
echo '<span>Background Size:</span>';
|
1223 |
+
$option_arr = array();
|
1224 |
+
$option_arr[0]['value'] = 'auto';
|
1225 |
+
$option_arr[0]['desc'] = 'no resize';
|
1226 |
+
$option_arr[1]['value'] = 'contain';
|
1227 |
+
$option_arr[1]['desc'] = 'contain';
|
1228 |
+
$option_arr[2]['value'] = 'cover';
|
1229 |
+
$option_arr[2]['desc'] = 'cover';
|
1230 |
+
$option_arr[3]['value'] = '100% 100%';
|
1231 |
+
$option_arr[3]['desc'] = '100%';
|
1232 |
+
$option_arr[4]['value'] = '100% auto';
|
1233 |
+
$option_arr[4]['desc'] = '100% width';
|
1234 |
+
$option_arr[5]['value'] = 'auto 100%';
|
1235 |
+
$option_arr[5]['desc'] = '100% height';
|
1236 |
+
echo "<select id='" . esc_attr( $slide_data[ $i ]['image_size'] ) . "' name='" . esc_attr( $slide_data[ $i ]['image_size'] ) . "' onChange='change_slide_image_size(" . esc_attr( $slide_data[ $i ]['slide_no'] ) . ");'>";
|
1237 |
+
$tot_loop = count( $option_arr );
|
1238 |
+
for ( $j = 0; $j < $tot_loop; $j++ ) {
|
1239 |
+
if ( $slide_image_size === $option_arr[ $j ]['value'] ) {
|
1240 |
+
echo "<option value='" . esc_attr( $option_arr[ $j ]['value'] ) . "' selected>" . esc_html( $option_arr[ $j ]['desc'] ) . '</option>';
|
1241 |
+
} else {
|
1242 |
+
echo "<option value='" . esc_attr( $option_arr[ $j ]['value'] ) . "'>" . esc_html( $option_arr[ $j ]['desc'] ) . '</option>';
|
1243 |
+
}
|
1244 |
+
}
|
1245 |
+
echo '</select>';
|
1246 |
+
echo "</div>\n";
|
1247 |
+
|
1248 |
+
// SLIDER BACKGROUND IMAGE - BACKGROUND REPEAT (dropdown box).
|
1249 |
+
echo "<div class='slide_image_settings_line'>";
|
1250 |
+
echo '<span>Background Repeat:</span>';
|
1251 |
+
$option_arr = array();
|
1252 |
+
$option_arr[0] = 'no-repeat';
|
1253 |
+
$option_arr[1] = 'repeat';
|
1254 |
+
$option_arr[2] = 'repeat-x';
|
1255 |
+
$option_arr[3] = 'repeat-y';
|
1256 |
+
echo "<select id='" . esc_attr( $slide_data[ $i ]['image_repeat'] ) . "' name='" . esc_attr( $slide_data[ $i ]['image_repeat'] ) . "' ";
|
1257 |
+
echo "onChange='change_slide_image_repeat(" . esc_attr( $slide_data[ $i ]['slide_no'] ) . ");'>";
|
1258 |
+
$tot_loop = count( $option_arr );
|
1259 |
+
for ( $j = 0; $j < $tot_loop; $j++ ) {
|
1260 |
+
if ( $slide_image_repeat === $option_arr[ $j ] ) {
|
1261 |
+
echo "<option value='" . esc_attr( $option_arr[ $j ] ) . "' selected>" . esc_html( $option_arr[ $j ] ) . '</option>';
|
1262 |
+
} else {
|
1263 |
+
echo "<option value='" . esc_attr( $option_arr[ $j ] ) . "'>" . esc_html( $option_arr[ $j ] ) . '</option>';
|
1264 |
+
}
|
1265 |
+
}
|
1266 |
+
echo '</select>';
|
1267 |
+
echo "</div>\n";
|
1268 |
+
|
1269 |
+
// SLIDER BACKGROUND IMAGE - BACKGROUND COLOR (color picker).
|
1270 |
+
echo "<div class='slide_image_settings_line'>";
|
1271 |
+
echo '<span>Background Color:</span>';
|
1272 |
+
echo "<input type='text' id='" . esc_attr( $slide_data[ $i ]['image_color'] ) . "' name='" . esc_attr( $slide_data[ $i ]['image_color'] ) . "' value='" . esc_attr( $slide_image_color ) . "' ";
|
1273 |
+
echo "onChange='change_slide_image_color(" . esc_attr( $slide_data[ $i ]['slide_no'] ) . ");'>";
|
1274 |
+
echo "</div>\n";
|
1275 |
+
|
1276 |
+
echo "<div style='clear:both; float:none; width:100%; height:1px;'></div>\n";
|
1277 |
+
echo "</div>\n";
|
1278 |
+
echo "</div>\n";
|
1279 |
+
|
1280 |
+
/**
|
1281 |
+
* ####### SLIDE TAB 2 - SLIDE LINK #######
|
1282 |
+
*/
|
1283 |
+
echo "<div id='slide" . esc_attr( $tabs_num ) . "_link_tab' class='sa_slide_tab'>\n";
|
1284 |
+
|
1285 |
+
// GET SLIDE LINK DATA FOR THIS SLIDE FROM THE DATABASE.
|
1286 |
+
$slide_link_url = get_post_meta( $post->ID, $slide_data[ $i ]['link_url'], true );
|
1287 |
+
$slide_link_target = get_post_meta( $post->ID, $slide_data[ $i ]['link_target'], true );
|
1288 |
+
if ( '' === $slide_link_target ) {
|
1289 |
+
$slide_link_target = '_self';
|
1290 |
+
}
|
1291 |
+
|
1292 |
+
// DISPLAY INPUT FIELDS FOR SLIDE LINK SETTINGS.
|
1293 |
+
echo "<div class='slide_link_settings_wrapper'>";
|
1294 |
+
echo '<p>Specify a link URL that this slide opens</h3>';
|
1295 |
+
// LINK URL.
|
1296 |
+
echo '<div><span>Link URL:</span>';
|
1297 |
+
echo "<input type='text' id='" . esc_attr( $slide_data[ $i ]['link_url'] ) . "' name='" . esc_attr( $slide_data[ $i ]['link_url'] ) . "' ";
|
1298 |
+
echo "value='" . esc_attr( $slide_link_url ) . "'/></div>\n";
|
1299 |
+
// LINK TARGET.
|
1300 |
+
echo '<div><span>Link Target:</span>';
|
1301 |
+
echo "<select id='" . esc_attr( $slide_data[ $i ]['link_target'] ) . "' name='" . esc_attr( $slide_data[ $i ]['link_target'] ) . "'>";
|
1302 |
+
if ( '_blank' === $slide_link_target ) {
|
1303 |
+
echo "<option value='_self'>Same Tab/Window</option>";
|
1304 |
+
echo "<option value='_blank' selected>New Tab/Window</option>";
|
1305 |
+
} else {
|
1306 |
+
echo "<option value='_self' selected>Same Tab/Window</option>";
|
1307 |
+
echo "<option value='_blank'>New Tab/Window</option>";
|
1308 |
+
}
|
1309 |
+
echo '</select>';
|
1310 |
+
echo "</div>\n";
|
1311 |
+
|
1312 |
+
echo "</div>\n";
|
1313 |
+
echo "</div>\n";
|
1314 |
+
|
1315 |
+
/**
|
1316 |
+
* ####### SLIDE TAB 3 - SLIDE POPUP #######
|
1317 |
+
*/
|
1318 |
+
echo "<div id='slide" . esc_attr( $tabs_num ) . "_popup_tab' class='sa_slide_tab'>\n";
|
1319 |
+
|
1320 |
+
if ( $sa_pro_version ) {
|
1321 |
+
/**
|
1322 |
+
* ### SLIDE ANYTHING PRO VERSION ONLY ###
|
1323 |
+
*/
|
1324 |
+
|
1325 |
+
// GET SLIDE POPUP DATA FOR THIS SLIDE FROM THE DATABASE.
|
1326 |
+
$slide_popup_type = get_post_meta( $post->ID, $slide_data[ $i ]['popup_type'], true );
|
1327 |
+
if ( '' === $slide_popup_type ) {
|
1328 |
+
$slide_popup_type = 'NONE';
|
1329 |
+
}
|
1330 |
+
$popup_imageid = intval( get_post_meta( $post->ID, $slide_data[ $i ]['popup_imageid'], true ) );
|
1331 |
+
$popup_video_id = get_post_meta( $post->ID, $slide_data[ $i ]['popup_video_id'], true );
|
1332 |
+
$popup_video_type = get_post_meta( $post->ID, $slide_data[ $i ]['popup_video_type'], true );
|
1333 |
+
$popup_imagetitle = get_post_meta( $post->ID, $slide_data[ $i ]['popup_imagetitle'], true );
|
1334 |
+
$popup_html = get_post_meta( $post->ID, $slide_data[ $i ]['popup_html'], true );
|
1335 |
+
$popup_shortcode = get_post_meta( $post->ID, $slide_data[ $i ]['popup_shortcode'], true );
|
1336 |
+
$popup_bgcol = get_post_meta( $post->ID, $slide_data[ $i ]['popup_bgcol'], true );
|
1337 |
+
$popup_width = intval( get_post_meta( $post->ID, $slide_data[ $i ]['popup_width'], true ) );
|
1338 |
+
$css_id = get_post_meta( $post->ID, 'sa_css_id', true );
|
1339 |
+
|
1340 |
+
// POPUP TYPE.
|
1341 |
+
echo "<div class='slide_popup_settings_line'>";
|
1342 |
+
echo '<span>SA Popup Type:</span>';
|
1343 |
+
$option_arr = array();
|
1344 |
+
$option_arr[0] = 'NONE';
|
1345 |
+
$option_arr[1] = 'IMAGE';
|
1346 |
+
$option_arr[2] = 'VIDEO';
|
1347 |
+
$option_arr[3] = 'HTML';
|
1348 |
+
echo "<select id='" . esc_attr( $slide_data[ $i ]['popup_type'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_type'] ) . "' ";
|
1349 |
+
echo "onChange='change_slide_popup_type(" . esc_attr( $slide_data[ $i ]['slide_no'] ) . ");'>";
|
1350 |
+
$tot_loop = count( $option_arr );
|
1351 |
+
for ( $j = 0; $j < $tot_loop; $j++ ) {
|
1352 |
+
if ( $slide_popup_type === $option_arr[ $j ] ) {
|
1353 |
+
echo "<option value='" . esc_attr( $option_arr[ $j ] ) . "' selected>" . esc_html( $option_arr[ $j ] ) . '</option>';
|
1354 |
+
} else {
|
1355 |
+
echo "<option value='" . esc_attr( $option_arr[ $j ] ) . "'>" . esc_html( $option_arr[ $j ] ) . '</option>';
|
1356 |
+
}
|
1357 |
+
}
|
1358 |
+
echo '</select>';
|
1359 |
+
echo "</div>\n";
|
1360 |
+
|
1361 |
+
// A) IMAGE POPUP SETTINGS.
|
1362 |
+
$sl_num = ( $i + 1 );
|
1363 |
+
if ( 'IMAGE' === $slide_popup_type ) {
|
1364 |
+
echo "<div id='slide" . esc_attr( $sl_num ) . "_image_popup_wrapper' class='image_popup_wrapper'>\n";
|
1365 |
+
} else {
|
1366 |
+
echo "<div id='slide" . esc_attr( $sl_num ) . "_image_popup_wrapper' class='image_popup_wrapper' style='display:none;'>\n";
|
1367 |
+
}
|
1368 |
+
// get WordPress media upload frame url.
|
1369 |
+
$upload_popup_frame_url = esc_url( get_upload_iframe_src( 'image', $post->ID ) . '&popup=' . $slide_data[ $i ]['slide_no'] );
|
1370 |
+
// Get image src for slide popup image.
|
1371 |
+
$popup_image_src = wp_get_attachment_image_src( $popup_imageid, 'medium' );
|
1372 |
+
// check if the slide background image id already exists.
|
1373 |
+
$image_exists = is_array( $popup_image_src );
|
1374 |
+
echo "<div id='slide" . esc_attr( $sl_num ) . "_popup_thumb' class='slide_popup_thumb'>\n";
|
1375 |
+
$placeholder = SA_PLUGIN_PATH . 'images/image_placeholder.jpg';
|
1376 |
+
if ( $image_exists ) {
|
1377 |
+
// media library image id exists - display thumbnail image.
|
1378 |
+
echo "<div><img src='" . esc_attr( $popup_image_src[0] ) . "'/></div>";
|
1379 |
+
// display image delete button.
|
1380 |
+
echo "<span onClick='remove_popup_image(\"" . esc_attr( $slide_data[ $i ]['slide_no'] ) . '", "' . esc_attr( $placeholder ) . "\");' ";
|
1381 |
+
echo "id='slide" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "_popup_image_del' title='Delete the popup image for this slide'>X</span>\n";
|
1382 |
+
// get popup image info (size & dimensions).
|
1383 |
+
$popup_image_meta = wp_get_attachment_metadata( $popup_imageid );
|
1384 |
+
$image_width = $popup_image_meta['width'];
|
1385 |
+
$image_height = $popup_image_meta['height'];
|
1386 |
+
$info_dim = $image_width . ' x ' . $image_height . ' pixels';
|
1387 |
+
$popup_image_full = wp_get_attachment_image_src( $popup_imageid, 'full' );
|
1388 |
+
$img_headers = get_headers( $popup_image_full[0], 1 );
|
1389 |
+
$info_size = $img_headers['Content-Length'];
|
1390 |
+
if ( '' !== $info_size ) {
|
1391 |
+
$size_unit = 'bytes';
|
1392 |
+
if ( $info_size > 1048576 ) {
|
1393 |
+
if ( ! is_array( $info_size ) ) {
|
1394 |
+
$info_size = round( $info_size / 1048576 ) . ' MB';
|
1395 |
+
} else {
|
1396 |
+
$info_size = '';
|
1397 |
+
}
|
1398 |
+
} elseif ( $info_size > 1024 ) {
|
1399 |
+
if ( ! is_array( $info_size ) ) {
|
1400 |
+
$info_size = round( $info_size / 1024 ) . ' kb';
|
1401 |
+
} else {
|
1402 |
+
$info_size = '';
|
1403 |
+
}
|
1404 |
+
}
|
1405 |
+
}
|
1406 |
+
} else {
|
1407 |
+
// no image selected yet - display placeholder image.
|
1408 |
+
$popup_image_id = 0;
|
1409 |
+
echo "<div><img src='" . esc_attr( $placeholder ) . "'/></div>";
|
1410 |
+
// display image delete button (hidden state).
|
1411 |
+
echo "<span class='sa_hidden' onClick='remove_popup_image(\"" . esc_attr( $slide_data[ $i ]['slide_no'] ) . '", "' . esc_attr( $placeholder ) . "\");' ";
|
1412 |
+
echo "id='slide" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "_popup_image_del' title='Delete the popup image for this slide'>X</span>\n";
|
1413 |
+
// reset popup image info (size & dimensions).
|
1414 |
+
$info_dim = '';
|
1415 |
+
$info_size = '';
|
1416 |
+
}
|
1417 |
+
echo "</div>\n";
|
1418 |
+
// slide popup image - 'set image' button.
|
1419 |
+
echo "<a class='button button-secondary popup_image_add' href='" . esc_attr( $upload_popup_frame_url ) . "' ";
|
1420 |
+
echo "title='Set the background image for this slide'>Set Image</a>\n";
|
1421 |
+
// slide popup image - 'preview' button.
|
1422 |
+
$preview_button = 'slide' . esc_attr( $slide_data[ $i ]['slide_no'] ) . '_popup_image_preview';
|
1423 |
+
echo "<div id='" . esc_attr( $preview_button ) . "' class='slide_popup_image_preview'>";
|
1424 |
+
if ( $image_exists ) {
|
1425 |
+
echo "<a class='button button-secondary' href='" . esc_attr( $popup_image_full[0] ) . "' title='" . esc_attr( $popup_imagetitle ) . "'>Preview</a>";
|
1426 |
+
} else {
|
1427 |
+
echo "<a class='button button-secondary' href='" . esc_attr( $placeholder ) . "' title='" . esc_attr( $popup_imagetitle ) . "'>Preview</a>";
|
1428 |
+
}
|
1429 |
+
echo "</div>\n";
|
1430 |
+
// slide popup image - jquery code to generate 'magnific popup' preview.
|
1431 |
+
echo "<script type='text/javascript'>\n";
|
1432 |
+
echo "jQuery(document).ready(function() {\n";
|
1433 |
+
echo " jQuery('#" . esc_attr( $preview_button ) . " a').magnificPopup({\n";
|
1434 |
+
echo " mainClass: 'sa_popup',\n";
|
1435 |
+
echo " closeBtnInside: true,\n";
|
1436 |
+
echo " type: 'image'\n";
|
1437 |
+
echo " });\n";
|
1438 |
+
echo "});\n";
|
1439 |
+
echo "</script>\n";
|
1440 |
+
// slide popup image - popup image id hidden field.
|
1441 |
+
echo "<input type='hidden' id='" . esc_attr( $slide_data[ $i ]['popup_imageid'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_imageid'] );
|
1442 |
+
echo "' value='" . esc_attr( $popup_imageid ) . "' />\n";
|
1443 |
+
// slide popup image - popup image info (title, dimensions & size).
|
1444 |
+
echo "<div class='slide_popup_info'>\n";
|
1445 |
+
// popup image title.
|
1446 |
+
echo "<input class='sa_slide_popup_imagetitle' type='text' id='" . esc_attr( $slide_data[ $i ]['popup_imagetitle'] ) . "' ";
|
1447 |
+
echo "name='" . esc_attr( $slide_data[ $i ]['popup_imagetitle'] ) . "' value='" . esc_attr( $popup_imagetitle ) . "' ";
|
1448 |
+
echo "onChange='change_popup_image_title(this.value, \"" . esc_attr( $preview_button ) . "\")' placeholder='Enter popup title'/>\n";
|
1449 |
+
// popup dimensions.
|
1450 |
+
echo "<div id='slide" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "_popup_info_dim' class='slide_popup_info_dim'>";
|
1451 |
+
echo '<strong>Dimensions:</strong> ' . esc_html( $info_dim ) . "</div>\n";
|
1452 |
+
// popup file size.
|
1453 |
+
echo "<div id='slide" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "_popup_info_size' class='slide_popup_info_size'>";
|
1454 |
+
if ( '' !== $info_size ) {
|
1455 |
+
echo '<strong>File Size:</strong> ' . esc_html( $info_size );
|
1456 |
+
}
|
1457 |
+
echo "</div>\n";
|
1458 |
+
echo "</div>\n";
|
1459 |
+
echo "<div style='clear:both; float:none; width:100%; height:1px;'></div>\n";
|
1460 |
+
echo "</div>\n";
|
1461 |
+
|
1462 |
+
// B) VIDEO POPUP SETTINGS.
|
1463 |
+
$sl_num = ( $i + 1 );
|
1464 |
+
if ( 'VIDEO' === $slide_popup_type ) {
|
1465 |
+
echo "<div id='slide" . esc_attr( $sl_num ) . "_video_popup_wrapper' class='video_popup_wrapper'>\n";
|
1466 |
+
} else {
|
1467 |
+
echo "<div id='slide" . esc_attr( $sl_num ) . "_video_popup_wrapper' class='video_popup_wrapper' style='display:none;'>\n";
|
1468 |
+
}
|
1469 |
+
// set default video values.
|
1470 |
+
if ( ( 'youtube' !== $popup_video_type ) && ( 'vimeo' !== $popup_video_type ) ) {
|
1471 |
+
$popup_video_type = '';
|
1472 |
+
$popup_video_id = '';
|
1473 |
+
}
|
1474 |
+
if ( '' === $popup_video_id ) {
|
1475 |
+
$popup_video_type = '';
|
1476 |
+
}
|
1477 |
+
// video preview.
|
1478 |
+
echo "<div id='slide" . esc_attr( $sl_num ) . "_video_thumb' class='slide_video_thumb'>\n";
|
1479 |
+
if ( '' !== $popup_video_id ) {
|
1480 |
+
if ( 'youtube' === $popup_video_type ) {
|
1481 |
+
echo "<iframe src='https://www.youtube.com/embed/" . esc_attr( $popup_video_id ) . "' frameborder='0' allowfullscreen></iframe>\n";
|
1482 |
+
} elseif ( 'vimeo' === $popup_video_type ) {
|
1483 |
+
echo "<iframe src='https://player.vimeo.com/video/" . esc_attr( $popup_video_id ) . "' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";
|
1484 |
+
} else {
|
1485 |
+
echo "<img src='" . esc_attr( SA_PLUGIN_PATH ) . "images/video_placeholder.jpg'/>";
|
1486 |
+
}
|
1487 |
+
} else {
|
1488 |
+
echo "<img src='" . esc_attr( SA_PLUGIN_PATH ) . "images/video_placeholder.jpg'/>";
|
1489 |
+
}
|
1490 |
+
echo "<div style='float:none; clear:both; width:100%; height:1px;'></div>\n";
|
1491 |
+
echo "</div>\n";
|
1492 |
+
// video url (youtube/vimeo) input text box.
|
1493 |
+
echo "<div class='sa_slide_video_url'>";
|
1494 |
+
echo "<input type='text' id='sa_slide" . esc_attr( $sl_num ) . "_video_url' name='sa_slide" . esc_attr( $sl_num ) . "_video_url' ";
|
1495 |
+
echo "placeholder='Enter YouTube or Vimeo URL'/></div>\n";
|
1496 |
+
// 'update video' button.
|
1497 |
+
echo "<a class='button button-secondary' title='Update popup video using the above video URL' ";
|
1498 |
+
echo "onClick='update_popup_video(" . esc_attr( $sl_num ) . ");'>Set Video</a>\n";
|
1499 |
+
|
1500 |
+
// slide popup video - 'preview' button.
|
1501 |
+
$video_preview_url = SA_PLUGIN_PATH . 'images/video_placeholder_admin.jpg';
|
1502 |
+
if ( '' !== $popup_video_id ) {
|
1503 |
+
if ( 'youtube' === $popup_video_type ) {
|
1504 |
+
$video_preview_url = 'http://www.youtube.com/watch?v=' . $popup_video_id;
|
1505 |
+
} elseif ( 'vimeo' === $popup_video_type ) {
|
1506 |
+
$video_preview_url = 'http://vimeo.com/' . $popup_video_id;
|
1507 |
+
}
|
1508 |
+
}
|
1509 |
+
$preview_button = 'slide' . esc_attr( $slide_data[ $i ]['slide_no'] ) . '_popup_video_preview';
|
1510 |
+
echo "<div id='" . esc_attr( $preview_button ) . "' class='slide_popup_video_preview'>";
|
1511 |
+
echo "<a class='button button-secondary' href='" . esc_attr( $video_preview_url ) . "'>Preview</a>";
|
1512 |
+
echo "</div>\n";
|
1513 |
+
// slide popup image - jquery code to generate 'magnific popup' preview.
|
1514 |
+
echo "<script type='text/javascript'>\n";
|
1515 |
+
echo "jQuery(document).ready(function() {\n";
|
1516 |
+
echo " jQuery('#" . esc_attr( $preview_button ) . " a').magnificPopup({\n";
|
1517 |
+
echo " mainClass: 'sa_popup',\n";
|
1518 |
+
echo " closeBtnInside: true,\n";
|
1519 |
+
echo " type: 'iframe'\n";
|
1520 |
+
echo " });\n";
|
1521 |
+
echo "});\n";
|
1522 |
+
echo "</script>\n";
|
1523 |
+
// invalid url error message.
|
1524 |
+
echo "<div id='sa_slide" . esc_attr( $sl_num ) . "_video_invalid_url' class='sa_popup_video_invalid_url'>";
|
1525 |
+
echo "URL entered is NOT a valid YouTube or Vimeo URL!</div>\n";
|
1526 |
+
// hidden video id text field.
|
1527 |
+
echo "<input type='hidden' id='" . esc_attr( $slide_data[ $i ]['popup_video_id'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_video_id'] ) . "' ";
|
1528 |
+
echo "value='" . esc_attr( $popup_video_id ) . "'/>\n";
|
1529 |
+
// hidden video type (youtube/vimeo) text field.
|
1530 |
+
echo "<input type='hidden' id='" . esc_attr( $slide_data[ $i ]['popup_video_type'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_video_type'] ) . "' ";
|
1531 |
+
echo "value='" . esc_attr( $popup_video_type ) . "'/>\n";
|
1532 |
+
echo "<div style='float:none; clear:both; width:100%; height:1px;'></div>\n";
|
1533 |
+
echo "</div>\n";
|
1534 |
+
|
1535 |
+
// C) CONTENT POPUP SETTINGS.
|
1536 |
+
$sl_num = ( $i + 1 );
|
1537 |
+
if ( 'HTML' === $slide_popup_type ) {
|
1538 |
+
echo "<div id='slide" . esc_attr( $sl_num ) . "_html_popup_wrapper' class='html_popup_wrapper'>\n";
|
1539 |
+
} else {
|
1540 |
+
echo "<div id='slide" . esc_attr( $sl_num ) . "_html_popup_wrapper' class='html_popup_wrapper' style='display:none;'>\n";
|
1541 |
+
}
|
1542 |
+
// content popup - html.
|
1543 |
+
echo "<textarea id='" . esc_attr( $slide_data[ $i ]['popup_html'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_html'] ) . "' ";
|
1544 |
+
echo "placeholder='Enter HTML Code or WordPress Shortcode'>" . esc_attr( $popup_html ) . "</textarea>\n";
|
1545 |
+
// content popup - shortcode.
|
1546 |
+
if ( '' === $popup_shortcode ) {
|
1547 |
+
$popup_shortcode = '0';
|
1548 |
+
}
|
1549 |
+
echo "<div class='slide_popup_settings_line' style='margin:3px 0px 15px;'><span>Shortcode Content:</span>";
|
1550 |
+
if ( '1' === $popup_shortcode ) {
|
1551 |
+
echo "<input type='checkbox' id='" . esc_attr( $slide_data[ $i ]['popup_shortcode'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_shortcode'] ) . "' value='1' checked/>";
|
1552 |
+
} else {
|
1553 |
+
echo "<input type='checkbox' id='" . esc_attr( $slide_data[ $i ]['popup_shortcode'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_shortcode'] ) . "' value='1'/>";
|
1554 |
+
}
|
1555 |
+
echo "<em class='sa_tooltip' href='' title='Use a WordPress shortcode instead of HTML as your popup content'></em>\n";
|
1556 |
+
echo "</div>\n";
|
1557 |
+
// content popup - css id.
|
1558 |
+
$popup_id = $css_id . '_popup' . ( $i + 1 );
|
1559 |
+
echo "<div class='slide_popup_settings_line'>";
|
1560 |
+
echo "<span>Popup CSS ID:</span><div id='sa_slide" . esc_attr( $sl_num ) . "_popup_css' class='slide_popup_css'>#" . esc_html( $popup_id ) . '</div>';
|
1561 |
+
echo '<strong>(click to copy to clipboard)</strong></div>';
|
1562 |
+
// content popup - background color.
|
1563 |
+
if ( '' === $popup_bgcol ) {
|
1564 |
+
$popup_bgcol = '#ffffff';
|
1565 |
+
}
|
1566 |
+
echo "<div class='slide_popup_settings_line'>";
|
1567 |
+
echo '<span>Background Color:</span>';
|
1568 |
+
echo "<input type='text' id='" . esc_attr( $slide_data[ $i ]['popup_bgcol'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_bgcol'] ) . "' ";
|
1569 |
+
echo "value='" . esc_attr( $popup_bgcol ) . "'>";
|
1570 |
+
echo "</div>\n";
|
1571 |
+
// content popup - width.
|
1572 |
+
if ( ( '' === $popup_width ) || ( 0 === $popup_width ) ) {
|
1573 |
+
$popup_width = '600';
|
1574 |
+
}
|
1575 |
+
echo "<div class='slide_popup_settings_line'>";
|
1576 |
+
echo '<span>Popup Width:</span>';
|
1577 |
+
echo "<input type='text' id='" . esc_attr( $slide_data[ $i ]['popup_width'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_width'] ) . "' ";
|
1578 |
+
echo "value='" . esc_attr( $popup_width ) . "'><em>px</em>";
|
1579 |
+
echo "</div>\n";
|
1580 |
+
|
1581 |
+
echo "</div>\n";
|
1582 |
+
} else {
|
1583 |
+
/**
|
1584 |
+
* ### SLIDE ANYTHING FREE VERSION - DISPLAY PRO INFORMATION ###
|
1585 |
+
*/
|
1586 |
+
echo "<div class='slide_popup_pro_version'>\n";
|
1587 |
+
echo "<h4>Available in the PRO VERSION only!</h4>\n";
|
1588 |
+
echo '<p>With <strong>SLIDE ANYTHING PRO </strong> each slide can now open a <strong>MODAL POPUP</strong>, which may be one ';
|
1589 |
+
echo "of the following:</p>\n";
|
1590 |
+
echo "<ul>\n";
|
1591 |
+
echo "<li>An <strong>IMAGE</strong> popup, and with multiple image popups you can create a lightbox image gallery.</li>\n";
|
1592 |
+
echo "<li>An embedded <strong>VIDEO</strong> popup or gallery, which can contain <em>YouTube</em> or <em>Vimeo</em> videos.</li>\n";
|
1593 |
+
echo "<li>Popups containing any custom <strong>HTML</strong> content or WordPress <strong>SHORTCODES</strong> (such as an HTML form).</li>\n";
|
1594 |
+
echo "<li>Or your Slide Anything sliders can conatin a combination of image, video, HTML and shortcode popups!</li>\n";
|
1595 |
+
echo "</ul>\n";
|
1596 |
+
echo '<p>To find out more about <strong>SLIDE ANYTHING PRO</strong>, view demos or get your hands on a copy, click ';
|
1597 |
+
echo "<a href='https://edgewebpages.com' title='Slide Anything PRO' target='_blank'>HERE</a>.</p>";
|
1598 |
+
echo "</div>\n";
|
1599 |
+
}
|
1600 |
+
echo "</div>\n";
|
1601 |
+
|
1602 |
+
/**
|
1603 |
+
* ####### SLIDE TAB 4 - SLIDE GOTO LINK #######
|
1604 |
+
*/
|
1605 |
+
$css_id = get_post_meta( $post->ID, 'sa_css_id', true );
|
1606 |
+
$goto_class = $css_id . '_goto' . ( $i + 1 );
|
1607 |
+
$eg_link = 'https://edgewebpages.com/slide-goto-links';
|
1608 |
+
echo "<div id='slide" . esc_attr( $tabs_num ) . "_goto_tab' class='sa_slide_tab'>\n";
|
1609 |
+
echo "<div class='slide_goto_link_content'>\n";
|
1610 |
+
echo "<p><strong>Create a link or button to link directly to this slide</strong></p>\n";
|
1611 |
+
echo "<p>To do this, give your link or button the following <strong>CSS Class:</strong></p>\n";
|
1612 |
+
echo "<div class='slide_goto_class'><span>" . esc_html( $goto_class ) . "</span></div>\n";
|
1613 |
+
echo "<p>To see an example of how a '<strong>Slide Goto Link</strong>' works ";
|
1614 |
+
echo "<a href='" . esc_attr( $eg_link ) . "' target='_blank'>CLICK HERE</a></p>\n";
|
1615 |
+
echo "</div>\n";
|
1616 |
+
echo "</div>\n";
|
1617 |
+
|
1618 |
+
/**
|
1619 |
+
* // ############################
|
1620 |
+
* // ##### SLIDE TABS - END #####
|
1621 |
+
* // ############################
|
1622 |
+
*/
|
1623 |
+
echo "</div>\n";
|
1624 |
+
|
1625 |
+
// 3. DELETE STATUS FIELD (hidden) AND DELETE SLIDE BUTTON.
|
1626 |
+
echo "<input type='hidden' id='" . esc_attr( $slide_data[ $i ]['del_id'] ) . "' name='" . esc_attr( $slide_data[ $i ]['del_id'] ) . "' value='1'/>\n";
|
1627 |
+
echo "<div class='button button-secondary' onClick='delete_sa_slide(\"" . esc_attr( $slide_data[ $i ]['del_id'] ) . "\");' title='Delete this slide'>Delete Slide</div>\n";
|
1628 |
+
|
1629 |
+
// 4. DUPLICATE SLIDE BUTTON.
|
1630 |
+
echo "<div class='button button-secondary' onClick='duplicate_slide(\"" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "\");' title='Duplicate this slide'>Duplicate Slide</div>\n";
|
1631 |
+
|
1632 |
+
// 5. MOVE SLIDE UP BUTTON.
|
1633 |
+
if ( 1 !== $slide_data[ $i ]['slide_no'] ) {
|
1634 |
+
echo "<div class='button button-secondary' onClick='move_slide_up(\"" . esc_attr( $slide_data[ $i ]['slide_no'] ) . "\");' title='Move this slide up within the slide order'>Move Slide Up</div>\n";
|
1635 |
+
}
|
1636 |
+
|
1637 |
+
echo "</div>\n";
|
1638 |
+
}
|
1639 |
+
echo "</div>\n";
|
1640 |
+
|
1641 |
+
// ADD SLIDE BUTTON.
|
1642 |
+
if ( $num_slides < 99 ) {
|
1643 |
+
// a maximum of 99 slides allowed.
|
1644 |
+
echo "<div id='sa_add_slide' class='button button-primary button-large' title='Add a new slide'>Add Slide</div>\n";
|
1645 |
+
}
|
1646 |
+
|
1647 |
+
// JQUERY-UI DIALOG BOX DIV - FOR CONFIRMATION DIALOG BOXES.
|
1648 |
+
echo "<div id='sa_dialog_box'></div>\n";
|
1649 |
+
}
|
1650 |
+
|
1651 |
+
|
1652 |
+
|
1653 |
+
/**
|
1654 |
+
* ##### META BOX CONTENT - 'Slider Preview/Shortcode' BOX #####
|
1655 |
+
*
|
1656 |
+
* @param array $post Custom Post 'sa_slider'.
|
1657 |
+
*/
|
1658 |
+
function cpt_slider_shortcode_content( $post ) {
|
1659 |
+
// CHECK IF YOAST SEO PLUGIN IS INSTALLED.
|
1660 |
+
$yoast = 0;
|
1661 |
+
if ( is_plugin_active( 'wordpress-seo/wp-seo.php' ) || is_plugin_active( 'wordpress-seo-premium/wp-seo-premium.php' ) ) {
|
1662 |
+
$yoast = 1;
|
1663 |
+
}
|
1664 |
+
$post_status = get_post_status( $post->ID );
|
1665 |
+
$allow_shortcodes = get_post_meta( $post->ID, 'sa_shortcodes', true );
|
1666 |
+
$shortcode = '[slide-anything id="' . $post->ID . '"]';
|
1667 |
+
echo "<div id='sa_slider_shortcode'>" . esc_html( $shortcode ) . "</div>\n";
|
1668 |
+
echo "<div id='sa_shortcode_copy' class='button button-secondary'>Copy to Clipboard</div>\n";
|
1669 |
+
|
1670 |
+
// get value of 'Disable Preview Feature' checkbox.
|
1671 |
+
$disable_preview = '0';
|
1672 |
+
$other_settings = get_post_meta( $post->ID, 'sa_other_settings', true );
|
1673 |
+
if ( '' !== $other_settings ) {
|
1674 |
+
$other_settings_arr = explode( '|', $other_settings );
|
1675 |
+
}
|
1676 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[5] ) ) {
|
1677 |
+
$disable_preview = $other_settings_arr[5];
|
1678 |
+
}
|
1679 |
+
|
1680 |
+
if ( ( 'publish' === $post_status ) && ( '0' === $disable_preview ) && ( 0 === $yoast ) ) {
|
1681 |
+
// CHECK IF THE PREVIEW PAGE ALREADY EXISTS.
|
1682 |
+
// DISABLE THE PREVIEW FEATURE IF 'YOAST SEO' PLUGIN IS INSTALLED.
|
1683 |
+
$preview_page_created = 1;
|
1684 |
+
$preview_page = get_page_by_title( 'Slide Anything Popup Preview' );
|
1685 |
+
$preview_id = $preview_page->ID;
|
1686 |
+
if ( '' !== $preview_id ) {
|
1687 |
+
// PREVIEW PAGE EXISTS - UPDATE PAGE CONTENT TO CONTAIN THIS SA SHORTCODE.
|
1688 |
+
wp_untrash_post( $preview_id ); // remove preview page from trash (if applicable).
|
1689 |
+
$page_content = "[slide-anything id='" . $post->ID . "']";
|
1690 |
+
$page_data = array(
|
1691 |
+
'ID' => $preview_id,
|
1692 |
+
'post_content' => $page_content,
|
1693 |
+
);
|
1694 |
+
$page_id = wp_update_post( $page_data );
|
1695 |
+
if ( is_wp_error( $page_id ) ) {
|
1696 |
+
$preview_page_created = 0;
|
1697 |
+
}
|
1698 |
+
} else {
|
1699 |
+
// PREVIEW PAGE DOES NOT EXIST - CREATE PREVIEW PAGE WITH SA SHORTCODE CONTENT.
|
1700 |
+
$page_content = "[slide-anything id='" . $post->ID . "']";
|
1701 |
+
$curr_user_id = get_current_user_id();
|
1702 |
+
$page_data = array(
|
1703 |
+
'post_title' => 'Slide Anything Popup Preview',
|
1704 |
+
'post_content' => $page_content,
|
1705 |
+
'post_status' => 'publish',
|
1706 |
+
'post_type' => 'page',
|
1707 |
+
'post_author' => $curr_user_id,
|
1708 |
+
'menu_order' => 9999,
|
1709 |
+
);
|
1710 |
+
$page_id = wp_insert_post( $page_data );
|
1711 |
+
if ( is_wp_error( $page_id ) ) {
|
1712 |
+
$preview_page_created = 0;
|
1713 |
+
}
|
1714 |
+
}
|
1715 |
+
if ( 1 === $preview_page_created ) {
|
1716 |
+
// DISPLAY SLIDER PREVIEW BUTTON.
|
1717 |
+
if ( 'publish' === $post_status ) {
|
1718 |
+
echo "<div id='sa_preview_slider' class='button button-secondary' ";
|
1719 |
+
echo "onClick='document.getElementById(\"sa_preview_popup\").style.display = \"block\";'>Preview Slider</div>\n";
|
1720 |
+
}
|
1721 |
+
// DISPLAY SLIDER PREVIEW POPUP.
|
1722 |
+
$preview_page_url = get_page_link( $page_id );
|
1723 |
+
echo "<div id='sa_preview_popup' style='display:none;'>\n";
|
1724 |
+
echo "<div id='sa_preview_wrapper'>\n";
|
1725 |
+
echo "<div id='sa_preview_close' title='Close Slider Preview' ";
|
1726 |
+
echo "onClick='document.getElementById(\"sa_preview_popup\").style.display = \"none\";'>X</div>\n";
|
1727 |
+
echo "<div id='sa_preview_content'>";
|
1728 |
+
echo "<iframe src='" . esc_attr( $preview_page_url ) . "'></iframe>\n";
|
1729 |
+
echo "</div>\n"; // #sa_preview_content
|
1730 |
+
echo "</div>\n"; // #sa_preview_wrapper
|
1731 |
+
echo "</div>\n";
|
1732 |
+
}
|
1733 |
+
}
|
1734 |
+
}
|
1735 |
+
|
1736 |
+
|
1737 |
+
|
1738 |
+
/**
|
1739 |
+
* ##### META BOX CONTENT - 'Items Displayed' BOX #####
|
1740 |
+
*
|
1741 |
+
* @param array $post Custom Post 'sa_slider'.
|
1742 |
+
*/
|
1743 |
+
function cpt_slider_items_content( $post ) {
|
1744 |
+
$sa_pro_version = validate_slide_anything_pro_registration();
|
1745 |
+
$items_width1 = intval( get_post_meta( $post->ID, 'sa_items_width1', true ) );
|
1746 |
+
$items_width2 = intval( get_post_meta( $post->ID, 'sa_items_width2', true ) );
|
1747 |
+
$items_width3 = intval( get_post_meta( $post->ID, 'sa_items_width3', true ) );
|
1748 |
+
$items_width4 = intval( get_post_meta( $post->ID, 'sa_items_width4', true ) );
|
1749 |
+
$items_width5 = intval( get_post_meta( $post->ID, 'sa_items_width5', true ) );
|
1750 |
+
$items_width6 = intval( get_post_meta( $post->ID, 'sa_items_width6', true ) );
|
1751 |
+
if ( 0 === $items_width1 ) {
|
1752 |
+
$items_width1 = 1; }
|
1753 |
+
if ( 0 === $items_width2 ) {
|
1754 |
+
$items_width2 = 1; }
|
1755 |
+
if ( 0 === $items_width3 ) {
|
1756 |
+
$items_width3 = 1; }
|
1757 |
+
if ( 0 === $items_width4 ) {
|
1758 |
+
$items_width4 = 1; }
|
1759 |
+
if ( 0 === $items_width5 ) {
|
1760 |
+
$items_width5 = 1; }
|
1761 |
+
if ( 0 === $items_width6 ) {
|
1762 |
+
$items_width6 = $items_width5; }
|
1763 |
+
|
1764 |
+
echo "<div id='items_displayed_metabox'>\n";
|
1765 |
+
echo "<h4>Browser/Device Width:</h4>\n";
|
1766 |
+
// items for browser width category 1.
|
1767 |
+
echo "<div><em class='sa_tooltip' href='' title='Up to 479 pixels'></em><span>Mobile Portrait</span><select name='sa_items_width1'>";
|
1768 |
+
for ( $i = 1; $i <= 12; $i++ ) {
|
1769 |
+
if ( $i === $items_width1 ) {
|
1770 |
+
echo "<option value='" . esc_attr( $i ) . "' selected>" . esc_html( $i ) . '</option>';
|
1771 |
+
} else {
|
1772 |
+
echo "<option value='" . esc_attr( $i ) . "'>" . esc_html( $i ) . '</option>';
|
1773 |
+
}
|
1774 |
+
}
|
1775 |
+
echo "</select></div>\n";
|
1776 |
+
// items for browser width category 2.
|
1777 |
+
echo "<div><em class='sa_tooltip' href='' title='480 to 767 pixels'></em><span>Mobile Landscape</span><select name='sa_items_width2'>";
|
1778 |
+
for ( $i = 1; $i <= 12; $i++ ) {
|
1779 |
+
if ( $i === $items_width2 ) {
|
1780 |
+
echo "<option value='" . esc_attr( $i ) . "' selected>" . esc_html( $i ) . '</option>';
|
1781 |
+
} else {
|
1782 |
+
echo "<option value='" . esc_attr( $i ) . "'>" . esc_html( $i ) . '</option>';
|
1783 |
+
}
|
1784 |
+
}
|
1785 |
+
echo "</select></div>\n";
|
1786 |
+
// items for browser width category 3.
|
1787 |
+
echo "<div><em class='sa_tooltip' href='' title='768 to 979 pixels'></em><span>Tablet Portrait</span><select name='sa_items_width3'>";
|
1788 |
+
for ( $i = 1; $i <= 12; $i++ ) {
|
1789 |
+
if ( $i === $items_width3 ) {
|
1790 |
+
echo "<option value='" . esc_attr( $i ) . "' selected>" . esc_html( $i ) . '</option>';
|
1791 |
+
} else {
|
1792 |
+
echo "<option value='" . esc_attr( $i ) . "'>" . esc_html( $i ) . '</option>';
|
1793 |
+
}
|
1794 |
+
}
|
1795 |
+
echo "</select></div>\n";
|
1796 |
+
// items for browser width category 4.
|
1797 |
+
echo "<div><em class='sa_tooltip' href='' title='980 to 1199 pixels'></em><span>Desktop Small</span><select name='sa_items_width4'>";
|
1798 |
+
for ( $i = 1; $i <= 12; $i++ ) {
|
1799 |
+
if ( $i === $items_width4 ) {
|
1800 |
+
echo "<option value='" . esc_attr( $i ) . "' selected>" . esc_html( $i ) . '</option>';
|
1801 |
+
} else {
|
1802 |
+
echo "<option value='" . esc_attr( $i ) . "'>" . esc_html( $i ) . '</option>';
|
1803 |
+
}
|
1804 |
+
}
|
1805 |
+
echo "</select></div>\n";
|
1806 |
+
// items for browser width category 5.
|
1807 |
+
echo "<div><em class='sa_tooltip' href='' title='1200 to 1499 pixels'></em><span>Desktop Large</span><select name='sa_items_width5'>";
|
1808 |
+
for ( $i = 1; $i <= 12; $i++ ) {
|
1809 |
+
if ( $i === $items_width5 ) {
|
1810 |
+
echo "<option value='" . esc_attr( $i ) . "' selected>" . esc_html( $i ) . '</option>';
|
1811 |
+
} else {
|
1812 |
+
echo "<option value='" . esc_attr( $i ) . "'>" . esc_html( $i ) . '</option>';
|
1813 |
+
}
|
1814 |
+
}
|
1815 |
+
echo "</select></div>\n";
|
1816 |
+
// items for browser width category 6.
|
1817 |
+
echo "<div><em class='sa_tooltip' href='' title='Over 1500 pixels'></em><span>Desktop X-Large</span><select name='sa_items_width6'>";
|
1818 |
+
for ( $i = 1; $i <= 12; $i++ ) {
|
1819 |
+
if ( $i === $items_width6 ) {
|
1820 |
+
echo "<option value='" . esc_attr( $i ) . "' selected>" . esc_html( $i ) . '</option>';
|
1821 |
+
} else {
|
1822 |
+
echo "<option value='" . esc_attr( $i ) . "'>" . esc_html( $i ) . '</option>';
|
1823 |
+
}
|
1824 |
+
}
|
1825 |
+
echo "</select></div>\n";
|
1826 |
+
// slide transition effect.
|
1827 |
+
$transition = get_post_meta( $post->ID, 'sa_transition', true );
|
1828 |
+
if ( '' === $transition ) {
|
1829 |
+
$transition = 'fade';
|
1830 |
+
}
|
1831 |
+
$option_arr = array();
|
1832 |
+
$option_arr[0] = 'Slide';
|
1833 |
+
$option_arr[1] = 'Fade';
|
1834 |
+
$option_arr[2] = 'Zoom In';
|
1835 |
+
$option_arr[3] = 'Zoom Out';
|
1836 |
+
$option_arr[4] = 'Flip Out X';
|
1837 |
+
$option_arr[5] = 'Flip Out Y';
|
1838 |
+
$option_arr[6] = 'Rotate Left';
|
1839 |
+
$option_arr[7] = 'Rotate Right';
|
1840 |
+
$option_arr[8] = 'Bounce Out';
|
1841 |
+
$option_arr[9] = 'Roll Out';
|
1842 |
+
$option_arr[10] = 'Slide Down';
|
1843 |
+
if ( ( 1 === $items_width1 ) && ( 1 === $items_width2 ) && ( 1 === $items_width3 ) && ( 1 === $items_width4 ) && ( 1 === $items_width5 ) && ( 1 === $items_width6 ) ) {
|
1844 |
+
echo "<div class='sa_items_all_one' style='display:block;'>";
|
1845 |
+
} else {
|
1846 |
+
echo "<div class='sa_items_all_one' style='display:none;'>";
|
1847 |
+
}
|
1848 |
+
echo "<em class='sa_tooltip' href='' title='NOTE: Slide transitions only work when the above items displayed are ALL SET TO 1'></em>";
|
1849 |
+
echo "<span style='color:firebrick !important;'>Slide Transition</span><select style='max-width:100px !important;' name='sa_transition'>";
|
1850 |
+
$tot_opt = count( $option_arr );
|
1851 |
+
for ( $i = 0; $i < $tot_opt; $i++ ) {
|
1852 |
+
if ( $transition === $option_arr[ $i ] ) {
|
1853 |
+
echo "<option value='" . esc_attr( $option_arr[ $i ] ) . "' selected>" . esc_html( $option_arr[ $i ] ) . '</option>';
|
1854 |
+
} else {
|
1855 |
+
echo "<option value='" . esc_attr( $option_arr[ $i ] ) . "'>" . esc_html( $option_arr[ $i ] ) . '</option>';
|
1856 |
+
}
|
1857 |
+
}
|
1858 |
+
echo "</select></div>\n";
|
1859 |
+
|
1860 |
+
// HERO SLIDER.
|
1861 |
+
$hero_slider = get_post_meta( $post->ID, 'sa_hero_slider', true );
|
1862 |
+
if ( '1' !== $hero_slider ) {
|
1863 |
+
$hero_slider = '0';
|
1864 |
+
}
|
1865 |
+
if ( ( 1 === $items_width1 ) && ( 1 === $items_width2 ) && ( 1 === $items_width3 ) && ( 1 === $items_width4 ) && ( 1 === $items_width5 ) && ( 1 === $items_width6 ) ) {
|
1866 |
+
echo "<div id='sa_hero_slider_wrapper' class='sa_items_all_one' style='display:block;'>";
|
1867 |
+
} else {
|
1868 |
+
echo "<div id='sa_hero_slider_wrapper' class='sa_items_all_one' style='display:none;'>";
|
1869 |
+
}
|
1870 |
+
echo '<span>Hero Slider</span>';
|
1871 |
+
if ( $sa_pro_version ) {
|
1872 |
+
// hero slider checkbox.
|
1873 |
+
if ( '1' === $hero_slider ) {
|
1874 |
+
echo "<input type='checkbox' id='sa_hero_slider' name='sa_hero_slider' value='1' checked/>";
|
1875 |
+
} else {
|
1876 |
+
echo "<input type='checkbox' id='sa_hero_slider' name='sa_hero_slider' value='1'/>";
|
1877 |
+
}
|
1878 |
+
$hs_note1 = 'Most WP Theme 'Page Builders' (Visual Composer, Divi, Elementor, SiteOrigin...) allow you create full-width sections in your content. If you are not using a page builder then you will have to manually create a PHP template file to include a full-width container.';
|
1879 |
+
$hs_note2 = 'The slider height is set to 100% screen/device height using CSS 'vh' (viewport height). Just about all browsers now support CSS viewport units, except Opera Mini which was installed on the old 'button' phones.';
|
1880 |
+
if ( '1' === $hero_slider ) {
|
1881 |
+
echo "<div id='sa_hero_slider_note' style='display:block;'>";
|
1882 |
+
} else {
|
1883 |
+
echo "<div id='sa_hero_slider_note' style='display:none;'>";
|
1884 |
+
}
|
1885 |
+
echo '<strong>Please Note:</strong>';
|
1886 |
+
echo "<ol><li>Shortcode should be inserted into a full-width section<em class='sa_tooltip' title='" . esc_attr( $hs_note1 ) . "'></em></li>";
|
1887 |
+
echo "<li>Only works on browsers that support Viewport units - see <a href='https://caniuse.com/#feat=viewport-units' target='_blank'>here</a>";
|
1888 |
+
echo "<em class='sa_tooltip' title='" . esc_attr( $hs_note2 ) . "'></em></li></ol></div>";
|
1889 |
+
} else {
|
1890 |
+
// display slide anything pro promotional text.
|
1891 |
+
echo "<div id='sa_hero_slider_promo'>";
|
1892 |
+
echo "<h4>Available in the PRO VERSION only!</h4>\n";
|
1893 |
+
echo '<p>With <strong>Slide Anything PRO </strong> you can create full width/height <strong>Hero Sliders</strong> ';
|
1894 |
+
echo 'which auto-resize depending on device/screen.</p>';
|
1895 |
+
echo '<p>To view a Hero Slider DEMO click:</p>';
|
1896 |
+
echo "<p style='padding-top:2px !important;'><a href='https://edgewebpages.com/hero-slider-with-thumbnails' target='_blank'>HERO SLIDER DEMO</a></p>";
|
1897 |
+
echo '</div>';
|
1898 |
+
}
|
1899 |
+
echo "</div>\n";
|
1900 |
+
|
1901 |
+
// SHOWCASE SLIDER.
|
1902 |
+
if ( ( 1 === $items_width1 ) && ( 1 === $items_width2 ) && ( 1 === $items_width3 ) && ( 1 === $items_width4 ) && ( 1 === $items_width5 ) && ( 1 === $items_width6 ) ) {
|
1903 |
+
echo "<div id='sa_showcase_slider_wrapper' style='display:none;'>";
|
1904 |
+
} else {
|
1905 |
+
echo "<div id='sa_showcase_slider_wrapper' style='display:block;'>";
|
1906 |
+
}
|
1907 |
+
// showcase slider checkbox.
|
1908 |
+
$showcase_slider = get_post_meta( $post->ID, 'sa_showcase_slider', true );
|
1909 |
+
if ( '1' !== $showcase_slider ) {
|
1910 |
+
$showcase_slider = '0';
|
1911 |
+
}
|
1912 |
+
echo "<div class='sa_ss_line'><span><strong>Showcase Carousel</strong></span>";
|
1913 |
+
if ( $sa_pro_version ) {
|
1914 |
+
echo "<input type='checkbox' id='sa_showcase_slider' name='sa_showcase_slider' value='1'";
|
1915 |
+
if ( '1' === $showcase_slider ) {
|
1916 |
+
echo ' checked'; }
|
1917 |
+
echo ' />';
|
1918 |
+
}
|
1919 |
+
echo '</div>';
|
1920 |
+
if ( $sa_pro_version ) {
|
1921 |
+
if ( '1' === $showcase_slider ) {
|
1922 |
+
echo "<div id='sa_showcase_slider_pro' style='display:block;'>";
|
1923 |
+
} else {
|
1924 |
+
echo "<div id='sa_showcase_slider_pro' style='display:none;'>";
|
1925 |
+
|
1926 |
+
}
|
1927 |
+
// showcase slider - desktop width.
|
1928 |
+
$showcase_width = get_post_meta( $post->ID, 'sa_showcase_width', true );
|
1929 |
+
if ( '' === $showcase_width ) {
|
1930 |
+
$showcase_width = '120';
|
1931 |
+
}
|
1932 |
+
echo "<div class='sa_ss_line'><span>Desktop Width</span>";
|
1933 |
+
echo "<input type='text' id='sa_showcase_width' name='sa_showcase_width' value='" . esc_attr( $showcase_width ) . "'>";
|
1934 |
+
echo "<em>%</em></div>\n";
|
1935 |
+
// showcase slider - use on tablets.
|
1936 |
+
$showcase_tablet = get_post_meta( $post->ID, 'sa_showcase_tablet', true );
|
1937 |
+
if ( ( '0' !== $showcase_tablet ) && ( '1' !== $showcase_tablet ) ) {
|
1938 |
+
$showcase_tablet = '1';
|
1939 |
+
}
|
1940 |
+
echo "<div class='sa_ss_line'><span>Use on Tablets</span>";
|
1941 |
+
if ( '1' === $showcase_tablet ) {
|
1942 |
+
echo "<input type='checkbox' id='sa_showcase_tablet' name='sa_showcase_tablet' value='1' checked />";
|
1943 |
+
} else {
|
1944 |
+
echo "<input type='checkbox' id='sa_showcase_tablet' name='sa_showcase_tablet' value='1' />";
|
1945 |
+
}
|
1946 |
+
echo "</div>\n";
|
1947 |
+
// showcase slider - tablet width.
|
1948 |
+
$showcase_width_tab = get_post_meta( $post->ID, 'sa_showcase_width_tab', true );
|
1949 |
+
if ( '' === $showcase_width_tab ) {
|
1950 |
+
$showcase_width_tab = '130';
|
1951 |
+
}
|
1952 |
+
echo "<div class='sa_ss_line'><span>Tablet Width</span>";
|
1953 |
+
echo "<input type='text' id='sa_showcase_width_tab' name='sa_showcase_width_tab' value='" . esc_attr( $showcase_width_tab ) . "'>";
|
1954 |
+
echo "<em>%</em></div>\n";
|
1955 |
+
// showcase slider - use on mobiles.
|
1956 |
+
$showcase_mobile = get_post_meta( $post->ID, 'sa_showcase_mobile', true );
|
1957 |
+
if ( '1' !== $showcase_mobile ) {
|
1958 |
+
$showcase_mobile = '0';
|
1959 |
+
}
|
1960 |
+
echo "<div class='sa_ss_line'><span>Use on Mobiles</span>";
|
1961 |
+
if ( '1' === $showcase_mobile ) {
|
1962 |
+
echo "<input type='checkbox' id='sa_showcase_mobile' name='sa_showcase_mobile' value='1' checked />";
|
1963 |
+
} else {
|
1964 |
+
echo "<input type='checkbox' id='sa_showcase_mobile' name='sa_showcase_mobile' value='1' />";
|
1965 |
+
}
|
1966 |
+
echo "</div>\n";
|
1967 |
+
// showcase slider - mobile width.
|
1968 |
+
$showcase_width_mob = get_post_meta( $post->ID, 'sa_showcase_width_mob', true );
|
1969 |
+
if ( '' === $showcase_width_mob ) {
|
1970 |
+
$showcase_width_mob = '140';
|
1971 |
+
}
|
1972 |
+
echo "<div class='sa_ss_line'><span>Mobile Width</span>";
|
1973 |
+
echo "<input type='text' id='sa_showcase_width_mob' name='sa_showcase_width_mob' value='" . esc_attr( $showcase_width_mob ) . "'>";
|
1974 |
+
echo "<em>%</em></div>\n";
|
1975 |
+
// showcase slider - css to style left/rightmost slides.
|
1976 |
+
$css_id = get_post_meta( $post->ID, 'sa_css_id', true );
|
1977 |
+
echo "<div class='sa_ss_css_line'>CSS to target left+right partial slides:";
|
1978 |
+
echo "<div id='ss_css_value'>#" . esc_html( $css_id ) . ' .sc_partial</div>';
|
1979 |
+
echo "</div>\n";
|
1980 |
+
echo '</div>'; // #sa_showcase_slider_pro
|
1981 |
+
} else {
|
1982 |
+
// display slide anything pro promotional text.
|
1983 |
+
echo "<div id='sa_showcase_slider_promo'>";
|
1984 |
+
echo "<h4>Available in the PRO VERSION only!</h4>\n";
|
1985 |
+
echo '<p>A <strong>Showcase Carousels</strong> has a container width that exceeds the screen/window width. ';
|
1986 |
+
echo 'The leftmost/rightmost visible slides therefore become partially visible.</p>';
|
1987 |
+
echo '<p>Showcase Carousel DEMO:</p>';
|
1988 |
+
echo "<p style='padding-top:2px !important;'><a href='https://edgewebpages.com/showcase-carousel-demo/' target='_blank'>SHOWCASE CAROUSEL DEMO</a></p>";
|
1989 |
+
echo '</div>';
|
1990 |
+
}
|
1991 |
+
echo "</div>\n";
|
1992 |
+
|
1993 |
+
echo "</div>\n";
|
1994 |
+
}
|
1995 |
+
|
1996 |
+
|
1997 |
+
|
1998 |
+
/**
|
1999 |
+
* ##### META BOX CONTENT - 'Slider Style' BOX #####
|
2000 |
+
*
|
2001 |
+
* @param array $post Custom Post 'sa_slider'.
|
2002 |
+
*/
|
2003 |
+
function cpt_slider_style_content( $post ) {
|
2004 |
+
// CSS ID.
|
2005 |
+
$css_id = get_post_meta( $post->ID, 'sa_css_id', true );
|
2006 |
+
if ( '' === $css_id ) {
|
2007 |
+
$css_id = 'slider_' . $post->ID;
|
2008 |
+
}
|
2009 |
+
echo "<div id='slider_style_metabox'>\n";
|
2010 |
+
echo "<h4>CSS <span>#id</span> for Slider:</h4>\n";
|
2011 |
+
echo "<div style='padding-bottom:10px; color:#909090;'>Must consist of letters (upper/lowercase) or Underscore '_' characters <span style='color:firebrick;'>ONLY!</span></div>\n";
|
2012 |
+
echo "<input type='text' id='sa_css_id' name='sa_css_id' value='" . esc_attr( $css_id ) . "'/>\n";
|
2013 |
+
echo "<div id='css_note_text'>To style slides use CSS selector:</div>";
|
2014 |
+
echo "<div id='css_note_value'>#" . esc_html( $css_id ) . ' .owl-item</div>';
|
2015 |
+
echo "<div class='ca_style_hr'></div>\n";
|
2016 |
+
|
2017 |
+
// SLIDER PADDING (TOP, RIGHT, BOTTOM, LEFT).
|
2018 |
+
$wrapper_padd_top = get_post_meta( $post->ID, 'sa_wrapper_padd_top', true );
|
2019 |
+
if ( '' === $wrapper_padd_top ) {
|
2020 |
+
$wrapper_padd_top = '0'; }
|
2021 |
+
$wrapper_padd_right = get_post_meta( $post->ID, 'sa_wrapper_padd_right', true );
|
2022 |
+
if ( '' === $wrapper_padd_right ) {
|
2023 |
+
$wrapper_padd_right = '0'; }
|
2024 |
+
$wrapper_padd_bottom = get_post_meta( $post->ID, 'sa_wrapper_padd_bottom', true );
|
2025 |
+
if ( '' === $wrapper_padd_bottom ) {
|
2026 |
+
$wrapper_padd_bottom = '0'; }
|
2027 |
+
$wrapper_padd_left = get_post_meta( $post->ID, 'sa_wrapper_padd_left', true );
|
2028 |
+
if ( '' === $wrapper_padd_left ) {
|
2029 |
+
$wrapper_padd_left = '0'; }
|
2030 |
+
$tooltip = 'Padding space around the entire carousel/slider';
|
2031 |
+
echo "<h4>Padding <span>(pixels)</span>:<em class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></em></h4>";
|
2032 |
+
echo "<div class='ca_style_padding'>";
|
2033 |
+
echo "<div id='padd_top'>";
|
2034 |
+
echo "<input type='text' id='sa_wrapper_padd_top' name='sa_wrapper_padd_top' value='" . esc_attr( $wrapper_padd_top ) . "'></div>";
|
2035 |
+
echo "<div id='padd_right'>";
|
2036 |
+
echo "<input type='text' id='sa_wrapper_padd_right' name='sa_wrapper_padd_right' value='" . esc_attr( $wrapper_padd_right ) . "'></div>";
|
2037 |
+
echo "<div type='text' id='padd_bottom'>";
|
2038 |
+
echo "<input type='text' id='sa_wrapper_padd_bottom' name='sa_wrapper_padd_bottom' value='" . esc_attr( $wrapper_padd_bottom ) . "'></div>";
|
2039 |
+
echo "<div id='padd_left'>";
|
2040 |
+
echo "<input type='text' id='sa_wrapper_padd_left' name='sa_wrapper_padd_left' value='" . esc_attr( $wrapper_padd_left ) . "'></div>";
|
2041 |
+
echo "</div>\n";
|
2042 |
+
echo "<div style='clear:both; float:none; width:100%; height:10px;'></div>";
|
2043 |
+
|
2044 |
+
$tooltip = 'Style settings for the slider navigation arrows and slider pagination';
|
2045 |
+
echo "<h4>Slider Navigation:<em class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></em></h4>";
|
2046 |
+
|
2047 |
+
// AUTOHIDE ARROWS.
|
2048 |
+
$autohide_arrows = get_post_meta( $post->ID, 'sa_autohide_arrows', true );
|
2049 |
+
if ( '' === $autohide_arrows ) {
|
2050 |
+
$autohide_arrows = '1';
|
2051 |
+
}
|
2052 |
+
echo "<div class='ca_style_setting_line'><span style='width:140px;'>Autohide Arrows</span>";
|
2053 |
+
if ( '1' === $autohide_arrows ) {
|
2054 |
+
echo "<input type='checkbox' id='sa_autohide_arrows' name='sa_autohide_arrows' value='1' checked/>";
|
2055 |
+
} else {
|
2056 |
+
echo "<input type='checkbox' id='sa_autohide_arrows' name='sa_autohide_arrows' value='1'/>";
|
2057 |
+
}
|
2058 |
+
echo "</div>\n";
|
2059 |
+
|
2060 |
+
// SHOW DOT PER SLIDE.
|
2061 |
+
$dot_per_slide = get_post_meta( $post->ID, 'sa_dot_per_slide', true );
|
2062 |
+
if ( '' === $dot_per_slide ) {
|
2063 |
+
$dot_per_slide = '0';
|
2064 |
+
}
|
2065 |
+
echo "<div class='ca_style_setting_line'><span style='width:140px;'>Show 1 Dot Per Slide</span>";
|
2066 |
+
if ( '1' === $dot_per_slide ) {
|
2067 |
+
echo "<input type='checkbox' id='sa_dot_per_slide' name='sa_dot_per_slide' value='1' checked/>";
|
2068 |
+
} else {
|
2069 |
+
echo "<input type='checkbox' id='sa_dot_per_slide' name='sa_dot_per_slide' value='1'/>";
|
2070 |
+
}
|
2071 |
+
echo "</div>\n";
|
2072 |
+
|
2073 |
+
$tooltip = 'The background color and border around the entire carousel/slider';
|
2074 |
+
echo "<h4>Background/Border:<em class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></em></h4>";
|
2075 |
+
|
2076 |
+
// SLIDER BACKGROUND COLOR.
|
2077 |
+
$background_color = get_post_meta( $post->ID, 'sa_background_color', true );
|
2078 |
+
if ( '' === $background_color ) {
|
2079 |
+
$background_color = 'rgba(0,0,0,0)';
|
2080 |
+
}
|
2081 |
+
echo "<div class='ca_style_setting_line'><span>Background:</span>";
|
2082 |
+
echo "<input type='text' id='sa_background_color' name='sa_background_color' value='" . esc_attr( $background_color ) . "'></div>\n";
|
2083 |
+
|
2084 |
+
// SLIDER BORDER (WIDTH & COLOR).
|
2085 |
+
$border_width = get_post_meta( $post->ID, 'sa_border_width', true );
|
2086 |
+
if ( '' === $border_width ) {
|
2087 |
+
$border_width = '0';
|
2088 |
+
}
|
2089 |
+
$border_color = get_post_meta( $post->ID, 'sa_border_color', true );
|
2090 |
+
if ( '' === $border_color ) {
|
2091 |
+
$border_color = 'rgba(0,0,0,0)';
|
2092 |
+
}
|
2093 |
+
echo "<div class='ca_style_setting_line'><span>Border Style:</span>";
|
2094 |
+
echo "<input type='text' id='sa_border_width' name='sa_border_width' value='" . esc_attr( $border_width ) . "'><em>px</em>";
|
2095 |
+
echo "<input type='text' id='sa_border_color' name='sa_border_color' value='" . esc_attr( $border_color ) . "'></div>\n";
|
2096 |
+
|
2097 |
+
// SLIDER BORDER RADIUS.
|
2098 |
+
$border_radius = get_post_meta( $post->ID, 'sa_border_radius', true );
|
2099 |
+
if ( '' === $border_radius ) {
|
2100 |
+
$border_radius = '0';
|
2101 |
+
}
|
2102 |
+
echo "<div class='ca_style_setting_line'><span>Border Radius:</span>";
|
2103 |
+
echo "<input type='text' id='sa_border_radius' name='sa_border_radius' value='" . esc_attr( $border_radius ) . "'></div>\n";
|
2104 |
+
|
2105 |
+
echo "<div class='ca_style_hr' style='margin-top:10px;'></div>\n";
|
2106 |
+
|
2107 |
+
$tooltip = 'The style settings for all slides (within the slider/carousel)';
|
2108 |
+
echo "<h4>Slide Style:<em class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></em></h4>";
|
2109 |
+
|
2110 |
+
// SLIDE - MINIMUM HEIGHT.
|
2111 |
+
$slide_min_height = get_post_meta( $post->ID, 'sa_slide_min_height_perc', true );
|
2112 |
+
if ( '' === $slide_min_height ) {
|
2113 |
+
$slide_min_height = '50';
|
2114 |
+
}
|
2115 |
+
echo "<div style='padding:5px 0px 10px;'>\n";
|
2116 |
+
$tooltip = 'The minimum height of each slide. Can be set to a percentage of the slide width, or for image sliders set to a 4:3 or 16:9 aspect ratio.';
|
2117 |
+
echo "<div class='ca_style_setting_line' id='ca_style_min_height' style='padding-bottom:7px !important;'>";
|
2118 |
+
echo "<span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'>Min Height:</span><br/>";
|
2119 |
+
if ( 'aspect43' === $slide_min_height ) {
|
2120 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='percent' style='margin-left:20px !important;'/><em>%</em>";
|
2121 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='px'/><em>px</em>";
|
2122 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='43' checked/><em>4:3</em>";
|
2123 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='169'/><em>16:9</em>";
|
2124 |
+
} elseif ( 'aspect169' === $slide_min_height ) {
|
2125 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='percent' style='margin-left:20px !important;'/><em>%</em>";
|
2126 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='px'/><em>px</em>";
|
2127 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='43'/><em>4:3</em>";
|
2128 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='169' checked/><em>16:9</em>";
|
2129 |
+
} elseif ( strpos( $slide_min_height, 'px' ) !== false ) {
|
2130 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='percent' style='margin-left:20px !important;'/><em>%</em>";
|
2131 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='px' checked/><em>px</em>";
|
2132 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='43'/><em>4:3</em>";
|
2133 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='169'/><em>16:9</em>";
|
2134 |
+
} else {
|
2135 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='percent' style='margin-left:20px !important;' checked/><em>%</em>";
|
2136 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='px'/><em>px</em>";
|
2137 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='43'/><em>4:3</em>";
|
2138 |
+
echo "<input type='radio' name='sa_slide_min_height_type' class='sa_slide_min_height_type' value='169'/><em>16:9</em>";
|
2139 |
+
}
|
2140 |
+
echo "</div>\n";
|
2141 |
+
if ( ( 'aspect43' === $slide_min_height ) || ( 'aspect169' === $slide_min_height ) ) {
|
2142 |
+
$mh_suffix = '';
|
2143 |
+
echo "<div class='ca_style_setting_line' id='sa_slide_min_height_wrapper' style='display:none;'>";
|
2144 |
+
echo "<input type='text' id='sa_slide_min_height' name='sa_slide_min_height' value='" . esc_attr( $slide_min_height ) . "'/>";
|
2145 |
+
echo "<em id='mh_suffix'>" . esc_html( $mh_suffix ) . "</em></div>\n";
|
2146 |
+
echo "<input type='hidden' id='sa_slide_min_height_hidden' name='sa_slide_min_height_hidden' value='0'/>\n";
|
2147 |
+
} else {
|
2148 |
+
if ( strpos( $slide_min_height, 'px' ) !== false ) {
|
2149 |
+
$mh_value = str_replace( 'px', '', $slide_min_height );
|
2150 |
+
$mh_suffix = 'px';
|
2151 |
+
} else {
|
2152 |
+
$mh_value = $slide_min_height;
|
2153 |
+
$mh_suffix = '%';
|
2154 |
+
}
|
2155 |
+
echo "<div class='ca_style_setting_line' id='sa_slide_min_height_wrapper'><span style='width:20px;'> </span>";
|
2156 |
+
echo "<input type='text' id='sa_slide_min_height' name='sa_slide_min_height' value='" . esc_attr( $mh_value ) . "'/>";
|
2157 |
+
echo "<em id='mh_suffix'>" . esc_html( $mh_suffix ) . "</em></div>\n";
|
2158 |
+
echo "<input type='hidden' id='sa_slide_min_height_hidden' name='sa_slide_min_height_hidden' value='" . esc_attr( $mh_value ) . "'/>\n";
|
2159 |
+
}
|
2160 |
+
echo "</div>\n";
|
2161 |
+
|
2162 |
+
// SLIDE - PADDING TOP/BOTTOM.
|
2163 |
+
$slide_padding_tb = get_post_meta( $post->ID, 'sa_slide_padding_tb', true );
|
2164 |
+
if ( '' === $slide_padding_tb ) {
|
2165 |
+
$slide_padding_tb = '5';
|
2166 |
+
}
|
2167 |
+
$tooltip = 'Padding space top/bottom for each individual slide';
|
2168 |
+
echo "<div class='ca_style_setting_line' id='ca_style_padding_top_bottom'><span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'>Padding:</span>";
|
2169 |
+
echo "<input type='text' id='sa_slide_padding_tb' name='sa_slide_padding_tb' value='" . esc_attr( $slide_padding_tb ) . "'><em>%</em></div>\n";
|
2170 |
+
|
2171 |
+
// SLIDE - PADDING LEFT/RIGHT.
|
2172 |
+
$slide_padding_lr = get_post_meta( $post->ID, 'sa_slide_padding_lr', true );
|
2173 |
+
if ( '' === $slide_padding_lr ) {
|
2174 |
+
$slide_padding_lr = '5';
|
2175 |
+
}
|
2176 |
+
$tooltip = 'Padding space left/right for each individual slide';
|
2177 |
+
echo "<div class='ca_style_setting_line' id='ca_style_padding_left_right'><span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'>Padding:</span>";
|
2178 |
+
echo "<input type='text' id='sa_slide_padding_lr' name='sa_slide_padding_lr' value='" . esc_attr( $slide_padding_lr ) . "'><em>%</em></div>\n";
|
2179 |
+
|
2180 |
+
// SLIDE - MARGIN LEFT/RIGHT.
|
2181 |
+
$slide_margin_lr = get_post_meta( $post->ID, 'sa_slide_margin_lr', true );
|
2182 |
+
if ( '' === $slide_margin_lr ) {
|
2183 |
+
$slide_margin_lr = '0';
|
2184 |
+
}
|
2185 |
+
$tooltip = 'Margin space left and right of each slide';
|
2186 |
+
echo "<div class='ca_style_setting_line' id='ca_style_margin_left_right'><span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'>Margin:</span>";
|
2187 |
+
echo "<input type='text' id='sa_slide_margin_lr' name='sa_slide_margin_lr' value='" . esc_attr( $slide_margin_lr ) . "'><em>%</em></div>\n";
|
2188 |
+
|
2189 |
+
$tooltip = 'The link/popup buttons that appear on a slide';
|
2190 |
+
echo "<h4>Link/Popup Icons:<em class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></em></h4>";
|
2191 |
+
|
2192 |
+
// LINK/POPUP ICONS - ICON LOCATION.
|
2193 |
+
$slide_icons_location = get_post_meta( $post->ID, 'sa_slide_icons_location', true );
|
2194 |
+
if ( '' === $slide_icons_location ) {
|
2195 |
+
$slide_icons_location = 'Center Center';
|
2196 |
+
}
|
2197 |
+
echo "<div class='ca_style_setting_line'><span>Icon Location</span>";
|
2198 |
+
echo "<select id='sa_slide_icons_location' name='sa_slide_icons_location'>";
|
2199 |
+
$option_arr = array();
|
2200 |
+
$option_arr[0] = 'Center Center';
|
2201 |
+
$option_arr[1] = 'Top Left';
|
2202 |
+
$option_arr[2] = 'Top Center';
|
2203 |
+
$option_arr[3] = 'Top Right';
|
2204 |
+
$option_arr[4] = 'Bottom Left';
|
2205 |
+
$option_arr[5] = 'Bottom Center';
|
2206 |
+
$option_arr[6] = 'Bottom Right';
|
2207 |
+
$tot_opt = count( $option_arr );
|
2208 |
+
for ( $i = 0; $i < $tot_opt; $i++ ) {
|
2209 |
+
if ( $option_arr[ $i ] === $slide_icons_location ) {
|
2210 |
+
echo "<option value='" . esc_attr( $option_arr[ $i ] ) . "' selected>" . esc_html( $option_arr[ $i ] ) . '</option>';
|
2211 |
+
} else {
|
2212 |
+
echo "<option value='" . esc_attr( $option_arr[ $i ] ) . "'>" . esc_html( $option_arr[ $i ] ) . '</option>';
|
2213 |
+
}
|
2214 |
+
}
|
2215 |
+
echo "</select></div>\n";
|
2216 |
+
|
2217 |
+
// LINK/POPUP ICONS - ALWAYS VISIBLE.
|
2218 |
+
$slide_icons_visible = get_post_meta( $post->ID, 'sa_slide_icons_visible', true );
|
2219 |
+
if ( '1' !== $slide_icons_visible ) {
|
2220 |
+
$slide_icons_visible = '0';
|
2221 |
+
}
|
2222 |
+
echo "<div class='ca_style_setting_line'><span>Always Visible</span>";
|
2223 |
+
if ( '1' === $slide_icons_visible ) {
|
2224 |
+
echo "<input type='checkbox' id='sa_slide_icons_visible' name='sa_slide_icons_visible' value='1' checked/>";
|
2225 |
+
} else {
|
2226 |
+
echo "<input type='checkbox' id='sa_slide_icons_visible' name='sa_slide_icons_visible' value='1'/>";
|
2227 |
+
}
|
2228 |
+
echo "</div>\n";
|
2229 |
+
|
2230 |
+
// LINK/POPUP ICONS - COLOR SCHEME.
|
2231 |
+
$slide_icons_color = get_post_meta( $post->ID, 'sa_slide_icons_color', true );
|
2232 |
+
if ( '' === $slide_icons_color ) {
|
2233 |
+
$slide_icons_location = 'white';
|
2234 |
+
}
|
2235 |
+
echo "<div class='ca_style_setting_line'><span>Color Scheme</span>";
|
2236 |
+
echo "<select id='sa_slide_icons_color' name='sa_slide_icons_color'>";
|
2237 |
+
if ( 'black' === $slide_icons_color ) {
|
2238 |
+
echo "<option value='white'>White</option>";
|
2239 |
+
echo "<option value='black' selected>Black</option>";
|
2240 |
+
} else {
|
2241 |
+
echo "<option value='white selected'>White</option>";
|
2242 |
+
echo "<option value='black'>Black</option>";
|
2243 |
+
}
|
2244 |
+
echo "</select></div>\n";
|
2245 |
+
|
2246 |
+
// LINK/POPUP ICONS - FULL SLIDE LINKS.
|
2247 |
+
$slide_icons_fullslide = get_post_meta( $post->ID, 'sa_slide_icons_fullslide', true );
|
2248 |
+
if ( '1' !== $slide_icons_fullslide ) {
|
2249 |
+
$slide_icons_fullslide = '0';
|
2250 |
+
}
|
2251 |
+
echo "<div class='ca_style_setting_line'><span>Full Slide Links</span>";
|
2252 |
+
if ( '1' === $slide_icons_fullslide ) {
|
2253 |
+
echo "<input type='checkbox' id='sa_slide_icons_fullslide' name='sa_slide_icons_fullslide' value='1' checked/>";
|
2254 |
+
} else {
|
2255 |
+
echo "<input type='checkbox' id='sa_slide_icons_fullslide' name='sa_slide_icons_fullslide' value='1'/>";
|
2256 |
+
}
|
2257 |
+
$tooltip = 'This makes the entire slide area a clickable link. NOTE: This feature is ';
|
2258 |
+
$tooltip .= 'disabled if you have both a slide link AND a popup link for a slide.';
|
2259 |
+
$tt_style = 'margin:0px 0px -3px 5px; cursor:help;';
|
2260 |
+
echo "<em class='sa_tooltip' style='" . esc_attr( $tt_style ) . "' title='" . esc_attr( $tooltip ) . "'></em>";
|
2261 |
+
echo "</div>\n";
|
2262 |
+
|
2263 |
+
// ##### OTHER SETTINGS #####
|
2264 |
+
|
2265 |
+
echo "<h4 style='margin-top:10px !important;'>Other Settings:</h4>";
|
2266 |
+
|
2267 |
+
// FETCH OTHER SETTINGS POST META.
|
2268 |
+
$other_settings = get_post_meta( $post->ID, 'sa_other_settings', true );
|
2269 |
+
if ( '' !== $other_settings ) {
|
2270 |
+
$other_settings_arr = explode( '|', $other_settings );
|
2271 |
+
}
|
2272 |
+
// setting 1 - sa_window_onload.
|
2273 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[0] ) ) {
|
2274 |
+
$window_onload = $other_settings_arr[0];
|
2275 |
+
} else {
|
2276 |
+
$window_onload = get_post_meta( $post->ID, 'sa_window_onload', true );
|
2277 |
+
if ( '' === $window_onload ) {
|
2278 |
+
$window_onload = '0';
|
2279 |
+
}
|
2280 |
+
}
|
2281 |
+
// setting 2 - sa_strip_javascript.
|
2282 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[1] ) ) {
|
2283 |
+
$strip_javascript = $other_settings_arr[1];
|
2284 |
+
} else {
|
2285 |
+
$strip_javascript = get_post_meta( $post->ID, 'sa_strip_javascript', true );
|
2286 |
+
if ( '' === $strip_javascript ) {
|
2287 |
+
$strip_javascript = '0';
|
2288 |
+
}
|
2289 |
+
}
|
2290 |
+
// setting 3 - sa_lazy_load_images.
|
2291 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[2] ) ) {
|
2292 |
+
$lazy_load_images = $other_settings_arr[2];
|
2293 |
+
} else {
|
2294 |
+
$lazy_load_images = get_post_meta( $post->ID, 'sa_lazy_load_images', true );
|
2295 |
+
if ( '' === $lazy_load_images ) {
|
2296 |
+
$lazy_load_images = '0';
|
2297 |
+
}
|
2298 |
+
}
|
2299 |
+
// setting 4 - sa_ulli_containers.
|
2300 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[3] ) ) {
|
2301 |
+
$ulli_containers = $other_settings_arr[3];
|
2302 |
+
} else {
|
2303 |
+
$ulli_containers = get_post_meta( $post->ID, 'sa_ulli_containers', true );
|
2304 |
+
if ( '' === $ulli_containers ) {
|
2305 |
+
$ulli_containers = '0';
|
2306 |
+
}
|
2307 |
+
}
|
2308 |
+
// setting 5 - sa_rtl_slider.
|
2309 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[4] ) ) {
|
2310 |
+
$rtl_slider = $other_settings_arr[4];
|
2311 |
+
} else {
|
2312 |
+
$rtl_slider = '0';
|
2313 |
+
}
|
2314 |
+
// setting 6 - sa_disable_preview.
|
2315 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[5] ) ) {
|
2316 |
+
$disable_preview = $other_settings_arr[5];
|
2317 |
+
} else {
|
2318 |
+
$disable_preview = '0';
|
2319 |
+
}
|
2320 |
+
// setting 7 - bg_image_size.
|
2321 |
+
$bg_image_size = 'full';
|
2322 |
+
if ( isset( $other_settings_arr ) && ( count( $other_settings_arr ) > 6 ) ) {
|
2323 |
+
if ( '' !== $other_settings_arr[6] ) {
|
2324 |
+
$bg_image_size = $other_settings_arr[6];
|
2325 |
+
}
|
2326 |
+
}
|
2327 |
+
// setting 8 - sa_disable_slide_ids.
|
2328 |
+
if ( isset( $other_settings_arr ) && ( count( $other_settings_arr ) > 7 ) ) {
|
2329 |
+
$disable_slide_ids = $other_settings_arr[7];
|
2330 |
+
} else {
|
2331 |
+
$disable_slide_ids = '0';
|
2332 |
+
}
|
2333 |
+
|
2334 |
+
// USE 'DOMContentLoaded' EVENT (checkbox).
|
2335 |
+
$tooltip = 'Load the Slide Anything JavaScript during the DOMContentLoaded event. Use this option if jQuery ';
|
2336 |
+
$tooltip .= 'is loading in your theme footer and you are getting the JavaScript error message ';
|
2337 |
+
$tooltip .= '"Uncaught ReferenceError: jQuery is not defined".';
|
2338 |
+
echo "<div class='sa_window_onload_line'>";
|
2339 |
+
echo "<span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></span><span style='min-width:160px;'>DOMContentLoaded event:</span>";
|
2340 |
+
if ( '1' === $window_onload ) {
|
2341 |
+
echo "<input type='checkbox' id='sa_window_onload' name='sa_window_onload' value='1' checked/>";
|
2342 |
+
} else {
|
2343 |
+
echo "<input type='checkbox' id='sa_window_onload' name='sa_window_onload' value='1'/>";
|
2344 |
+
}
|
2345 |
+
echo "</div>\n";
|
2346 |
+
|
2347 |
+
echo "<div style='display:none !important;'>";
|
2348 |
+
echo "<input type='checkbox' id='sa_lazy_load_images' name='sa_lazy_load_images' value='0'/>";
|
2349 |
+
echo "</div>\n";
|
2350 |
+
|
2351 |
+
// Use UL and LI Containers.
|
2352 |
+
$tooltip = 'Use "UL" as the DOM element for "owl-stage" and use "LI" as the DOM elements for "owl-item".';
|
2353 |
+
echo "<div class='sa_window_onload_line'>";
|
2354 |
+
echo "<span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></span><span style='min-width:160px;'>Use UL and LI Containers:</span>";
|
2355 |
+
if ( '1' === $ulli_containers ) {
|
2356 |
+
echo "<input type='checkbox' id='sa_ulli_containers' name='sa_ulli_containers' value='1' checked/>";
|
2357 |
+
} else {
|
2358 |
+
echo "<input type='checkbox' id='sa_ulli_containers' name='sa_ulli_containers' value='1'/>";
|
2359 |
+
}
|
2360 |
+
echo "</div>\n";
|
2361 |
+
|
2362 |
+
// Right to Left Slider.
|
2363 |
+
$tooltip = 'Change the direction of the slider to be right to left.';
|
2364 |
+
echo "<div class='sa_window_onload_line'>";
|
2365 |
+
echo "<span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></span><span style='min-width:160px;'>Right to Left Slider:</span>";
|
2366 |
+
if ( '1' === $rtl_slider ) {
|
2367 |
+
echo "<input type='checkbox' id='sa_rtl_slider' name='sa_rtl_slider' value='1' checked/>";
|
2368 |
+
} else {
|
2369 |
+
echo "<input type='checkbox' id='sa_rtl_slider' name='sa_rtl_slider' value='1'/>";
|
2370 |
+
}
|
2371 |
+
echo "</div>\n";
|
2372 |
+
|
2373 |
+
// Disable Preview Feature.
|
2374 |
+
$tooltip = 'Disable the "Preview Slider" feature in this settings page - the "Slide Anything Popup Preview" page will no longer be auto generated.';
|
2375 |
+
echo "<div class='sa_window_onload_line'>";
|
2376 |
+
echo "<span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></span><span style='min-width:160px;'>Disable Preview Feature:</span>";
|
2377 |
+
if ( '1' === $disable_preview ) {
|
2378 |
+
echo "<input type='checkbox' id='sa_disable_preview' name='sa_disable_preview' value='1' checked/>";
|
2379 |
+
} else {
|
2380 |
+
echo "<input type='checkbox' id='sa_disable_preview' name='sa_disable_preview' value='1'/>";
|
2381 |
+
}
|
2382 |
+
echo "</div>\n";
|
2383 |
+
|
2384 |
+
// Don't use Slide IDs.
|
2385 |
+
$tooltip = 'Do not use a unique CSS ID to identify each slide container - use a unique CSS Class instead.';
|
2386 |
+
echo "<div class='sa_window_onload_line'>";
|
2387 |
+
echo "<span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></span><span style='min-width:160px;'>Don't use CSS IDs for slides:</span>";
|
2388 |
+
if ( '1' === $disable_slide_ids ) {
|
2389 |
+
echo "<input type='checkbox' id='sa_disable_slide_ids' name='sa_disable_slide_ids' value='1' checked/>";
|
2390 |
+
} else {
|
2391 |
+
echo "<input type='checkbox' id='sa_disable_slide_ids' name='sa_disable_slide_ids' value='1'/>";
|
2392 |
+
}
|
2393 |
+
echo "</div>\n";
|
2394 |
+
|
2395 |
+
// Start Position.
|
2396 |
+
$num_slides = intval( get_post_meta( $post->ID, 'sa_num_slides', true ) );
|
2397 |
+
if ( '' === $num_slides ) {
|
2398 |
+
$start_pos = 1;
|
2399 |
+
} else {
|
2400 |
+
$start_pos = intval( get_post_meta( $post->ID, 'sa_start_pos', true ) );
|
2401 |
+
if ( '' === $start_pos ) {
|
2402 |
+
$start_pos = 1;
|
2403 |
+
}
|
2404 |
+
$tooltip = 'Which slide number to start display first';
|
2405 |
+
echo "<div class='sa_window_onload_line'>";
|
2406 |
+
echo "<span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></span><span style='min-width:160px;'>Starting Slide Number:</span>";
|
2407 |
+
echo "<select name='sa_start_pos'>";
|
2408 |
+
for ( $i = 1; $i <= $num_slides; $i++ ) {
|
2409 |
+
if ( $i === $start_pos ) {
|
2410 |
+
echo "<option value='" . esc_attr( $i ) . "' selected>" . esc_html( $i ) . '</option>';
|
2411 |
+
} else {
|
2412 |
+
echo "<option value='" . esc_attr( $i ) . "'>" . esc_html( $i ) . '</option>';
|
2413 |
+
}
|
2414 |
+
}
|
2415 |
+
echo '</select>';
|
2416 |
+
echo "</div>\n";
|
2417 |
+
}
|
2418 |
+
|
2419 |
+
// SLIDE BACKGROUND IMAGE SIZE.
|
2420 |
+
global $_wp_additional_image_sizes;
|
2421 |
+
$image_size_arr = array();
|
2422 |
+
// get WordPress image size data and save into and array.
|
2423 |
+
$image_size_arr[0]['value'] = 'full';
|
2424 |
+
$image_size_arr[0]['desc'] = 'Full Size';
|
2425 |
+
$count = 1;
|
2426 |
+
foreach ( get_intermediate_image_sizes() as $image_size ) {
|
2427 |
+
if ( in_array( $image_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ), true ) ) {
|
2428 |
+
$width = get_option( "{$image_size}_size_w" );
|
2429 |
+
$height = get_option( "{$image_size}_size_h" );
|
2430 |
+
} elseif ( isset( $_wp_additional_image_sizes[ $image_size ] ) ) {
|
2431 |
+
$width = $_wp_additional_image_sizes[ $image_size ]['width'];
|
2432 |
+
$height = $_wp_additional_image_sizes[ $image_size ]['height'];
|
2433 |
+
}
|
2434 |
+
if ( ( 0 !== $width ) && ( 0 !== $height ) ) {
|
2435 |
+
$image_size_arr[ $count ]['value'] = $image_size;
|
2436 |
+
$image_size_arr[ $count ]['desc'] = $image_size . ' (' . $width . '×' . $height . ')';
|
2437 |
+
$count++;
|
2438 |
+
}
|
2439 |
+
}
|
2440 |
+
// display the dropdown input box allowing user to select background image size.
|
2441 |
+
$tooltip = 'Allows you to set the WordPress image size to use for your slide background images.';
|
2442 |
+
echo "<div class='bg_image_size_wrapper'>\n<div>\n";
|
2443 |
+
echo "<em class='sa_tooltip' href='' title='" . esc_attr( $tooltip ) . "'></em>";
|
2444 |
+
echo '<span>Background Image Size:</span>';
|
2445 |
+
echo "<div style='float:none; clear:both; width:100%; height:1px; padding:0px !important;'></div>\n</div>\n";
|
2446 |
+
echo "<select name='bg_image_size'>";
|
2447 |
+
$tot_size_arr = count( $image_size_arr );
|
2448 |
+
for ( $j = 0; $j < $tot_size_arr; $j++ ) {
|
2449 |
+
if ( $bg_image_size === $image_size_arr[ $j ]['value'] ) {
|
2450 |
+
echo "<option value='" . esc_attr( $image_size_arr[ $j ]['value'] ) . "' selected>" . esc_html( $image_size_arr[ $j ]['desc'] ) . '</option>';
|
2451 |
+
} else {
|
2452 |
+
echo "<option value='" . esc_attr( $image_size_arr[ $j ]['value'] ) . "'>" . esc_html( $image_size_arr[ $j ]['desc'] ) . '</option>';
|
2453 |
+
}
|
2454 |
+
}
|
2455 |
+
echo "</select>\n";
|
2456 |
+
echo "</div>\n"; // .bg_image_size_wrapper
|
2457 |
+
|
2458 |
+
echo "</div>\n";
|
2459 |
+
}
|
2460 |
+
|
2461 |
+
|
2462 |
+
|
2463 |
+
/**
|
2464 |
+
* ##### META BOX CONTENT - 'Thumbnails (Pagination)' BOX #####
|
2465 |
+
*
|
2466 |
+
* @param array $post Custom Post 'sa_slider'.
|
2467 |
+
*/
|
2468 |
+
function cpt_slider_thumbs_content( $post ) {
|
2469 |
+
$sa_pro_version = validate_slide_anything_pro_registration();
|
2470 |
+
|
2471 |
+
if ( $sa_pro_version ) {
|
2472 |
+
// get WordPress image size data and save into and array.
|
2473 |
+
global $_wp_additional_image_sizes;
|
2474 |
+
$image_size_arr = array();
|
2475 |
+
$count = 0;
|
2476 |
+
foreach ( get_intermediate_image_sizes() as $image_size ) {
|
2477 |
+
if ( in_array( $image_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ), true ) ) {
|
2478 |
+
$width = get_option( "{$image_size}_size_w" );
|
2479 |
+
$height = get_option( "{$image_size}_size_h" );
|
2480 |
+
} elseif ( isset( $_wp_additional_image_sizes[ $image_size ] ) ) {
|
2481 |
+
$width = $_wp_additional_image_sizes[ $image_size ]['width'];
|
2482 |
+
$height = $_wp_additional_image_sizes[ $image_size ]['height'];
|
2483 |
+
}
|
2484 |
+
if ( ( 0 !== $width ) && ( 0 !== $height ) ) {
|
2485 |
+
$image_size_arr[ $count ]['value'] = $image_size;
|
2486 |
+
$image_size_arr[ $count ]['desc'] = $image_size . ' (' . $width . '×' . $height . ')';
|
2487 |
+
$count++;
|
2488 |
+
}
|
2489 |
+
}
|
2490 |
+
|
2491 |
+
// Use thumbnail pagination (checkbox).
|
2492 |
+
$thumbs_active = get_post_meta( $post->ID, 'sa_thumbs_active', true );
|
2493 |
+
if ( '' === $thumbs_active ) {
|
2494 |
+
$thumbs_active = '0';
|
2495 |
+
}
|
2496 |
+
echo "<div class='sa_thumbs_line'><span>Use Thumbnail Pagination:</span>";
|
2497 |
+
if ( '1' === $thumbs_active ) {
|
2498 |
+
echo "<input type='checkbox' id='sa_thumbs_active' name='sa_thumbs_active' value='1' checked/>";
|
2499 |
+
} else {
|
2500 |
+
echo "<input type='checkbox' id='sa_thumbs_active' name='sa_thumbs_active' value='1'/>";
|
2501 |
+
}
|
2502 |
+
echo "</div>\n";
|
2503 |
+
|
2504 |
+
if ( '1' === $thumbs_active ) {
|
2505 |
+
echo "<div id='sa_thumbs_settings' style='display:block;'>\n";
|
2506 |
+
} else {
|
2507 |
+
echo "<div id='sa_thumbs_settings' style='display:none;'>\n";
|
2508 |
+
}
|
2509 |
+
|
2510 |
+
// Thumbs Location (dropdown).
|
2511 |
+
$thumbs_location = get_post_meta( $post->ID, 'sa_thumbs_location', true );
|
2512 |
+
if ( '' === $thumbs_location ) {
|
2513 |
+
$thumbs_location = 'inside_bottom';
|
2514 |
+
}
|
2515 |
+
echo "<div class='sa_thumbs_line'><span>Thumbs Location:</span>";
|
2516 |
+
echo "<select id='sa_thumbs_location' name='sa_thumbs_location'>";
|
2517 |
+
$option_arr = array();
|
2518 |
+
$option_arr[0] = 'Inside Bottom';
|
2519 |
+
$option_arr[1] = 'Inside Top';
|
2520 |
+
$option_arr[2] = 'Inside Left';
|
2521 |
+
$option_arr[3] = 'Inside Right';
|
2522 |
+
$option_arr[4] = 'Outside Bottom';
|
2523 |
+
$tot_opt = count( $option_arr );
|
2524 |
+
for ( $i = 0; $i < $tot_opt; $i++ ) {
|
2525 |
+
$value = strtolower( str_replace( ' ', '_', $option_arr[ $i ] ) );
|
2526 |
+
if ( $value === $thumbs_location ) {
|
2527 |
+
echo "<option value='" . esc_attr( $value ) . "' selected>" . esc_html( $option_arr[ $i ] ) . '</option>';
|
2528 |
+
} else {
|
2529 |
+
echo "<option value='" . esc_attr( $value ) . "'>" . esc_html( $option_arr[ $i ] ) . '</option>';
|
2530 |
+
}
|
2531 |
+
}
|
2532 |
+
echo "</select></div>\n";
|
2533 |
+
|
2534 |
+
// Thumbnail Image Size (dropdown).
|
2535 |
+
$thumbs_image_size = get_post_meta( $post->ID, 'sa_thumbs_image_size', true );
|
2536 |
+
if ( '' === $thumbs_image_size ) {
|
2537 |
+
$thumbs_image_size = 'thumbnail';
|
2538 |
+
}
|
2539 |
+
echo "<div class='sa_thumbs_line'><span>Thumbnail Image Size:</span>";
|
2540 |
+
echo "<select id='sa_thumbs_image_size' name='sa_thumbs_image_size'>";
|
2541 |
+
$tot_img_arr = count( $image_size_arr );
|
2542 |
+
for ( $i = 0; $i < $tot_img_arr; $i++ ) {
|
2543 |
+
if ( $image_size_arr[ $i ]['value'] === $thumbs_image_size ) {
|
2544 |
+
echo "<option value='" . esc_attr( $image_size_arr[ $i ]['value'] ) . "' selected>" . esc_html( $image_size_arr[ $i ]['desc'] ) . '</option>';
|
2545 |
+
} else {
|
2546 |
+
echo "<option value='" . esc_attr( $image_size_arr[ $i ]['value'] ) . "'>" . esc_html( $image_size_arr[ $i ]['desc'] ) . '</option>';
|
2547 |
+
}
|
2548 |
+
}
|
2549 |
+
echo "</select></div>\n";
|
2550 |
+
|
2551 |
+
// Container Padding.
|
2552 |
+
$thumbs_padding = get_post_meta( $post->ID, 'sa_thumbs_padding', true );
|
2553 |
+
if ( '' === $thumbs_padding ) {
|
2554 |
+
$thumbs_padding = '3';
|
2555 |
+
}
|
2556 |
+
echo "<div class='sa_thumbs_line'><span>Container Padding:</span>";
|
2557 |
+
echo "<input type='text' id='sa_thumbs_padding' name='sa_thumbs_padding' value='" . esc_attr( $thumbs_padding ) . "'><em>%</em>";
|
2558 |
+
echo "</div>\n";
|
2559 |
+
|
2560 |
+
// Thumbs Width.
|
2561 |
+
$thumbs_width = get_post_meta( $post->ID, 'sa_thumbs_width', true );
|
2562 |
+
if ( '' === $thumbs_width ) {
|
2563 |
+
$thumbs_width = '150';
|
2564 |
+
}
|
2565 |
+
echo "<div class='sa_thumbs_line'><span>Thumbs Width:</span>";
|
2566 |
+
echo "<input type='text' id='sa_thumbs_width' name='sa_thumbs_width' value='" . esc_attr( $thumbs_width ) . "'><em>px</em>";
|
2567 |
+
echo "</div>\n";
|
2568 |
+
|
2569 |
+
// Thumbs Height.
|
2570 |
+
$thumbs_height = get_post_meta( $post->ID, 'sa_thumbs_height', true );
|
2571 |
+
if ( '' === $thumbs_height ) {
|
2572 |
+
$thumbs_height = '85';
|
2573 |
+
}
|
2574 |
+
echo "<div class='sa_thumbs_line'><span>Thumbs Height:</span>";
|
2575 |
+
echo "<input type='text' id='sa_thumbs_height' name='sa_thumbs_height' value='" . esc_attr( $thumbs_height ) . "'><em>px</em>";
|
2576 |
+
echo "</div>\n";
|
2577 |
+
|
2578 |
+
// Thumbs Opacity.
|
2579 |
+
$thumbs_opacity = get_post_meta( $post->ID, 'sa_thumbs_opacity', true );
|
2580 |
+
if ( '' === $thumbs_opacity ) {
|
2581 |
+
$thumbs_opacity = '50';
|
2582 |
+
}
|
2583 |
+
echo "<div class='sa_thumbs_line'><span>Thumbs Opacity:</span>";
|
2584 |
+
echo "<input type='text' id='sa_thumbs_opacity' name='sa_thumbs_opacity' value='" . esc_attr( $thumbs_opacity ) . "'><em>%</em>";
|
2585 |
+
echo "</div>\n";
|
2586 |
+
|
2587 |
+
echo '<h4>Active Thumb Border Style</h4>';
|
2588 |
+
|
2589 |
+
// Border Width.
|
2590 |
+
$thumbs_border_width = get_post_meta( $post->ID, 'sa_thumbs_border_width', true );
|
2591 |
+
if ( '' === $thumbs_border_width ) {
|
2592 |
+
$thumbs_border_width = '0';
|
2593 |
+
}
|
2594 |
+
echo "<div class='sa_thumbs_line'><span>Border Width:</span>";
|
2595 |
+
echo "<input type='text' id='sa_thumbs_border_width' name='sa_thumbs_border_width' value='" . esc_attr( $thumbs_border_width ) . "'><em>px</em>";
|
2596 |
+
echo "</div>\n";
|
2597 |
+
|
2598 |
+
// Border Color.
|
2599 |
+
$thumbs_border_color = get_post_meta( $post->ID, 'sa_thumbs_border_color', true );
|
2600 |
+
if ( '' === $thumbs_border_color ) {
|
2601 |
+
$thumbs_border_color = '#ffffff';
|
2602 |
+
}
|
2603 |
+
echo "<div class='sa_thumbs_line'><span>Border Color:</span>";
|
2604 |
+
echo "<input type='text' id='sa_thumbs_border_color' name='sa_thumbs_border_color' value='" . esc_attr( $thumbs_border_color ) . "'></div>\n";
|
2605 |
+
|
2606 |
+
echo '<h4>Responsive Thumb Sizes</h4>';
|
2607 |
+
|
2608 |
+
// Tablet Thumb Size.
|
2609 |
+
$thumbs_resp_tablet = get_post_meta( $post->ID, 'sa_thumbs_resp_tablet', true );
|
2610 |
+
if ( '' === $thumbs_resp_tablet ) {
|
2611 |
+
$thumbs_resp_tablet = '75';
|
2612 |
+
}
|
2613 |
+
echo "<div class='sa_thumbs_line'><span>Tablet Thumb Size:</span>";
|
2614 |
+
echo "<input type='text' id='sa_thumbs_resp_tablet' name='sa_thumbs_resp_tablet' value='" . esc_attr( $thumbs_resp_tablet ) . "'><em>%</em>";
|
2615 |
+
echo "</div>\n";
|
2616 |
+
|
2617 |
+
// Mobile Thumb Size.
|
2618 |
+
$thumbs_resp_mobile = get_post_meta( $post->ID, 'sa_thumbs_resp_mobile', true );
|
2619 |
+
if ( '' === $thumbs_resp_mobile ) {
|
2620 |
+
$thumbs_resp_mobile = '50';
|
2621 |
+
}
|
2622 |
+
echo "<div class='sa_thumbs_line'><span>Mobile Thumb Size:</span>";
|
2623 |
+
echo "<input type='text' id='sa_thumbs_resp_mobile' name='sa_thumbs_resp_mobile' value='" . esc_attr( $thumbs_resp_mobile ) . "'><em>%</em>";
|
2624 |
+
echo "</div>\n";
|
2625 |
+
|
2626 |
+
echo "</div>\n"; // #sa_thumbs_settings
|
2627 |
+
|
2628 |
+
} else {
|
2629 |
+
|
2630 |
+
// display slide anything pro promotional text.
|
2631 |
+
echo "<div id='sa_thumbs_promo'>";
|
2632 |
+
echo "<h4>Available in the PRO VERSION only!</h4>\n";
|
2633 |
+
echo '<p>With <strong>Slide Anything PRO </strong> you can now add <strong>Thumbnail Pagination</strong>.';
|
2634 |
+
echo '<p>Wiew a Thumbnail Pagination DEMO here:</p>';
|
2635 |
+
echo "<p style='padding-top:2px !important;'><a href='https://edgewebpages.com/hero-slider-with-thumbnails' target='_blank'>THUMBNAIL PAGINATION DEMO</a></p>";
|
2636 |
+
echo '</div>';
|
2637 |
+
}
|
2638 |
+
}
|
2639 |
+
|
2640 |
+
|
2641 |
+
|
2642 |
+
/**
|
2643 |
+
* // ##### META BOX CONTENT - 'Slide Any Post' PROMOTION BOX #####
|
2644 |
+
*/
|
2645 |
+
function cpt_slide_any_post_content() {
|
2646 |
+
echo "<div id='sa_post_notice'>\n";
|
2647 |
+
echo "<div id='sapn_image'>\n";
|
2648 |
+
echo "<a href='https://edgewebpages.com/sap' title='View the Slide Any Post website' target='_blank'>";
|
2649 |
+
echo "<img src='" . esc_url( get_site_url() ) . "/wp-content/plugins/slide-anything/images/slide_any_post_logo.png' />";
|
2650 |
+
echo "</a>\n";
|
2651 |
+
echo "</div>\n"; // #sapn_image
|
2652 |
+
echo "<div id='sapn_text'>\n";
|
2653 |
+
echo "<h3>Generate a carousel/slider for ANY WordPress post type!</h3>\n";
|
2654 |
+
echo "<h5>Filter specific posts, filter by taxonomy, or filter by meta data values</h5>\n";
|
2655 |
+
echo "<h5>Create custom slide layouts containing post taxonomy data and post meta data</h5>\n";
|
2656 |
+
echo "<div><a id='sapn_link' href='https://edgewebpages.com/sap' title='View the Slide Any Post website' ";
|
2657 |
+
echo "target='_blank'>MORE INFORMATION</a>\n";
|
2658 |
+
if ( isset( $_SERVER['REQUEST_URI'] ) && ( '' !== $_SERVER['REQUEST_URI'] ) ) {
|
2659 |
+
$dismiss_url = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) );
|
2660 |
+
echo "<a id='sapn_dismiss' href='" . esc_url( $dismiss_url ) . "&sapost_ignore=0'>DISMISS THIS NOTICE</a></div>";
|
2661 |
+
}
|
2662 |
+
echo "</div>\n"; // #sapn_text
|
2663 |
+
echo "<div style='float:none; clear:both; width:100%; height:1px;'></div>\n";
|
2664 |
+
echo "</div>\n"; // #sa_post_notice
|
2665 |
+
}
|
2666 |
+
|
2667 |
+
|
2668 |
+
|
2669 |
+
/**
|
2670 |
+
* // ##### ACTION HOOK - SAVE CUSTOM POST TYPE ('Slide Anything') DATA #####
|
2671 |
+
*/
|
2672 |
+
function cpt_slider_save_postdata() {
|
2673 |
+
global $post;
|
2674 |
+
$sa_pro_version = validate_slide_anything_pro_registration();
|
2675 |
+
|
2676 |
+
// ### REMOVE XSS ATTACK VULNERABILITY FROM SLIDER POST TITLES ###
|
2677 |
+
global $wpdb;
|
2678 |
+
if ( isset( $post->ID ) && ( '' !== $post->ID ) ) {
|
2679 |
+
$post_title = get_the_title( $post->ID );
|
2680 |
+
$sanitize_title = sanitize_text_field( $post_title );
|
2681 |
+
$where = array( 'ID' => $post->ID );
|
2682 |
+
$wpdb->update( $wpdb->posts, array( 'post_title' => $sanitize_title ), $where ); // db call ok; no-cache ok.
|
2683 |
+
}
|
2684 |
+
|
2685 |
+
// ### VERIFY 1) LOGGED-IN USER IS ADMINISTRATOR AND 2) VALID NONCE TO PREVENT CSRF HACKER ATTACKS ###
|
2686 |
+
if ( current_user_can( 'edit_pages' ) &&
|
2687 |
+
isset( $_POST['nonce_save_slider'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce_save_slider'] ) ), basename( __FILE__ ) ) ) {
|
2688 |
+
if ( isset( $_POST['sa_num_slides'] ) ) {
|
2689 |
+
$total_slides = intval( $_POST['sa_num_slides'] );
|
2690 |
+
} else {
|
2691 |
+
$total_slides = 1;
|
2692 |
+
}
|
2693 |
+
if ( isset( $_POST['sa_duplicate_slide'] ) ) {
|
2694 |
+
if ( ( '' === $_POST['sa_duplicate_slide'] ) || ( '0' === $_POST['sa_duplicate_slide'] ) ) {
|
2695 |
+
$duplicate_slide = 0;
|
2696 |
+
} else {
|
2697 |
+
// A SLIDE NEEDS TO BE DUPLICATED.
|
2698 |
+
$duplicate_slide = intval( $_POST['sa_duplicate_slide'] );
|
2699 |
+
}
|
2700 |
+
} else {
|
2701 |
+
$duplicate_slide = 0;
|
2702 |
+
}
|
2703 |
+
if ( isset( $_POST['sa_move_slide_up'] ) ) {
|
2704 |
+
if ( ( '' === $_POST['sa_move_slide_up'] ) || ( '0' === $_POST['sa_move_slide_up'] ) ) {
|
2705 |
+
$move_slide_up = 0;
|
2706 |
+
} else {
|
2707 |
+
// A SLIDE NEEDS TO BE MOVED.
|
2708 |
+
$move_slide_up = intval( $_POST['sa_move_slide_up'] );
|
2709 |
+
}
|
2710 |
+
} else {
|
2711 |
+
$move_slide_up = 0;
|
2712 |
+
}
|
2713 |
+
|
2714 |
+
// UPDATE CONTENT FOR EACH SLIDE.
|
2715 |
+
$slides_saved = 0;
|
2716 |
+
for ( $i = 1; $i <= $total_slides; $i++ ) {
|
2717 |
+
$slide_edit_id = 'sa_slide' . $i . '_content';
|
2718 |
+
$slide_image_id = 'sa_slide' . $i . '_image_id';
|
2719 |
+
$slide_image_pos = 'sa_slide' . $i . '_image_pos';
|
2720 |
+
$slide_image_size = 'sa_slide' . $i . '_image_size';
|
2721 |
+
$slide_image_repeat = 'sa_slide' . $i . '_image_repeat';
|
2722 |
+
$slide_image_color = 'sa_slide' . $i . '_image_color';
|
2723 |
+
$slide_link_url = 'sa_slide' . $i . '_link_url';
|
2724 |
+
$slide_link_target = 'sa_slide' . $i . '_link_target';
|
2725 |
+
if ( $sa_pro_version ) {
|
2726 |
+
$slide_popup_type = 'sa_slide' . $i . '_popup_type';
|
2727 |
+
$slide_popup_imageid = 'sa_slide' . $i . '_popup_imageid';
|
2728 |
+
$slide_popup_imagetitle = 'sa_slide' . $i . '_popup_imagetitle';
|
2729 |
+
$slide_popup_video_id = 'sa_slide' . $i . '_popup_video_id';
|
2730 |
+
$slide_popup_video_type = 'sa_slide' . $i . '_popup_video_type';
|
2731 |
+
$slide_popup_background = 'sa_slide' . $i . '_popup_background';
|
2732 |
+
$slide_popup_html = 'sa_slide' . $i . '_popup_html';
|
2733 |
+
$slide_popup_shortcode = 'sa_slide' . $i . '_popup_shortcode';
|
2734 |
+
$slide_popup_bgcol = 'sa_slide' . $i . '_popup_bgcol';
|
2735 |
+
$slide_popup_width = 'sa_slide' . $i . '_popup_width';
|
2736 |
+
}
|
2737 |
+
$slide_content = '';
|
2738 |
+
$slide_image_id_val = 0;
|
2739 |
+
$slide_image_pos_val = '';
|
2740 |
+
$slide_image_size_val = '';
|
2741 |
+
$slide_image_repeat_val = '';
|
2742 |
+
$slide_image_color_val = '';
|
2743 |
+
$slide_link_url_val = '';
|
2744 |
+
$slide_link_target_val = '';
|
2745 |
+
if ( isset( $_POST[ $slide_edit_id ] ) && ( '' !== $_POST[ $slide_edit_id ] ) ) {
|
2746 |
+
$slide_content = wp_kses_post( wp_unslash( $_POST[ $slide_edit_id ] ) );
|
2747 |
+
}
|
2748 |
+
if ( isset( $_POST[ $slide_image_id ] ) ) {
|
2749 |
+
$slide_image_id_val = abs( intval( $_POST[ $slide_image_id ] ) );
|
2750 |
+
}
|
2751 |
+
if ( isset( $_POST[ $slide_image_pos ] ) ) {
|
2752 |
+
$slide_image_pos_val = sanitize_text_field( wp_unslash( $_POST[ $slide_image_pos ] ) );
|
2753 |
+
}
|
2754 |
+
if ( isset( $_POST[ $slide_image_size ] ) ) {
|
2755 |
+
$slide_image_size_val = sanitize_text_field( wp_unslash( $_POST[ $slide_image_size ] ) );
|
2756 |
+
}
|
2757 |
+
if ( isset( $_POST[ $slide_image_repeat ] ) ) {
|
2758 |
+
$slide_image_repeat_val = sanitize_text_field( wp_unslash( $_POST[ $slide_image_repeat ] ) );
|
2759 |
+
}
|
2760 |
+
if ( isset( $_POST[ $slide_image_color ] ) ) {
|
2761 |
+
$slide_image_color_val = sanitize_text_field( wp_unslash( $_POST[ $slide_image_color ] ) );
|
2762 |
+
}
|
2763 |
+
if ( isset( $_POST[ $slide_link_url ] ) ) {
|
2764 |
+
$slide_link_url_val = sanitize_text_field( wp_unslash( $_POST[ $slide_link_url ] ) );
|
2765 |
+
}
|
2766 |
+
if ( isset( $_POST[ $slide_link_target ] ) ) {
|
2767 |
+
$slide_link_target_val = sanitize_text_field( wp_unslash( $_POST[ $slide_link_target ] ) );
|
2768 |
+
}
|
2769 |
+
if ( $sa_pro_version ) {
|
2770 |
+
$slide_popup_type_val = '';
|
2771 |
+
$slide_popup_imageid_val = 0;
|
2772 |
+
$slide_popup_imagetitle_val = '';
|
2773 |
+
$slide_popup_video_id_val = '';
|
2774 |
+
$slide_popup_video_type_val = '';
|
2775 |
+
$slide_popup_background_val = '';
|
2776 |
+
$slide_popup_html_val = '';
|
2777 |
+
$slide_popup_shortcode_val = '';
|
2778 |
+
$slide_popup_bgcol_val = '';
|
2779 |
+
$slide_popup_width_val = 0;
|
2780 |
+
if ( isset( $_POST[ $slide_popup_type ] ) ) {
|
2781 |
+
$slide_popup_type_val = sanitize_text_field( wp_unslash( $_POST[ $slide_popup_type ] ) );
|
2782 |
+
}
|
2783 |
+
if ( isset( $_POST[ $slide_popup_imageid ] ) ) {
|
2784 |
+
$slide_popup_imageid_val = sanitize_text_field( wp_unslash( $_POST[ $slide_popup_imageid ] ) );
|
2785 |
+
}
|
2786 |
+
if ( isset( $_POST[ $slide_popup_imagetitle ] ) ) {
|
2787 |
+
$slide_popup_imagetitle_val = sanitize_text_field( wp_unslash( $_POST[ $slide_popup_imagetitle ] ) );
|
2788 |
+
}
|
2789 |
+
if ( isset( $_POST[ $slide_popup_video_id ] ) ) {
|
2790 |
+
$slide_popup_video_id_val = sanitize_text_field( wp_unslash( $_POST[ $slide_popup_video_id ] ) );
|
2791 |
+
}
|
2792 |
+
if ( isset( $_POST[ $slide_popup_video_type ] ) ) {
|
2793 |
+
$slide_popup_video_type_val = sanitize_text_field( wp_unslash( $_POST[ $slide_popup_video_type ] ) );
|
2794 |
+
}
|
2795 |
+
if ( isset( $_POST[ $slide_popup_background ] ) ) {
|
2796 |
+
$slide_popup_background_val = sanitize_text_field( wp_unslash( $_POST[ $slide_popup_background ] ) );
|
2797 |
+
}
|
2798 |
+
if ( isset( $_POST[ $slide_popup_html ] ) ) {
|
2799 |
+
$slide_popup_html_val = balanceTags( wp_kses_post( wp_unslash( $_POST[ $slide_popup_html ] ) ), true );
|
2800 |
+
}
|
2801 |
+
if ( isset( $_POST[ $slide_popup_shortcode ] ) ) {
|
2802 |
+
$slide_popup_shortcode_val = sanitize_text_field( wp_unslash( $_POST[ $slide_popup_shortcode ] ) );
|
2803 |
+
}
|
2804 |
+
if ( isset( $_POST[ $slide_popup_bgcol ] ) ) {
|
2805 |
+
$slide_popup_bgcol_val = sanitize_text_field( wp_unslash( $_POST[ $slide_popup_bgcol ] ) );
|
2806 |
+
}
|
2807 |
+
if ( isset( $_POST[ $slide_popup_width ] ) ) {
|
2808 |
+
$slide_popup_width_val = abs( intval( $_POST[ $slide_popup_width ] ) );
|
2809 |
+
}
|
2810 |
+
}
|
2811 |
+
// check delete status for slide.
|
2812 |
+
$del_status_id = 'sa_slide' . $i . '_delete';
|
2813 |
+
if ( isset( $_POST[ $del_status_id ] ) && ( '' !== $_POST[ $del_status_id ] ) ) {
|
2814 |
+
$del_status = sanitize_text_field( wp_unslash( $_POST[ $del_status_id ] ) );
|
2815 |
+
} else {
|
2816 |
+
// a new slide has been added.
|
2817 |
+
$del_status = '1';
|
2818 |
+
$slide_content = '';
|
2819 |
+
}
|
2820 |
+
if ( '1' === $del_status ) {
|
2821 |
+
// save slide content only if slide has not been marked for deletion.
|
2822 |
+
$slides_saved++;
|
2823 |
+
$slide_edit_id_save = 'sa_slide' . $slides_saved . '_content';
|
2824 |
+
$slide_image_data_saved = 'sa_slide' . $slides_saved . '_image_data';
|
2825 |
+
$slide_link_url_saved = 'sa_slide' . $slides_saved . '_link_url';
|
2826 |
+
$slide_link_target_saved = 'sa_slide' . $slides_saved . '_link_target';
|
2827 |
+
if ( $sa_pro_version ) {
|
2828 |
+
$slide_popup_type_saved = 'sa_slide' . $slides_saved . '_popup_type';
|
2829 |
+
$slide_popup_imageid_saved = 'sa_slide' . $slides_saved . '_popup_imageid';
|
2830 |
+
$slide_popup_imagetitle_saved = 'sa_slide' . $slides_saved . '_popup_imagetitle';
|
2831 |
+
$slide_popup_video_id_saved = 'sa_slide' . $slides_saved . '_popup_video_id';
|
2832 |
+
$slide_popup_video_type_saved = 'sa_slide' . $slides_saved . '_popup_video_type';
|
2833 |
+
$slide_popup_background_saved = 'sa_slide' . $slides_saved . '_popup_background';
|
2834 |
+
$slide_popup_html_saved = 'sa_slide' . $slides_saved . '_popup_html';
|
2835 |
+
$slide_popup_shortcode_saved = 'sa_slide' . $slides_saved . '_popup_shortcode';
|
2836 |
+
$slide_popup_bgcol_saved = 'sa_slide' . $slides_saved . '_popup_bgcol';
|
2837 |
+
$slide_popup_width_saved = 'sa_slide' . $slides_saved . '_popup_width';
|
2838 |
+
}
|
2839 |
+
update_post_meta( $post->ID, $slide_edit_id_save, $slide_content );
|
2840 |
+
$slide_image_data_val = $slide_image_id_val . '~' . $slide_image_pos_val . '~' . $slide_image_size_val . '~' . $slide_image_repeat_val . '~' . $slide_image_color_val;
|
2841 |
+
update_post_meta( $post->ID, $slide_image_data_saved, $slide_image_data_val );
|
2842 |
+
update_post_meta( $post->ID, $slide_link_url_saved, $slide_link_url_val );
|
2843 |
+
update_post_meta( $post->ID, $slide_link_target_saved, $slide_link_target_val );
|
2844 |
+
if ( $sa_pro_version ) {
|
2845 |
+
update_post_meta( $post->ID, $slide_popup_type_saved, $slide_popup_type_val );
|
2846 |
+
update_post_meta( $post->ID, $slide_popup_imageid_saved, $slide_popup_imageid_val );
|
2847 |
+
update_post_meta( $post->ID, $slide_popup_imagetitle_saved, $slide_popup_imagetitle_val );
|
2848 |
+
update_post_meta( $post->ID, $slide_popup_video_id_saved, $slide_popup_video_id_val );
|
2849 |
+
update_post_meta( $post->ID, $slide_popup_video_type_saved, $slide_popup_video_type_val );
|
2850 |
+
update_post_meta( $post->ID, $slide_popup_background_saved, $slide_popup_background_val );
|
2851 |
+
update_post_meta( $post->ID, $slide_popup_html_saved, $slide_popup_html_val );
|
2852 |
+
update_post_meta( $post->ID, $slide_popup_shortcode_saved, $slide_popup_shortcode_val );
|
2853 |
+
update_post_meta( $post->ID, $slide_popup_bgcol_saved, $slide_popup_bgcol_val );
|
2854 |
+
update_post_meta( $post->ID, $slide_popup_width_saved, $slide_popup_width_val );
|
2855 |
+
}
|
2856 |
+
if ( $i === $duplicate_slide ) {
|
2857 |
+
// the 'duplicate slide' button has been click for this slide - create a new slide that is an exact copy of previous slide.
|
2858 |
+
$slides_saved++;
|
2859 |
+
$slide_edit_id_save = 'sa_slide' . $slides_saved . '_content';
|
2860 |
+
$slide_image_data_saved = 'sa_slide' . $slides_saved . '_image_data';
|
2861 |
+
$slide_link_url_saved = 'sa_slide' . $slides_saved . '_link_url';
|
2862 |
+
$slide_link_target_saved = 'sa_slide' . $slides_saved . '_link_target';
|
2863 |
+
if ( $sa_pro_version ) {
|
2864 |
+
$slide_popup_type_saved = 'sa_slide' . $slides_saved . '_popup_type';
|
2865 |
+
$slide_popup_imageid_saved = 'sa_slide' . $slides_saved . '_popup_imageid';
|
2866 |
+
$slide_popup_imagetitle_saved = 'sa_slide' . $slides_saved . '_popup_imagetitle';
|
2867 |
+
$slide_popup_video_id_saved = 'sa_slide' . $slides_saved . '_popup_video_id';
|
2868 |
+
$slide_popup_video_type_saved = 'sa_slide' . $slides_saved . '_popup_video_type';
|
2869 |
+
$slide_popup_background_saved = 'sa_slide' . $slides_saved . '_popup_background';
|
2870 |
+
$slide_popup_html_saved = 'sa_slide' . $slides_saved . '_popup_html';
|
2871 |
+
$slide_popup_shortcode_saved = 'sa_slide' . $slides_saved . '_popup_shortcode';
|
2872 |
+
$slide_popup_bgcol_saved = 'sa_slide' . $slides_saved . '_popup_bgcol';
|
2873 |
+
$slide_popup_width_saved = 'sa_slide' . $slides_saved . '_popup_width';
|
2874 |
+
}
|
2875 |
+
update_post_meta( $post->ID, $slide_edit_id_save, $slide_content );
|
2876 |
+
$slide_image_data_val = $slide_image_id_val . '~' . $slide_image_pos_val . '~' . $slide_image_size_val . '~' . $slide_image_repeat_val . '~' . $slide_image_color_val;
|
2877 |
+
update_post_meta( $post->ID, $slide_image_data_saved, $slide_image_data_val );
|
2878 |
+
update_post_meta( $post->ID, $slide_link_url_saved, $slide_link_url_val );
|
2879 |
+
update_post_meta( $post->ID, $slide_link_target_saved, $slide_link_target_val );
|
2880 |
+
if ( $sa_pro_version ) {
|
2881 |
+
update_post_meta( $post->ID, $slide_popup_type_saved, $slide_popup_type_val );
|
2882 |
+
update_post_meta( $post->ID, $slide_popup_imageid_saved, $slide_popup_imageid_val );
|
2883 |
+
update_post_meta( $post->ID, $slide_popup_imagetitle_saved, $slide_popup_imagetitle_val );
|
2884 |
+
update_post_meta( $post->ID, $slide_popup_video_id_saved, $slide_popup_video_id_val );
|
2885 |
+
update_post_meta( $post->ID, $slide_popup_video_type_saved, $slide_popup_video_type_val );
|
2886 |
+
update_post_meta( $post->ID, $slide_popup_background_saved, $slide_popup_background_val );
|
2887 |
+
update_post_meta( $post->ID, $slide_popup_html_saved, $slide_popup_html_val );
|
2888 |
+
update_post_meta( $post->ID, $slide_popup_shortcode_saved, $slide_popup_shortcode_val );
|
2889 |
+
update_post_meta( $post->ID, $slide_popup_bgcol_saved, $slide_popup_bgcol_val );
|
2890 |
+
update_post_meta( $post->ID, $slide_popup_width_saved, $slide_popup_width_val );
|
2891 |
+
}
|
2892 |
+
}
|
2893 |
+
}
|
2894 |
+
}
|
2895 |
+
|
2896 |
+
if ( 0 !== $move_slide_up ) {
|
2897 |
+
// A SLIDE NEEDS TO BE MOVED (TWO SLIDES ARE SWAPPED).
|
2898 |
+
$slide2 = $move_slide_up;
|
2899 |
+
$slide1 = intval( $move_slide_up ) - 1;
|
2900 |
+
$slide1_content = '';
|
2901 |
+
$slide1_image_id = 0;
|
2902 |
+
$slide1_image_pos = '';
|
2903 |
+
$slide1_image_size = '';
|
2904 |
+
$slide1_image_repeat = '';
|
2905 |
+
$slide1_image_color = '';
|
2906 |
+
$slide1_link_url = '';
|
2907 |
+
$slide1_link_target = '';
|
2908 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_content' ] ) ) {
|
2909 |
+
$slide1_content = balanceTags( sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_content' ] ) ), true );
|
2910 |
+
}
|
2911 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_image_id' ] ) ) {
|
2912 |
+
$slide1_image_id = abs( intval( $_POST[ 'sa_slide' . $slide1 . '_image_id' ] ) );
|
2913 |
+
}
|
2914 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_image_pos' ] ) ) {
|
2915 |
+
$slide1_image_pos = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_image_pos' ] ) );
|
2916 |
+
}
|
2917 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_image_size' ] ) ) {
|
2918 |
+
$slide1_image_size = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_image_size' ] ) );
|
2919 |
+
}
|
2920 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_image_repeat' ] ) ) {
|
2921 |
+
$slide1_image_repeat = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_image_repeat' ] ) );
|
2922 |
+
}
|
2923 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_image_color' ] ) ) {
|
2924 |
+
$slide1_image_color = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_image_color' ] ) );
|
2925 |
+
}
|
2926 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_link_url' ] ) ) {
|
2927 |
+
$slide1_link_url = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_link_url' ] ) );
|
2928 |
+
}
|
2929 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_link_target' ] ) ) {
|
2930 |
+
$slide1_link_target = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_link_target' ] ) );
|
2931 |
+
}
|
2932 |
+
if ( $sa_pro_version ) {
|
2933 |
+
$slide1_popup_type = '';
|
2934 |
+
$slide1_popup_imageid = '';
|
2935 |
+
$slide1_popup_imagetitle = '';
|
2936 |
+
$slide1_popup_video_id = '';
|
2937 |
+
$slide1_popup_video_type = '';
|
2938 |
+
$slide1_popup_background = '';
|
2939 |
+
$slide1_popup_html = '';
|
2940 |
+
$slide1_popup_shortcode = '';
|
2941 |
+
$slide1_popup_bgcol = '';
|
2942 |
+
$slide1_popup_width = 0;
|
2943 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_popup_type' ] ) ) {
|
2944 |
+
$slide1_popup_type = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_popup_type' ] ) );
|
2945 |
+
}
|
2946 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_popup_imageid' ] ) ) {
|
2947 |
+
$slide1_popup_imageid = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_popup_imageid' ] ) );
|
2948 |
+
}
|
2949 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_popup_imagetitle' ] ) ) {
|
2950 |
+
$slide1_popup_imagetitle = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_popup_imagetitle' ] ) );
|
2951 |
+
}
|
2952 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_popup_video_id' ] ) ) {
|
2953 |
+
$slide1_popup_video_id = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_popup_video_id' ] ) );
|
2954 |
+
}
|
2955 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_popup_video_type' ] ) ) {
|
2956 |
+
$slide1_popup_video_type = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_popup_video_type' ] ) );
|
2957 |
+
}
|
2958 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_popup_background' ] ) ) {
|
2959 |
+
$slide1_popup_background = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_popup_background' ] ) );
|
2960 |
+
}
|
2961 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_popup_html' ] ) ) {
|
2962 |
+
$slide1_popup_html = balanceTags( wp_kses_post( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_popup_html' ] ) ), true );
|
2963 |
+
}
|
2964 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_popup_shortcode' ] ) ) {
|
2965 |
+
$slide1_popup_shortcode = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_popup_shortcode' ] ) );
|
2966 |
+
}
|
2967 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_popup_bgcol' ] ) ) {
|
2968 |
+
$slide1_popup_bgcol = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide1 . '_popup_bgcol' ] ) );
|
2969 |
+
}
|
2970 |
+
if ( isset( $_POST[ 'sa_slide' . $slide1 . '_popup_width' ] ) ) {
|
2971 |
+
$slide1_popup_width = abs( intval( $_POST[ 'sa_slide' . $slide1 . '_popup_width' ] ) );
|
2972 |
+
}
|
2973 |
+
}
|
2974 |
+
$slide2_content = '';
|
2975 |
+
$slide2_image_id = 0;
|
2976 |
+
$slide2_image_pos = '';
|
2977 |
+
$slide2_image_size = '';
|
2978 |
+
$slide2_image_repeat = '';
|
2979 |
+
$slide2_image_color = '';
|
2980 |
+
$slide2_link_url = '';
|
2981 |
+
$slide2_link_target = '';
|
2982 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_content' ] ) ) {
|
2983 |
+
$slide2_content = balanceTags( sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_content' ] ) ), true );
|
2984 |
+
}
|
2985 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_image_id' ] ) ) {
|
2986 |
+
$slide2_image_id = abs( intval( $_POST[ 'sa_slide' . $slide2 . '_image_id' ] ) );
|
2987 |
+
}
|
2988 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_image_pos' ] ) ) {
|
2989 |
+
$slide2_image_pos = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_image_pos' ] ) );
|
2990 |
+
}
|
2991 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_image_size' ] ) ) {
|
2992 |
+
$slide2_image_size = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_image_size' ] ) );
|
2993 |
+
}
|
2994 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_image_repeat' ] ) ) {
|
2995 |
+
$slide2_image_repeat = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_image_repeat' ] ) );
|
2996 |
+
}
|
2997 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_image_color' ] ) ) {
|
2998 |
+
$slide2_image_color = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_image_color' ] ) );
|
2999 |
+
}
|
3000 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_link_url' ] ) ) {
|
3001 |
+
$slide2_link_url = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_link_url' ] ) );
|
3002 |
+
}
|
3003 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_link_target' ] ) ) {
|
3004 |
+
$slide2_link_target = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_link_target' ] ) );
|
3005 |
+
}
|
3006 |
+
if ( $sa_pro_version ) {
|
3007 |
+
$slide2_popup_type = '';
|
3008 |
+
$slide2_popup_imageid = '';
|
3009 |
+
$slide2_popup_imagetitle = '';
|
3010 |
+
$slide2_popup_video_id = '';
|
3011 |
+
$slide2_popup_video_type = '';
|
3012 |
+
$slide2_popup_background = '';
|
3013 |
+
$slide2_popup_html = '';
|
3014 |
+
$slide2_popup_shortcode = '';
|
3015 |
+
$slide2_popup_bgcol = '';
|
3016 |
+
$slide2_popup_width = 0;
|
3017 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_popup_type' ] ) ) {
|
3018 |
+
$slide2_popup_type = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_popup_type' ] ) );
|
3019 |
+
}
|
3020 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_popup_imageid' ] ) ) {
|
3021 |
+
$slide2_popup_imageid = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_popup_imageid' ] ) );
|
3022 |
+
}
|
3023 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_popup_imagetitle' ] ) ) {
|
3024 |
+
$slide2_popup_imagetitle = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_popup_imagetitle' ] ) );
|
3025 |
+
}
|
3026 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_popup_video_id' ] ) ) {
|
3027 |
+
$slide2_popup_video_id = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_popup_video_id' ] ) );
|
3028 |
+
}
|
3029 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_popup_video_type' ] ) ) {
|
3030 |
+
$slide2_popup_video_type = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_popup_video_type' ] ) );
|
3031 |
+
}
|
3032 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_popup_background' ] ) ) {
|
3033 |
+
$slide2_popup_background = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_popup_background' ] ) );
|
3034 |
+
}
|
3035 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_popup_html' ] ) ) {
|
3036 |
+
$slide2_popup_html = balanceTags( wp_kses_post( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_popup_html' ] ) ), true );
|
3037 |
+
}
|
3038 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_popup_shortcode' ] ) ) {
|
3039 |
+
$slide2_popup_shortcode = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_popup_shortcode' ] ) );
|
3040 |
+
}
|
3041 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_popup_bgcol' ] ) ) {
|
3042 |
+
$slide2_popup_bgcol = sanitize_text_field( wp_unslash( $_POST[ 'sa_slide' . $slide2 . '_popup_bgcol' ] ) );
|
3043 |
+
}
|
3044 |
+
if ( isset( $_POST[ 'sa_slide' . $slide2 . '_popup_width' ] ) ) {
|
3045 |
+
$slide2_popup_width = abs( intval( $_POST[ 'sa_slide' . $slide2 . '_popup_width' ] ) );
|
3046 |
+
}
|
3047 |
+
}
|
3048 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_content', $slide1_content );
|
3049 |
+
$slide1_image_data = $slide1_image_id . '~' . $slide1_image_pos . '~' . $slide1_image_size . '~' . $slide1_image_repeat . '~' . $slide1_image_color;
|
3050 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_image_data', $slide1_image_data );
|
3051 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_link_url', $slide1_link_url );
|
3052 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_link_target', $slide1_link_target );
|
3053 |
+
if ( $sa_pro_version ) {
|
3054 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_popup_type', $slide1_popup_type );
|
3055 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_popup_imageid', $slide1_popup_imageid );
|
3056 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_popup_imagetitle', $slide1_popup_imagetitle );
|
3057 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_popup_video_id', $slide1_popup_video_id );
|
3058 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_popup_video_type', $slide1_popup_video_type );
|
3059 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_popup_background', $slide1_popup_background );
|
3060 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_popup_html', $slide1_popup_html );
|
3061 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_popup_shortcode', $slide1_popup_shortcode );
|
3062 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_popup_bgcol', $slide1_popup_bgcol );
|
3063 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide2 . '_popup_width', $slide1_popup_width );
|
3064 |
+
}
|
3065 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_content', $slide2_content );
|
3066 |
+
$slide2_image_data = $slide2_image_id . '~' . $slide2_image_pos . '~' . $slide2_image_size . '~' . $slide2_image_repeat . '~' . $slide2_image_color;
|
3067 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_image_data', $slide2_image_data );
|
3068 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_link_url', $slide2_link_url );
|
3069 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_link_target', $slide2_link_target );
|
3070 |
+
if ( $sa_pro_version ) {
|
3071 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_popup_type', $slide2_popup_type );
|
3072 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_popup_imageid', $slide2_popup_imageid );
|
3073 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_popup_imagetitle', $slide2_popup_imagetitle );
|
3074 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_popup_video_id', $slide2_popup_video_id );
|
3075 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_popup_video_type', $slide2_popup_video_type );
|
3076 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_popup_background', $slide2_popup_background );
|
3077 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_popup_html', $slide2_popup_html );
|
3078 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_popup_shortcode', $slide2_popup_shortcode );
|
3079 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_popup_bgcol', $slide2_popup_bgcol );
|
3080 |
+
update_post_meta( $post->ID, 'sa_slide' . $slide1 . '_popup_width', $slide2_popup_width );
|
3081 |
+
}
|
3082 |
+
}
|
3083 |
+
|
3084 |
+
// UPDATE SLIDE CONTENT CHARACTER COUNT.
|
3085 |
+
$total_slides = get_post_meta( $post->ID, 'sa_num_slides', true );
|
3086 |
+
for ( $i = 1; $i <= $total_slides; $i++ ) {
|
3087 |
+
$slide_content = get_post_meta( $post->ID, 'sa_slide' . $i . '_content', true );
|
3088 |
+
$char_count = strlen( $slide_content );
|
3089 |
+
update_post_meta( $post->ID, 'sa_slide' . $i . '_char_count', $char_count );
|
3090 |
+
}
|
3091 |
+
|
3092 |
+
// UPDATE SLIDER SETTINGS.
|
3093 |
+
update_post_meta( $post->ID, 'sa_num_slides', abs( intval( $slides_saved ) ) );
|
3094 |
+
if ( isset( $_POST['sa_disable_visual_editor'] ) && ( '1' === $_POST['sa_disable_visual_editor'] ) ) {
|
3095 |
+
update_post_meta( $post->ID, 'sa_disable_visual_editor', '1' );
|
3096 |
+
} else {
|
3097 |
+
update_post_meta( $post->ID, 'sa_disable_visual_editor', '0' );
|
3098 |
+
}
|
3099 |
+
if ( isset( $_POST['sa_info_added'] ) ) {
|
3100 |
+
update_post_meta( $post->ID, 'sa_info_added', abs( intval( $_POST['sa_info_added'] ) ) );
|
3101 |
+
}
|
3102 |
+
if ( isset( $_POST['sa_info_deleted'] ) ) {
|
3103 |
+
update_post_meta( $post->ID, 'sa_info_deleted', abs( intval( $_POST['sa_info_deleted'] ) ) );
|
3104 |
+
}
|
3105 |
+
if ( isset( $_POST['sa_duplicate_slide'] ) ) {
|
3106 |
+
update_post_meta( $post->ID, 'sa_duplicate_slide', abs( intval( $_POST['sa_duplicate_slide'] ) ) );
|
3107 |
+
}
|
3108 |
+
if ( isset( $_POST['sa_info_duplicated'] ) ) {
|
3109 |
+
update_post_meta( $post->ID, 'sa_info_duplicated', abs( intval( $_POST['sa_info_duplicated'] ) ) );
|
3110 |
+
}
|
3111 |
+
if ( isset( $_POST['sa_move_slide_up'] ) ) {
|
3112 |
+
update_post_meta( $post->ID, 'sa_move_slide_up', abs( intval( $_POST['sa_move_slide_up'] ) ) );
|
3113 |
+
}
|
3114 |
+
if ( isset( $_POST['sa_info_moved'] ) ) {
|
3115 |
+
update_post_meta( $post->ID, 'sa_info_moved', abs( intval( $_POST['sa_info_moved'] ) ) );
|
3116 |
+
}
|
3117 |
+
if ( isset( $_POST['sa_slide_duration'] ) ) {
|
3118 |
+
update_post_meta( $post->ID, 'sa_slide_duration', abs( floatval( $_POST['sa_slide_duration'] ) ) );
|
3119 |
+
}
|
3120 |
+
if ( isset( $_POST['sa_slide_transition'] ) ) {
|
3121 |
+
update_post_meta( $post->ID, 'sa_slide_transition', abs( floatval( $_POST['sa_slide_transition'] ) ) );
|
3122 |
+
}
|
3123 |
+
if ( isset( $_POST['sa_slide_by'] ) ) {
|
3124 |
+
update_post_meta( $post->ID, 'sa_slide_by', abs( floatval( $_POST['sa_slide_by'] ) ) );
|
3125 |
+
}
|
3126 |
+
if ( isset( $_POST['sa_loop_slider'] ) && ( '1' === $_POST['sa_loop_slider'] ) ) {
|
3127 |
+
update_post_meta( $post->ID, 'sa_loop_slider', '1' );
|
3128 |
+
} else {
|
3129 |
+
update_post_meta( $post->ID, 'sa_loop_slider', '0' );
|
3130 |
+
}
|
3131 |
+
if ( isset( $_POST['sa_stop_hover'] ) && ( '1' === $_POST['sa_stop_hover'] ) ) {
|
3132 |
+
update_post_meta( $post->ID, 'sa_stop_hover', '1' );
|
3133 |
+
} else {
|
3134 |
+
update_post_meta( $post->ID, 'sa_stop_hover', '0' );
|
3135 |
+
}
|
3136 |
+
if ( isset( $_POST['sa_nav_arrows'] ) && ( '1' === $_POST['sa_nav_arrows'] ) ) {
|
3137 |
+
update_post_meta( $post->ID, 'sa_nav_arrows', '1' );
|
3138 |
+
} else {
|
3139 |
+
update_post_meta( $post->ID, 'sa_nav_arrows', '0' );
|
3140 |
+
}
|
3141 |
+
if ( isset( $_POST['sa_pagination'] ) && ( '1' === $_POST['sa_pagination'] ) ) {
|
3142 |
+
update_post_meta( $post->ID, 'sa_pagination', '1' );
|
3143 |
+
} else {
|
3144 |
+
update_post_meta( $post->ID, 'sa_pagination', '0' );
|
3145 |
+
}
|
3146 |
+
if ( isset( $_POST['sa_random_order'] ) && ( '1' === $_POST['sa_random_order'] ) ) {
|
3147 |
+
update_post_meta( $post->ID, 'sa_random_order', '1' );
|
3148 |
+
} else {
|
3149 |
+
update_post_meta( $post->ID, 'sa_random_order', '0' );
|
3150 |
+
}
|
3151 |
+
if ( isset( $_POST['sa_reverse_order'] ) && ( '1' === $_POST['sa_reverse_order'] ) ) {
|
3152 |
+
update_post_meta( $post->ID, 'sa_reverse_order', '1' );
|
3153 |
+
} else {
|
3154 |
+
update_post_meta( $post->ID, 'sa_reverse_order', '0' );
|
3155 |
+
}
|
3156 |
+
if ( isset( $_POST['sa_shortcodes'] ) && ( '1' === $_POST['sa_shortcodes'] ) ) {
|
3157 |
+
update_post_meta( $post->ID, 'sa_shortcodes', '1' );
|
3158 |
+
} else {
|
3159 |
+
update_post_meta( $post->ID, 'sa_shortcodes', '0' );
|
3160 |
+
}
|
3161 |
+
if ( isset( $_POST['sa_mouse_drag'] ) && ( '1' === $_POST['sa_mouse_drag'] ) ) {
|
3162 |
+
update_post_meta( $post->ID, 'sa_mouse_drag', '1' );
|
3163 |
+
} else {
|
3164 |
+
update_post_meta( $post->ID, 'sa_mouse_drag', '0' );
|
3165 |
+
}
|
3166 |
+
if ( isset( $_POST['sa_touch_drag'] ) && ( '1' === $_POST['sa_touch_drag'] ) ) {
|
3167 |
+
update_post_meta( $post->ID, 'sa_touch_drag', '1' );
|
3168 |
+
} else {
|
3169 |
+
update_post_meta( $post->ID, 'sa_touch_drag', '0' );
|
3170 |
+
}
|
3171 |
+
if ( isset( $_POST['sa_mousewheel'] ) && ( '1' === $_POST['sa_mousewheel'] ) ) {
|
3172 |
+
update_post_meta( $post->ID, 'sa_mousewheel', '1' );
|
3173 |
+
} else {
|
3174 |
+
update_post_meta( $post->ID, 'sa_mousewheel', '0' );
|
3175 |
+
}
|
3176 |
+
if ( isset( $_POST['sa_click_advance'] ) && ( '1' === $_POST['sa_click_advance'] ) ) {
|
3177 |
+
update_post_meta( $post->ID, 'sa_click_advance', '1' );
|
3178 |
+
} else {
|
3179 |
+
update_post_meta( $post->ID, 'sa_click_advance', '0' );
|
3180 |
+
}
|
3181 |
+
if ( isset( $_POST['sa_auto_height'] ) && ( '1' === $_POST['sa_auto_height'] ) ) {
|
3182 |
+
update_post_meta( $post->ID, 'sa_auto_height', '1' );
|
3183 |
+
} else {
|
3184 |
+
update_post_meta( $post->ID, 'sa_auto_height', '0' );
|
3185 |
+
}
|
3186 |
+
if ( isset( $_POST['sa_vert_center'] ) && ( '1' === $_POST['sa_vert_center'] ) ) {
|
3187 |
+
update_post_meta( $post->ID, 'sa_vert_center', '1' );
|
3188 |
+
} else {
|
3189 |
+
update_post_meta( $post->ID, 'sa_vert_center', '0' );
|
3190 |
+
}
|
3191 |
+
|
3192 |
+
// UPDATE SLIDER ITEMS DISPLAYED.
|
3193 |
+
if ( isset( $_POST['sa_items_width1'] ) ) {
|
3194 |
+
update_post_meta( $post->ID, 'sa_items_width1', abs( intval( $_POST['sa_items_width1'] ) ) );
|
3195 |
+
}
|
3196 |
+
if ( isset( $_POST['sa_items_width2'] ) ) {
|
3197 |
+
update_post_meta( $post->ID, 'sa_items_width2', abs( intval( $_POST['sa_items_width2'] ) ) );
|
3198 |
+
}
|
3199 |
+
if ( isset( $_POST['sa_items_width3'] ) ) {
|
3200 |
+
update_post_meta( $post->ID, 'sa_items_width3', abs( intval( $_POST['sa_items_width3'] ) ) );
|
3201 |
+
}
|
3202 |
+
if ( isset( $_POST['sa_items_width4'] ) ) {
|
3203 |
+
update_post_meta( $post->ID, 'sa_items_width4', abs( intval( $_POST['sa_items_width4'] ) ) );
|
3204 |
+
}
|
3205 |
+
if ( isset( $_POST['sa_items_width5'] ) ) {
|
3206 |
+
update_post_meta( $post->ID, 'sa_items_width5', abs( intval( $_POST['sa_items_width5'] ) ) );
|
3207 |
+
}
|
3208 |
+
if ( isset( $_POST['sa_items_width6'] ) ) {
|
3209 |
+
update_post_meta( $post->ID, 'sa_items_width6', abs( intval( $_POST['sa_items_width6'] ) ) );
|
3210 |
+
}
|
3211 |
+
if ( isset( $_POST['sa_transition'] ) ) {
|
3212 |
+
update_post_meta( $post->ID, 'sa_transition', sanitize_text_field( wp_unslash( $_POST['sa_transition'] ) ) );
|
3213 |
+
}
|
3214 |
+
if ( isset( $_POST['sa_hero_slider'] ) && ( '1' === $_POST['sa_hero_slider'] ) ) {
|
3215 |
+
update_post_meta( $post->ID, 'sa_hero_slider', '1' );
|
3216 |
+
} else {
|
3217 |
+
update_post_meta( $post->ID, 'sa_hero_slider', '0' );
|
3218 |
+
}
|
3219 |
+
if ( isset( $_POST['sa_showcase_slider'] ) && ( '1' === $_POST['sa_showcase_slider'] ) ) {
|
3220 |
+
update_post_meta( $post->ID, 'sa_showcase_slider', '1' );
|
3221 |
+
} else {
|
3222 |
+
update_post_meta( $post->ID, 'sa_showcase_slider', '0' );
|
3223 |
+
}
|
3224 |
+
if ( isset( $_POST['sa_showcase_width'] ) ) {
|
3225 |
+
update_post_meta( $post->ID, 'sa_showcase_width', abs( intval( $_POST['sa_showcase_width'] ) ) );
|
3226 |
+
}
|
3227 |
+
if ( isset( $_POST['sa_showcase_tablet'] ) && ( '1' === $_POST['sa_showcase_tablet'] ) ) {
|
3228 |
+
update_post_meta( $post->ID, 'sa_showcase_tablet', '1' );
|
3229 |
+
} else {
|
3230 |
+
update_post_meta( $post->ID, 'sa_showcase_tablet', '0' );
|
3231 |
+
}
|
3232 |
+
if ( isset( $_POST['sa_showcase_width_tab'] ) ) {
|
3233 |
+
update_post_meta( $post->ID, 'sa_showcase_width_tab', abs( intval( $_POST['sa_showcase_width_tab'] ) ) );
|
3234 |
+
}
|
3235 |
+
if ( isset( $_POST['sa_showcase_mobile'] ) && ( '1' === $_POST['sa_showcase_mobile'] ) ) {
|
3236 |
+
update_post_meta( $post->ID, 'sa_showcase_mobile', '1' );
|
3237 |
+
} else {
|
3238 |
+
update_post_meta( $post->ID, 'sa_showcase_mobile', '0' );
|
3239 |
+
}
|
3240 |
+
if ( isset( $_POST['sa_showcase_width_mob'] ) ) {
|
3241 |
+
update_post_meta( $post->ID, 'sa_showcase_width_mob', abs( intval( $_POST['sa_showcase_width_mob'] ) ) );
|
3242 |
+
}
|
3243 |
+
|
3244 |
+
// UPDATE SLIDER STYLE.
|
3245 |
+
if ( isset( $_POST['sa_css_id'] ) ) {
|
3246 |
+
$post_css_id = str_replace( '-', '_', sanitize_text_field( wp_unslash( $_POST['sa_css_id'] ) ) );
|
3247 |
+
update_post_meta( $post->ID, 'sa_css_id', sanitize_text_field( $post_css_id ) );
|
3248 |
+
}
|
3249 |
+
if ( isset( $_POST['sa_background_color'] ) ) {
|
3250 |
+
update_post_meta( $post->ID, 'sa_background_color', sanitize_text_field( wp_unslash( $_POST['sa_background_color'] ) ) );
|
3251 |
+
}
|
3252 |
+
if ( isset( $_POST['sa_border_width'] ) ) {
|
3253 |
+
update_post_meta( $post->ID, 'sa_border_width', abs( intval( $_POST['sa_border_width'] ) ) );
|
3254 |
+
}
|
3255 |
+
if ( isset( $_POST['sa_border_color'] ) ) {
|
3256 |
+
update_post_meta( $post->ID, 'sa_border_color', sanitize_text_field( wp_unslash( $_POST['sa_border_color'] ) ) );
|
3257 |
+
}
|
3258 |
+
if ( isset( $_POST['sa_border_radius'] ) ) {
|
3259 |
+
update_post_meta( $post->ID, 'sa_border_radius', abs( intval( $_POST['sa_border_radius'] ) ) );
|
3260 |
+
}
|
3261 |
+
if ( isset( $_POST['sa_wrapper_padd_top'] ) ) {
|
3262 |
+
update_post_meta( $post->ID, 'sa_wrapper_padd_top', abs( intval( $_POST['sa_wrapper_padd_top'] ) ) );
|
3263 |
+
}
|
3264 |
+
if ( isset( $_POST['sa_wrapper_padd_right'] ) ) {
|
3265 |
+
update_post_meta( $post->ID, 'sa_wrapper_padd_right', abs( intval( $_POST['sa_wrapper_padd_right'] ) ) );
|
3266 |
+
}
|
3267 |
+
if ( isset( $_POST['sa_wrapper_padd_bottom'] ) ) {
|
3268 |
+
update_post_meta( $post->ID, 'sa_wrapper_padd_bottom', abs( intval( $_POST['sa_wrapper_padd_bottom'] ) ) );
|
3269 |
+
}
|
3270 |
+
if ( isset( $_POST['sa_wrapper_padd_left'] ) ) {
|
3271 |
+
update_post_meta( $post->ID, 'sa_wrapper_padd_left', abs( intval( $_POST['sa_wrapper_padd_left'] ) ) );
|
3272 |
+
}
|
3273 |
+
if ( isset( $_POST['sa_slide_min_height_type'] ) && isset( $_POST['sa_slide_min_height'] ) ) {
|
3274 |
+
if ( 'px' === $_POST['sa_slide_min_height_type'] ) {
|
3275 |
+
update_post_meta( $post->ID, 'sa_slide_min_height_perc', sanitize_text_field( wp_unslash( $_POST['sa_slide_min_height'] ) ) . 'px' );
|
3276 |
+
} else {
|
3277 |
+
update_post_meta( $post->ID, 'sa_slide_min_height_perc', sanitize_text_field( wp_unslash( $_POST['sa_slide_min_height'] ) ) );
|
3278 |
+
}
|
3279 |
+
}
|
3280 |
+
if ( isset( $_POST['sa_slide_padding_tb'] ) ) {
|
3281 |
+
update_post_meta( $post->ID, 'sa_slide_padding_tb', abs( floatval( $_POST['sa_slide_padding_tb'] ) ) );
|
3282 |
+
}
|
3283 |
+
if ( isset( $_POST['sa_slide_padding_lr'] ) ) {
|
3284 |
+
update_post_meta( $post->ID, 'sa_slide_padding_lr', abs( floatval( $_POST['sa_slide_padding_lr'] ) ) );
|
3285 |
+
}
|
3286 |
+
if ( isset( $_POST['sa_slide_margin_lr'] ) ) {
|
3287 |
+
update_post_meta( $post->ID, 'sa_slide_margin_lr', abs( floatval( $_POST['sa_slide_margin_lr'] ) ) );
|
3288 |
+
}
|
3289 |
+
if ( isset( $_POST['sa_slide_icons_location'] ) ) {
|
3290 |
+
update_post_meta( $post->ID, 'sa_slide_icons_location', sanitize_text_field( wp_unslash( $_POST['sa_slide_icons_location'] ) ) );
|
3291 |
+
}
|
3292 |
+
if ( isset( $_POST['sa_slide_icons_color'] ) ) {
|
3293 |
+
update_post_meta( $post->ID, 'sa_slide_icons_color', sanitize_text_field( wp_unslash( $_POST['sa_slide_icons_color'] ) ) );
|
3294 |
+
}
|
3295 |
+
if ( isset( $_POST['sa_autohide_arrows'] ) && ( '1' === $_POST['sa_autohide_arrows'] ) ) {
|
3296 |
+
update_post_meta( $post->ID, 'sa_autohide_arrows', '1' );
|
3297 |
+
} else {
|
3298 |
+
update_post_meta( $post->ID, 'sa_autohide_arrows', '0' );
|
3299 |
+
}
|
3300 |
+
if ( isset( $_POST['sa_dot_per_slide'] ) && ( '1' === $_POST['sa_dot_per_slide'] ) ) {
|
3301 |
+
update_post_meta( $post->ID, 'sa_dot_per_slide', '1' );
|
3302 |
+
} else {
|
3303 |
+
update_post_meta( $post->ID, 'sa_dot_per_slide', '0' );
|
3304 |
+
}
|
3305 |
+
if ( isset( $_POST['sa_slide_icons_visible'] ) && ( '1' === $_POST['sa_slide_icons_visible'] ) ) {
|
3306 |
+
update_post_meta( $post->ID, 'sa_slide_icons_visible', '1' );
|
3307 |
+
} else {
|
3308 |
+
update_post_meta( $post->ID, 'sa_slide_icons_visible', '0' );
|
3309 |
+
}
|
3310 |
+
if ( isset( $_POST['sa_slide_icons_fullslide'] ) && ( '1' === $_POST['sa_slide_icons_fullslide'] ) ) {
|
3311 |
+
update_post_meta( $post->ID, 'sa_slide_icons_fullslide', '1' );
|
3312 |
+
} else {
|
3313 |
+
update_post_meta( $post->ID, 'sa_slide_icons_fullslide', '0' );
|
3314 |
+
}
|
3315 |
+
|
3316 |
+
// OTHER SETTINGS.
|
3317 |
+
$other_settings = '';
|
3318 |
+
if ( isset( $_POST['sa_window_onload'] ) && ( '1' === $_POST['sa_window_onload'] ) ) {
|
3319 |
+
$other_settings .= '1';
|
3320 |
+
} else {
|
3321 |
+
$other_settings .= '0';
|
3322 |
+
}
|
3323 |
+
$_POST['sa_strip_javascript'] = 0;
|
3324 |
+
if ( isset( $_POST['sa_strip_javascript'] ) && ( '1' === $_POST['sa_strip_javascript'] ) ) {
|
3325 |
+
$other_settings .= '|1';
|
3326 |
+
} else {
|
3327 |
+
$other_settings .= '|0';
|
3328 |
+
}
|
3329 |
+
if ( isset( $_POST['sa_lazy_load_images'] ) && ( '1' === $_POST['sa_lazy_load_images'] ) ) {
|
3330 |
+
$other_settings .= '|1';
|
3331 |
+
} else {
|
3332 |
+
$other_settings .= '|0';
|
3333 |
+
}
|
3334 |
+
if ( isset( $_POST['sa_ulli_containers'] ) && ( '1' === $_POST['sa_ulli_containers'] ) ) {
|
3335 |
+
$other_settings .= '|1';
|
3336 |
+
} else {
|
3337 |
+
$other_settings .= '|0';
|
3338 |
+
}
|
3339 |
+
if ( isset( $_POST['sa_rtl_slider'] ) && ( '1' === $_POST['sa_rtl_slider'] ) ) {
|
3340 |
+
$other_settings .= '|1';
|
3341 |
+
} else {
|
3342 |
+
$other_settings .= '|0';
|
3343 |
+
}
|
3344 |
+
if ( isset( $_POST['sa_disable_preview'] ) && ( '1' === $_POST['sa_disable_preview'] ) ) {
|
3345 |
+
$other_settings .= '|1';
|
3346 |
+
} else {
|
3347 |
+
$other_settings .= '|0';
|
3348 |
+
}
|
3349 |
+
if ( isset( $_POST['bg_image_size'] ) && ( '' !== $_POST['bg_image_size'] ) ) {
|
3350 |
+
$other_settings .= '|' . sanitize_text_field( wp_unslash( $_POST['bg_image_size'] ) );
|
3351 |
+
} else {
|
3352 |
+
$other_settings .= '|full';
|
3353 |
+
}
|
3354 |
+
if ( isset( $_POST['sa_disable_slide_ids'] ) && ( '1' === $_POST['sa_disable_slide_ids'] ) ) {
|
3355 |
+
$other_settings .= '|1';
|
3356 |
+
} else {
|
3357 |
+
$other_settings .= '|0';
|
3358 |
+
}
|
3359 |
+
update_post_meta( $post->ID, 'sa_other_settings', $other_settings );
|
3360 |
+
// starting slide number.
|
3361 |
+
if ( isset( $_POST['sa_start_pos'] ) ) {
|
3362 |
+
update_post_meta( $post->ID, 'sa_start_pos', abs( intval( $_POST['sa_start_pos'] ) ) );
|
3363 |
+
}
|
3364 |
+
|
3365 |
+
if ( $sa_pro_version ) {
|
3366 |
+
// THUMBNAIL PAGINATION.
|
3367 |
+
if ( isset( $_POST['sa_thumbs_active'] ) && ( '1' === $_POST['sa_thumbs_active'] ) ) {
|
3368 |
+
update_post_meta( $post->ID, 'sa_thumbs_active', '1' );
|
3369 |
+
} else {
|
3370 |
+
update_post_meta( $post->ID, 'sa_thumbs_active', '0' );
|
3371 |
+
}
|
3372 |
+
if ( isset( $_POST['sa_thumbs_location'] ) ) {
|
3373 |
+
update_post_meta( $post->ID, 'sa_thumbs_location', sanitize_text_field( wp_unslash( $_POST['sa_thumbs_location'] ) ) );
|
3374 |
+
}
|
3375 |
+
if ( isset( $_POST['sa_thumbs_image_size'] ) ) {
|
3376 |
+
update_post_meta( $post->ID, 'sa_thumbs_image_size', sanitize_text_field( wp_unslash( $_POST['sa_thumbs_image_size'] ) ) );
|
3377 |
+
}
|
3378 |
+
if ( isset( $_POST['sa_thumbs_padding'] ) ) {
|
3379 |
+
update_post_meta( $post->ID, 'sa_thumbs_padding', abs( floatval( $_POST['sa_thumbs_padding'] ) ) );
|
3380 |
+
}
|
3381 |
+
if ( isset( $_POST['sa_thumbs_width'] ) ) {
|
3382 |
+
update_post_meta( $post->ID, 'sa_thumbs_width', abs( intval( $_POST['sa_thumbs_width'] ) ) );
|
3383 |
+
}
|
3384 |
+
if ( isset( $_POST['sa_thumbs_height'] ) ) {
|
3385 |
+
update_post_meta( $post->ID, 'sa_thumbs_height', abs( intval( $_POST['sa_thumbs_height'] ) ) );
|
3386 |
+
}
|
3387 |
+
if ( isset( $_POST['sa_thumbs_opacity'] ) ) {
|
3388 |
+
update_post_meta( $post->ID, 'sa_thumbs_opacity', abs( intval( $_POST['sa_thumbs_opacity'] ) ) );
|
3389 |
+
}
|
3390 |
+
if ( isset( $_POST['sa_thumbs_border_width'] ) ) {
|
3391 |
+
update_post_meta( $post->ID, 'sa_thumbs_border_width', abs( intval( $_POST['sa_thumbs_border_width'] ) ) );
|
3392 |
+
}
|
3393 |
+
if ( isset( $_POST['sa_thumbs_border_color'] ) ) {
|
3394 |
+
update_post_meta( $post->ID, 'sa_thumbs_border_color', sanitize_text_field( wp_unslash( $_POST['sa_thumbs_border_color'] ) ) );
|
3395 |
+
}
|
3396 |
+
if ( isset( $_POST['sa_thumbs_resp_tablet'] ) ) {
|
3397 |
+
update_post_meta( $post->ID, 'sa_thumbs_resp_tablet', abs( intval( $_POST['sa_thumbs_resp_tablet'] ) ) );
|
3398 |
+
}
|
3399 |
+
if ( isset( $_POST['sa_thumbs_resp_mobile'] ) ) {
|
3400 |
+
update_post_meta( $post->ID, 'sa_thumbs_resp_mobile', abs( intval( $_POST['sa_thumbs_resp_mobile'] ) ) );
|
3401 |
+
}
|
3402 |
+
}
|
3403 |
+
}
|
3404 |
+
}
|
3405 |
+
|
3406 |
+
/**
|
3407 |
+
* ##### FUNCTION CHECKS WHETHER SLIDE ANYTHING PRO IS REGISTERED - RETURNS TRUE OR FALSE #####
|
3408 |
+
*/
|
3409 |
+
function validate_slide_anything_pro_registration() {
|
3410 |
+
if ( ! function_exists( 'validate_slide_anything_pro_license_key' ) ) {
|
3411 |
+
return false;
|
3412 |
+
}
|
3413 |
+
$valid_key = validate_slide_anything_pro_license_key();
|
3414 |
+
return $valid_key;
|
3415 |
+
}
|
3416 |
+
|
3417 |
+
|
3418 |
+
|
3419 |
+
/**
|
3420 |
+
* ###################################################################################
|
3421 |
+
* ### FUNCTION DISPLAYS THE 'RE-ORDER SLIDES' SUB-PAGE IN THE WordPress DASHBOARD ###
|
3422 |
+
* ###################################################################################
|
3423 |
+
*/
|
3424 |
+
function extra_sa_menu_pages() {
|
3425 |
+
add_submenu_page(
|
3426 |
+
'edit.php?post_type=sa_slider',
|
3427 |
+
__( 'Re-Order Slides', 'menu-sa-order' ),
|
3428 |
+
__( 'Re-Order Slides', 'menu-sa-order' ),
|
3429 |
+
'manage_options',
|
3430 |
+
'reorderslides',
|
3431 |
+
'sa_reorder_slides_page'
|
3432 |
+
);
|
3433 |
+
}
|
3434 |
+
|
3435 |
+
/**
|
3436 |
+
* ### FUNCTION CONTAINING THE 'RE-ORDER' SLIDES FUNCTIONALITY ###
|
3437 |
+
*/
|
3438 |
+
function sa_reorder_slides_page() {
|
3439 |
+
$sa_pro_version = validate_slide_anything_pro_registration();
|
3440 |
+
$page_url = get_admin_url() . 'edit.php?post_type=sa_slider&page=reorderslides';
|
3441 |
+
$placeholder_image = get_site_url() . '/wp-content/plugins/slide-anything/images/bg_placeholder.png';
|
3442 |
+
|
3443 |
+
echo "<div id='sa_reorder_slides'>\n";
|
3444 |
+
echo '<h1>Slide Anything - Re-Order Slides</h1>';
|
3445 |
+
|
3446 |
+
if ( isset( $_SERVER['REQUEST_METHOD'] ) && ( 'POST' === $_SERVER['REQUEST_METHOD'] )
|
3447 |
+
&& isset( $_POST['reorder_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['reorder_nonce'] ) ), 'reorder_action' ) ) {
|
3448 |
+
// A POST VARIABLE FOR 'SLIDER ID' HAS BEEN PASSED.
|
3449 |
+
if ( isset( $_POST['sar_slider_id'] ) ) {
|
3450 |
+
$slider_id = sanitize_text_field( wp_unslash( $_POST['sar_slider_id'] ) );
|
3451 |
+
$slider_title = get_the_title( $slider_id );
|
3452 |
+
} else {
|
3453 |
+
exit();
|
3454 |
+
}
|
3455 |
+
|
3456 |
+
if ( isset( $_POST['sar_sort_order'] ) && ( '' !== $_POST['sar_sort_order'] ) ) {
|
3457 |
+
// CHANGE THE ORDER OF SLIDE DATA FOR THE SLIDER AND RE-SAVE METADATA.
|
3458 |
+
$sort_order = sanitize_text_field( wp_unslash( $_POST['sar_sort_order'] ) );
|
3459 |
+
$data_in_arr = array();
|
3460 |
+
$data_out_arr = array();
|
3461 |
+
|
3462 |
+
// 1) SAVE SLIDES METADATA TO AN 'IN' ARRAY (ONLY SLIDES MEATDATA AND NO SETTINGS DATA SAVED!).
|
3463 |
+
$metadata = get_metadata( 'post', $slider_id );
|
3464 |
+
$num_slides = $metadata['sa_num_slides'][0];
|
3465 |
+
foreach ( $metadata as $key => $value_arr ) {
|
3466 |
+
$value = $value_arr[0];
|
3467 |
+
for ( $i = 1; $i <= $num_slides; $i++ ) {
|
3468 |
+
$key_prefix = 'sa_slide' . $i . '_';
|
3469 |
+
if ( strpos( $key, $key_prefix ) === 0 ) {
|
3470 |
+
// metadata key starts with the key prefix ('sa_slide??').
|
3471 |
+
$data_in_arr[ $key ] = $value;
|
3472 |
+
}
|
3473 |
+
}
|
3474 |
+
}
|
3475 |
+
|
3476 |
+
// 2) CREATE THE NEW SLIDES 'OUT' ARRAY (WITH THE NEW SLIDE ORDER).
|
3477 |
+
$sort_order_arr = explode( ',', $sort_order );
|
3478 |
+
$count_order_arr = count( $sort_order_arr );
|
3479 |
+
for ( $i = 0; $i < $count_order_arr; $i++ ) {
|
3480 |
+
$loop_prefix = 'sa_slide' . ( $i + 1 ) . '_'; // ascending loop order (1, 2, 3...).
|
3481 |
+
$order_prefix = 'sa_slide' . $sort_order_arr[ $i ] . '_'; // slide number to be stored in this slot.
|
3482 |
+
foreach ( $data_in_arr as $key => $value ) {
|
3483 |
+
if ( strpos( $key, $order_prefix ) === 0 ) {
|
3484 |
+
// metakey key value starts with the order prefix.
|
3485 |
+
$new_key = str_replace( $order_prefix, $loop_prefix, $key );
|
3486 |
+
$data_out_arr[ $new_key ] = $value;
|
3487 |
+
}
|
3488 |
+
}
|
3489 |
+
}
|
3490 |
+
|
3491 |
+
// 3) LOOP THROUGH SLIDES 'OUT' ARRAY UPDATING POST METADATA.
|
3492 |
+
foreach ( $data_out_arr as $key => $value ) {
|
3493 |
+
update_post_meta( $slider_id, $key, $value );
|
3494 |
+
}
|
3495 |
+
|
3496 |
+
echo "<h3 id='sar_success_message'>SLIDE ORDER HAS BEEN UPDATED</h3>";
|
3497 |
+
} else {
|
3498 |
+
if ( isset( $_POST['sar_del_slides'] ) && ( '' !== $_POST['sar_del_slides'] ) ) {
|
3499 |
+
// DELETE ALL SLIDES WITH THE 'DELETE SLIDE' CHECKBOX CHECKED.
|
3500 |
+
$del_slides = sanitize_text_field( wp_unslash( $_POST['sar_del_slides'] ) );
|
3501 |
+
$del_slides_arr = explode( ',', $del_slides );
|
3502 |
+
$data_in_arr = array();
|
3503 |
+
$data_out_arr = array();
|
3504 |
+
|
3505 |
+
// 1) SAVE SLIDES METADATA TO AN 'IN' ARRAY (ONLY SLIDES MEATDATA AND NO SETTINGS DATA SAVED!).
|
3506 |
+
$metadata = get_metadata( 'post', $slider_id );
|
3507 |
+
$num_slides = $metadata['sa_num_slides'][0];
|
3508 |
+
foreach ( $metadata as $key => $value_arr ) {
|
3509 |
+
$value = $value_arr[0];
|
3510 |
+
for ( $i = 1; $i <= $num_slides; $i++ ) {
|
3511 |
+
$key_prefix = 'sa_slide' . $i . '_';
|
3512 |
+
if ( strpos( $key, $key_prefix ) === 0 ) {
|
3513 |
+
// metadata key starts with the key prefix ('sa_slide??').
|
3514 |
+
$data_in_arr[ $i ][ $key ] = $value;
|
3515 |
+
}
|
3516 |
+
}
|
3517 |
+
}
|
3518 |
+
|
3519 |
+
// 2) CREATE THE NEW SLIDES 'OUT' ARRAY (WITH THE DELETED SLIDES REMOVED)
|
3520 |
+
$curr_index = 0;
|
3521 |
+
$tot_del = 0;
|
3522 |
+
for ( $i = 1; $i <= $num_slides; $i++ ) {
|
3523 |
+
$loop_prefix = 'sa_slide' . $i . '_';
|
3524 |
+
$delete_yn = 0;
|
3525 |
+
$count_del_arr = count( $del_slides_arr );
|
3526 |
+
for ( $j = 0; $j < $count_del_arr; $j++ ) {
|
3527 |
+
if ( $i === $del_slides_arr[ $j ] ) {
|
3528 |
+
$delete_yn = 1;
|
3529 |
+
}
|
3530 |
+
}
|
3531 |
+
if ( 0 === $delete_yn ) {
|
3532 |
+
// current slide is NOT to be deleted - copy to 'out' array.
|
3533 |
+
$curr_index++;
|
3534 |
+
$curr_prefix = 'sa_slide' . $curr_index . '_';
|
3535 |
+
foreach ( $data_in_arr[ $i ] as $key => $value ) {
|
3536 |
+
$new_key = str_replace( $loop_prefix, $curr_prefix, $key );
|
3537 |
+
$data_out_arr[ $new_key ] = $value;
|
3538 |
+
}
|
3539 |
+
} else {
|
3540 |
+
$tot_del++;
|
3541 |
+
}
|
3542 |
+
}
|
3543 |
+
|
3544 |
+
// 3) LOOP THROUGH SLIDES 'OUT' ARRAY UPDATING POST METADATA.
|
3545 |
+
update_post_meta( $slider_id, 'sa_num_slides', $curr_index );
|
3546 |
+
foreach ( $data_out_arr as $key => $value ) {
|
3547 |
+
update_post_meta( $slider_id, $key, $value );
|
3548 |
+
}
|
3549 |
+
|
3550 |
+
if ( 1 === $tot_del ) {
|
3551 |
+
echo "<h3 id='sar_success_message'>" . esc_html( $tot_del ) . ' SLIDE HAS BEEN DELETED</h3>';
|
3552 |
+
} else {
|
3553 |
+
echo "<h3 id='sar_success_message'>" . esc_html( $tot_del ) . ' SLIDES HAVE BEEN DELETED</h3>';
|
3554 |
+
}
|
3555 |
+
}
|
3556 |
+
}
|
3557 |
+
|
3558 |
+
// GET REQUIRED SLIDER METADATA AND SAVE WITHIN AN ARRAY.
|
3559 |
+
$num_slides = 0;
|
3560 |
+
$slide_arr = array();
|
3561 |
+
$metadata = get_metadata( 'post', $slider_id );
|
3562 |
+
if ( count( $metadata ) > 0 ) {
|
3563 |
+
$num_slides = $metadata['sa_num_slides'][0];
|
3564 |
+
}
|
3565 |
+
if ( 0 !== $num_slides ) {
|
3566 |
+
// SLIDER CONTAINS SLIDES - DISPLAY SORTABLE LIST OF SLIDES.
|
3567 |
+
for ( $i = 1; $i <= $num_slides; $i++ ) {
|
3568 |
+
$image_data = $metadata[ 'sa_slide' . $i . '_image_data' ][0];
|
3569 |
+
$image_data_arr = explode( '~', $image_data );
|
3570 |
+
$slide_arr[ $i ]['image_id'] = $image_data_arr[0];
|
3571 |
+
$slide_arr[ $i ]['content'] = $metadata[ 'sa_slide' . $i . '_content' ][0];
|
3572 |
+
// cater for popup images used as the slide background.
|
3573 |
+
$popup_type = '';
|
3574 |
+
$popup_background = '';
|
3575 |
+
if ( ! $sa_pro_version ) {
|
3576 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_type' ][0] ) ) {
|
3577 |
+
$popup_type = $metadata[ 'sa_slide' . $i . '_popup_type' ][0];
|
3578 |
+
}
|
3579 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_background' ][0] ) ) {
|
3580 |
+
$popup_background = $metadata[ 'sa_slide' . $i . '_popup_background' ][0];
|
3581 |
+
}
|
3582 |
+
}
|
3583 |
+
if ( 'IMAGE' === $popup_type ) {
|
3584 |
+
if ( ( '' !== $popup_background ) && ( 'no' !== $popup_background ) ) {
|
3585 |
+
$slide_arr[ $i ]['image_id'] = $metadata[ 'sa_slide' . $i . '_popup_imageid' ][0];
|
3586 |
+
}
|
3587 |
+
}
|
3588 |
+
}
|
3589 |
+
|
3590 |
+
// DISPLAY THE SORTABLE GRID OF SLIDES.
|
3591 |
+
echo "<h2 id='sar_slider_title'>" . esc_html( $slider_title ) . "</h2>\n";
|
3592 |
+
echo "<h3 id='sar_drag_message'>Drag slides to re-order...</h3>\n";
|
3593 |
+
echo "<ul id='sar_sortable'>\n";
|
3594 |
+
for ( $i = 1; $i <= $num_slides; $i++ ) {
|
3595 |
+
$bg_image = $placeholder_image;
|
3596 |
+
$slide_image_src = wp_get_attachment_image_src( $slide_arr[ $i ]['image_id'], 'thumbnail' );
|
3597 |
+
if ( ! empty( $slide_image_src[0] ) ) {
|
3598 |
+
$bg_image = $slide_image_src[0];
|
3599 |
+
}
|
3600 |
+
echo "<li id='sar" . esc_attr( $i ) . "' class='ui-state-default'>\n";
|
3601 |
+
echo "<div class='sar_image' style='background-image:url(\"" . esc_url( $bg_image ) . "\");'></div>\n";
|
3602 |
+
echo "<div class='sar_content'>\n";
|
3603 |
+
echo "<h4 class='sar_slide_num'>SLIDE " . esc_html( $i ) . "</h4>\n";
|
3604 |
+
echo "<div class='sar_del_slide'>DELETE <span>SLIDE</span>";
|
3605 |
+
echo "<input type='checkbox' id='sar_del" . esc_attr( $i ) . "' name='sar_del" . esc_attr( $i ) . "' class='sar_del_checkbox'/>";
|
3606 |
+
echo "</div>\n";
|
3607 |
+
echo "<div class='sar_slide_html'>" . esc_html( nl2br( htmlentities( $slide_arr[ $i ]['content'] ) ) ) . "</div>\n";
|
3608 |
+
echo '</div>';
|
3609 |
+
echo "</li>\n";
|
3610 |
+
}
|
3611 |
+
echo "</ul>\n";
|
3612 |
+
|
3613 |
+
// DISPLAY THE HTML FORM CONTAINING THE SORT ORDER INPUT ELEMENT.
|
3614 |
+
echo "<form method='post' id='sar_order_form'>\n";
|
3615 |
+
wp_nonce_field( 'reorder_action', 'reorder_nonce' );
|
3616 |
+
echo "<input type='hidden' name='sar_slider_id' value='" . esc_attr( $slider_id ) . "'/>";
|
3617 |
+
echo "<input type='hidden' id='sar_sort_order' name='sar_sort_order'/>";
|
3618 |
+
echo "<input type='hidden' id='sar_del_slides' name='sar_del_slides'/>";
|
3619 |
+
echo "<input type='submit' id='sar_update_but' value='UPDATE ORDER'/>";
|
3620 |
+
echo "<input type='submit' id='sar_delete_but' value='DELETE SLIDES'/>";
|
3621 |
+
echo "</form>\n";
|
3622 |
+
|
3623 |
+
} else {
|
3624 |
+
// SLIDER CONTAINS NO SLIDES - DISPLAY MESSAGE.
|
3625 |
+
echo "<h3 id='sar_no_slides_found'>This slider contains NO slides!</h3>\n";
|
3626 |
+
echo "<a class='sar_back_button' href='" . esc_url( $page_url ) . "'>BACK</a>";
|
3627 |
+
}
|
3628 |
+
} else {
|
3629 |
+
// ##### NO POST VARIABLE FOR 'SLIDER ID' HAS BEEN PASSED #####
|
3630 |
+
// WP QUERY TO GET ARRAY OF SA SLIDERS (ID & TITLE) THAT EXIST.
|
3631 |
+
$slider_arr = array();
|
3632 |
+
$count = 0;
|
3633 |
+
$args = array(
|
3634 |
+
'post_type' => 'sa_slider',
|
3635 |
+
'post_status' => array( 'publish', 'draft' ),
|
3636 |
+
'orderby' => 'menu_order',
|
3637 |
+
'order' => 'ASC',
|
3638 |
+
'posts_per_page' => -1,
|
3639 |
+
);
|
3640 |
+
$sliders = new WP_Query( $args );
|
3641 |
+
if ( $sliders->have_posts() ) {
|
3642 |
+
while ( $sliders->have_posts() ) {
|
3643 |
+
$sliders->the_post();
|
3644 |
+
$slider_arr[ $count ]['id'] = get_the_ID();
|
3645 |
+
$slider_arr[ $count ]['title'] = get_the_title();
|
3646 |
+
$count++;
|
3647 |
+
}
|
3648 |
+
}
|
3649 |
+
wp_reset_postdata();
|
3650 |
+
|
3651 |
+
if ( count( $slider_arr ) > 0 ) {
|
3652 |
+
// DISPLAY FORM CONTAINING SA SLIDER SELECT DROPDOWN.
|
3653 |
+
echo "<form method='post' id='sar_slider_form'>\n";
|
3654 |
+
wp_nonce_field( 'reorder_action', 'reorder_nonce' );
|
3655 |
+
echo "<p>This tool allows you to change the order of slides within a Slide Anything slider.</p>\n";
|
3656 |
+
echo "<p>Select the slider you would like to re-order, then just drag-and-drop slides for your new slide order.</p>\n";
|
3657 |
+
echo "<div style='padding-top:10px;'>Select Slider to Re-Order:<br/>";
|
3658 |
+
echo "<select id='sar_slider_id' name='sar_slider_id'>\n";
|
3659 |
+
$count_slider_arr = count( $slider_arr );
|
3660 |
+
for ( $i = 0; $i < $count_slider_arr; $i++ ) {
|
3661 |
+
echo '<h4>|' . esc_html( $slider_arr[ $i ]['id'] ) . '|' . esc_html( $slider_arr[ $i ]['title'] ) . '|</h4>';
|
3662 |
+
echo "<option value='" . esc_attr( $slider_arr[ $i ]['id'] ) . "'>" . esc_html( $slider_arr[ $i ]['title'] ) . ' (#' . esc_html( $slider_arr[ $i ]['id'] ) . ")</option>\n";
|
3663 |
+
}
|
3664 |
+
echo "<select></div>\n";
|
3665 |
+
echo "<div><input type='submit' value='Select Slider'/></div>\n";
|
3666 |
+
echo "</form>\n";
|
3667 |
+
} else {
|
3668 |
+
// NO SA SLIDERS FOUND - DISPLAY MESSAGE.
|
3669 |
+
echo "<h3 id='sar_no_sliders_found'>No Slide Anything sliders found!</h3>\n";
|
3670 |
+
}
|
3671 |
+
}
|
3672 |
+
|
3673 |
+
echo "</div>\n";
|
3674 |
+
}
|
3675 |
+
|
3676 |
+
|
3677 |
+
/**
|
3678 |
+
* ### FUNCTION CALLED BY 'template_include' FILTER TO USE A CUSTOM PAGE TERMPLATE FOR SA PREVIEW PAGE ###
|
3679 |
+
*
|
3680 |
+
* @param string $template Page Template.
|
3681 |
+
*/
|
3682 |
+
function sa_preview_page_template( $template ) {
|
3683 |
+
if ( is_page( 'Slide Anything Popup Preview' ) ) {
|
3684 |
+
$template = dirname( __FILE__ ) . '/single-page.php';
|
3685 |
+
}
|
3686 |
+
return $template;
|
3687 |
+
}
|
3688 |
+
|
3689 |
+
|
3690 |
+
/**
|
3691 |
+
* ### FILTER TO ALLOW IFRAMES WITHIN SLIDE CONTENT ###
|
3692 |
+
*
|
3693 |
+
* @param array $allowedposttags Allowed Post Tags.
|
3694 |
+
*/
|
3695 |
+
function slides_allow_iframes_filter( $allowedposttags ) {
|
3696 |
+
// Only change for users who can publish posts.
|
3697 |
+
if ( ! current_user_can( 'publish_posts' ) ) {
|
3698 |
+
return $allowedposttags;
|
3699 |
+
}
|
3700 |
+
|
3701 |
+
// Allow iframes and the following attributes.
|
3702 |
+
$allowedposttags['iframe'] = array(
|
3703 |
+
'align' => true,
|
3704 |
+
'width' => true,
|
3705 |
+
'height' => true,
|
3706 |
+
'frameborder' => true,
|
3707 |
+
'name' => true,
|
3708 |
+
'src' => true,
|
3709 |
+
'title' => true,
|
3710 |
+
'allow' => true,
|
3711 |
+
'allowfullscreen' => true,
|
3712 |
+
'id' => true,
|
3713 |
+
'class' => true,
|
3714 |
+
'style' => true,
|
3715 |
+
'scrolling' => true,
|
3716 |
+
'marginwidth' => true,
|
3717 |
+
'marginheight' => true,
|
3718 |
+
);
|
3719 |
+
return $allowedposttags;
|
3720 |
+
}
|
3721 |
+
?>
|
php/slide-anything-frontend.php
CHANGED
@@ -1,1322 +1,1241 @@
|
|
1 |
-
<?php
|
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 |
-
$slide_data[
|
76 |
-
|
77 |
-
$slide_data[
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
$
|
82 |
-
|
83 |
-
|
84 |
-
$
|
85 |
-
$slide_data[
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
$slide_data[
|
95 |
-
$slide_data[
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
$slide_data[
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
$slide_data[
|
113 |
-
$
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
if (
|
125 |
-
$slide_data[
|
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 |
-
$slide_data['
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
$slide_data['
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
$slide_data['
|
168 |
-
}
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
$slide_data['
|
174 |
-
}
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
$slide_data['
|
180 |
-
}
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
$slide_data['
|
186 |
-
}
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
$slide_data['
|
192 |
-
}
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
$slide_data['
|
198 |
-
}
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
$slide_data['
|
204 |
-
}
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
} else {
|
215 |
-
$slide_data['
|
216 |
-
}
|
217 |
-
if (isset($metadata['
|
218 |
-
$slide_data['
|
219 |
-
if ($slide_data['
|
220 |
-
$slide_data['
|
221 |
-
} else {
|
222 |
-
$slide_data['
|
223 |
-
}
|
224 |
-
} else {
|
225 |
-
$slide_data['
|
226 |
-
}
|
227 |
-
if (isset($metadata['
|
228 |
-
$slide_data['
|
229 |
-
if ($slide_data['
|
230 |
-
$slide_data['
|
231 |
-
} else {
|
232 |
-
$slide_data['
|
233 |
-
}
|
234 |
-
} else {
|
235 |
-
$slide_data['
|
236 |
-
}
|
237 |
-
if (($metadata['
|
238 |
-
$slide_data['
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
$slide_data['
|
262 |
-
$slide_data['
|
263 |
-
$slide_data['
|
264 |
-
$slide_data['
|
265 |
-
$slide_data['
|
266 |
-
$slide_data['
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
$slide_data['
|
271 |
-
$slide_data['
|
272 |
-
$slide_data['
|
273 |
-
$slide_data['
|
274 |
-
$slide_data['
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
$slide_data['
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
$slide_data['
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
$slide_data['
|
298 |
-
}
|
299 |
-
|
300 |
-
|
301 |
-
$slide_data['
|
302 |
-
} else {
|
303 |
-
$slide_data['
|
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 |
-
// setting 3 - sa_lazy_load_images
|
338 |
-
$slide_data['lazy_load_images'] = '0';
|
339 |
-
if (isset($other_settings_arr) && ($other_settings_arr[2]
|
340 |
-
$slide_data['lazy_load_images'] = $other_settings_arr[2];
|
341 |
-
} else {
|
342 |
-
if (isset($metadata['sa_lazy_load_images'])) {
|
343 |
-
$slide_data['lazy_load_images'] = $metadata['sa_lazy_load_images'][0];
|
344 |
-
if ($slide_data['lazy_load_images']
|
345 |
-
$slide_data['lazy_load_images'] = '0';
|
346 |
-
}
|
347 |
-
}
|
348 |
-
}
|
349 |
-
// setting 4 - sa_ulli_containers
|
350 |
-
$slide_data['ulli_containers'] = '0';
|
351 |
-
if (isset($other_settings_arr) && ($other_settings_arr[3]
|
352 |
-
$slide_data['ulli_containers'] = $other_settings_arr[3];
|
353 |
-
} else {
|
354 |
-
if (isset($metadata['sa_ulli_containers'])) {
|
355 |
-
$slide_data['ulli_containers'] = $metadata['sa_ulli_containers'][0];
|
356 |
-
if ($slide_data['ulli_containers']
|
357 |
-
$slide_data['ulli_containers'] = '0';
|
358 |
-
}
|
359 |
-
}
|
360 |
-
}
|
361 |
-
// setting 5 - sa_rtl_slider
|
362 |
-
$slide_data['rtl_slider'] = '0';
|
363 |
-
if (isset($other_settings_arr) && ($other_settings_arr[4]
|
364 |
-
$slide_data['rtl_slider'] = $other_settings_arr[4];
|
365 |
-
}
|
366 |
-
// setting 7 - bg_image_size
|
367 |
-
$slide_data['bg_image_size'] = 'full';
|
368 |
-
if (isset($other_settings_arr) && (count($other_settings_arr) > 6)) {
|
369 |
-
if ($other_settings_arr[6]
|
370 |
-
$slide_data['bg_image_size'] = $other_settings_arr[6];
|
371 |
-
}
|
372 |
-
}
|
373 |
-
// setting 8 - disable_slide_ids
|
374 |
-
$slide_data['disable_slide_ids'] = '0';
|
375 |
-
if (isset($other_settings_arr) && (count($other_settings_arr) > 7)) {
|
376 |
-
if ($other_settings_arr[7]
|
377 |
-
$slide_data['disable_slide_ids'] = $other_settings_arr[7];
|
378 |
-
}
|
379 |
-
}
|
380 |
-
// Start Position
|
381 |
-
$slide_data['start_pos'] = 0;
|
382 |
-
if (isset($metadata['sa_start_pos'])) {
|
383 |
-
$slide_data['start_pos'] = $metadata['sa_start_pos'][0];
|
384 |
-
if ($slide_data['start_pos']
|
385 |
-
$slide_data['start_pos'] = abs(intval($slide_data['start_pos']));
|
386 |
-
if ($slide_data['start_pos'] > 0) {
|
387 |
-
$slide_data['start_pos'] = $slide_data['start_pos'] - 1;
|
388 |
-
}
|
389 |
-
}
|
390 |
-
}
|
391 |
-
|
392 |
-
// hero slider and slider thumbnails
|
393 |
-
$slide_data['hero_slider']
|
394 |
-
$slide_data['thumbs_active'] = '0';
|
395 |
-
if ($sa_pro_version) {
|
396 |
-
if (isset($metadata['sa_hero_slider'])) {
|
397 |
-
$slide_data['hero_slider'] = $metadata['sa_hero_slider'][0];
|
398 |
-
if ($slide_data['hero_slider']
|
399 |
-
$slide_data['hero_slider'] = '0';
|
400 |
-
}
|
401 |
-
} else {
|
402 |
-
$slide_data['hero_slider'] = '0';
|
403 |
-
}
|
404 |
-
if (isset($metadata['sa_thumbs_active'])) {
|
405 |
-
$slide_data['thumbs_active'] = $metadata['sa_thumbs_active'][0];
|
406 |
-
if ($slide_data['thumbs_active']
|
407 |
-
$slide_data['thumbs_active'] = '0';
|
408 |
-
}
|
409 |
-
} else {
|
410 |
-
$slide_data['thumbs_active'] = '0';
|
411 |
-
}
|
412 |
-
if (isset($metadata['sa_thumbs_location'])) {
|
413 |
-
$slide_data['thumbs_location'] = $metadata['sa_thumbs_location'][0];
|
414 |
-
} else {
|
415 |
-
$slide_data['thumbs_location'] = 'inside_bottom';
|
416 |
-
}
|
417 |
-
if (isset($metadata['sa_thumbs_image_size'])) {
|
418 |
-
$slide_data['thumbs_image_size'] = $metadata['sa_thumbs_image_size'][0];
|
419 |
-
} else {
|
420 |
-
$slide_data['thumbs_image_size'] = 'thumbnail';
|
421 |
-
}
|
422 |
-
if (isset($metadata['sa_thumbs_padding'])) {
|
423 |
-
$slide_data['thumbs_padding'] = $metadata['sa_thumbs_padding'][0];
|
424 |
-
} else {
|
425 |
-
$slide_data['thumbs_padding'] = '3';
|
426 |
-
}
|
427 |
-
if (isset($metadata['sa_thumbs_width'])) {
|
428 |
-
$slide_data['thumbs_width'] = $metadata['sa_thumbs_width'][0];
|
429 |
-
} else {
|
430 |
-
$slide_data['thumbs_width'] = '150';
|
431 |
-
}
|
432 |
-
if (isset($metadata['sa_thumbs_height'])) {
|
433 |
-
$slide_data['thumbs_height'] = $metadata['sa_thumbs_height'][0];
|
434 |
-
} else {
|
435 |
-
$slide_data['thumbs_height'] = '85';
|
436 |
-
}
|
437 |
-
if (isset($metadata['sa_thumbs_opacity'])) {
|
438 |
-
$slide_data['thumbs_opacity'] = $metadata['sa_thumbs_opacity'][0];
|
439 |
-
} else {
|
440 |
-
$slide_data['thumbs_opacity'] = '50';
|
441 |
-
}
|
442 |
-
if (isset($metadata['sa_thumbs_border_width'])) {
|
443 |
-
$slide_data['thumbs_border_width'] = $metadata['sa_thumbs_border_width'][0];
|
444 |
-
} else {
|
445 |
-
$slide_data['thumbs_border_width'] = '0';
|
446 |
-
}
|
447 |
-
if (isset($metadata['sa_thumbs_border_color'])) {
|
448 |
-
$slide_data['thumbs_border_color'] = $metadata['sa_thumbs_border_color'][0];
|
449 |
-
} else {
|
450 |
-
$slide_data['thumbs_border_color'] = '#ffffff';
|
451 |
-
}
|
452 |
-
if (isset($metadata['sa_thumbs_resp_tablet'])) {
|
453 |
-
$slide_data['thumbs_resp_tablet'] = $metadata['sa_thumbs_resp_tablet'][0];
|
454 |
-
} else {
|
455 |
-
$slide_data['thumbs_resp_tablet'] = '75';
|
456 |
-
}
|
457 |
-
if (isset($metadata['sa_thumbs_resp_mobile'])) {
|
458 |
-
$slide_data['thumbs_resp_mobile'] = $metadata['sa_thumbs_resp_mobile'][0];
|
459 |
-
} else {
|
460 |
-
$slide_data['thumbs_resp_mobile'] = '50';
|
461 |
-
}
|
462 |
-
}
|
463 |
-
// showcase carousel
|
464 |
-
$slide_data['showcase_slider'] = '0';
|
465 |
-
if ($sa_pro_version) {
|
466 |
-
if (isset($metadata['sa_showcase_slider'])) {
|
467 |
-
$slide_data['showcase_slider'] = $metadata['sa_showcase_slider'][0];
|
468 |
-
if ($slide_data['showcase_slider']
|
469 |
-
$slide_data['showcase_slider'] = '0';
|
470 |
-
}
|
471 |
-
} else {
|
472 |
-
$slide_data['showcase_slider'] = '0';
|
473 |
-
}
|
474 |
-
if (isset($metadata['sa_showcase_width'])) {
|
475 |
-
$slide_data['showcase_width'] = $metadata['sa_showcase_width'][0];
|
476 |
-
} else {
|
477 |
-
$slide_data['showcase_width'] = '120';
|
478 |
-
}
|
479 |
-
if (isset($metadata['sa_showcase_tablet'])) {
|
480 |
-
$slide_data['showcase_tablet'] = $metadata['sa_showcase_tablet'][0];
|
481 |
-
if ($slide_data['showcase_tablet']
|
482 |
-
$slide_data['showcase_tablet'] = '0';
|
483 |
-
}
|
484 |
-
} else {
|
485 |
-
$slide_data['showcase_tablet'] = '0';
|
486 |
-
}
|
487 |
-
if (isset($metadata['sa_showcase_width_tab'])) {
|
488 |
-
$slide_data['showcase_width_tab'] = $metadata['sa_showcase_width_tab'][0];
|
489 |
-
} else {
|
490 |
-
$slide_data['showcase_width_tab'] = '130';
|
491 |
-
}
|
492 |
-
if (isset($metadata['sa_showcase_mobile'])) {
|
493 |
-
$slide_data['showcase_mobile'] = $metadata['sa_showcase_mobile'][0];
|
494 |
-
if ($slide_data['showcase_mobile']
|
495 |
-
$slide_data['showcase_mobile'] = '0';
|
496 |
-
}
|
497 |
-
} else {
|
498 |
-
$slide_data['showcase_mobile'] = '0';
|
499 |
-
}
|
500 |
-
if (isset($metadata['sa_showcase_width_mob'])) {
|
501 |
-
$slide_data['showcase_width_mob'] = $metadata['sa_showcase_width_mob'][0];
|
502 |
-
} else {
|
503 |
-
$slide_data['showcase_width_mob'] = '140';
|
504 |
-
}
|
505 |
-
}
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
$reorder_arr[$i-1]['
|
515 |
-
$reorder_arr[$i-1]['
|
516 |
-
$reorder_arr[$i-1]['
|
517 |
-
$reorder_arr[$i-1]['
|
518 |
-
$reorder_arr[$i-1]['
|
519 |
-
$reorder_arr[$i-1]['
|
520 |
-
$reorder_arr[$i-1]['
|
521 |
-
$
|
522 |
-
|
523 |
-
|
524 |
-
$reorder_arr[$i-1]['
|
525 |
-
$reorder_arr[$i-1]['
|
526 |
-
$reorder_arr[$i-1]['
|
527 |
-
$reorder_arr[$i-1]['
|
528 |
-
$reorder_arr[$i-1]['
|
529 |
-
$reorder_arr[$i-1]['
|
530 |
-
$reorder_arr[$i-1]['
|
531 |
-
$reorder_arr[$i-1]['
|
532 |
-
$reorder_arr[$i-1]['
|
533 |
-
$reorder_arr[$i-1]['
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
$slide_data[
|
548 |
-
$slide_data[
|
549 |
-
$slide_data[
|
550 |
-
$slide_data[
|
551 |
-
$slide_data[
|
552 |
-
$slide_data[
|
553 |
-
$slide_data[
|
554 |
-
$
|
555 |
-
|
556 |
-
|
557 |
-
$slide_data[
|
558 |
-
$slide_data[
|
559 |
-
$slide_data[
|
560 |
-
$slide_data[
|
561 |
-
$slide_data[
|
562 |
-
$slide_data[
|
563 |
-
$slide_data[
|
564 |
-
$slide_data[
|
565 |
-
$slide_data[
|
566 |
-
$slide_data[
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
$wrapper_style
|
575 |
-
$wrapper_style .=
|
576 |
-
$wrapper_style .=
|
577 |
-
$wrapper_style .=
|
578 |
-
$wrapper_style .= $slide_data['
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
$additional_classes =
|
589 |
-
}
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
$
|
602 |
-
|
603 |
-
|
604 |
-
$
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
$
|
609 |
-
$
|
610 |
-
|
611 |
-
$additional_classes .=
|
612 |
-
}
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
$
|
617 |
-
$
|
618 |
-
|
619 |
-
$additional_classes .=
|
620 |
-
}
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
$
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
$slide_image_src =
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
$
|
656 |
-
$
|
657 |
-
$
|
658 |
-
$
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
$slide_style .=
|
663 |
-
$slide_style .=
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
$
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
$
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
$
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
$style =
|
738 |
-
}
|
739 |
-
// icons location -
|
740 |
-
$
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
$output .= "<div class='sa_hover_buttons
|
762 |
-
}
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
$
|
789 |
-
}
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
$
|
800 |
-
|
801 |
-
$
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
$
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
$
|
840 |
-
|
841 |
-
$
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
//
|
867 |
-
if (
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
if (
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
$output .= " animateOut : '
|
915 |
-
|
916 |
-
|
917 |
-
$output .= "
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
$output .= "
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
$output .= "
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
$output .= "
|
957 |
-
} else {
|
958 |
-
$output .=
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
$
|
967 |
-
|
968 |
-
$output .= "
|
969 |
-
}
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
if ($slide_data['
|
979 |
-
$output .=
|
980 |
-
}
|
981 |
-
|
982 |
-
|
983 |
-
$output .= "
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
if (
|
990 |
-
$
|
991 |
-
$
|
992 |
-
|
993 |
-
|
994 |
-
$
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
$
|
1016 |
-
|
1017 |
-
|
1018 |
-
$output .= "
|
1019 |
-
|
1020 |
-
|
1021 |
-
$output .= "
|
1022 |
-
|
1023 |
-
$output .= "
|
1024 |
-
|
1025 |
-
$output .=
|
1026 |
-
$output .= "
|
1027 |
-
|
1028 |
-
$output .=
|
1029 |
-
$output .= "
|
1030 |
-
$output .= " }
|
1031 |
-
|
1032 |
-
$output .= "
|
1033 |
-
$output .= "
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
$output .= "
|
1100 |
-
$output .= "
|
1101 |
-
$output .= "
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
$output .= "
|
1116 |
-
$output .= "
|
1117 |
-
$output .= "
|
1118 |
-
}
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
//
|
1126 |
-
if ($
|
1127 |
-
|
1128 |
-
$output .= "
|
1129 |
-
$output .= "
|
1130 |
-
|
1131 |
-
$output .= "
|
1132 |
-
$output .= "
|
1133 |
-
$output .= "
|
1134 |
-
$output .= "
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
$output .= "
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
$output .= "
|
1162 |
-
|
1163 |
-
$output .= "
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
$output .= " gallery: { enabled: true, tCounter: '' },\n";
|
1243 |
-
$output .= " mainClass: 'sa_popup',\n";
|
1244 |
-
$output .= " closeBtnInside: true,\n";
|
1245 |
-
$output .= " fixedContentPos: true,\n";
|
1246 |
-
if ($slide_data['slide_duration'] != 0) {
|
1247 |
-
$output .= " callbacks: {\n";
|
1248 |
-
$output .= " open: function() {\n";
|
1249 |
-
$output .= " jQuery('#".esc_attr($slide_data['css_id'])."').trigger('stop.owl.autoplay');\n";
|
1250 |
-
$output .= " },\n";
|
1251 |
-
$output .= " close: function() {\n";
|
1252 |
-
$output .= " jQuery('#".esc_attr($slide_data['css_id'])."').trigger('play.owl.autoplay');\n";
|
1253 |
-
$output .= " }\n";
|
1254 |
-
$output .= " },\n";
|
1255 |
-
}
|
1256 |
-
$output .= " type: 'image'\n";
|
1257 |
-
$output .= " });\n";
|
1258 |
-
$output .= "});\n";
|
1259 |
-
|
1260 |
-
// JAVASCRIPT FUNCTION WHICH OPENS THIS MAGNIFIC POPUP ON A SPECIFIED SLIDE
|
1261 |
-
$output .= "function ".$lightbox_function."(slide) {\n";
|
1262 |
-
$output .= " jQuery('#".$lightbox_gallery_id."').magnificPopup('open');\n";
|
1263 |
-
$output .= " jQuery('#".$lightbox_gallery_id."').magnificPopup('goTo', slide-1);\n";
|
1264 |
-
$output .= "}\n";
|
1265 |
-
$output .= "</script>\n";
|
1266 |
-
|
1267 |
-
// DIV CONTAINER WHICH HOLDS THIS MAGNIFIC POPUP CONTENT (HIDDEN)
|
1268 |
-
$output .= "<div id='".$lightbox_gallery_id."' style='display:none;'></div>\n";
|
1269 |
-
}
|
1270 |
-
}
|
1271 |
-
}
|
1272 |
-
return $output;
|
1273 |
-
}
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
// ### STRIP JAVASCRIPT ('<script>' tags) FROM SUPPLIED STRING ARGUMENT ###
|
1278 |
-
function remove_javascript_from_content($slide_content) {
|
1279 |
-
if ($slide_content != '') {
|
1280 |
-
$dom = new DOMDocument();
|
1281 |
-
$dom->loadHTML($slide_content);
|
1282 |
-
//$dom->loadHTML($slide_content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
1283 |
-
$script = $dom->getElementsByTagName('script');
|
1284 |
-
$remove = array();
|
1285 |
-
foreach($script as $item) {
|
1286 |
-
$item->parentNode->removeChild($item);
|
1287 |
-
}
|
1288 |
-
//$slide_content = $dom->saveHTML();
|
1289 |
-
$slide_content = preg_replace('~<(?:!DOCTYPE|/?(?:html|body))[^>]*>\s*~i', '', $dom->saveHTML());
|
1290 |
-
}
|
1291 |
-
return $slide_content;
|
1292 |
-
}
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
// ### MODIFY IMAGES (<img> tag) WITHIN STRING PASSED (SLIDE CONTENT) TO ENABLE OWL CAROUSEL LAZY LOAD ###
|
1297 |
-
function set_slide_images_to_lazy_load($slide_content) {
|
1298 |
-
if (trim($slide_content) != '') {
|
1299 |
-
// 1) REPLACE 'src=' WITH 'data-src=' WITHIN <IMG> TAGS
|
1300 |
-
$slide_content = preg_replace('~<img[^>]*\K(?=src)~i','data-', $slide_content);
|
1301 |
-
|
1302 |
-
// 2) FOR EACH <IMG> TAG WITHIN THE SLIDE CONTENT, ADD THE 'owl-lazy' CLASS
|
1303 |
-
$dom = new DOMDocument();
|
1304 |
-
$dom->loadHTML(mb_convert_encoding($slide_content, 'HTML-ENTITIES', 'UTF-8'));
|
1305 |
-
//$dom->loadHTML(mb_convert_encoding($slide_content, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
1306 |
-
$imgs = $dom->getElementsByTagName('img');
|
1307 |
-
foreach ($imgs as $img) {
|
1308 |
-
$curr_class = $img->getAttribute('class');
|
1309 |
-
if ($curr_class != '') {
|
1310 |
-
$img->setAttribute('class', $curr_class.' owl-lazy');
|
1311 |
-
} else {
|
1312 |
-
$img->setAttribute('class', 'owl-lazy');
|
1313 |
-
}
|
1314 |
-
}
|
1315 |
-
|
1316 |
-
//$slide_content = $dom->saveHTML();
|
1317 |
-
$slide_content = preg_replace('~<(?:!DOCTYPE|/?(?:html|body))[^>]*>\s*~i', '', $dom->saveHTML());
|
1318 |
-
}
|
1319 |
-
|
1320 |
-
return $slide_content;
|
1321 |
-
}
|
1322 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* #####################################################################
|
4 |
+
* ### SLIDE ANYTHING PLUGIN - PHP FUNCTIONS FOR WordPress FRONT-END ###
|
5 |
+
* #####################################################################
|
6 |
+
*
|
7 |
+
* @package WordPress_Slide_Anything
|
8 |
+
* @author Simon Edge
|
9 |
+
* @copyright EdgeWebPages
|
10 |
+
* @license GPLv2 or later
|
11 |
+
*/
|
12 |
+
|
13 |
+
add_shortcode( 'slide-anything', 'slide_anything_shortcode' );
|
14 |
+
|
15 |
+
/**
|
16 |
+
* ##### ROOT FUNCTION THAT IS CALLED TO BY THE 'slide-anything' SHORTCODE #####
|
17 |
+
*
|
18 |
+
* @param array $atts Shortcode attributes.
|
19 |
+
*/
|
20 |
+
function slide_anything_shortcode( $atts ) {
|
21 |
+
$sa_pro_version = esc_attr( get_option( 'sap_valid_license' ) );
|
22 |
+
wp_enqueue_script( 'jquery' );
|
23 |
+
wp_register_script( 'owl_carousel_js', SA_PLUGIN_PATH . 'owl-carousel/owl.carousel.min.js', array( 'jquery' ), '2.2.1', true );
|
24 |
+
wp_enqueue_script( 'owl_carousel_js' );
|
25 |
+
wp_register_style( 'owl_carousel_css', SA_PLUGIN_PATH . 'owl-carousel/owl.carousel.css', array(), '2.2.1.1', 'all' );
|
26 |
+
wp_enqueue_style( 'owl_carousel_css' );
|
27 |
+
wp_register_style( 'owl_theme_css', SA_PLUGIN_PATH . 'owl-carousel/sa-owl-theme.css', array(), '2.0', 'all' );
|
28 |
+
wp_enqueue_style( 'owl_theme_css' );
|
29 |
+
wp_register_style( 'owl_animate_css', SA_PLUGIN_PATH . 'owl-carousel/animate.min.css', array(), '2.0', 'all' );
|
30 |
+
wp_enqueue_style( 'owl_animate_css' );
|
31 |
+
wp_register_script( 'mousewheel_js', SA_PLUGIN_PATH . 'js/jquery.mousewheel.min.js', array( 'jquery' ), '3.1.13', true );
|
32 |
+
wp_enqueue_script( 'mousewheel_js' );
|
33 |
+
if ( $sa_pro_version ) {
|
34 |
+
// JAVASCRIPT/CSS FOR MAGNIFIC POPUP.
|
35 |
+
wp_register_script( 'magnific-popup_js', SA_PLUGIN_PATH . 'magnific-popup/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );
|
36 |
+
wp_enqueue_script( 'magnific-popup_js' );
|
37 |
+
wp_register_style( 'magnific-popup_css', SA_PLUGIN_PATH . 'magnific-popup/magnific-popup.css', array(), '1.1.0', 'all' );
|
38 |
+
wp_enqueue_style( 'magnific-popup_css' );
|
39 |
+
wp_register_script( 'owl_thumbs_js', SA_PLUGIN_PATH . 'owl-carousel/owl.carousel2.thumbs.min.js', array( 'jquery' ), '0.1.8', true );
|
40 |
+
wp_enqueue_script( 'owl_thumbs_js' );
|
41 |
+
}
|
42 |
+
|
43 |
+
// EXTRACT SHORTCODE ATTRIBUTES.
|
44 |
+
$args = shortcode_atts( array( 'id' => '0' ), $atts );
|
45 |
+
$id = (int) $args['id'];
|
46 |
+
$output = '';
|
47 |
+
if ( 0 === $id ) {
|
48 |
+
// SHORTCODE 'id' PARAMETER PROVIDED IS INVALID.
|
49 |
+
$output .= "<div id='sa_invalid_postid'>Slide Anything shortcode error: A valid ID has not been provided</div>\n";
|
50 |
+
} else {
|
51 |
+
$post_status = get_post_status( $id );
|
52 |
+
if ( 'publish' === $post_status ) {
|
53 |
+
$metadata = get_metadata( 'post', $id );
|
54 |
+
$post_type = get_post_type( $id );
|
55 |
+
}
|
56 |
+
if ( ( 'publish' !== $post_status ) || ( 0 === count( $metadata ) ) || ( 'sa_slider' !== $post_type ) ) {
|
57 |
+
// SHORTCODE 'id' PARAMETER PROVIDED IS INVALID.
|
58 |
+
$output .= "<div id='sa_invalid_postid'>Slide Anything shortcode error: A valid ID has not been provided</div>\n";
|
59 |
+
} else {
|
60 |
+
// VALID 'id' PROVIDED - PROCESS SHORTCODE.
|
61 |
+
// GET SLIDE DATA FROM DATABASE AND SAVE IN ARRAY.
|
62 |
+
$slide_data = array();
|
63 |
+
$slide_data['num_slides'] = $metadata['sa_num_slides'][0];
|
64 |
+
$slide_data['shortcodes'] = $metadata['sa_shortcodes'][0];
|
65 |
+
if ( '1' === $slide_data['shortcodes'] ) {
|
66 |
+
$slide_data['shortcodes'] = 'true';
|
67 |
+
} else {
|
68 |
+
$slide_data['shortcodes'] = 'false';
|
69 |
+
}
|
70 |
+
$slide_data['css_id'] = $metadata['sa_css_id'][0];
|
71 |
+
for ( $i = 1; $i <= $slide_data['num_slides']; $i++ ) {
|
72 |
+
$slide_data[ 'slide' . $i . '_num' ] = $i;
|
73 |
+
// apply 'the_content' filter to slide content to process any shortcodes.
|
74 |
+
if ( 'true' === $slide_data['shortcodes'] ) {
|
75 |
+
$slide_data[ 'slide' . $i . '_content' ] = do_shortcode( $metadata[ 'sa_slide' . $i . '_content' ][0] );
|
76 |
+
} else {
|
77 |
+
$slide_data[ 'slide' . $i . '_content' ] = $metadata[ 'sa_slide' . $i . '_content' ][0];
|
78 |
+
}
|
79 |
+
$slide_image_data = '';
|
80 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_image_data' ] ) ) {
|
81 |
+
$slide_image_data = $metadata[ 'sa_slide' . $i . '_image_data' ][0];
|
82 |
+
}
|
83 |
+
if ( isset( $slide_image_data ) && ( '' !== $slide_image_data ) ) {
|
84 |
+
$data_arr = explode( '~', $slide_image_data );
|
85 |
+
$slide_data[ 'slide' . $i . '_image_id' ] = $data_arr[0];
|
86 |
+
$slide_data[ 'slide' . $i . '_image_pos' ] = $data_arr[1];
|
87 |
+
$slide_data[ 'slide' . $i . '_image_size' ] = $data_arr[2];
|
88 |
+
$slide_data[ 'slide' . $i . '_image_repeat' ] = $data_arr[3];
|
89 |
+
$slide_data[ 'slide' . $i . '_image_color' ] = $data_arr[4];
|
90 |
+
} else {
|
91 |
+
$slide_data[ 'slide' . $i . '_image_id' ] = $metadata[ 'sa_slide' . $i . '_image_id' ][0];
|
92 |
+
$slide_data[ 'slide' . $i . '_image_pos' ] = $metadata[ 'sa_slide' . $i . '_image_pos' ][0];
|
93 |
+
$slide_data[ 'slide' . $i . '_image_size' ] = $metadata[ 'sa_slide' . $i . '_image_size' ][0];
|
94 |
+
$slide_data[ 'slide' . $i . '_image_repeat' ] = $metadata[ 'sa_slide' . $i . '_image_repeat' ][0];
|
95 |
+
$slide_data[ 'slide' . $i . '_image_color' ] = $metadata[ 'sa_slide' . $i . '_image_color' ][0];
|
96 |
+
}
|
97 |
+
$slide_data[ 'slide' . $i . '_link_url' ] = $metadata[ 'sa_slide' . $i . '_link_url' ][0];
|
98 |
+
$slide_data[ 'slide' . $i . '_link_target' ] = $metadata[ 'sa_slide' . $i . '_link_target' ][0];
|
99 |
+
if ( '' === $slide_data[ 'slide' . $i . '_link_target' ] ) {
|
100 |
+
$slide_data[ 'slide' . $i . '_link_target' ] = '_self';
|
101 |
+
}
|
102 |
+
if ( $sa_pro_version ) {
|
103 |
+
// ### PRO VERSION - GET POPUP DATA ###
|
104 |
+
$slide_data[ 'slide' . $i . '_popup_type' ] = 'NONE';
|
105 |
+
$slide_data[ 'slide' . $i . '_popup_imageid' ] = '';
|
106 |
+
$slide_data[ 'slide' . $i . '_popup_imagetitle' ] = '';
|
107 |
+
$slide_data[ 'slide' . $i . '_popup_video_id' ] = '';
|
108 |
+
$slide_data[ 'slide' . $i . '_popup_video_type' ] = '';
|
109 |
+
$slide_data[ 'slide' . $i . '_popup_html' ] = '';
|
110 |
+
$slide_data[ 'slide' . $i . '_popup_shortcode' ] = '';
|
111 |
+
$slide_data[ 'slide' . $i . '_popup_bgcol' ] = '#ffffff';
|
112 |
+
$slide_data[ 'slide' . $i . '_popup_width' ] = '600';
|
113 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_type' ] ) ) {
|
114 |
+
$slide_data[ 'slide' . $i . '_popup_type' ] = $metadata[ 'sa_slide' . $i . '_popup_type' ][0];
|
115 |
+
}
|
116 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_imageid' ] ) ) {
|
117 |
+
$slide_data[ 'slide' . $i . '_popup_imageid' ] = $metadata[ 'sa_slide' . $i . '_popup_imageid' ][0];
|
118 |
+
}
|
119 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_imagetitle' ] ) ) {
|
120 |
+
$slide_data[ 'slide' . $i . '_popup_imagetitle' ] = $metadata[ 'sa_slide' . $i . '_popup_imagetitle' ][0];
|
121 |
+
}
|
122 |
+
$slide_data[ 'slide' . $i . '_popup_image' ] = '';
|
123 |
+
$slide_data[ 'slide' . $i . '_popup_background' ] = 'no';
|
124 |
+
if ( 'IMAGE' === $slide_data[ 'slide' . $i . '_popup_type' ] ) {
|
125 |
+
if ( ( '' !== $slide_data[ 'slide' . $i . '_popup_imageid' ] ) && ( 0 !== $slide_data[ 'slide' . $i . '_popup_imageid' ] ) ) {
|
126 |
+
$popup_full_images = wp_get_attachment_image_src( $slide_data[ 'slide' . $i . '_popup_imageid' ], 'full' );
|
127 |
+
$slide_data[ 'slide' . $i . '_popup_image' ] = $popup_full_images[0];
|
128 |
+
$slide_data[ 'slide' . $i . '_popup_background' ] = $metadata[ 'sa_slide' . $i . '_popup_background' ][0];
|
129 |
+
if ( '' === $slide_data[ 'slide' . $i . '_popup_background' ] ) {
|
130 |
+
$slide_data[ 'slide' . $i . '_popup_background' ] = 'no';
|
131 |
+
}
|
132 |
+
}
|
133 |
+
}
|
134 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_video_id' ] ) ) {
|
135 |
+
$slide_data[ 'slide' . $i . '_popup_video_id' ] = $metadata[ 'sa_slide' . $i . '_popup_video_id' ][0];
|
136 |
+
}
|
137 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_video_type' ] ) ) {
|
138 |
+
$slide_data[ 'slide' . $i . '_popup_video_type' ] = $metadata[ 'sa_slide' . $i . '_popup_video_type' ][0];
|
139 |
+
}
|
140 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_html' ] ) ) {
|
141 |
+
$slide_data[ 'slide' . $i . '_popup_html' ] = $metadata[ 'sa_slide' . $i . '_popup_html' ][0];
|
142 |
+
}
|
143 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_shortcode' ] ) ) {
|
144 |
+
$slide_data[ 'slide' . $i . '_popup_shortcode' ] = $metadata[ 'sa_slide' . $i . '_popup_shortcode' ][0];
|
145 |
+
}
|
146 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_bgcol' ] ) ) {
|
147 |
+
$slide_data[ 'slide' . $i . '_popup_bgcol' ] = $metadata[ 'sa_slide' . $i . '_popup_bgcol' ][0];
|
148 |
+
}
|
149 |
+
if ( isset( $metadata[ 'sa_slide' . $i . '_popup_width' ] ) ) {
|
150 |
+
$slide_data[ 'slide' . $i . '_popup_width' ] = $metadata[ 'sa_slide' . $i . '_popup_width' ][0];
|
151 |
+
}
|
152 |
+
if ( 'HTML' === $slide_data[ 'slide' . $i . '_popup_type' ] ) {
|
153 |
+
$slide_data[ 'slide' . $i . '_popup_css_id' ] = $slide_data['css_id'] . '_popup' . $i;
|
154 |
+
} else {
|
155 |
+
$slide_data[ 'slide' . $i . '_popup_css_id' ] = '';
|
156 |
+
}
|
157 |
+
}
|
158 |
+
}
|
159 |
+
$slide_data['slide_duration'] = floatval( $metadata['sa_slide_duration'][0] ) * 1000;
|
160 |
+
$slide_data['slide_transition'] = floatval( $metadata['sa_slide_transition'][0] ) * 1000;
|
161 |
+
if ( isset( $metadata['sa_slide_by'][0] ) && ( '' !== $metadata['sa_slide_by'][0] ) ) {
|
162 |
+
$slide_data['slide_by'] = $metadata['sa_slide_by'][0];
|
163 |
+
if ( '0' === $slide_data['slide_by'] ) {
|
164 |
+
$slide_data['slide_by'] = 'page';
|
165 |
+
}
|
166 |
+
} else {
|
167 |
+
$slide_data['slide_by'] = 1;
|
168 |
+
}
|
169 |
+
$slide_data['loop_slider'] = $metadata['sa_loop_slider'][0];
|
170 |
+
if ( '1' === $slide_data['loop_slider'] ) {
|
171 |
+
$slide_data['loop_slider'] = 'true';
|
172 |
+
} else {
|
173 |
+
$slide_data['loop_slider'] = 'false';
|
174 |
+
}
|
175 |
+
$slide_data['stop_hover'] = $metadata['sa_stop_hover'][0];
|
176 |
+
if ( '1' === $slide_data['stop_hover'] ) {
|
177 |
+
$slide_data['stop_hover'] = 'true';
|
178 |
+
} else {
|
179 |
+
$slide_data['stop_hover'] = 'false';
|
180 |
+
}
|
181 |
+
$slide_data['random_order'] = $metadata['sa_random_order'][0];
|
182 |
+
if ( '1' === $slide_data['random_order'] ) {
|
183 |
+
$slide_data['random_order'] = 'true';
|
184 |
+
} else {
|
185 |
+
$slide_data['random_order'] = 'false';
|
186 |
+
}
|
187 |
+
$slide_data['reverse_order'] = $metadata['sa_reverse_order'][0];
|
188 |
+
if ( '1' === $slide_data['reverse_order'] ) {
|
189 |
+
$slide_data['reverse_order'] = 'true';
|
190 |
+
} else {
|
191 |
+
$slide_data['reverse_order'] = 'false';
|
192 |
+
}
|
193 |
+
$slide_data['nav_arrows'] = $metadata['sa_nav_arrows'][0];
|
194 |
+
if ( '1' === $slide_data['nav_arrows'] ) {
|
195 |
+
$slide_data['nav_arrows'] = 'true';
|
196 |
+
} else {
|
197 |
+
$slide_data['nav_arrows'] = 'false';
|
198 |
+
}
|
199 |
+
$slide_data['pagination'] = $metadata['sa_pagination'][0];
|
200 |
+
if ( '1' === $slide_data['pagination'] ) {
|
201 |
+
$slide_data['pagination'] = 'true';
|
202 |
+
} else {
|
203 |
+
$slide_data['pagination'] = 'false';
|
204 |
+
}
|
205 |
+
$slide_data['mouse_drag'] = $metadata['sa_mouse_drag'][0];
|
206 |
+
if ( '1' === $slide_data['mouse_drag'] ) {
|
207 |
+
$slide_data['mouse_drag'] = 'true';
|
208 |
+
} else {
|
209 |
+
$slide_data['mouse_drag'] = 'false';
|
210 |
+
}
|
211 |
+
$slide_data['touch_drag'] = $metadata['sa_touch_drag'][0];
|
212 |
+
if ( '1' === $slide_data['touch_drag'] ) {
|
213 |
+
$slide_data['touch_drag'] = 'true';
|
214 |
+
} else {
|
215 |
+
$slide_data['touch_drag'] = 'false';
|
216 |
+
}
|
217 |
+
if ( isset( $metadata['sa_mousewheel'] ) ) {
|
218 |
+
$slide_data['mousewheel'] = $metadata['sa_mousewheel'][0];
|
219 |
+
if ( '1' === $slide_data['mousewheel'] ) {
|
220 |
+
$slide_data['mousewheel'] = 'true';
|
221 |
+
} else {
|
222 |
+
$slide_data['mousewheel'] = 'false';
|
223 |
+
}
|
224 |
+
} else {
|
225 |
+
$slide_data['mousewheel'] = 'false';
|
226 |
+
}
|
227 |
+
if ( isset( $metadata['sa_click_advance'] ) ) {
|
228 |
+
$slide_data['click_advance'] = $metadata['sa_click_advance'][0];
|
229 |
+
if ( '1' === $slide_data['click_advance'] ) {
|
230 |
+
$slide_data['click_advance'] = 'true';
|
231 |
+
} else {
|
232 |
+
$slide_data['click_advance'] = 'false';
|
233 |
+
}
|
234 |
+
} else {
|
235 |
+
$slide_data['click_advance'] = 'false';
|
236 |
+
}
|
237 |
+
if ( isset( $metadata['sa_auto_height'] ) ) {
|
238 |
+
$slide_data['auto_height'] = $metadata['sa_auto_height'][0];
|
239 |
+
if ( '1' === $slide_data['auto_height'] ) {
|
240 |
+
$slide_data['auto_height'] = 'true';
|
241 |
+
} else {
|
242 |
+
$slide_data['auto_height'] = 'false';
|
243 |
+
}
|
244 |
+
} else {
|
245 |
+
$slide_data['auto_height'] = 'false';
|
246 |
+
}
|
247 |
+
if ( ( '0' === $metadata['sa_slide_min_height_perc'][0] ) || ( '0px' === $metadata['sa_slide_min_height_perc'][0] ) ) {
|
248 |
+
$slide_data['vert_center'] = 'false';
|
249 |
+
} else {
|
250 |
+
if ( isset( $metadata['sa_vert_center'] ) ) {
|
251 |
+
$slide_data['vert_center'] = $metadata['sa_vert_center'][0];
|
252 |
+
if ( '1' === $slide_data['vert_center'] ) {
|
253 |
+
$slide_data['vert_center'] = 'true';
|
254 |
+
} else {
|
255 |
+
$slide_data['vert_center'] = 'false';
|
256 |
+
}
|
257 |
+
} else {
|
258 |
+
$slide_data['vert_center'] = 'false';
|
259 |
+
}
|
260 |
+
}
|
261 |
+
$slide_data['items_width1'] = $metadata['sa_items_width1'][0];
|
262 |
+
$slide_data['items_width2'] = $metadata['sa_items_width2'][0];
|
263 |
+
$slide_data['items_width3'] = $metadata['sa_items_width3'][0];
|
264 |
+
$slide_data['items_width4'] = $metadata['sa_items_width4'][0];
|
265 |
+
$slide_data['items_width5'] = $metadata['sa_items_width5'][0];
|
266 |
+
$slide_data['items_width6'] = $metadata['sa_items_width6'][0];
|
267 |
+
if ( '' === $slide_data['items_width6'] ) {
|
268 |
+
$slide_data['items_width6'] = $slide_data['items_width5'];
|
269 |
+
}
|
270 |
+
$slide_data['transition'] = $metadata['sa_transition'][0];
|
271 |
+
$slide_data['background_color'] = $metadata['sa_background_color'][0];
|
272 |
+
$slide_data['border_width'] = $metadata['sa_border_width'][0];
|
273 |
+
$slide_data['border_color'] = $metadata['sa_border_color'][0];
|
274 |
+
$slide_data['border_radius'] = $metadata['sa_border_radius'][0];
|
275 |
+
$slide_data['wrapper_padd_top'] = $metadata['sa_wrapper_padd_top'][0];
|
276 |
+
$slide_data['wrapper_padd_right'] = $metadata['sa_wrapper_padd_right'][0];
|
277 |
+
$slide_data['wrapper_padd_bottom'] = $metadata['sa_wrapper_padd_bottom'][0];
|
278 |
+
$slide_data['wrapper_padd_left'] = $metadata['sa_wrapper_padd_left'][0];
|
279 |
+
$slide_data['slide_min_height_perc'] = $metadata['sa_slide_min_height_perc'][0];
|
280 |
+
$slide_data['slide_padding_tb'] = $metadata['sa_slide_padding_tb'][0];
|
281 |
+
$slide_data['slide_padding_lr'] = $metadata['sa_slide_padding_lr'][0];
|
282 |
+
$slide_data['slide_margin_lr'] = $metadata['sa_slide_margin_lr'][0];
|
283 |
+
$slide_data['slide_icons_location'] = $metadata['sa_slide_icons_location'][0];
|
284 |
+
$slide_data['autohide_arrows'] = $metadata['sa_autohide_arrows'][0];
|
285 |
+
if ( '1' === $slide_data['autohide_arrows'] ) {
|
286 |
+
$slide_data['autohide_arrows'] = 'true';
|
287 |
+
} else {
|
288 |
+
$slide_data['autohide_arrows'] = 'false';
|
289 |
+
}
|
290 |
+
$slide_data['dot_per_slide'] = '0';
|
291 |
+
if ( isset( $metadata['sa_dot_per_slide'] ) ) {
|
292 |
+
$slide_data['dot_per_slide'] = $metadata['sa_dot_per_slide'][0];
|
293 |
+
if ( '1' !== $slide_data['dot_per_slide'] ) {
|
294 |
+
$slide_data['dot_per_slide'] = '0';
|
295 |
+
}
|
296 |
+
} else {
|
297 |
+
$slide_data['dot_per_slide'] = '0';
|
298 |
+
}
|
299 |
+
$slide_data['slide_icons_visible'] = $metadata['sa_slide_icons_visible'][0];
|
300 |
+
if ( '1' === $slide_data['slide_icons_visible'] ) {
|
301 |
+
$slide_data['slide_icons_visible'] = 'true';
|
302 |
+
} else {
|
303 |
+
$slide_data['slide_icons_visible'] = 'false';
|
304 |
+
}
|
305 |
+
$slide_data['slide_icons_color'] = $metadata['sa_slide_icons_color'][0];
|
306 |
+
if ( 'black' !== $slide_data['slide_icons_color'] ) {
|
307 |
+
$slide_data['slide_icons_color'] = 'white';
|
308 |
+
}
|
309 |
+
if ( isset( $metadata['sa_slide_icons_fullslide'][0] ) &&
|
310 |
+
( 1 === $metadata['sa_slide_icons_fullslide'][0] ) ) {
|
311 |
+
$slide_data['slide_icons_fullslide'] = '1';
|
312 |
+
} else {
|
313 |
+
$slide_data['slide_icons_fullslide'] = '0';
|
314 |
+
}
|
315 |
+
// FETCH OTHER SETTINGS POST META.
|
316 |
+
$other_settings = '';
|
317 |
+
if ( isset( $metadata['sa_other_settings'] ) ) {
|
318 |
+
$other_settings = $metadata['sa_other_settings'][0];
|
319 |
+
if ( isset( $other_settings ) && ( '' !== $other_settings ) ) {
|
320 |
+
$other_settings_arr = explode( '|', $other_settings );
|
321 |
+
}
|
322 |
+
}
|
323 |
+
// setting 1 - sa_window_onload.
|
324 |
+
$slide_data['sa_window_onload'] = '0';
|
325 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[0] ) ) {
|
326 |
+
$slide_data['sa_window_onload'] = $other_settings_arr[0];
|
327 |
+
} else {
|
328 |
+
if ( isset( $metadata['sa_window_onload'] ) ) {
|
329 |
+
$slide_data['sa_window_onload'] = $metadata['sa_window_onload'][0];
|
330 |
+
if ( '1' !== $slide_data['sa_window_onload'] ) {
|
331 |
+
$slide_data['sa_window_onload'] = '0';
|
332 |
+
}
|
333 |
+
}
|
334 |
+
}
|
335 |
+
// setting 2 - sa_strip_javascript.
|
336 |
+
$slide_data['strip_javascript'] = '0';
|
337 |
+
// setting 3 - sa_lazy_load_images.
|
338 |
+
$slide_data['lazy_load_images'] = '0';
|
339 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[2] ) ) {
|
340 |
+
$slide_data['lazy_load_images'] = $other_settings_arr[2];
|
341 |
+
} else {
|
342 |
+
if ( isset( $metadata['sa_lazy_load_images'] ) ) {
|
343 |
+
$slide_data['lazy_load_images'] = $metadata['sa_lazy_load_images'][0];
|
344 |
+
if ( '1' !== $slide_data['lazy_load_images'] ) {
|
345 |
+
$slide_data['lazy_load_images'] = '0';
|
346 |
+
}
|
347 |
+
}
|
348 |
+
}
|
349 |
+
// setting 4 - sa_ulli_containers.
|
350 |
+
$slide_data['ulli_containers'] = '0';
|
351 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[3] ) ) {
|
352 |
+
$slide_data['ulli_containers'] = $other_settings_arr[3];
|
353 |
+
} else {
|
354 |
+
if ( isset( $metadata['sa_ulli_containers'] ) ) {
|
355 |
+
$slide_data['ulli_containers'] = $metadata['sa_ulli_containers'][0];
|
356 |
+
if ( '1' !== $slide_data['ulli_containers'] ) {
|
357 |
+
$slide_data['ulli_containers'] = '0';
|
358 |
+
}
|
359 |
+
}
|
360 |
+
}
|
361 |
+
// setting 5 - sa_rtl_slider.
|
362 |
+
$slide_data['rtl_slider'] = '0';
|
363 |
+
if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[4] ) ) {
|
364 |
+
$slide_data['rtl_slider'] = $other_settings_arr[4];
|
365 |
+
}
|
366 |
+
// setting 7 - bg_image_size.
|
367 |
+
$slide_data['bg_image_size'] = 'full';
|
368 |
+
if ( isset( $other_settings_arr ) && ( count( $other_settings_arr ) > 6 ) ) {
|
369 |
+
if ( '' !== $other_settings_arr[6] ) {
|
370 |
+
$slide_data['bg_image_size'] = $other_settings_arr[6];
|
371 |
+
}
|
372 |
+
}
|
373 |
+
// setting 8 - disable_slide_ids.
|
374 |
+
$slide_data['disable_slide_ids'] = '0';
|
375 |
+
if ( isset( $other_settings_arr ) && ( count( $other_settings_arr ) > 7 ) ) {
|
376 |
+
if ( '' !== $other_settings_arr[7] ) {
|
377 |
+
$slide_data['disable_slide_ids'] = $other_settings_arr[7];
|
378 |
+
}
|
379 |
+
}
|
380 |
+
// Start Position.
|
381 |
+
$slide_data['start_pos'] = 0;
|
382 |
+
if ( isset( $metadata['sa_start_pos'] ) ) {
|
383 |
+
$slide_data['start_pos'] = $metadata['sa_start_pos'][0];
|
384 |
+
if ( '' !== $slide_data['start_pos'] ) {
|
385 |
+
$slide_data['start_pos'] = abs( intval( $slide_data['start_pos'] ) );
|
386 |
+
if ( $slide_data['start_pos'] > 0 ) {
|
387 |
+
$slide_data['start_pos'] = $slide_data['start_pos'] - 1;
|
388 |
+
}
|
389 |
+
}
|
390 |
+
}
|
391 |
+
|
392 |
+
// hero slider and slider thumbnails.
|
393 |
+
$slide_data['hero_slider'] = '0';
|
394 |
+
$slide_data['thumbs_active'] = '0';
|
395 |
+
if ( $sa_pro_version ) {
|
396 |
+
if ( isset( $metadata['sa_hero_slider'] ) ) {
|
397 |
+
$slide_data['hero_slider'] = $metadata['sa_hero_slider'][0];
|
398 |
+
if ( '1' !== $slide_data['hero_slider'] ) {
|
399 |
+
$slide_data['hero_slider'] = '0';
|
400 |
+
}
|
401 |
+
} else {
|
402 |
+
$slide_data['hero_slider'] = '0';
|
403 |
+
}
|
404 |
+
if ( isset( $metadata['sa_thumbs_active'] ) ) {
|
405 |
+
$slide_data['thumbs_active'] = $metadata['sa_thumbs_active'][0];
|
406 |
+
if ( '1' !== $slide_data['thumbs_active'] ) {
|
407 |
+
$slide_data['thumbs_active'] = '0';
|
408 |
+
}
|
409 |
+
} else {
|
410 |
+
$slide_data['thumbs_active'] = '0';
|
411 |
+
}
|
412 |
+
if ( isset( $metadata['sa_thumbs_location'] ) ) {
|
413 |
+
$slide_data['thumbs_location'] = $metadata['sa_thumbs_location'][0];
|
414 |
+
} else {
|
415 |
+
$slide_data['thumbs_location'] = 'inside_bottom';
|
416 |
+
}
|
417 |
+
if ( isset( $metadata['sa_thumbs_image_size'] ) ) {
|
418 |
+
$slide_data['thumbs_image_size'] = $metadata['sa_thumbs_image_size'][0];
|
419 |
+
} else {
|
420 |
+
$slide_data['thumbs_image_size'] = 'thumbnail';
|
421 |
+
}
|
422 |
+
if ( isset( $metadata['sa_thumbs_padding'] ) ) {
|
423 |
+
$slide_data['thumbs_padding'] = $metadata['sa_thumbs_padding'][0];
|
424 |
+
} else {
|
425 |
+
$slide_data['thumbs_padding'] = '3';
|
426 |
+
}
|
427 |
+
if ( isset( $metadata['sa_thumbs_width'] ) ) {
|
428 |
+
$slide_data['thumbs_width'] = $metadata['sa_thumbs_width'][0];
|
429 |
+
} else {
|
430 |
+
$slide_data['thumbs_width'] = '150';
|
431 |
+
}
|
432 |
+
if ( isset( $metadata['sa_thumbs_height'] ) ) {
|
433 |
+
$slide_data['thumbs_height'] = $metadata['sa_thumbs_height'][0];
|
434 |
+
} else {
|
435 |
+
$slide_data['thumbs_height'] = '85';
|
436 |
+
}
|
437 |
+
if ( isset( $metadata['sa_thumbs_opacity'] ) ) {
|
438 |
+
$slide_data['thumbs_opacity'] = $metadata['sa_thumbs_opacity'][0];
|
439 |
+
} else {
|
440 |
+
$slide_data['thumbs_opacity'] = '50';
|
441 |
+
}
|
442 |
+
if ( isset( $metadata['sa_thumbs_border_width'] ) ) {
|
443 |
+
$slide_data['thumbs_border_width'] = $metadata['sa_thumbs_border_width'][0];
|
444 |
+
} else {
|
445 |
+
$slide_data['thumbs_border_width'] = '0';
|
446 |
+
}
|
447 |
+
if ( isset( $metadata['sa_thumbs_border_color'] ) ) {
|
448 |
+
$slide_data['thumbs_border_color'] = $metadata['sa_thumbs_border_color'][0];
|
449 |
+
} else {
|
450 |
+
$slide_data['thumbs_border_color'] = '#ffffff';
|
451 |
+
}
|
452 |
+
if ( isset( $metadata['sa_thumbs_resp_tablet'] ) ) {
|
453 |
+
$slide_data['thumbs_resp_tablet'] = $metadata['sa_thumbs_resp_tablet'][0];
|
454 |
+
} else {
|
455 |
+
$slide_data['thumbs_resp_tablet'] = '75';
|
456 |
+
}
|
457 |
+
if ( isset( $metadata['sa_thumbs_resp_mobile'] ) ) {
|
458 |
+
$slide_data['thumbs_resp_mobile'] = $metadata['sa_thumbs_resp_mobile'][0];
|
459 |
+
} else {
|
460 |
+
$slide_data['thumbs_resp_mobile'] = '50';
|
461 |
+
}
|
462 |
+
}
|
463 |
+
// showcase carousel.
|
464 |
+
$slide_data['showcase_slider'] = '0';
|
465 |
+
if ( $sa_pro_version ) {
|
466 |
+
if ( isset( $metadata['sa_showcase_slider'] ) ) {
|
467 |
+
$slide_data['showcase_slider'] = $metadata['sa_showcase_slider'][0];
|
468 |
+
if ( '1' !== $slide_data['showcase_slider'] ) {
|
469 |
+
$slide_data['showcase_slider'] = '0';
|
470 |
+
}
|
471 |
+
} else {
|
472 |
+
$slide_data['showcase_slider'] = '0';
|
473 |
+
}
|
474 |
+
if ( isset( $metadata['sa_showcase_width'] ) ) {
|
475 |
+
$slide_data['showcase_width'] = $metadata['sa_showcase_width'][0];
|
476 |
+
} else {
|
477 |
+
$slide_data['showcase_width'] = '120';
|
478 |
+
}
|
479 |
+
if ( isset( $metadata['sa_showcase_tablet'] ) ) {
|
480 |
+
$slide_data['showcase_tablet'] = $metadata['sa_showcase_tablet'][0];
|
481 |
+
if ( '1' !== $slide_data['showcase_tablet'] ) {
|
482 |
+
$slide_data['showcase_tablet'] = '0';
|
483 |
+
}
|
484 |
+
} else {
|
485 |
+
$slide_data['showcase_tablet'] = '0';
|
486 |
+
}
|
487 |
+
if ( isset( $metadata['sa_showcase_width_tab'] ) ) {
|
488 |
+
$slide_data['showcase_width_tab'] = $metadata['sa_showcase_width_tab'][0];
|
489 |
+
} else {
|
490 |
+
$slide_data['showcase_width_tab'] = '130';
|
491 |
+
}
|
492 |
+
if ( isset( $metadata['sa_showcase_mobile'] ) ) {
|
493 |
+
$slide_data['showcase_mobile'] = $metadata['sa_showcase_mobile'][0];
|
494 |
+
if ( '1' !== $slide_data['showcase_mobile'] ) {
|
495 |
+
$slide_data['showcase_mobile'] = '0';
|
496 |
+
}
|
497 |
+
} else {
|
498 |
+
$slide_data['showcase_mobile'] = '0';
|
499 |
+
}
|
500 |
+
if ( isset( $metadata['sa_showcase_width_mob'] ) ) {
|
501 |
+
$slide_data['showcase_width_mob'] = $metadata['sa_showcase_width_mob'][0];
|
502 |
+
} else {
|
503 |
+
$slide_data['showcase_width_mob'] = '140';
|
504 |
+
}
|
505 |
+
}
|
506 |
+
|
507 |
+
// REVERSE THE ORDER OF THE SLIDES IF 'Random Order' CHECKBOX IS CHECKED OR
|
508 |
+
// RE-ORDER SLIDES IN A RANDOM ORDER IF 'Random Order' CHECKBOX IS CHECKED.
|
509 |
+
if ( ( 'true' === $slide_data['reverse_order'] ) || ( 'true' === $slide_data['random_order'] ) ) {
|
510 |
+
$reorder_arr = array();
|
511 |
+
for ( $i = 1; $i <= $slide_data['num_slides']; $i++ ) {
|
512 |
+
$reorder_arr[ $i - 1 ]['num'] = $slide_data[ 'slide' . $i . '_num' ];
|
513 |
+
$reorder_arr[ $i - 1 ]['content'] = $slide_data[ 'slide' . $i . '_content' ];
|
514 |
+
$reorder_arr[ $i - 1 ]['image_id'] = $slide_data[ 'slide' . $i . '_image_id' ];
|
515 |
+
$reorder_arr[ $i - 1 ]['image_pos'] = $slide_data[ 'slide' . $i . '_image_pos' ];
|
516 |
+
$reorder_arr[ $i - 1 ]['image_size'] = $slide_data[ 'slide' . $i . '_image_size' ];
|
517 |
+
$reorder_arr[ $i - 1 ]['image_repeat'] = $slide_data[ 'slide' . $i . '_image_repeat' ];
|
518 |
+
$reorder_arr[ $i - 1 ]['image_color'] = $slide_data[ 'slide' . $i . '_image_color' ];
|
519 |
+
$reorder_arr[ $i - 1 ]['link_url'] = $slide_data[ 'slide' . $i . '_link_url' ];
|
520 |
+
$reorder_arr[ $i - 1 ]['link_target'] = $slide_data[ 'slide' . $i . '_link_target' ];
|
521 |
+
if ( $sa_pro_version ) {
|
522 |
+
$reorder_arr[ $i - 1 ]['popup_type'] = $slide_data[ 'slide' . $i . '_popup_type' ];
|
523 |
+
$reorder_arr[ $i - 1 ]['popup_imageid'] = $slide_data[ 'slide' . $i . '_popup_imageid' ];
|
524 |
+
$reorder_arr[ $i - 1 ]['popup_imagetitle'] = $slide_data[ 'slide' . $i . '_popup_imagetitle' ];
|
525 |
+
$reorder_arr[ $i - 1 ]['popup_image'] = $slide_data[ 'slide' . $i . '_popup_image' ];
|
526 |
+
$reorder_arr[ $i - 1 ]['popup_background'] = $slide_data[ 'slide' . $i . '_popup_background' ];
|
527 |
+
$reorder_arr[ $i - 1 ]['popup_video_id'] = $slide_data[ 'slide' . $i . '_popup_video_id' ];
|
528 |
+
$reorder_arr[ $i - 1 ]['popup_video_type'] = $slide_data[ 'slide' . $i . '_popup_video_type' ];
|
529 |
+
$reorder_arr[ $i - 1 ]['popup_html'] = $slide_data[ 'slide' . $i . '_popup_html' ];
|
530 |
+
$reorder_arr[ $i - 1 ]['popup_shortcode'] = $slide_data[ 'slide' . $i . '_popup_shortcode' ];
|
531 |
+
$reorder_arr[ $i - 1 ]['popup_bgcol'] = $slide_data[ 'slide' . $i . '_popup_bgcol' ];
|
532 |
+
$reorder_arr[ $i - 1 ]['popup_width'] = $slide_data[ 'slide' . $i . '_popup_width' ];
|
533 |
+
$reorder_arr[ $i - 1 ]['popup_css_id'] = $slide_data[ 'slide' . $i . '_popup_css_id' ];
|
534 |
+
}
|
535 |
+
}
|
536 |
+
if ( 'true' === $slide_data['random_order'] ) {
|
537 |
+
// SORT SLIDE ARRAY DATA IN A RANDOM ORDER.
|
538 |
+
shuffle( $reorder_arr );
|
539 |
+
} else {
|
540 |
+
// REVERSE THE ORDER OF THE SLIDE DATA ARRAY.
|
541 |
+
$reverse_arr = array_reverse( $reorder_arr );
|
542 |
+
$reorder_arr = $reverse_arr;
|
543 |
+
}
|
544 |
+
for ( $i = 1; $i <= $slide_data['num_slides']; $i++ ) {
|
545 |
+
$slide_data[ 'slide' . $i . '_num' ] = $reorder_arr[ $i - 1 ]['num'];
|
546 |
+
$slide_data[ 'slide' . $i . '_content' ] = $reorder_arr[ $i - 1 ]['content'];
|
547 |
+
$slide_data[ 'slide' . $i . '_image_id' ] = $reorder_arr[ $i - 1 ]['image_id'];
|
548 |
+
$slide_data[ 'slide' . $i . '_image_pos' ] = $reorder_arr[ $i - 1 ]['image_pos'];
|
549 |
+
$slide_data[ 'slide' . $i . '_image_size' ] = $reorder_arr[ $i - 1 ]['image_size'];
|
550 |
+
$slide_data[ 'slide' . $i . '_image_repeat' ] = $reorder_arr[ $i - 1 ]['image_repeat'];
|
551 |
+
$slide_data[ 'slide' . $i . '_image_color' ] = $reorder_arr[ $i - 1 ]['image_color'];
|
552 |
+
$slide_data[ 'slide' . $i . '_link_url' ] = $reorder_arr[ $i - 1 ]['link_url'];
|
553 |
+
$slide_data[ 'slide' . $i . '_link_target' ] = $reorder_arr[ $i - 1 ]['link_target'];
|
554 |
+
if ( $sa_pro_version ) {
|
555 |
+
$slide_data[ 'slide' . $i . '_popup_type' ] = $reorder_arr[ $i - 1 ]['popup_type'];
|
556 |
+
$slide_data[ 'slide' . $i . '_popup_imageid' ] = $reorder_arr[ $i - 1 ]['popup_imageid'];
|
557 |
+
$slide_data[ 'slide' . $i . '_popup_imagetitle' ] = $reorder_arr[ $i - 1 ]['popup_imagetitle'];
|
558 |
+
$slide_data[ 'slide' . $i . '_popup_image' ] = $reorder_arr[ $i - 1 ]['popup_image'];
|
559 |
+
$slide_data[ 'slide' . $i . '_popup_background' ] = $reorder_arr[ $i - 1 ]['popup_background'];
|
560 |
+
$slide_data[ 'slide' . $i . '_popup_video_id' ] = $reorder_arr[ $i - 1 ]['popup_video_id'];
|
561 |
+
$slide_data[ 'slide' . $i . '_popup_video_type' ] = $reorder_arr[ $i - 1 ]['popup_video_type'];
|
562 |
+
$slide_data[ 'slide' . $i . '_popup_html' ] = $reorder_arr[ $i - 1 ]['popup_html'];
|
563 |
+
$slide_data[ 'slide' . $i . '_popup_shortcode' ] = $reorder_arr[ $i - 1 ]['popup_shortcode'];
|
564 |
+
$slide_data[ 'slide' . $i . '_popup_bgcol' ] = $reorder_arr[ $i - 1 ]['popup_bgcol'];
|
565 |
+
$slide_data[ 'slide' . $i . '_popup_width' ] = $reorder_arr[ $i - 1 ]['popup_width'];
|
566 |
+
$slide_data[ 'slide' . $i . '_popup_css_id' ] = $reorder_arr[ $i - 1 ]['popup_css_id'];
|
567 |
+
}
|
568 |
+
}
|
569 |
+
}
|
570 |
+
|
571 |
+
// GENERATE HTML CODE FOR THE OWL CAROUSEL SLIDER.
|
572 |
+
$wrapper_style = 'background:' . $slide_data['background_color'] . '; ';
|
573 |
+
$wrapper_style .= 'border:solid ' . $slide_data['border_width'] . 'px ' . $slide_data['border_color'] . '; ';
|
574 |
+
$wrapper_style .= 'border-radius:' . $slide_data['border_radius'] . 'px; ';
|
575 |
+
$wrapper_style .= 'padding:' . $slide_data['wrapper_padd_top'] . 'px ';
|
576 |
+
$wrapper_style .= $slide_data['wrapper_padd_right'] . 'px ';
|
577 |
+
$wrapper_style .= $slide_data['wrapper_padd_bottom'] . 'px ';
|
578 |
+
$wrapper_style .= $slide_data['wrapper_padd_left'] . 'px;';
|
579 |
+
if ( '1' === $slide_data['showcase_slider'] ) {
|
580 |
+
$wrapper_style .= ' overflow:hidden;';
|
581 |
+
}
|
582 |
+
$output .= "<div class='" . $slide_data['slide_icons_color'] . "' style='" . esc_attr( $wrapper_style ) . "'>\n";
|
583 |
+
$additional_classes = '';
|
584 |
+
if ( 'true' === $slide_data['pagination'] ) {
|
585 |
+
if ( 'true' === $slide_data['autohide_arrows'] ) {
|
586 |
+
$additional_classes = 'owl-pagination-true autohide-arrows';
|
587 |
+
} else {
|
588 |
+
$additional_classes = 'owl-pagination-true';
|
589 |
+
}
|
590 |
+
} else {
|
591 |
+
if ( 'true' === $slide_data['autohide_arrows'] ) {
|
592 |
+
$additional_classes = 'autohide-arrows';
|
593 |
+
}
|
594 |
+
}
|
595 |
+
// hero slider.
|
596 |
+
if ( '1' === $slide_data['hero_slider'] ) {
|
597 |
+
$additional_classes .= ' sa_hero_slider';
|
598 |
+
}
|
599 |
+
$slider_style = 'visibility:hidden;';
|
600 |
+
// showcase slider.
|
601 |
+
if ( '1' === $slide_data['showcase_slider'] ) {
|
602 |
+
$left_perc = ( intval( $slide_data['showcase_width'] ) - 100 ) / 2;
|
603 |
+
$slider_style .= ' width:' . $slide_data['showcase_width'] . '%;';
|
604 |
+
$slider_style .= ' left:-' . $left_perc . '%;';
|
605 |
+
if ( '1' === $slide_data['showcase_tablet'] ) {
|
606 |
+
$left_perc_tab = ( intval( $slide_data['showcase_width_tab'] ) - 100 ) / 2;
|
607 |
+
$slider_style .= ' --widthtab:' . $slide_data['showcase_width_tab'] . '%;';
|
608 |
+
$slider_style .= ' --lefttab:-' . $left_perc_tab . '%;';
|
609 |
+
$additional_classes .= ' showcase_tablet';
|
610 |
+
} else {
|
611 |
+
$additional_classes .= ' showcase_hide_tablet';
|
612 |
+
}
|
613 |
+
if ( '1' === $slide_data['showcase_mobile'] ) {
|
614 |
+
$left_perc_mob = ( intval( $slide_data['showcase_width_mob'] ) - 100 ) / 2;
|
615 |
+
$slider_style .= ' --widthmob:' . $slide_data['showcase_width_mob'] . '%;';
|
616 |
+
$slider_style .= ' --leftmob:-' . $left_perc_mob . '%;';
|
617 |
+
$additional_classes .= ' showcase_mobile';
|
618 |
+
} else {
|
619 |
+
$additional_classes .= ' showcase_hide_mobile';
|
620 |
+
}
|
621 |
+
}
|
622 |
+
$output .= "<div id='" . esc_attr( $slide_data['css_id'] ) . "' class='owl-carousel sa_owl_theme " . $additional_classes . "' ";
|
623 |
+
$output .= "data-slider-id='" . esc_attr( $slide_data['css_id'] ) . "' style='" . $slider_style . "'>\n";
|
624 |
+
if ( $sa_pro_version ) {
|
625 |
+
// PRO VERSION - INITIALISE VAIRABLES FOR MAGNIFIC POPUP.
|
626 |
+
$lightbox_function = 'open_lightbox_gallery_' . $slide_data['css_id'];
|
627 |
+
$lightbox_gallery_id = 'lightbox_button_' . $slide_data['css_id'];
|
628 |
+
$lightbox_count = 0;
|
629 |
+
}
|
630 |
+
for ( $i = 1; $i <= $slide_data['num_slides']; $i++ ) {
|
631 |
+
$slide_content = $slide_data[ 'slide' . $i . '_content' ];
|
632 |
+
if ( 'full' !== $slide_data['bg_image_size'] ) {
|
633 |
+
// use predefined WordPress image size (from 'other settings').
|
634 |
+
$slide_image_src = wp_get_attachment_image_src( $slide_data[ 'slide' . $i . '_image_id' ], $slide_data['bg_image_size'] );
|
635 |
+
} else {
|
636 |
+
// use "full" WordPress image size.
|
637 |
+
$slide_image_src = wp_get_attachment_image_src( $slide_data[ 'slide' . $i . '_image_id' ], 'full' );
|
638 |
+
}
|
639 |
+
// SA PRO VERSION - USE POPUP IMAGE AS SLIDE BACKGROUND IMAGE (IF THIS OPTION SELECTED).
|
640 |
+
if ( ( $sa_pro_version ) && ( 'IMAGE' === $slide_data[ 'slide' . $i . '_popup_type' ] ) ) {
|
641 |
+
if ( ( 'no' !== $slide_data[ 'slide' . $i . '_popup_background' ] ) && ( '' !== $slide_data[ 'slide' . $i . '_popup_image' ] ) ) {
|
642 |
+
$slide_image_src = wp_get_attachment_image_src( $slide_data[ 'slide' . $i . '_popup_imageid' ], $slide_data[ 'slide' . $i . '_popup_background' ] );
|
643 |
+
}
|
644 |
+
} elseif ( ( $sa_pro_version ) && ( 'VIDEO' === $slide_data[ 'slide' . $i . '_popup_type' ] ) ) {
|
645 |
+
if ( 'youtube' === $slide_data[ 'slide' . $i . '_popup_video_type' ] ) {
|
646 |
+
if ( '99999999' === $slide_data[ 'slide' . $i . '_image_id' ] ) {
|
647 |
+
$slide_image_src = array();
|
648 |
+
$popup_video_id = $slide_data[ 'slide' . $i . '_popup_video_id' ];
|
649 |
+
$slide_image_src[0] = 'https://img.youtube.com/vi/' . $popup_video_id . '/hqdefault.jpg';
|
650 |
+
}
|
651 |
+
}
|
652 |
+
}
|
653 |
+
$slide_image_size = $slide_data[ 'slide' . $i . '_image_size' ];
|
654 |
+
$slide_image_pos = $slide_data[ 'slide' . $i . '_image_pos' ];
|
655 |
+
$slide_image_repeat = $slide_data[ 'slide' . $i . '_image_repeat' ];
|
656 |
+
$slide_image_color = $slide_data[ 'slide' . $i . '_image_color' ];
|
657 |
+
$slide_style = 'padding:' . $slide_data['slide_padding_tb'] . '% ' . $slide_data['slide_padding_lr'] . '%; ';
|
658 |
+
$slide_style .= 'margin:0px ' . $slide_data['slide_margin_lr'] . '%; ';
|
659 |
+
if ( ! empty( $slide_image_src[0] ) ) {
|
660 |
+
$slide_style .= 'background-image:url("' . $slide_image_src[0] . '"); ';
|
661 |
+
$slide_style .= 'background-position:' . $slide_image_pos . '; ';
|
662 |
+
$slide_style .= 'background-size:' . $slide_image_size . '; ';
|
663 |
+
$slide_style .= 'background-repeat:' . $slide_image_repeat . '; ';
|
664 |
+
}
|
665 |
+
if ( ! empty( $slide_image_color ) && ( 'rgba(0,0,0,0)' !== $slide_image_color ) ) {
|
666 |
+
$slide_style .= 'background-color:' . $slide_image_color . '; ';
|
667 |
+
}
|
668 |
+
if ( strpos( $slide_data['slide_min_height_perc'], 'px' ) !== false ) {
|
669 |
+
$slide_style .= 'min-height:' . $slide_data['slide_min_height_perc'] . '; ';
|
670 |
+
}
|
671 |
+
|
672 |
+
// BUILD SLIDE LINK HOVER BUTTON.
|
673 |
+
$link_output = '';
|
674 |
+
if ( '' !== $slide_data[ 'slide' . $i . '_link_url' ] ) {
|
675 |
+
$link_title = ''; // SET LINK TITLE TO BLANK - 03/01/2022.
|
676 |
+
$link_output = "<a class='sa_slide_link_icon' href='" . $slide_data[ 'slide' . $i . '_link_url' ] . "' ";
|
677 |
+
$link_output .= "target='" . $slide_data[ 'slide' . $i . '_link_target' ] . "' ";
|
678 |
+
$link_output .= "title='" . $link_title . "' aria-label='" . $link_title . "'></a>";
|
679 |
+
}
|
680 |
+
|
681 |
+
// BUILD POPUP HOVER BUTTON - PRO VERSION ONLY.
|
682 |
+
$popup_output = '';
|
683 |
+
if ( $sa_pro_version ) {
|
684 |
+
if ( ( 'IMAGE' === $slide_data[ 'slide' . $i . '_popup_type' ] ) && ( '' !== $slide_data[ 'slide' . $i . '_popup_image' ] ) ) {
|
685 |
+
$lightbox_count++;
|
686 |
+
$popup_output = "<div class='sa_popup_zoom_icon' onClick='" . $lightbox_function . '(' . $lightbox_count . ");'></div>";
|
687 |
+
}
|
688 |
+
if ( ( 'VIDEO' === $slide_data[ 'slide' . $i . '_popup_type' ] ) && ( '' !== $slide_data[ 'slide' . $i . '_popup_video_id' ] ) ) {
|
689 |
+
$lightbox_count++;
|
690 |
+
$popup_output = "<div class='sa_popup_video_icon' onClick='" . $lightbox_function . '(' . $lightbox_count . ");'></div>";
|
691 |
+
}
|
692 |
+
if ( 'HTML' === $slide_data[ 'slide' . $i . '_popup_type' ] ) {
|
693 |
+
$lightbox_count++;
|
694 |
+
$popup_output = "<div class='sa_popup_zoom_icon' onClick='" . $lightbox_function . '(' . $lightbox_count . ");'></div>";
|
695 |
+
}
|
696 |
+
}
|
697 |
+
|
698 |
+
// DISPLAY SLIDE OUTPUT.
|
699 |
+
$css_id = $slide_data['css_id'] . '_slide' . sprintf( '%02d', $slide_data[ 'slide' . $i . '_num' ] );
|
700 |
+
if ( '1' === $slide_data['disable_slide_ids'] ) {
|
701 |
+
if ( 'true' === $slide_data['vert_center'] ) {
|
702 |
+
$output .= "<div class='" . $css_id . " sa_hover_container sa_vert_center_wrap' style='" . esc_attr( $slide_style ) . "'>";
|
703 |
+
} else {
|
704 |
+
$output .= "<div class='" . $css_id . " sa_hover_container' style='" . esc_attr( $slide_style ) . "'>";
|
705 |
+
}
|
706 |
+
} else {
|
707 |
+
if ( 'true' === $slide_data['vert_center'] ) {
|
708 |
+
$output .= "<div id='" . $css_id . "' class='sa_hover_container sa_vert_center_wrap' style='" . esc_attr( $slide_style ) . "'>";
|
709 |
+
} else {
|
710 |
+
$output .= "<div id='" . $css_id . "' class='sa_hover_container' style='" . esc_attr( $slide_style ) . "'>";
|
711 |
+
}
|
712 |
+
}
|
713 |
+
if ( ( '' !== $link_output ) || ( '' !== $popup_output ) ) {
|
714 |
+
if ( 'Top Left' === $slide_data['slide_icons_location'] ) {
|
715 |
+
// icons location - top left.
|
716 |
+
$style = 'top:0px; left:0px; margin:0px;';
|
717 |
+
} elseif ( 'Top Center' === $slide_data['slide_icons_location'] ) {
|
718 |
+
// icons location - top center.
|
719 |
+
if ( ( '' !== $link_output ) && ( '' !== $popup_output ) ) {
|
720 |
+
$hov_margin_l = '-40px'; } else {
|
721 |
+
$hov_margin_l = '-20px'; }
|
722 |
+
$style = 'top:0px; left:50%; margin-left:' . $hov_margin_l . ';';
|
723 |
+
} elseif ( 'Top Right' === $slide_data['slide_icons_location'] ) {
|
724 |
+
// icons location - top right.
|
725 |
+
$style = 'top:0px; right:0px; margin:0px;';
|
726 |
+
} elseif ( 'Bottom Left' === $slide_data['slide_icons_location'] ) {
|
727 |
+
// icons location - bottom left.
|
728 |
+
$style = 'bottom:0px; left:0px; margin:0px;';
|
729 |
+
} elseif ( 'Bottom Center' === $slide_data['slide_icons_location'] ) {
|
730 |
+
// icons location - bottom center.
|
731 |
+
if ( ( '' !== $link_output ) && ( '' !== $popup_output ) ) {
|
732 |
+
$hov_margin_l = '-40px'; } else {
|
733 |
+
$hov_margin_l = '-20px'; }
|
734 |
+
$style = 'bottom:0px; left:50%; margin-left:' . $hov_margin_l . ';';
|
735 |
+
} elseif ( 'Bottom Right' === $slide_data['slide_icons_location'] ) {
|
736 |
+
// icons location - bottom right.
|
737 |
+
$style = 'bottom:0px; right:0px; margin:0px;';
|
738 |
+
} else {
|
739 |
+
// icons location - center center (default).
|
740 |
+
if ( ( '' !== $link_output ) && ( '' !== $popup_output ) ) {
|
741 |
+
$hov_margin_l = '-40px'; } else {
|
742 |
+
$hov_margin_l = '-20px'; }
|
743 |
+
$style = 'top:50%; left:50%; margin-top:-20px; margin-left:' . $hov_margin_l . ';';
|
744 |
+
}
|
745 |
+
// check whether to display a 'full slide link' for this slide.
|
746 |
+
$full_slide_link = 0;
|
747 |
+
if ( ( ( '' === $link_output ) && ( '' !== $popup_output ) ) ||
|
748 |
+
( ( '' !== $link_output ) && ( '' === $popup_output ) ) ) {
|
749 |
+
if ( '1' === $slide_data['slide_icons_fullslide'] ) {
|
750 |
+
$full_slide_link = 1;
|
751 |
+
}
|
752 |
+
}
|
753 |
+
if ( 1 === $full_slide_link ) {
|
754 |
+
// display full slide link.
|
755 |
+
$output .= "<div class='sa_hover_fullslide'>";
|
756 |
+
} else {
|
757 |
+
// display link buttons.
|
758 |
+
if ( 'true' === $slide_data['slide_icons_visible'] ) {
|
759 |
+
$output .= "<div class='sa_hover_buttons always_visible' style='" . $style . "'>";
|
760 |
+
} else {
|
761 |
+
$output .= "<div class='sa_hover_buttons' style='" . $style . "'>";
|
762 |
+
}
|
763 |
+
}
|
764 |
+
if ( '' !== $link_output ) {
|
765 |
+
$output .= $link_output;
|
766 |
+
}
|
767 |
+
if ( '' !== $popup_output ) {
|
768 |
+
$output .= $popup_output;
|
769 |
+
}
|
770 |
+
$output .= "</div>\n"; // .sa_hover_buttons
|
771 |
+
}
|
772 |
+
if ( 'true' === $slide_data['vert_center'] ) {
|
773 |
+
// vertically center content within each slide.
|
774 |
+
// (we do this by wrapping slide content in a '<div>' wrapper.
|
775 |
+
$slide_content = "<div class='sa_vert_center'>" . $slide_content . '</div>';
|
776 |
+
}
|
777 |
+
$output .= $slide_content . "</div>\n"; // .sa_hover_container
|
778 |
+
}
|
779 |
+
$output .= "</div>\n"; // .owl-carousel
|
780 |
+
|
781 |
+
// PRO VERSION - THUMBNAIL PAGINATION.
|
782 |
+
if ( ( $sa_pro_version ) && ( '1' === $slide_data['thumbs_active'] ) ) {
|
783 |
+
$thumbs_loc = $slide_data['thumbs_location'];
|
784 |
+
$thumbs_opacity = $slide_data['thumbs_opacity'] / 100;
|
785 |
+
// thumbnail container - set style.
|
786 |
+
$thumbs_style = ' padding:' . $slide_data['thumbs_padding'] . '%;';
|
787 |
+
if ( 'inside_left' === $thumbs_loc ) {
|
788 |
+
$thumbs_style .= 'left:' . $slide_data['thumbs_padding'] . '%; width:' . $slide_data['thumbs_width'] . 'px;';
|
789 |
+
} elseif ( 'inside_right' === $thumbs_loc ) {
|
790 |
+
$thumbs_style .= 'right:' . $slide_data['thumbs_padding'] . '%; width:' . $slide_data['thumbs_width'] . 'px;';
|
791 |
+
} elseif ( 'outside_bottom' === $thumbs_loc ) {
|
792 |
+
$thumbs_style .= ' padding-bottom:0px;';
|
793 |
+
}
|
794 |
+
$add_classes = '';
|
795 |
+
if ( 0 === $slide_data['thumbs_resp_tablet'] ) {
|
796 |
+
$add_classes .= ' sa_thumbs_hide_tablet'; }
|
797 |
+
if ( 0 === $slide_data['thumbs_resp_mobile'] ) {
|
798 |
+
$add_classes .= ' sa_thumbs_hide_mobile'; }
|
799 |
+
$output .= "<div id='" . esc_attr( $slide_data['css_id'] ) . "_thumbs' class='sa_owl_thumbs_wrap sa_thumbs_" . $thumbs_loc . $add_classes . "' style='" . $thumbs_style . "'>";
|
800 |
+
$output .= "<div class='owl-thumbs' data-slider-id='" . esc_attr( $slide_data['css_id'] ) . "'>";
|
801 |
+
for ( $i = 1; $i <= $slide_data['num_slides']; $i++ ) {
|
802 |
+
// get background image for the thumb (slide image background).
|
803 |
+
if ( ( 'IMAGE' === $slide_data[ 'slide' . $i . '_popup_type' ] ) &&
|
804 |
+
( 'no' !== $slide_data[ 'slide' . $i . '_popup_background' ] ) &&
|
805 |
+
( '' !== $slide_data[ 'slide' . $i . '_popup_image' ] ) ) {
|
806 |
+
$thumb_image_arr = wp_get_attachment_image_src( $slide_data[ 'slide' . $i . '_popup_imageid' ], $slide_data[ 'slide' . $i . '_popup_background' ] );
|
807 |
+
$thumb_image_src = $thumb_image_arr[0];
|
808 |
+
} elseif ( ( 'VIDEO' === $slide_data[ 'slide' . $i . '_popup_type' ] ) &&
|
809 |
+
( 'youtube' === $slide_data[ 'slide' . $i . '_popup_video_type' ] ) &&
|
810 |
+
( '99999999' === $slide_data[ 'slide' . $i . '_image_id' ] ) ) {
|
811 |
+
$thumb_image_src = array();
|
812 |
+
$popup_video_id = $slide_data[ 'slide' . $i . '_popup_video_id' ];
|
813 |
+
$thumb_image_src = 'https://img.youtube.com/vi/' . $popup_video_id . '/hqdefault.jpg';
|
814 |
+
} elseif ( 0 !== $slide_data[ 'slide' . $i . '_image_id' ] ) {
|
815 |
+
$thumb_image_src = wp_get_attachment_image_src( $slide_data[ 'slide' . $i . '_image_id' ], $slide_data['thumbs_image_size'] );
|
816 |
+
$thumb_image_src = $thumb_image_src[0];
|
817 |
+
} else {
|
818 |
+
// use a placeholder image if slide has no background image.
|
819 |
+
$thumb_image_src = SA_PLUGIN_PATH . 'images/image_placeholder.jpg';
|
820 |
+
}
|
821 |
+
// thumbnail - set style.
|
822 |
+
$thumb_style = 'background-image:url("' . $thumb_image_src . '"); ';
|
823 |
+
$thumb_style .= 'width:' . $slide_data['thumbs_width'] . 'px; ';
|
824 |
+
$thumb_style .= 'height:' . $slide_data['thumbs_height'] . 'px; ';
|
825 |
+
$thumb_style .= 'background-position:' . $slide_data[ 'slide' . $i . '_image_pos' ] . '; ';
|
826 |
+
$thumb_style .= 'background-size:' . $slide_data[ 'slide' . $i . '_image_size' ] . '; ';
|
827 |
+
$thumb_style .= 'background-repeat:' . $slide_data[ 'slide' . $i . '_image_repeat' ] . '; ';
|
828 |
+
$thumb_style .= 'opacity:' . $thumbs_opacity . '; ';
|
829 |
+
$thumb_style .= 'border:solid ' . $slide_data['thumbs_border_width'] . 'px transparent';
|
830 |
+
$output .= "<div class='owl-thumb-item' style='" . $thumb_style . "' title='Slide " . $i . "'></div>";
|
831 |
+
}
|
832 |
+
$output .= '</div>'; // .sa_owl_thumbs
|
833 |
+
$output .= "</div>\n"; // .sa_owl_thumbs_wrap
|
834 |
+
}
|
835 |
+
|
836 |
+
// SHOWCASE CAROUSEL - NAVIGATION CONTAINER.
|
837 |
+
if ( '1' === $slide_data['showcase_slider'] ) {
|
838 |
+
if ( 'true' === $slide_data['autohide_arrows'] ) {
|
839 |
+
$output .= "<div id='showcase_" . esc_attr( $id ) . "' class='showcase_nav owl-nav autohide_arrows'></div>\n";
|
840 |
+
} else {
|
841 |
+
$output .= "<div id='showcase_" . esc_attr( $id ) . "' class='showcase_nav owl-nav'></div>\n";
|
842 |
+
}
|
843 |
+
}
|
844 |
+
|
845 |
+
$output .= "</div>\n"; // .white or .black
|
846 |
+
|
847 |
+
// PRO VERSION - CREATE A (HIDDEN) DIV FOR EACH 'HTML' POPUP.
|
848 |
+
if ( $sa_pro_version ) {
|
849 |
+
for ( $i = 1; $i <= $slide_data['num_slides']; $i++ ) {
|
850 |
+
if ( 'HTML' === $slide_data[ 'slide' . $i . '_popup_type' ] ) {
|
851 |
+
$popup_css_id = $slide_data[ 'slide' . $i . '_popup_css_id' ];
|
852 |
+
$popup_bgcol = $slide_data[ 'slide' . $i . '_popup_bgcol' ];
|
853 |
+
$popup_width = $slide_data[ 'slide' . $i . '_popup_width' ];
|
854 |
+
$output .= "<div id='" . $popup_css_id . "' class='mfp-hide sa_custom_popup' ";
|
855 |
+
$output .= "style='background:" . $popup_bgcol . '; max-width:' . $popup_width . "px;'>\n";
|
856 |
+
if ( '1' === $slide_data[ 'slide' . $i . '_popup_shortcode' ] ) {
|
857 |
+
$output .= do_shortcode( $slide_data[ 'slide' . $i . '_popup_html' ] );
|
858 |
+
} else {
|
859 |
+
$output .= $slide_data[ 'slide' . $i . '_popup_html' ];
|
860 |
+
}
|
861 |
+
$output .= "</div>\n";
|
862 |
+
}
|
863 |
+
}
|
864 |
+
}
|
865 |
+
|
866 |
+
// ### ENQUEUE JQUERY SCRIPT IF IT HAS NOT ALREADY BEEN LOADED ###
|
867 |
+
if ( ! wp_script_is( 'jquery', 'done' ) ) {
|
868 |
+
wp_enqueue_script( 'jquery' );
|
869 |
+
}
|
870 |
+
|
871 |
+
// ### GENERATE JQUERY CODE FOR THE OWL CAROUSEL SLIDER ###
|
872 |
+
if ( ( 1 === $slide_data['items_width1'] ) && ( 1 === $slide_data['items_width2'] ) && ( 1 === $slide_data['items_width3'] ) &&
|
873 |
+
( 1 === $slide_data['items_width4'] ) && ( 1 === $slide_data['items_width5'] ) && ( 1 === $slide_data['items_width6'] ) ) {
|
874 |
+
$single_item = 1;
|
875 |
+
} else {
|
876 |
+
$single_item = 0;
|
877 |
+
}
|
878 |
+
|
879 |
+
$output .= "<script type='text/javascript'>\n";
|
880 |
+
if ( '1' === $slide_data['sa_window_onload'] ) {
|
881 |
+
$output .= " document.addEventListener('DOMContentLoaded', function() {\n";
|
882 |
+
} else {
|
883 |
+
$output .= " jQuery(document).ready(function() {\n";
|
884 |
+
}
|
885 |
+
|
886 |
+
// JQUERY CODE FOR OWN CAROUSEL.
|
887 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "').owlCarousel({\n";
|
888 |
+
if ( 1 === $single_item ) {
|
889 |
+
$output .= " items : 1,\n";
|
890 |
+
if ( ( 'Fade' === $slide_data['transition'] ) || ( 'fade' === $slide_data['transition'] ) ) {
|
891 |
+
$output .= " animateOut : 'fadeOut',\n";
|
892 |
+
} elseif ( ( 'Slide Down' === $slide_data['transition'] ) || ( 'goDown' === $slide_data['transition'] ) ) {
|
893 |
+
$output .= " animateOut : 'slideOutDown',\n";
|
894 |
+
$output .= " animateIn : 'fadeIn',\n";
|
895 |
+
} elseif ( 'Zoom In' === $slide_data['transition'] ) {
|
896 |
+
$output .= " animateOut : 'fadeOut',\n";
|
897 |
+
$output .= " animateIn : 'zoomIn',\n";
|
898 |
+
} elseif ( 'Zoom Out' === $slide_data['transition'] ) {
|
899 |
+
$output .= " animateOut : 'zoomOut',\n";
|
900 |
+
$output .= " animateIn : 'fadeIn',\n";
|
901 |
+
} elseif ( 'Flip Out X' === $slide_data['transition'] ) {
|
902 |
+
$output .= " animateOut : 'flipOutX',\n";
|
903 |
+
$output .= " animateIn : 'fadeIn',\n";
|
904 |
+
} elseif ( 'Flip Out Y' === $slide_data['transition'] ) {
|
905 |
+
$output .= " animateOut : 'flipOutY',\n";
|
906 |
+
$output .= " animateIn : 'fadeIn',\n";
|
907 |
+
} elseif ( 'Rotate Left' === $slide_data['transition'] ) {
|
908 |
+
$output .= " animateOut : 'rotateOutDownLeft',\n";
|
909 |
+
$output .= " animateIn : 'fadeIn',\n";
|
910 |
+
} elseif ( 'Rotate Right' === $slide_data['transition'] ) {
|
911 |
+
$output .= " animateOut : 'rotateOutDownRight',\n";
|
912 |
+
$output .= " animateIn : 'fadeIn',\n";
|
913 |
+
} elseif ( 'Bounce Out' === $slide_data['transition'] ) {
|
914 |
+
$output .= " animateOut : 'bounceOut',\n";
|
915 |
+
$output .= " animateIn : 'fadeIn',\n";
|
916 |
+
} elseif ( 'Roll Out' === $slide_data['transition'] ) {
|
917 |
+
$output .= " animateOut : 'rollOut',\n";
|
918 |
+
$output .= " animateIn : 'fadeIn',\n";
|
919 |
+
}
|
920 |
+
$output .= ' smartSpeed : ' . esc_attr( $slide_data['slide_transition'] ) . ",\n";
|
921 |
+
} else {
|
922 |
+
$output .= " responsive:{\n";
|
923 |
+
$output .= ' 0:{ items:' . esc_attr( $slide_data['items_width1'] ) . " },\n";
|
924 |
+
$output .= ' 480:{ items:' . esc_attr( $slide_data['items_width2'] ) . " },\n";
|
925 |
+
$output .= ' 768:{ items:' . esc_attr( $slide_data['items_width3'] ) . " },\n";
|
926 |
+
$output .= ' 980:{ items:' . esc_attr( $slide_data['items_width4'] ) . " },\n";
|
927 |
+
$output .= ' 1200:{ items:' . esc_attr( $slide_data['items_width5'] ) . " },\n";
|
928 |
+
$output .= ' 1500:{ items:' . esc_attr( $slide_data['items_width6'] ) . " }\n";
|
929 |
+
$output .= " },\n";
|
930 |
+
}
|
931 |
+
if ( 0.0 === $slide_data['slide_duration'] ) {
|
932 |
+
$output .= " autoplay : false,\n";
|
933 |
+
$output .= " autoplayHoverPause : false,\n";
|
934 |
+
} else {
|
935 |
+
$output .= " autoplay : true,\n";
|
936 |
+
$output .= ' autoplayTimeout : ' . esc_attr( $slide_data['slide_duration'] ) . ",\n";
|
937 |
+
$output .= ' autoplayHoverPause : ' . esc_attr( $slide_data['stop_hover'] ) . ",\n";
|
938 |
+
}
|
939 |
+
$output .= ' smartSpeed : ' . esc_attr( $slide_data['slide_transition'] ) . ",\n";
|
940 |
+
$output .= ' fluidSpeed : ' . esc_attr( $slide_data['slide_transition'] ) . ",\n";
|
941 |
+
$output .= ' autoplaySpeed : ' . esc_attr( $slide_data['slide_transition'] ) . ",\n";
|
942 |
+
$output .= ' navSpeed : ' . esc_attr( $slide_data['slide_transition'] ) . ",\n";
|
943 |
+
$output .= ' dotsSpeed : ' . esc_attr( $slide_data['slide_transition'] ) . ",\n";
|
944 |
+
if ( '1' === $slide_data['dot_per_slide'] ) {
|
945 |
+
$output .= " dotsEach : 1,\n";
|
946 |
+
}
|
947 |
+
$output .= ' loop : ' . esc_attr( $slide_data['loop_slider'] ) . ",\n";
|
948 |
+
$output .= ' nav : ' . esc_attr( $slide_data['nav_arrows'] ) . ",\n";
|
949 |
+
$output .= " navText : ['Previous','Next'],\n";
|
950 |
+
if ( '1' === $slide_data['showcase_slider'] ) {
|
951 |
+
$output .= " navContainer : '#showcase_" . esc_attr( $id ) . "',\n";
|
952 |
+
}
|
953 |
+
$output .= ' dots : ' . esc_attr( $slide_data['pagination'] ) . ",\n";
|
954 |
+
$output .= " responsiveRefreshRate : 200,\n";
|
955 |
+
if ( 'page' === $slide_data['slide_by'] ) {
|
956 |
+
$output .= " slideBy : 'page',\n";
|
957 |
+
} else {
|
958 |
+
$output .= ' slideBy : ' . esc_attr( $slide_data['slide_by'] ) . ",\n";
|
959 |
+
}
|
960 |
+
$output .= " mergeFit : true,\n";
|
961 |
+
$output .= ' autoHeight : ' . esc_attr( $slide_data['auto_height'] ) . ",\n";
|
962 |
+
if ( '1' === $slide_data['lazy_load_images'] ) {
|
963 |
+
$output .= " lazyLoad : true,\n";
|
964 |
+
$output .= " lazyLoadEager: 1,\n";
|
965 |
+
}
|
966 |
+
if ( ( $sa_pro_version ) && ( '1' === $slide_data['thumbs_active'] ) ) {
|
967 |
+
$output .= " thumbs : true,\n";
|
968 |
+
$output .= " thumbsPrerendered : true,\n";
|
969 |
+
}
|
970 |
+
if ( '1' === $slide_data['ulli_containers'] ) {
|
971 |
+
$output .= " stageElement : 'ul',\n";
|
972 |
+
$output .= " itemElement : 'li',\n";
|
973 |
+
}
|
974 |
+
if ( '1' === $slide_data['rtl_slider'] ) {
|
975 |
+
$output .= " rtl : true,\n";
|
976 |
+
}
|
977 |
+
|
978 |
+
if ( 0 !== $slide_data['start_pos'] ) {
|
979 |
+
$output .= ' startPosition : ' . $slide_data['start_pos'] . ",\n";
|
980 |
+
}
|
981 |
+
$output .= ' mouseDrag : ' . esc_attr( $slide_data['mouse_drag'] ) . ",\n";
|
982 |
+
$output .= ' touchDrag : ' . esc_attr( $slide_data['touch_drag'] ) . "\n";
|
983 |
+
$output .= " });\n";
|
984 |
+
|
985 |
+
// MAKE SLIDER VISIBLE (AFTER 'WINDOW ONLOAD' OR 'DOCUMENT READY' EVENT).
|
986 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "').css('visibility', 'visible');\n";
|
987 |
+
|
988 |
+
// JAVASCRIPT 'WINDOW RESIZE' EVENT TO SET CSS 'min-height' OF SLIDES WITHIN THIS SLIDER.
|
989 |
+
if ( '1' !== $slide_data['hero_slider'] ) {
|
990 |
+
$slide_min_height = $slide_data['slide_min_height_perc'];
|
991 |
+
if ( strpos( $slide_min_height, 'px' ) !== false ) {
|
992 |
+
$slide_min_height = 0;
|
993 |
+
}
|
994 |
+
if ( ( '' !== $slide_min_height ) && ( '0' !== $slide_min_height ) ) {
|
995 |
+
$output .= ' sa_resize_' . esc_attr( $slide_data['css_id'] ) . "();\n"; // initial call of resize function.
|
996 |
+
$output .= " window.addEventListener('resize', sa_resize_" . esc_attr( $slide_data['css_id'] ) . ");\n"; // create resize event.
|
997 |
+
// RESIZE EVENT FUNCTION (to set slide CSS 'min-height').
|
998 |
+
$output .= ' function sa_resize_' . esc_attr( $slide_data['css_id'] ) . "() {\n";
|
999 |
+
// get slide min height setting.
|
1000 |
+
$output .= " var min_height = '" . $slide_min_height . "';\n";
|
1001 |
+
// get window width.
|
1002 |
+
$output .= " var win_width = jQuery(window).width();\n";
|
1003 |
+
$output .= " var slider_width = jQuery('#" . esc_attr( $slide_data['css_id'] ) . "').width();\n";
|
1004 |
+
// calculate slide width according to window width & number of slides.
|
1005 |
+
$output .= " if (win_width < 480) {\n";
|
1006 |
+
$output .= ' var slide_width = slider_width / ' . esc_attr( $slide_data['items_width1'] ) . ";\n";
|
1007 |
+
$output .= " } else if (win_width < 768) {\n";
|
1008 |
+
$output .= ' var slide_width = slider_width / ' . esc_attr( $slide_data['items_width2'] ) . ";\n";
|
1009 |
+
$output .= " } else if (win_width < 980) {\n";
|
1010 |
+
$output .= ' var slide_width = slider_width / ' . esc_attr( $slide_data['items_width3'] ) . ";\n";
|
1011 |
+
$output .= " } else if (win_width < 1200) {\n";
|
1012 |
+
$output .= ' var slide_width = slider_width / ' . esc_attr( $slide_data['items_width4'] ) . ";\n";
|
1013 |
+
$output .= " } else if (win_width < 1500) {\n";
|
1014 |
+
$output .= ' var slide_width = slider_width / ' . esc_attr( $slide_data['items_width5'] ) . ";\n";
|
1015 |
+
$output .= " } else {\n";
|
1016 |
+
$output .= ' var slide_width = slider_width / ' . esc_attr( $slide_data['items_width6'] ) . ";\n";
|
1017 |
+
$output .= " }\n";
|
1018 |
+
$output .= " slide_width = Math.round(slide_width);\n";
|
1019 |
+
// calculate CSS 'min-height' using the captured 'min-height' data settings for this slider.
|
1020 |
+
$output .= " var slide_height = '0';\n";
|
1021 |
+
$output .= " if (min_height == 'aspect43') {\n";
|
1022 |
+
$output .= ' slide_height = (slide_width / 4) * 3;';
|
1023 |
+
$output .= " slide_height = Math.round(slide_height);\n";
|
1024 |
+
$output .= " } else if (min_height == 'aspect169') {\n";
|
1025 |
+
$output .= ' slide_height = (slide_width / 16) * 9;';
|
1026 |
+
$output .= " slide_height = Math.round(slide_height);\n";
|
1027 |
+
$output .= " } else {\n";
|
1028 |
+
$output .= ' slide_height = (slide_width / 100) * min_height;';
|
1029 |
+
$output .= " slide_height = Math.round(slide_height);\n";
|
1030 |
+
$output .= " }\n";
|
1031 |
+
// set the slide 'min-height' css value.
|
1032 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . " .owl-item .sa_hover_container').css('min-height', slide_height+'px');\n";
|
1033 |
+
$output .= " }\n";
|
1034 |
+
}
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
// JAVASCRIPT FOR SHOWCASE CAROUSELS ONLY.
|
1038 |
+
// DYNAMICALLY SET CLASS NAMES FOR LEFTMOST (FIRST) AND RIGHTMOST (LAST) ACTIVE (DISPLAYED) SLIDES.
|
1039 |
+
if ( '1' === $slide_data['showcase_slider'] ) {
|
1040 |
+
$output .= " set_first_last_active_classes('" . esc_attr( $slide_data['css_id'] ) . "');\n";
|
1041 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "').on('translated.owl.carousel resized.owl.carousel', function(event) {\n";
|
1042 |
+
$output .= " set_first_last_active_classes('" . esc_attr( $slide_data['css_id'] ) . "');\n";
|
1043 |
+
$output .= " });\n";
|
1044 |
+
$output .= " function set_first_last_active_classes(css_id) {\n";
|
1045 |
+
$output .= " var total = jQuery('#" . esc_attr( $slide_data['css_id'] ) . " .owl-stage .owl-item.active').length;\n";
|
1046 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . " .owl-stage .owl-item').removeClass('sc_partial');\n";
|
1047 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . " .owl-stage .owl-item.active').each(function(index){\n";
|
1048 |
+
$output .= " if (index === 0) {\n"; // this is the first active slide.
|
1049 |
+
$output .= " jQuery(this).addClass('sc_partial');\n";
|
1050 |
+
$output .= " }\n";
|
1051 |
+
$output .= " if (index === total - 1 && total > 1) {\n"; // this is the last active slide.
|
1052 |
+
$output .= " jQuery(this).addClass('sc_partial');\n";
|
1053 |
+
$output .= " }\n";
|
1054 |
+
$output .= " });\n";
|
1055 |
+
$output .= " }\n";
|
1056 |
+
}
|
1057 |
+
|
1058 |
+
// JAVASCRIPT FOR 'CLICK TO ADVANCE' OPTION ONLY.
|
1059 |
+
if ( 'true' === $slide_data['click_advance'] ) {
|
1060 |
+
if ( ( 'false' === $slide_data['touch_drag'] ) && ( 'false' === $slide_data['mouse_drag'] ) ) {
|
1061 |
+
$output .= ' var cta_' . $id . " = jQuery('#" . esc_attr( $slide_data['css_id'] ) . "');\n";
|
1062 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "').click(function() {\n";
|
1063 |
+
$output .= ' cta_' . $id . ".trigger('next.owl.carousel');\n";
|
1064 |
+
$output .= " });\n";
|
1065 |
+
}
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
// JAVASCRIPT FOR 'MOUSEWHEEL NAVIGATION' OPTION ONLY.
|
1069 |
+
if ( 'true' === $slide_data['mousewheel'] ) {
|
1070 |
+
$output .= ' var mw_' . $id . " = jQuery('#" . esc_attr( $slide_data['css_id'] ) . "');\n";
|
1071 |
+
$output .= ' mw_' . $id . ".on('mousewheel', '.owl-stage', function (e) {\n";
|
1072 |
+
$output .= " if (e.deltaY>0) {\n";
|
1073 |
+
$output .= ' mw_' . $id . ".trigger('next.owl');\n";
|
1074 |
+
$output .= " } else {\n";
|
1075 |
+
$output .= ' mw_' . $id . ".trigger('prev.owl');\n";
|
1076 |
+
$output .= " }\n";
|
1077 |
+
$output .= " e.preventDefault();\n";
|
1078 |
+
$output .= " });\n";
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
// JAVASCRIPT FOR 'SLIDE GOTO LINKS".
|
1082 |
+
$output .= " var owl_goto = jQuery('#" . esc_attr( $slide_data['css_id'] ) . "');\n";
|
1083 |
+
for ( $i = 1; $i <= $slide_data['num_slides']; $i++ ) {
|
1084 |
+
$output .= " jQuery('." . esc_attr( $slide_data['css_id'] ) . '_goto' . $i . "').click(function(event){\n";
|
1085 |
+
$output .= " owl_goto.trigger('to.owl.carousel', " . ( $i - 1 ) . ");\n";
|
1086 |
+
$output .= " });\n";
|
1087 |
+
}
|
1088 |
+
|
1089 |
+
// ### PRO VERSION - JQUERY/JAVASCRIPT CODE FOR THUMBNAIL PAGINATION ###
|
1090 |
+
if ( ( $sa_pro_version ) && ( '1' === $slide_data['thumbs_active'] ) ) {
|
1091 |
+
|
1092 |
+
// BORDER WIDTH IS SET - SET BORDER COLOUR TO THE ACTIVE THUMB.
|
1093 |
+
if ( $slide_data['thumbs_border_width'] > 0 ) {
|
1094 |
+
// set border colour of the active (first) thumb.
|
1095 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs .owl-thumbs .active').css('border-color', '" . $slide_data['thumbs_border_color'] . "');\n";
|
1096 |
+
$output .= " var owl = jQuery('#" . esc_attr( $slide_data['css_id'] ) . "');\n";
|
1097 |
+
// owl carousel change event - set border colour of the active thumb.
|
1098 |
+
$output .= " owl.on('changed.owl.carousel', function(event) {\n";
|
1099 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs .owl-thumbs .owl-thumb-item').css('border-color', 'transparent');\n";
|
1100 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs .owl-thumbs .active').css('border-color', '" . $slide_data['thumbs_border_color'] . "');\n";
|
1101 |
+
$output .= " })\n";
|
1102 |
+
}
|
1103 |
+
|
1104 |
+
// RESIZE WINDOW EVENT - RESIZE THUMBS WIDTH & HEIGHT DEPENDING ON WINDOW WIDTH BREAKPOINTS.
|
1105 |
+
$output .= ' sa_resize_thumbs_' . esc_attr( $slide_data['css_id'] ) . "();\n"; // initial call of resize function.
|
1106 |
+
$output .= " window.addEventListener('resize', sa_resize_thumbs_" . esc_attr( $slide_data['css_id'] ) . ");\n"; // create resize event.
|
1107 |
+
$output .= ' function sa_resize_thumbs_' . esc_attr( $slide_data['css_id'] ) . "() {\n";
|
1108 |
+
$output .= " var win_width = jQuery(window).width();\n";
|
1109 |
+
$output .= ' var tablet_perc = parseFloat(' . $slide_data['thumbs_resp_tablet'] . " / 100);\n";
|
1110 |
+
$output .= ' var mobile_perc = parseFloat(' . $slide_data['thumbs_resp_mobile'] . " / 100);\n";
|
1111 |
+
$output .= ' var tablet_width = Math.round(' . $slide_data['thumbs_width'] . " * tablet_perc) + 'px';\n";
|
1112 |
+
$output .= ' var tablet_height = Math.round(' . $slide_data['thumbs_height'] . " * tablet_perc) + 'px';\n";
|
1113 |
+
$output .= ' var mobile_width = Math.round(' . $slide_data['thumbs_width'] . " * mobile_perc) + 'px';\n";
|
1114 |
+
$output .= ' var mobile_height = Math.round(' . $slide_data['thumbs_height'] . " * mobile_perc) + 'px';\n";
|
1115 |
+
$output .= " if ((mobile_perc != 0) && (win_width < 768)) {\n";
|
1116 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs .owl-thumbs .owl-thumb-item').css('width', mobile_width);\n";
|
1117 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs .owl-thumbs .owl-thumb-item').css('height', mobile_height);\n";
|
1118 |
+
$output .= " } else if ((tablet_perc != 0) && (win_width < 1000)) {\n";
|
1119 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs .owl-thumbs .owl-thumb-item').css('width', tablet_width);\n";
|
1120 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs .owl-thumbs .owl-thumb-item').css('height', tablet_height);\n";
|
1121 |
+
$output .= " } else {\n";
|
1122 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs .owl-thumbs .owl-thumb-item').css('width', '" . $slide_data['thumbs_width'] . "px');\n";
|
1123 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs .owl-thumbs .owl-thumb-item').css('height', '" . $slide_data['thumbs_height'] . "px');\n";
|
1124 |
+
$output .= " }\n";
|
1125 |
+
// THUMBS POSITION 'Inside Left' or 'Inside Right' - RESIZE CONTAINER WIDTH DEPENDING ON WINDOW WIDTH BREAKPOINTS.
|
1126 |
+
if ( ( 'inside_left' === $thumbs_loc ) || ( 'inside_right' === $thumbs_loc ) ) {
|
1127 |
+
$output .= " if ((mobile_perc != 0) && (win_width < 768)) {\n";
|
1128 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs').css('width', mobile_width);\n";
|
1129 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs').css('height', mobile_height);\n";
|
1130 |
+
$output .= " } else if ((tablet_perc != 0) && (win_width < 1000)) {\n";
|
1131 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs').css('width', tablet_width);\n";
|
1132 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs').css('height', tablet_height);\n";
|
1133 |
+
$output .= " } else {\n";
|
1134 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs').css('width', '" . $slide_data['thumbs_width'] . "px');\n";
|
1135 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "_thumbs').css('height', '" . $slide_data['thumbs_height'] . "px');\n";
|
1136 |
+
$output .= " }\n";
|
1137 |
+
}
|
1138 |
+
$output .= " }\n";
|
1139 |
+
}
|
1140 |
+
|
1141 |
+
// CALL THE WINDOW RESIZE EVENT AFTER THE OWL CAROUSEL SLIDER HAS BEEN INITIALIZED.
|
1142 |
+
$output .= ' var resize_' . $id . " = jQuery('.owl-carousel');\n";
|
1143 |
+
$output .= ' resize_' . $id . ".on('initialized.owl.carousel', function(e) {\n";
|
1144 |
+
$output .= " if (typeof(Event) === 'function') {\n";
|
1145 |
+
// modern browsers.
|
1146 |
+
$output .= " window.dispatchEvent(new Event('resize'));\n";
|
1147 |
+
$output .= " } else {\n";
|
1148 |
+
// for IE and other old browsers (causes deprecation warning on modern browsers).
|
1149 |
+
$output .= " var evt = window.document.createEvent('UIEvents');\n";
|
1150 |
+
$output .= " evt.initUIEvent('resize', true, false, window, 0);\n";
|
1151 |
+
$output .= " window.dispatchEvent(evt);\n";
|
1152 |
+
$output .= " }\n";
|
1153 |
+
$output .= " });\n";
|
1154 |
+
$output .= " });\n";
|
1155 |
+
$output .= "</script>\n";
|
1156 |
+
|
1157 |
+
// ### GENERATE JQUERY CODE FOR THE MAGNIFIC POPUP ###
|
1158 |
+
if ( ( $sa_pro_version ) && ( $lightbox_count > 0 ) ) {
|
1159 |
+
$output .= "<script type='text/javascript'>\n";
|
1160 |
+
if ( '1' === $slide_data['sa_window_onload'] ) {
|
1161 |
+
$output .= "document.addEventListener('DOMContentLoaded', function() {\n";
|
1162 |
+
} else {
|
1163 |
+
$output .= "jQuery(document).ready(function() {\n";
|
1164 |
+
}
|
1165 |
+
$output .= " jQuery('#" . $lightbox_gallery_id . "').magnificPopup({\n";
|
1166 |
+
$output .= " items: [\n";
|
1167 |
+
$count = 0;
|
1168 |
+
for ( $i = 1; $i <= $slide_data['num_slides']; $i++ ) {
|
1169 |
+
// LOOP THROUGH EACH SLIDE.
|
1170 |
+
if ( ( 'IMAGE' === $slide_data[ 'slide' . $i . '_popup_type' ] ) && ( '' !== $slide_data[ 'slide' . $i . '_popup_image' ] ) ) {
|
1171 |
+
// SLIDE CONTAINS AN IMAGE POPUP.
|
1172 |
+
$img_url = $slide_data[ 'slide' . $i . '_popup_image' ];
|
1173 |
+
$img_title = $slide_data[ 'slide' . $i . '_popup_imagetitle' ];
|
1174 |
+
if ( '' !== $img_title ) {
|
1175 |
+
$output .= " { src: '" . esc_attr( $img_url ) . "', title: '" . esc_attr( $img_title ) . "' }";
|
1176 |
+
} else {
|
1177 |
+
$output .= " { src: '" . esc_attr( $img_url ) . "' }";
|
1178 |
+
}
|
1179 |
+
$count++;
|
1180 |
+
if ( $count < $lightbox_count ) {
|
1181 |
+
$output .= ",\n"; } else {
|
1182 |
+
$output .= "\n"; }
|
1183 |
+
}
|
1184 |
+
if ( ( 'VIDEO' === $slide_data[ 'slide' . $i . '_popup_type' ] ) && ( '' !== $slide_data[ 'slide' . $i . '_popup_video_id' ] ) ) {
|
1185 |
+
// SLIDE CONTAINS A VIDEO POPUP.
|
1186 |
+
$video_id = $slide_data[ 'slide' . $i . '_popup_video_id' ];
|
1187 |
+
$video_type = $slide_data[ 'slide' . $i . '_popup_video_type' ];
|
1188 |
+
if ( 'youtube' === $video_type ) {
|
1189 |
+
$video_url = 'http://www.youtube.com/watch?v=' . $video_id;
|
1190 |
+
} elseif ( 'vimeo' === $video_type ) {
|
1191 |
+
$video_url = 'http://vimeo.com/' . $video_id;
|
1192 |
+
}
|
1193 |
+
$output .= " { src: '" . esc_attr( $video_url ) . "', type: 'iframe' }";
|
1194 |
+
$count++;
|
1195 |
+
if ( $count < $lightbox_count ) {
|
1196 |
+
$output .= ",\n"; } else {
|
1197 |
+
$output .= "\n"; }
|
1198 |
+
}
|
1199 |
+
if ( 'HTML' === $slide_data[ 'slide' . $i . '_popup_type' ] ) {
|
1200 |
+
// SLIDE CONTAINS A HTML POPUP.
|
1201 |
+
$popup_css_id = '#' . $slide_data[ 'slide' . $i . '_popup_css_id' ];
|
1202 |
+
$output .= " { src: '" . esc_attr( $popup_css_id ) . "', type: 'inline' }";
|
1203 |
+
$count++;
|
1204 |
+
if ( $count < $lightbox_count ) {
|
1205 |
+
$output .= ",\n"; } else {
|
1206 |
+
$output .= "\n"; }
|
1207 |
+
}
|
1208 |
+
}
|
1209 |
+
$output .= " ],\n";
|
1210 |
+
$output .= " gallery: { enabled: true, tCounter: '' },\n";
|
1211 |
+
$output .= " mainClass: 'sa_popup',\n";
|
1212 |
+
$output .= " closeBtnInside: true,\n";
|
1213 |
+
$output .= " fixedContentPos: true,\n";
|
1214 |
+
if ( 0 !== $slide_data['slide_duration'] ) {
|
1215 |
+
$output .= " callbacks: {\n";
|
1216 |
+
$output .= " open: function() {\n";
|
1217 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "').trigger('stop.owl.autoplay');\n";
|
1218 |
+
$output .= " },\n";
|
1219 |
+
$output .= " close: function() {\n";
|
1220 |
+
$output .= " jQuery('#" . esc_attr( $slide_data['css_id'] ) . "').trigger('play.owl.autoplay');\n";
|
1221 |
+
$output .= " }\n";
|
1222 |
+
$output .= " },\n";
|
1223 |
+
}
|
1224 |
+
$output .= " type: 'image'\n";
|
1225 |
+
$output .= " });\n";
|
1226 |
+
$output .= "});\n";
|
1227 |
+
|
1228 |
+
// JAVASCRIPT FUNCTION WHICH OPENS THIS MAGNIFIC POPUP ON A SPECIFIED SLIDE.
|
1229 |
+
$output .= 'function ' . $lightbox_function . "(slide) {\n";
|
1230 |
+
$output .= " jQuery('#" . $lightbox_gallery_id . "').magnificPopup('open');\n";
|
1231 |
+
$output .= " jQuery('#" . $lightbox_gallery_id . "').magnificPopup('goTo', slide-1);\n";
|
1232 |
+
$output .= "}\n";
|
1233 |
+
$output .= "</script>\n";
|
1234 |
+
|
1235 |
+
// DIV CONTAINER WHICH HOLDS THIS MAGNIFIC POPUP CONTENT (HIDDEN).
|
1236 |
+
$output .= "<div id='" . $lightbox_gallery_id . "' style='display:none;'></div>\n";
|
1237 |
+
}
|
1238 |
+
}
|
1239 |
+
}
|
1240 |
+
return $output;
|
1241 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -98,6 +98,9 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
|
|
98 |
|
99 |
== Changelog ==
|
100 |
|
|
|
|
|
|
|
101 |
= 2.3.47 =
|
102 |
* Fixed a security vulnerability whereby XSS scripts could be inserted within the slider post titles (part 2)
|
103 |
|
@@ -776,3 +779,6 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
|
|
776 |
|
777 |
= 2.3.47 =
|
778 |
* Fixed a security vulnerability whereby XSS scripts could be inserted within the slider post titles (part 2)
|
|
|
|
|
|
98 |
|
99 |
== Changelog ==
|
100 |
|
101 |
+
= 2.4.0 =
|
102 |
+
* Updated all PHP code within the plugin to meet the WordPress.org security and coding standards.
|
103 |
+
|
104 |
= 2.3.47 =
|
105 |
* Fixed a security vulnerability whereby XSS scripts could be inserted within the slider post titles (part 2)
|
106 |
|
779 |
|
780 |
= 2.3.47 =
|
781 |
* Fixed a security vulnerability whereby XSS scripts could be inserted within the slider post titles (part 2)
|
782 |
+
|
783 |
+
= 2.4.0 =
|
784 |
+
* Updated all PHP code within the plugin to meet the WordPress.org security and coding standards.
|
slide-anything.php
CHANGED
@@ -1,44 +1,49 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: Slide Anything - Responsive Content / HTML Slider and Carousel
|
4 |
-
* Plugin URI: https://wordpress.org/plugins/slide-anything/
|
5 |
-
* Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
|
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 |
-
add_action('
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Slide Anything - Responsive Content / HTML Slider and Carousel
|
4 |
+
* Plugin URI: https://wordpress.org/plugins/slide-anything/
|
5 |
+
* Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
|
6 |
+
* Version: 2.4.0
|
7 |
+
*
|
8 |
+
* @package WordPress_Slide_Anything
|
9 |
+
* @author Simon Edge
|
10 |
+
* @copyright EdgeWebPages
|
11 |
+
* @license GPLv2 or later
|
12 |
+
*/
|
13 |
+
|
14 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
15 |
+
exit; // EXIT IF ACCESSED DIRECTLY.
|
16 |
+
}
|
17 |
+
|
18 |
+
// SET CONSTANT FOR PLUGIN PATH.
|
19 |
+
define( 'SA_PLUGIN_PATH', plugins_url( '/', __FILE__ ) );
|
20 |
+
|
21 |
+
require 'php/slide-anything-admin.php';
|
22 |
+
require 'php/slide-anything-frontend.php';
|
23 |
+
|
24 |
+
/* ##### PLUGIN ACTIVATION HOOK ##### */
|
25 |
+
register_activation_hook( __FILE__, 'cpt_slider_plugin_activation' );
|
26 |
+
|
27 |
+
/* ##### ADD ACTION HOOKS & FILTERS FOR PLUGIN ##### */
|
28 |
+
add_action( 'admin_enqueue_scripts', 'cpt_register_admin_scripts', 999999 );
|
29 |
+
add_action( 'init', 'cpt_slider_register' );
|
30 |
+
add_action( 'post_row_actions', 'cpt_slider_row_actions', 10, 2 );
|
31 |
+
add_action( 'add_meta_boxes', 'cpt_slider_add_meta_boxes' );
|
32 |
+
add_action( 'save_post', 'cpt_slider_save_postdata' );
|
33 |
+
add_filter( 'manage_sa_slider_posts_columns', 'cpt_slider_modify_columns' );
|
34 |
+
add_filter( 'manage_sa_slider_posts_custom_column', 'cpt_slider_custom_column_content' );
|
35 |
+
if ( ! get_option( 'sa-disable-tinymce-button' ) ) {
|
36 |
+
add_action( 'admin_head', 'add_tinymce_button' );
|
37 |
+
add_action( 'admin_footer', 'get_tinymce_shortcode_array', 9999999 );
|
38 |
+
}
|
39 |
+
add_action( 'admin_menu', 'extra_sa_menu_pages' );
|
40 |
+
add_filter( 'template_include', 'sa_preview_page_template' );
|
41 |
+
add_filter( 'wp_kses_allowed_html', 'slides_allow_iframes_filter' );
|
42 |
+
|
43 |
+
// SLIDE ANYTHING 2.0 UPGRADE NOTICE.
|
44 |
+
add_action( 'admin_notices', 'version_20_upgrade_notice' );
|
45 |
+
add_action( 'admin_init', 'slide_anything_notice_ignore' );
|
46 |
+
|
47 |
+
// ADD A CHECKBOX OPTION UNDER 'Settings -> Writing' CALLED 'Disable TinyMCE Button'.
|
48 |
+
add_action( 'admin_init', 'slide_anything_disable_tinymce_button_setting' );
|
49 |
+
|