Version Description
- Fixed: Removed empty "filter_search_name" from lightbox URL.
- Fixed: Don't add Facebook/Instagram libraries if there is no need.
- Added: Image quality (optional).
Download this release
Release Info
Developer | webdorado |
Plugin | Photo Gallery by WD – Responsive Photo Gallery |
Version | 1.3.39 |
Comparing to | |
See all releases |
Code changes from version 1.3.38 to 1.3.39
- admin/controllers/BWGControllerGalleries_bwg.php +10 -8
- admin/controllers/BWGControllerOptions_bwg.php +2 -2
- admin/models/BWGModelUninstall_bwg.php +1 -0
- admin/views/BWGViewEditThumb.php +24 -22
- admin/views/BWGViewOptions_bwg.php +9 -0
- filemanager/UploadHandler.php +7 -15
- framework/BWGOptions.php +5 -2
- framework/WDWLibrary.php +18 -9
- frontend/views/BWGViewAlbum_compact_preview.php +2 -2
- frontend/views/BWGViewAlbum_extended_preview.php +2 -2
- frontend/views/BWGViewImage_browser.php +2 -2
- frontend/views/BWGViewSlideshow.php +36 -34
- frontend/views/BWGViewThumbnails.php +2 -2
- js/bwg_frontend.js +3 -2
- photo-gallery.php +8 -8
- readme.txt +6 -1
admin/controllers/BWGControllerGalleries_bwg.php
CHANGED
@@ -265,6 +265,7 @@ class BWGControllerGalleries_bwg {
|
|
265 |
}
|
266 |
|
267 |
function bwg_scaled_image($file_path, $max_width = 0, $max_height = 0, $crop = FALSE) {
|
|
|
268 |
$file_path = htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES);
|
269 |
if (!function_exists('getimagesize')) {
|
270 |
error_log('Function not found: getimagesize');
|
@@ -314,7 +315,7 @@ class BWGControllerGalleries_bwg {
|
|
314 |
case 2:
|
315 |
$src_img = @imagecreatefromjpeg($file_path);
|
316 |
$write_image = 'imagejpeg';
|
317 |
-
$image_quality =
|
318 |
break;
|
319 |
case 1:
|
320 |
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
@@ -328,7 +329,7 @@ class BWGControllerGalleries_bwg {
|
|
328 |
@imagesavealpha($new_img, TRUE);
|
329 |
$src_img = @imagecreatefrompng($file_path);
|
330 |
$write_image = 'imagepng';
|
331 |
-
$image_quality =
|
332 |
break;
|
333 |
default:
|
334 |
$src_img = NULL;
|
@@ -806,7 +807,7 @@ class BWGControllerGalleries_bwg {
|
|
806 |
case 2:
|
807 |
$src_img = @imagecreatefromjpeg($file_path);
|
808 |
$write_image = 'imagejpeg';
|
809 |
-
$image_quality =
|
810 |
break;
|
811 |
case 1:
|
812 |
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
@@ -820,7 +821,7 @@ class BWGControllerGalleries_bwg {
|
|
820 |
@imagesavealpha($new_img, true);
|
821 |
$src_img = @imagecreatefrompng($file_path);
|
822 |
$write_image = 'imagepng';
|
823 |
-
$image_quality =
|
824 |
break;
|
825 |
default:
|
826 |
$src_img = null;
|
@@ -863,6 +864,7 @@ class BWGControllerGalleries_bwg {
|
|
863 |
public function rotate($edit_type) {
|
864 |
global $WD_BWG_UPLOAD_DIR;
|
865 |
global $wpdb;
|
|
|
866 |
$flag = FALSE;
|
867 |
$gallery_id = ((isset($_POST['current_id'])) ? esc_html(stripslashes($_POST['current_id'])) : 0);
|
868 |
$images_data = $wpdb->get_results($wpdb->prepare('SELECT id, image_url, thumb_url FROM ' . $wpdb->prefix . 'bwg_image WHERE gallery_id="%d"', $gallery_id));
|
@@ -880,8 +882,8 @@ class BWGControllerGalleries_bwg {
|
|
880 |
$thumb_source = imagecreatefromjpeg($thumb_filename);
|
881 |
$rotate = imagerotate($source, $edit_type, 0);
|
882 |
$thumb_rotate = imagerotate($thumb_source, $edit_type, 0);
|
883 |
-
imagejpeg($thumb_rotate, $thumb_filename,
|
884 |
-
imagejpeg($rotate, $filename,
|
885 |
imagedestroy($source);
|
886 |
imagedestroy($rotate);
|
887 |
imagedestroy($thumb_source);
|
@@ -900,8 +902,8 @@ class BWGControllerGalleries_bwg {
|
|
900 |
imagealphablending($thumb_rotate, FALSE);
|
901 |
imagesavealpha($rotate, TRUE);
|
902 |
imagesavealpha($thumb_rotate, TRUE);
|
903 |
-
imagepng($rotate, $filename,
|
904 |
-
imagepng($thumb_rotate, $thumb_filename,
|
905 |
imagedestroy($source);
|
906 |
imagedestroy($rotate);
|
907 |
imagedestroy($thumb_source);
|
265 |
}
|
266 |
|
267 |
function bwg_scaled_image($file_path, $max_width = 0, $max_height = 0, $crop = FALSE) {
|
268 |
+
global $wd_bwg_options;
|
269 |
$file_path = htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES);
|
270 |
if (!function_exists('getimagesize')) {
|
271 |
error_log('Function not found: getimagesize');
|
315 |
case 2:
|
316 |
$src_img = @imagecreatefromjpeg($file_path);
|
317 |
$write_image = 'imagejpeg';
|
318 |
+
$image_quality = $wd_bwg_options->jpeg_quality;
|
319 |
break;
|
320 |
case 1:
|
321 |
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
329 |
@imagesavealpha($new_img, TRUE);
|
330 |
$src_img = @imagecreatefrompng($file_path);
|
331 |
$write_image = 'imagepng';
|
332 |
+
$image_quality = $wd_bwg_options->png_quality;
|
333 |
break;
|
334 |
default:
|
335 |
$src_img = NULL;
|
807 |
case 2:
|
808 |
$src_img = @imagecreatefromjpeg($file_path);
|
809 |
$write_image = 'imagejpeg';
|
810 |
+
$image_quality = $wd_bwg_options->jpeg_quality;
|
811 |
break;
|
812 |
case 1:
|
813 |
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
821 |
@imagesavealpha($new_img, true);
|
822 |
$src_img = @imagecreatefrompng($file_path);
|
823 |
$write_image = 'imagepng';
|
824 |
+
$image_quality = $wd_bwg_options->png_quality;
|
825 |
break;
|
826 |
default:
|
827 |
$src_img = null;
|
864 |
public function rotate($edit_type) {
|
865 |
global $WD_BWG_UPLOAD_DIR;
|
866 |
global $wpdb;
|
867 |
+
global $wd_bwg_options;
|
868 |
$flag = FALSE;
|
869 |
$gallery_id = ((isset($_POST['current_id'])) ? esc_html(stripslashes($_POST['current_id'])) : 0);
|
870 |
$images_data = $wpdb->get_results($wpdb->prepare('SELECT id, image_url, thumb_url FROM ' . $wpdb->prefix . 'bwg_image WHERE gallery_id="%d"', $gallery_id));
|
882 |
$thumb_source = imagecreatefromjpeg($thumb_filename);
|
883 |
$rotate = imagerotate($source, $edit_type, 0);
|
884 |
$thumb_rotate = imagerotate($thumb_source, $edit_type, 0);
|
885 |
+
imagejpeg($thumb_rotate, $thumb_filename, $wd_bwg_options->jpeg_quality);
|
886 |
+
imagejpeg($rotate, $filename, $wd_bwg_options->jpeg_quality);
|
887 |
imagedestroy($source);
|
888 |
imagedestroy($rotate);
|
889 |
imagedestroy($thumb_source);
|
902 |
imagealphablending($thumb_rotate, FALSE);
|
903 |
imagesavealpha($rotate, TRUE);
|
904 |
imagesavealpha($thumb_rotate, TRUE);
|
905 |
+
imagepng($rotate, $filename, $wd_bwg_options->png_quality);
|
906 |
+
imagepng($thumb_rotate, $thumb_filename, $wd_bwg_options->png_quality);
|
907 |
imagedestroy($source);
|
908 |
imagedestroy($rotate);
|
909 |
imagedestroy($thumb_source);
|
admin/controllers/BWGControllerOptions_bwg.php
CHANGED
@@ -152,7 +152,7 @@ class BWGControllerOptions_bwg {
|
|
152 |
case 2:
|
153 |
$src_img = @imagecreatefromjpeg($file_path);
|
154 |
$write_image = 'imagejpeg';
|
155 |
-
$image_quality =
|
156 |
break;
|
157 |
case 1:
|
158 |
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
@@ -166,7 +166,7 @@ class BWGControllerOptions_bwg {
|
|
166 |
@imagesavealpha($new_img, true);
|
167 |
$src_img = @imagecreatefrompng($file_path);
|
168 |
$write_image = 'imagepng';
|
169 |
-
$image_quality =
|
170 |
break;
|
171 |
default:
|
172 |
$src_img = null;
|
152 |
case 2:
|
153 |
$src_img = @imagecreatefromjpeg($file_path);
|
154 |
$write_image = 'imagejpeg';
|
155 |
+
$image_quality = $wd_bwg_options->jpeg_quality;
|
156 |
break;
|
157 |
case 1:
|
158 |
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
166 |
@imagesavealpha($new_img, true);
|
167 |
$src_img = @imagecreatefrompng($file_path);
|
168 |
$write_image = 'imagepng';
|
169 |
+
$image_quality = $wd_bwg_options->png_quality;
|
170 |
break;
|
171 |
default:
|
172 |
$src_img = null;
|
admin/models/BWGModelUninstall_bwg.php
CHANGED
@@ -32,6 +32,7 @@ class BWGModelUninstall_bwg {
|
|
32 |
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "bwg_shortcode");
|
33 |
delete_option("wd_bwg_version");
|
34 |
delete_option("bwg_subscribe_done");
|
|
|
35 |
delete_user_meta(get_current_user_id(), 'bwg_photo_gallery');
|
36 |
if (isset($_COOKIE['bwg_image_asc_or_desc'])) {
|
37 |
$_COOKIE['bwg_image_asc_or_desc'] = '';
|
32 |
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "bwg_shortcode");
|
33 |
delete_option("wd_bwg_version");
|
34 |
delete_option("bwg_subscribe_done");
|
35 |
+
delete_option("wd_bwg_options");
|
36 |
delete_user_meta(get_current_user_id(), 'bwg_photo_gallery');
|
37 |
if (isset($_COOKIE['bwg_image_asc_or_desc'])) {
|
38 |
$_COOKIE['bwg_image_asc_or_desc'] = '';
|
admin/views/BWGViewEditThumb.php
CHANGED
@@ -135,7 +135,7 @@ class BWGViewEditThumb {
|
|
135 |
$img_r = imagecreatefromjpeg($filename);
|
136 |
$dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
|
137 |
imagecopyresampled($dst_r, $img_r, 0, 0, $x, $y, $thumb_width, $thumb_height, $w, $h);
|
138 |
-
imagejpeg($dst_r, $thumb_filename,
|
139 |
imagedestroy($img_r);
|
140 |
imagedestroy($dst_r);
|
141 |
}
|
@@ -148,7 +148,7 @@ class BWGViewEditThumb {
|
|
148 |
imagecopyresampled($dst_r, $img_r, 0, 0, $x, $y, $thumb_width, $thumb_height, $w, $h);
|
149 |
imagealphablending($dst_r, FALSE);
|
150 |
imagesavealpha($dst_r, TRUE);
|
151 |
-
imagepng($dst_r, $thumb_filename,
|
152 |
imagedestroy($img_r);
|
153 |
imagedestroy($dst_r);
|
154 |
}
|
@@ -346,10 +346,11 @@ class BWGViewEditThumb {
|
|
346 |
<?php
|
347 |
die();
|
348 |
}
|
349 |
-
|
350 |
public function recover_image($id, $thumb_width, $thumb_height) {
|
351 |
global $WD_BWG_UPLOAD_DIR;
|
352 |
global $wpdb;
|
|
|
353 |
$image_data = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE id="%d"', $id));
|
354 |
if (!$image_data) {
|
355 |
$image_data = new stdClass();
|
@@ -367,7 +368,7 @@ class BWGViewEditThumb {
|
|
367 |
$img_r = imagecreatefromjpeg($filename);
|
368 |
$dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
|
369 |
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $thumb_width, $thumb_height, $width_orig, $height_orig);
|
370 |
-
imagejpeg($dst_r, $thumb_filename,
|
371 |
imagedestroy($img_r);
|
372 |
imagedestroy($dst_r);
|
373 |
}
|
@@ -380,7 +381,7 @@ class BWGViewEditThumb {
|
|
380 |
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $thumb_width, $thumb_height, $width_orig, $height_orig);
|
381 |
imagealphablending($dst_r, FALSE);
|
382 |
imagesavealpha($dst_r, TRUE);
|
383 |
-
imagepng($dst_r, $thumb_filename,
|
384 |
imagedestroy($img_r);
|
385 |
imagedestroy($dst_r);
|
386 |
}
|
@@ -399,9 +400,10 @@ class BWGViewEditThumb {
|
|
399 |
}
|
400 |
@ini_restore('memory_limit');
|
401 |
}
|
402 |
-
|
403 |
public function rotate() {
|
404 |
global $WD_BWG_UPLOAD_DIR;
|
|
|
405 |
$popup_width = ((int) (isset($_GET['width']) ? esc_html($_GET['width']) : '650')) - 30;
|
406 |
$image_width = $popup_width - 40;
|
407 |
$popup_height = ((int) (isset($_GET['height']) ? esc_html($_GET['height']) : '500')) - 55;
|
@@ -434,8 +436,8 @@ class BWGViewEditThumb {
|
|
434 |
$thumb_source = imagecreatefromjpeg($thumb_filename);
|
435 |
$rotate = imagerotate($source, $edit_type, 0);
|
436 |
$thumb_rotate = imagerotate($thumb_source, $edit_type, 0);
|
437 |
-
imagejpeg($thumb_rotate, $thumb_filename,
|
438 |
-
imagejpeg($rotate, $filename,
|
439 |
imagedestroy($source);
|
440 |
imagedestroy($rotate);
|
441 |
imagedestroy($thumb_source);
|
@@ -454,8 +456,8 @@ class BWGViewEditThumb {
|
|
454 |
imagealphablending($thumb_rotate, FALSE);
|
455 |
imagesavealpha($rotate, TRUE);
|
456 |
imagesavealpha($thumb_rotate, TRUE);
|
457 |
-
imagepng($rotate, $filename,
|
458 |
-
imagepng($thumb_rotate, $thumb_filename,
|
459 |
imagedestroy($source);
|
460 |
imagedestroy($rotate);
|
461 |
imagedestroy($thumb_source);
|
@@ -523,10 +525,10 @@ class BWGViewEditThumb {
|
|
523 |
if ($type_rotate == 2) {
|
524 |
$source = imagecreatefromjpeg($filename);
|
525 |
$flip = bwg_image_flip($source, $edit_type);
|
526 |
-
imagejpeg($flip, $filename,
|
527 |
$thumb_source = imagecreatefromjpeg($thumb_filename);
|
528 |
$thumb_flip = bwg_image_flip($thumb_source, $edit_type);
|
529 |
-
imagejpeg($thumb_flip, $thumb_filename,
|
530 |
imagedestroy($source);
|
531 |
imagedestroy($flip);
|
532 |
imagedestroy($thumb_source);
|
@@ -545,8 +547,8 @@ class BWGViewEditThumb {
|
|
545 |
imagealphablending($thumb_flip, FALSE);
|
546 |
imagesavealpha($flip, TRUE);
|
547 |
imagesavealpha($thumb_flip, TRUE);
|
548 |
-
imagepng($flip, $filename,
|
549 |
-
imagepng($thumb_flip, $thumb_filename,
|
550 |
imagedestroy($source);
|
551 |
imagedestroy($flip);
|
552 |
imagedestroy($thumb_source);
|
@@ -612,8 +614,8 @@ class BWGViewEditThumb {
|
|
612 |
$thumb_source = imagecreatefromjpeg($thumb_filename);
|
613 |
imagefilter($source, $img_filter_type, $ratio);
|
614 |
imagefilter($thumb_source, $img_filter_type, $ratio);
|
615 |
-
imagejpeg($source, $filename,
|
616 |
-
imagejpeg($thumb_source, $thumb_filename,
|
617 |
imagedestroy($source);
|
618 |
imagedestroy($thumb_source);
|
619 |
}
|
@@ -626,8 +628,8 @@ class BWGViewEditThumb {
|
|
626 |
imagesavealpha($thumb_source, TRUE);
|
627 |
imagefilter($source, $img_filter_type, $ratio);
|
628 |
imagefilter($thumb_source, $img_filter_type, $ratio);
|
629 |
-
imagepng($source, $filename,
|
630 |
-
imagepng($thumb_source, $thumb_filename,
|
631 |
imagedestroy($source);
|
632 |
imagedestroy($thumb_source);
|
633 |
}
|
@@ -675,8 +677,8 @@ class BWGViewEditThumb {
|
|
675 |
$thumb_source = imagecreatefromjpeg($thumb_filename);
|
676 |
imagefilter($source, $img_filter_type, $red, $green, $blue);
|
677 |
imagefilter($thumb_source, $img_filter_type, $red, $green, $blue);
|
678 |
-
imagejpeg($source, $filename,
|
679 |
-
imagejpeg($thumb_source, $thumb_filename,
|
680 |
imagedestroy($source);
|
681 |
imagedestroy($thumb_source);
|
682 |
}
|
@@ -689,8 +691,8 @@ class BWGViewEditThumb {
|
|
689 |
imagesavealpha($thumb_source, TRUE);
|
690 |
imagefilter($source, $img_filter_type, $red, $green, $blue);
|
691 |
imagefilter($thumb_source, $img_filter_type, $red, $green, $blue);
|
692 |
-
imagepng($source, $filename,
|
693 |
-
imagepng($thumb_source, $thumb_filename,
|
694 |
imagedestroy($source);
|
695 |
imagedestroy($thumb_source);
|
696 |
}
|
135 |
$img_r = imagecreatefromjpeg($filename);
|
136 |
$dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
|
137 |
imagecopyresampled($dst_r, $img_r, 0, 0, $x, $y, $thumb_width, $thumb_height, $w, $h);
|
138 |
+
imagejpeg($dst_r, $thumb_filename, $wd_bwg_options->jpeg_quality);
|
139 |
imagedestroy($img_r);
|
140 |
imagedestroy($dst_r);
|
141 |
}
|
148 |
imagecopyresampled($dst_r, $img_r, 0, 0, $x, $y, $thumb_width, $thumb_height, $w, $h);
|
149 |
imagealphablending($dst_r, FALSE);
|
150 |
imagesavealpha($dst_r, TRUE);
|
151 |
+
imagepng($dst_r, $thumb_filename, $wd_bwg_options->png_quality);
|
152 |
imagedestroy($img_r);
|
153 |
imagedestroy($dst_r);
|
154 |
}
|
346 |
<?php
|
347 |
die();
|
348 |
}
|
349 |
+
|
350 |
public function recover_image($id, $thumb_width, $thumb_height) {
|
351 |
global $WD_BWG_UPLOAD_DIR;
|
352 |
global $wpdb;
|
353 |
+
global $wd_bwg_options;
|
354 |
$image_data = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE id="%d"', $id));
|
355 |
if (!$image_data) {
|
356 |
$image_data = new stdClass();
|
368 |
$img_r = imagecreatefromjpeg($filename);
|
369 |
$dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
|
370 |
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $thumb_width, $thumb_height, $width_orig, $height_orig);
|
371 |
+
imagejpeg($dst_r, $thumb_filename, $wd_bwg_options->jpeg_quality);
|
372 |
imagedestroy($img_r);
|
373 |
imagedestroy($dst_r);
|
374 |
}
|
381 |
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $thumb_width, $thumb_height, $width_orig, $height_orig);
|
382 |
imagealphablending($dst_r, FALSE);
|
383 |
imagesavealpha($dst_r, TRUE);
|
384 |
+
imagepng($dst_r, $thumb_filename, $wd_bwg_options->png_quality);
|
385 |
imagedestroy($img_r);
|
386 |
imagedestroy($dst_r);
|
387 |
}
|
400 |
}
|
401 |
@ini_restore('memory_limit');
|
402 |
}
|
403 |
+
|
404 |
public function rotate() {
|
405 |
global $WD_BWG_UPLOAD_DIR;
|
406 |
+
global $wd_bwg_options;
|
407 |
$popup_width = ((int) (isset($_GET['width']) ? esc_html($_GET['width']) : '650')) - 30;
|
408 |
$image_width = $popup_width - 40;
|
409 |
$popup_height = ((int) (isset($_GET['height']) ? esc_html($_GET['height']) : '500')) - 55;
|
436 |
$thumb_source = imagecreatefromjpeg($thumb_filename);
|
437 |
$rotate = imagerotate($source, $edit_type, 0);
|
438 |
$thumb_rotate = imagerotate($thumb_source, $edit_type, 0);
|
439 |
+
imagejpeg($thumb_rotate, $thumb_filename, $wd_bwg_options->jpeg_quality);
|
440 |
+
imagejpeg($rotate, $filename, $wd_bwg_options->jpeg_quality);
|
441 |
imagedestroy($source);
|
442 |
imagedestroy($rotate);
|
443 |
imagedestroy($thumb_source);
|
456 |
imagealphablending($thumb_rotate, FALSE);
|
457 |
imagesavealpha($rotate, TRUE);
|
458 |
imagesavealpha($thumb_rotate, TRUE);
|
459 |
+
imagepng($rotate, $filename, $wd_bwg_options->png_quality);
|
460 |
+
imagepng($thumb_rotate, $thumb_filename, $wd_bwg_options->png_quality);
|
461 |
imagedestroy($source);
|
462 |
imagedestroy($rotate);
|
463 |
imagedestroy($thumb_source);
|
525 |
if ($type_rotate == 2) {
|
526 |
$source = imagecreatefromjpeg($filename);
|
527 |
$flip = bwg_image_flip($source, $edit_type);
|
528 |
+
imagejpeg($flip, $filename, $wd_bwg_options->jpeg_quality);
|
529 |
$thumb_source = imagecreatefromjpeg($thumb_filename);
|
530 |
$thumb_flip = bwg_image_flip($thumb_source, $edit_type);
|
531 |
+
imagejpeg($thumb_flip, $thumb_filename, $wd_bwg_options->jpeg_quality);
|
532 |
imagedestroy($source);
|
533 |
imagedestroy($flip);
|
534 |
imagedestroy($thumb_source);
|
547 |
imagealphablending($thumb_flip, FALSE);
|
548 |
imagesavealpha($flip, TRUE);
|
549 |
imagesavealpha($thumb_flip, TRUE);
|
550 |
+
imagepng($flip, $filename, $wd_bwg_options->png_quality);
|
551 |
+
imagepng($thumb_flip, $thumb_filename, $wd_bwg_options->png_quality);
|
552 |
imagedestroy($source);
|
553 |
imagedestroy($flip);
|
554 |
imagedestroy($thumb_source);
|
614 |
$thumb_source = imagecreatefromjpeg($thumb_filename);
|
615 |
imagefilter($source, $img_filter_type, $ratio);
|
616 |
imagefilter($thumb_source, $img_filter_type, $ratio);
|
617 |
+
imagejpeg($source, $filename, $wd_bwg_options->jpeg_quality);
|
618 |
+
imagejpeg($thumb_source, $thumb_filename, $wd_bwg_options->jpeg_quality);
|
619 |
imagedestroy($source);
|
620 |
imagedestroy($thumb_source);
|
621 |
}
|
628 |
imagesavealpha($thumb_source, TRUE);
|
629 |
imagefilter($source, $img_filter_type, $ratio);
|
630 |
imagefilter($thumb_source, $img_filter_type, $ratio);
|
631 |
+
imagepng($source, $filename, $wd_bwg_options->png_quality);
|
632 |
+
imagepng($thumb_source, $thumb_filename, $wd_bwg_options->png_quality);
|
633 |
imagedestroy($source);
|
634 |
imagedestroy($thumb_source);
|
635 |
}
|
677 |
$thumb_source = imagecreatefromjpeg($thumb_filename);
|
678 |
imagefilter($source, $img_filter_type, $red, $green, $blue);
|
679 |
imagefilter($thumb_source, $img_filter_type, $red, $green, $blue);
|
680 |
+
imagejpeg($source, $filename, $wd_bwg_options->jpeg_quality);
|
681 |
+
imagejpeg($thumb_source, $thumb_filename, $wd_bwg_options->jpeg_quality);
|
682 |
imagedestroy($source);
|
683 |
imagedestroy($thumb_source);
|
684 |
}
|
691 |
imagesavealpha($thumb_source, TRUE);
|
692 |
imagefilter($source, $img_filter_type, $red, $green, $blue);
|
693 |
imagefilter($thumb_source, $img_filter_type, $red, $green, $blue);
|
694 |
+
imagepng($source, $filename, $wd_bwg_options->png_quality);
|
695 |
+
imagepng($thumb_source, $thumb_filename, $wd_bwg_options->png_quality);
|
696 |
imagedestroy($source);
|
697 |
imagedestroy($thumb_source);
|
698 |
}
|
admin/views/BWGViewOptions_bwg.php
CHANGED
@@ -1226,6 +1226,15 @@ class BWGViewOptions_bwg {
|
|
1226 |
<div class="spider_description"><?php _e("The maximum size of the uploaded image (0 for original size).", 'bwg_back'); ?></div>
|
1227 |
</td>
|
1228 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1229 |
<tr>
|
1230 |
<td class="spider_label_options">
|
1231 |
<label><?php _e("Right click protection:", 'bwg_back'); ?></label>
|
1226 |
<div class="spider_description"><?php _e("The maximum size of the uploaded image (0 for original size).", 'bwg_back'); ?></div>
|
1227 |
</td>
|
1228 |
</tr>
|
1229 |
+
<tr>
|
1230 |
+
<td class="spider_label_options">
|
1231 |
+
<label for="image_quality"><?php _e('Image quality:', 'bwg_back'); ?></label>
|
1232 |
+
</td>
|
1233 |
+
<td>
|
1234 |
+
<input type="text" name="image_quality" id="image_quality" value="<?php echo $row->image_quality; ?>" class="spider_int_input" /> %
|
1235 |
+
<div class="spider_description"><?php _e('Set the quality of gallery images. Provide a value from 0 to 100%.', 'bwg_back'); ?></div>
|
1236 |
+
</td>
|
1237 |
+
</tr>
|
1238 |
<tr>
|
1239 |
<td class="spider_label_options">
|
1240 |
<label><?php _e("Right click protection:", 'bwg_back'); ?></label>
|
filemanager/UploadHandler.php
CHANGED
@@ -104,32 +104,23 @@ class bwg_UploadHandler {
|
|
104 |
$this->options['max_width'] = NULL;
|
105 |
$this->options['max_height'] = NULL;
|
106 |
}
|
|
|
107 |
$this->options += array(
|
108 |
'image_versions' => array(
|
109 |
-
// Uncomment the following to create medium sized images:
|
110 |
-
/*
|
111 |
-
'medium' => array(
|
112 |
-
'max_width' => 800,
|
113 |
-
'max_height' => 600,
|
114 |
-
'jpeg_quality' => 80
|
115 |
-
),
|
116 |
-
*/
|
117 |
'.original' => array(
|
118 |
'max_width' => NULL,
|
119 |
'max_height' => NULL,
|
120 |
-
'jpeg_quality' =>
|
121 |
),
|
122 |
-
|
123 |
'' => array(
|
124 |
'max_width' => $this->options['max_width'],
|
125 |
'max_height' => $this->options['max_height'],
|
126 |
-
'jpeg_quality' =>
|
127 |
),
|
128 |
-
|
129 |
'thumb' => array(
|
130 |
'max_width' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_thumb_width']) ? (int) $_REQUEST['importer_thumb_width'] : 300) : ((isset($_POST['upload_thumb_width']) && (int) $_POST['upload_thumb_width']) ? (int) $_POST['upload_thumb_width'] : 300)),
|
131 |
'max_height' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_thumb_height']) ? (int) $_REQUEST['importer_thumb_height'] : 300) : ((isset($_POST['upload_thumb_height']) && (int) $_POST['upload_thumb_height']) ? (int) $_POST['upload_thumb_height'] : 300)),
|
132 |
-
'jpeg_quality' =>
|
133 |
),
|
134 |
)
|
135 |
);
|
@@ -295,6 +286,7 @@ class bwg_UploadHandler {
|
|
295 |
}
|
296 |
|
297 |
protected function create_scaled_image($file_name, $version, $options) {
|
|
|
298 |
$file_path = $this->get_upload_path($file_name);
|
299 |
if (!empty($version) && ($version != 'main')) {
|
300 |
$version_dir = $this->get_upload_path(null, $version);
|
@@ -354,7 +346,7 @@ class bwg_UploadHandler {
|
|
354 |
case 2:
|
355 |
$src_img = @imagecreatefromjpeg($file_path);
|
356 |
$write_image = 'imagejpeg';
|
357 |
-
$image_quality =
|
358 |
break;
|
359 |
case 1:
|
360 |
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
@@ -368,7 +360,7 @@ class bwg_UploadHandler {
|
|
368 |
@imagesavealpha($new_img, true);
|
369 |
$src_img = @imagecreatefrompng($file_path);
|
370 |
$write_image = 'imagepng';
|
371 |
-
$image_quality =
|
372 |
break;
|
373 |
default:
|
374 |
$src_img = null;
|
104 |
$this->options['max_width'] = NULL;
|
105 |
$this->options['max_height'] = NULL;
|
106 |
}
|
107 |
+
global $wd_bwg_options;
|
108 |
$this->options += array(
|
109 |
'image_versions' => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
'.original' => array(
|
111 |
'max_width' => NULL,
|
112 |
'max_height' => NULL,
|
113 |
+
'jpeg_quality' => $wd_bwg_options->jpeg_quality
|
114 |
),
|
|
|
115 |
'' => array(
|
116 |
'max_width' => $this->options['max_width'],
|
117 |
'max_height' => $this->options['max_height'],
|
118 |
+
'jpeg_quality' => $wd_bwg_options->jpeg_quality
|
119 |
),
|
|
|
120 |
'thumb' => array(
|
121 |
'max_width' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_thumb_width']) ? (int) $_REQUEST['importer_thumb_width'] : 300) : ((isset($_POST['upload_thumb_width']) && (int) $_POST['upload_thumb_width']) ? (int) $_POST['upload_thumb_width'] : 300)),
|
122 |
'max_height' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_thumb_height']) ? (int) $_REQUEST['importer_thumb_height'] : 300) : ((isset($_POST['upload_thumb_height']) && (int) $_POST['upload_thumb_height']) ? (int) $_POST['upload_thumb_height'] : 300)),
|
123 |
+
'jpeg_quality' => $wd_bwg_options->jpeg_quality
|
124 |
),
|
125 |
)
|
126 |
);
|
286 |
}
|
287 |
|
288 |
protected function create_scaled_image($file_name, $version, $options) {
|
289 |
+
global $wd_bwg_options;
|
290 |
$file_path = $this->get_upload_path($file_name);
|
291 |
if (!empty($version) && ($version != 'main')) {
|
292 |
$version_dir = $this->get_upload_path(null, $version);
|
346 |
case 2:
|
347 |
$src_img = @imagecreatefromjpeg($file_path);
|
348 |
$write_image = 'imagejpeg';
|
349 |
+
$image_quality = $wd_bwg_options->jpeg_quality;
|
350 |
break;
|
351 |
case 1:
|
352 |
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
360 |
@imagesavealpha($new_img, true);
|
361 |
$src_img = @imagecreatefrompng($file_path);
|
362 |
$write_image = 'imagepng';
|
363 |
+
$image_quality = $wd_bwg_options->png_quality;
|
364 |
break;
|
365 |
default:
|
366 |
$src_img = null;
|
framework/BWGOptions.php
CHANGED
@@ -45,7 +45,7 @@ class WD_BWG_Options {
|
|
45 |
public $slideshow_enable_autoplay = 0;
|
46 |
public $slideshow_enable_shuffle = 0;
|
47 |
public $slideshow_enable_ctrl = 1;
|
48 |
-
public $slideshow_enable_filmstrip =
|
49 |
public $slideshow_filmstrip_height = 90;
|
50 |
public $slideshow_enable_title = 0;
|
51 |
public $slideshow_title_position = 'top-right';
|
@@ -59,7 +59,7 @@ class WD_BWG_Options {
|
|
59 |
public $popup_height = 500;
|
60 |
public $popup_type = 'fade';
|
61 |
public $popup_interval = 5;
|
62 |
-
public $popup_enable_filmstrip =
|
63 |
public $popup_filmstrip_height = 70;
|
64 |
public $popup_enable_ctrl_btn = 1;
|
65 |
public $popup_enable_fullscreen = 1;
|
@@ -158,6 +158,7 @@ class WD_BWG_Options {
|
|
158 |
public $placeholder = '';
|
159 |
public $gallery_download = 0;
|
160 |
public $enable_wp_editor = 1;
|
|
|
161 |
|
162 |
public function __construct($reset = false) {
|
163 |
$wd_bwg_options = get_option('wd_bwg_options');
|
@@ -190,6 +191,8 @@ class WD_BWG_Options {
|
|
190 |
if ($this->permissions != 'moderate_comments' && $this->permissions != 'publish_posts' && $this->permissions != 'edit_posts') {
|
191 |
$this->permissions = 'manage_options';
|
192 |
}
|
|
|
|
|
193 |
}
|
194 |
|
195 |
private function make_directory($upload_dir) {
|
45 |
public $slideshow_enable_autoplay = 0;
|
46 |
public $slideshow_enable_shuffle = 0;
|
47 |
public $slideshow_enable_ctrl = 1;
|
48 |
+
public $slideshow_enable_filmstrip = 0;
|
49 |
public $slideshow_filmstrip_height = 90;
|
50 |
public $slideshow_enable_title = 0;
|
51 |
public $slideshow_title_position = 'top-right';
|
59 |
public $popup_height = 500;
|
60 |
public $popup_type = 'fade';
|
61 |
public $popup_interval = 5;
|
62 |
+
public $popup_enable_filmstrip = 0;
|
63 |
public $popup_filmstrip_height = 70;
|
64 |
public $popup_enable_ctrl_btn = 1;
|
65 |
public $popup_enable_fullscreen = 1;
|
158 |
public $placeholder = '';
|
159 |
public $gallery_download = 0;
|
160 |
public $enable_wp_editor = 1;
|
161 |
+
public $image_quality = 75;
|
162 |
|
163 |
public function __construct($reset = false) {
|
164 |
$wd_bwg_options = get_option('wd_bwg_options');
|
191 |
if ($this->permissions != 'moderate_comments' && $this->permissions != 'publish_posts' && $this->permissions != 'edit_posts') {
|
192 |
$this->permissions = 'manage_options';
|
193 |
}
|
194 |
+
$this->jpeg_quality = $this->image_quality;
|
195 |
+
$this->png_quality = 9 - round(9 * $this->image_quality / 100);
|
196 |
}
|
197 |
|
198 |
private function make_directory($upload_dir) {
|
framework/WDWLibrary.php
CHANGED
@@ -923,8 +923,14 @@ class WDWLibrary {
|
|
923 |
}
|
924 |
}
|
925 |
else {
|
926 |
-
$
|
927 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
928 |
}
|
929 |
return $row;
|
930 |
}
|
@@ -1109,6 +1115,7 @@ class WDWLibrary {
|
|
1109 |
}
|
1110 |
|
1111 |
public static function set_text_watermark($original_filename, $dest_filename, $watermark_text, $watermark_font, $watermark_font_size, $watermark_color, $watermark_transparency, $watermark_position) {
|
|
|
1112 |
$original_filename = htmlspecialchars_decode($original_filename, ENT_COMPAT | ENT_QUOTES);
|
1113 |
$dest_filename = htmlspecialchars_decode($dest_filename, ENT_COMPAT | ENT_QUOTES);
|
1114 |
|
@@ -1145,7 +1152,7 @@ class WDWLibrary {
|
|
1145 |
if ($type == 2) {
|
1146 |
$image = imagecreatefromjpeg($original_filename);
|
1147 |
imagettftext($image, $watermark_font_size, 0, $left, $top, $watermark_color, $watermark_font, $watermark_text);
|
1148 |
-
imagejpeg ($image, $dest_filename,
|
1149 |
imagedestroy($image);
|
1150 |
}
|
1151 |
elseif ($type == 3) {
|
@@ -1154,7 +1161,7 @@ class WDWLibrary {
|
|
1154 |
imageColorAllocateAlpha($image, 0, 0, 0, 127);
|
1155 |
imagealphablending($image, FALSE);
|
1156 |
imagesavealpha($image, TRUE);
|
1157 |
-
imagepng($image, $dest_filename,
|
1158 |
imagedestroy($image);
|
1159 |
}
|
1160 |
elseif ($type == 1) {
|
@@ -1172,6 +1179,7 @@ class WDWLibrary {
|
|
1172 |
}
|
1173 |
|
1174 |
public static function set_image_watermark($original_filename, $dest_filename, $watermark_url, $watermark_height, $watermark_width, $watermark_position) {
|
|
|
1175 |
$original_filename = htmlspecialchars_decode($original_filename, ENT_COMPAT | ENT_QUOTES);
|
1176 |
$dest_filename = htmlspecialchars_decode($dest_filename, ENT_COMPAT | ENT_QUOTES);
|
1177 |
$watermark_url = htmlspecialchars_decode($watermark_url, ENT_COMPAT | ENT_QUOTES);
|
@@ -1225,10 +1233,10 @@ class WDWLibrary {
|
|
1225 |
$image = imagecreatefromjpeg($original_filename);
|
1226 |
imagecopy($image, $watermark_image_resized, $left, $top, 0, 0, $watermark_width, $watermark_height);
|
1227 |
if ($dest_filename <> '') {
|
1228 |
-
imagejpeg ($image, $dest_filename,
|
1229 |
} else {
|
1230 |
header('Content-Type: image/jpeg');
|
1231 |
-
imagejpeg($image, null,
|
1232 |
};
|
1233 |
imagedestroy($image);
|
1234 |
}
|
@@ -1237,7 +1245,7 @@ class WDWLibrary {
|
|
1237 |
imagecopy($image, $watermark_image_resized, $left, $top, 0, 0, $watermark_width, $watermark_height);
|
1238 |
imagealphablending($image, FALSE);
|
1239 |
imagesavealpha($image, TRUE);
|
1240 |
-
imagepng($image, $dest_filename,
|
1241 |
imagedestroy($image);
|
1242 |
}
|
1243 |
elseif ($type == 1) {
|
@@ -1298,6 +1306,7 @@ class WDWLibrary {
|
|
1298 |
}
|
1299 |
|
1300 |
public static function recover_image_size($width_orig, $height_orig, $width, $original_filename, $filename, $type_orig) {
|
|
|
1301 |
$percent = $width_orig / $width;
|
1302 |
$height = $height_orig / $percent;
|
1303 |
@ini_set('memory_limit', '-1');
|
@@ -1305,7 +1314,7 @@ class WDWLibrary {
|
|
1305 |
$img_r = imagecreatefromjpeg($original_filename);
|
1306 |
$dst_r = ImageCreateTrueColor($width, $height);
|
1307 |
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
1308 |
-
imagejpeg($dst_r, $filename,
|
1309 |
imagedestroy($img_r);
|
1310 |
imagedestroy($dst_r);
|
1311 |
}
|
@@ -1318,7 +1327,7 @@ class WDWLibrary {
|
|
1318 |
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
1319 |
imagealphablending($dst_r, FALSE);
|
1320 |
imagesavealpha($dst_r, TRUE);
|
1321 |
-
imagepng($dst_r, $filename,
|
1322 |
imagedestroy($img_r);
|
1323 |
imagedestroy($dst_r);
|
1324 |
}
|
923 |
}
|
924 |
}
|
925 |
else {
|
926 |
+
$row_count = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_gallery');
|
927 |
+
if (!$row_count) {
|
928 |
+
return false;
|
929 |
+
}
|
930 |
+
else {
|
931 |
+
$row = new stdClass();
|
932 |
+
$row->name = '';
|
933 |
+
}
|
934 |
}
|
935 |
return $row;
|
936 |
}
|
1115 |
}
|
1116 |
|
1117 |
public static function set_text_watermark($original_filename, $dest_filename, $watermark_text, $watermark_font, $watermark_font_size, $watermark_color, $watermark_transparency, $watermark_position) {
|
1118 |
+
global $wd_bwg_options;
|
1119 |
$original_filename = htmlspecialchars_decode($original_filename, ENT_COMPAT | ENT_QUOTES);
|
1120 |
$dest_filename = htmlspecialchars_decode($dest_filename, ENT_COMPAT | ENT_QUOTES);
|
1121 |
|
1152 |
if ($type == 2) {
|
1153 |
$image = imagecreatefromjpeg($original_filename);
|
1154 |
imagettftext($image, $watermark_font_size, 0, $left, $top, $watermark_color, $watermark_font, $watermark_text);
|
1155 |
+
imagejpeg ($image, $dest_filename, $wd_bwg_options->jpeg_quality);
|
1156 |
imagedestroy($image);
|
1157 |
}
|
1158 |
elseif ($type == 3) {
|
1161 |
imageColorAllocateAlpha($image, 0, 0, 0, 127);
|
1162 |
imagealphablending($image, FALSE);
|
1163 |
imagesavealpha($image, TRUE);
|
1164 |
+
imagepng($image, $dest_filename, $wd_bwg_options->png_quality);
|
1165 |
imagedestroy($image);
|
1166 |
}
|
1167 |
elseif ($type == 1) {
|
1179 |
}
|
1180 |
|
1181 |
public static function set_image_watermark($original_filename, $dest_filename, $watermark_url, $watermark_height, $watermark_width, $watermark_position) {
|
1182 |
+
global $wd_bwg_options;
|
1183 |
$original_filename = htmlspecialchars_decode($original_filename, ENT_COMPAT | ENT_QUOTES);
|
1184 |
$dest_filename = htmlspecialchars_decode($dest_filename, ENT_COMPAT | ENT_QUOTES);
|
1185 |
$watermark_url = htmlspecialchars_decode($watermark_url, ENT_COMPAT | ENT_QUOTES);
|
1233 |
$image = imagecreatefromjpeg($original_filename);
|
1234 |
imagecopy($image, $watermark_image_resized, $left, $top, 0, 0, $watermark_width, $watermark_height);
|
1235 |
if ($dest_filename <> '') {
|
1236 |
+
imagejpeg ($image, $dest_filename, $wd_bwg_options->jpeg_quality);
|
1237 |
} else {
|
1238 |
header('Content-Type: image/jpeg');
|
1239 |
+
imagejpeg($image, null, $wd_bwg_options->jpeg_quality);
|
1240 |
};
|
1241 |
imagedestroy($image);
|
1242 |
}
|
1245 |
imagecopy($image, $watermark_image_resized, $left, $top, 0, 0, $watermark_width, $watermark_height);
|
1246 |
imagealphablending($image, FALSE);
|
1247 |
imagesavealpha($image, TRUE);
|
1248 |
+
imagepng($image, $dest_filename, $wd_bwg_options->png_quality);
|
1249 |
imagedestroy($image);
|
1250 |
}
|
1251 |
elseif ($type == 1) {
|
1306 |
}
|
1307 |
|
1308 |
public static function recover_image_size($width_orig, $height_orig, $width, $original_filename, $filename, $type_orig) {
|
1309 |
+
global $wd_bwg_options;
|
1310 |
$percent = $width_orig / $width;
|
1311 |
$height = $height_orig / $percent;
|
1312 |
@ini_set('memory_limit', '-1');
|
1314 |
$img_r = imagecreatefromjpeg($original_filename);
|
1315 |
$dst_r = ImageCreateTrueColor($width, $height);
|
1316 |
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
1317 |
+
imagejpeg($dst_r, $filename, $wd_bwg_options->jpeg_quality);
|
1318 |
imagedestroy($img_r);
|
1319 |
imagedestroy($dst_r);
|
1320 |
}
|
1327 |
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
1328 |
imagealphablending($dst_r, FALSE);
|
1329 |
imagesavealpha($dst_r, TRUE);
|
1330 |
+
imagepng($dst_r, $filename, $wd_bwg_options->png_quality);
|
1331 |
imagedestroy($img_r);
|
1332 |
imagedestroy($dst_r);
|
1333 |
}
|
frontend/views/BWGViewAlbum_compact_preview.php
CHANGED
@@ -604,8 +604,8 @@ class BWGViewAlbum_compact_preview {
|
|
604 |
<script>
|
605 |
function bwg_gallery_box_<?php echo $bwg; ?>(gallery_id, image_id) {
|
606 |
var filterTags = jQuery("#bwg_tags_id_bwg_album_compact_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_tags_id_bwg_album_compact_<?php echo $bwg; ?>" ).val() : 0;
|
607 |
-
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
608 |
-
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&gallery_id=' + gallery_id + '&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" +
|
609 |
}
|
610 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
611 |
var bwg_touch_flag = false;
|
604 |
<script>
|
605 |
function bwg_gallery_box_<?php echo $bwg; ?>(gallery_id, image_id) {
|
606 |
var filterTags = jQuery("#bwg_tags_id_bwg_album_compact_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_tags_id_bwg_album_compact_<?php echo $bwg; ?>" ).val() : 0;
|
607 |
+
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
608 |
+
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&gallery_id=' + gallery_id + '&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
609 |
}
|
610 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
611 |
var bwg_touch_flag = false;
|
frontend/views/BWGViewAlbum_extended_preview.php
CHANGED
@@ -552,8 +552,8 @@ class BWGViewAlbum_extended_preview {
|
|
552 |
<script>
|
553 |
function bwg_gallery_box_<?php echo $bwg; ?>(gallery_id, image_id) {
|
554 |
var filterTags = jQuery("#bwg_tags_id_bwg_album_extended_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_tags_id_bwg_album_extended_<?php echo $bwg; ?>" ).val() : 0;
|
555 |
-
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
556 |
-
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&gallery_id=' + gallery_id + '&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags +
|
557 |
}
|
558 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
559 |
var bwg_touch_flag = false;
|
552 |
<script>
|
553 |
function bwg_gallery_box_<?php echo $bwg; ?>(gallery_id, image_id) {
|
554 |
var filterTags = jQuery("#bwg_tags_id_bwg_album_extended_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_tags_id_bwg_album_extended_<?php echo $bwg; ?>" ).val() : 0;
|
555 |
+
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
556 |
+
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&gallery_id=' + gallery_id + '&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
557 |
}
|
558 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
559 |
var bwg_touch_flag = false;
|
frontend/views/BWGViewImage_browser.php
CHANGED
@@ -408,8 +408,8 @@ class BWGViewImage_browser {
|
|
408 |
bwg_image_browser_<?php echo $bwg; ?>();
|
409 |
});
|
410 |
function bwg_gallery_box_<?php echo $bwg; ?>(image_id) {
|
411 |
-
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
412 |
-
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&image_id=' + image_id +
|
413 |
}
|
414 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
415 |
var bwg_touch_flag = false;
|
408 |
bwg_image_browser_<?php echo $bwg; ?>();
|
409 |
});
|
410 |
function bwg_gallery_box_<?php echo $bwg; ?>(image_id) {
|
411 |
+
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
412 |
+
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&image_id=' + image_id + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
413 |
}
|
414 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
415 |
var bwg_touch_flag = false;
|
frontend/views/BWGViewSlideshow.php
CHANGED
@@ -233,9 +233,11 @@ class BWGViewSlideshow {
|
|
233 |
if (!$images_count) {
|
234 |
if ($params['tag']) {
|
235 |
echo WDWLibrary::message(__('There are no images.', 'bwg'), 'wd_error');
|
|
|
236 |
}
|
237 |
else {
|
238 |
echo WDWLibrary::message(__('There are no images in this gallery.', 'bwg'), 'wd_error');
|
|
|
239 |
}
|
240 |
}
|
241 |
$current_image_id = ($image_rows ? $image_rows[0]->id : 0);
|
@@ -299,7 +301,7 @@ class BWGViewSlideshow {
|
|
299 |
?>
|
300 |
data_<?php echo $bwg; ?>["<?php echo $key; ?>"] = [];
|
301 |
data_<?php echo $bwg; ?>["<?php echo $key; ?>"]["id"] = "<?php echo $image_row->id; ?>";
|
302 |
-
data_<?php echo $bwg; ?>["<?php echo $key; ?>"]["alt"] = "<?php echo $image_row->alt; ?>";
|
303 |
data_<?php echo $bwg; ?>["<?php echo $key; ?>"]["description"] = "<?php echo str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->description); ?>";
|
304 |
data_<?php echo $bwg; ?>["<?php echo $key; ?>"]["filetype"] = "<?php echo $image_row->filetype; ?>";
|
305 |
data_<?php echo $bwg; ?>["<?php echo $key; ?>"]["filename"] = "<?php echo $image_row->filename; ?>";
|
@@ -346,7 +348,6 @@ class BWGViewSlideshow {
|
|
346 |
<div class="bwg_slider_<?php echo $bwg; ?>">
|
347 |
<?php
|
348 |
foreach ($image_rows as $key => $image_row) {
|
349 |
-
|
350 |
$is_embed = preg_match('/EMBED/',$image_row->filetype)==1 ? true :false;
|
351 |
$is_embed_video = ($is_embed && preg_match('/_VIDEO/',$image_row->filetype)==1) ? true :false;
|
352 |
$is_embed_instagram_post = preg_match('/INSTAGRAM_POST/',$image_row->filetype)==1 ? true :false;
|
@@ -439,7 +440,6 @@ class BWGViewSlideshow {
|
|
439 |
$instagram_post_height = explode(' ', $image_resolution[1]);
|
440 |
$instagram_post_height = $instagram_post_height[0];
|
441 |
}
|
442 |
-
|
443 |
WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('class'=>"bwg_embed_frame_".$bwg, 'data-width' => $instagram_post_width, 'data-height' => $instagram_post_height, 'frameborder'=>"0", 'style'=>"width:".$post_width."px; height:".$post_height."px; vertical-align:middle; display:inline-block; position:relative;"));
|
444 |
}
|
445 |
else{
|
@@ -571,26 +571,26 @@ class BWGViewSlideshow {
|
|
571 |
'enable_image_tumblr' => $params['popup_enable_tumblr'],
|
572 |
'watermark_type' => $params['watermark_type'],
|
573 |
'slideshow_effect_duration' => isset($params['popup_effect_duration']) ? $params['popup_effect_duration'] : 1,
|
574 |
-
'
|
575 |
-
'current_url' => urlencode($current_url)
|
576 |
);
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
var bwg_trans_in_progress_<?php echo $bwg; ?> = false;
|
595 |
var bwg_transition_duration_<?php echo $bwg; ?> = <?php echo (($slideshow_interval < 4) && ($slideshow_interval != 0)) ? ($slideshow_interval * 1000) / 4 : ($slideshow_effect_duration * 1000); ?>;
|
596 |
var bwg_playInterval_<?php echo $bwg; ?>;
|
@@ -986,7 +986,6 @@ class BWGViewSlideshow {
|
|
986 |
}
|
987 |
return iterator;
|
988 |
}
|
989 |
-
|
990 |
function bwg_change_image_<?php echo $bwg; ?>(current_key, key, data_<?php echo $bwg; ?>, from_effect) {
|
991 |
/* Pause videos.*/
|
992 |
jQuery("#bwg_slideshow_image_container_<?php echo $bwg; ?>").find("iframe").each(function () {
|
@@ -1033,7 +1032,6 @@ class BWGViewSlideshow {
|
|
1033 |
var next_image_class = "#image_id_<?php echo $bwg; ?>_" + data_<?php echo $bwg; ?>[key]["id"];*/
|
1034 |
var current_image_class = jQuery(".bwg_slideshow_image_spun_<?php echo $bwg; ?>").css("zIndex") == 2 ? ".bwg_slideshow_image_spun_<?php echo $bwg; ?>" : ".bwg_slideshow_image_second_spun_<?php echo $bwg; ?>";
|
1035 |
var next_image_class = current_image_class == ".bwg_slideshow_image_second_spun_<?php echo $bwg; ?>" ? ".bwg_slideshow_image_spun_<?php echo $bwg; ?>" : ".bwg_slideshow_image_second_spun_<?php echo $bwg; ?>";
|
1036 |
-
|
1037 |
var is_embed = data_<?php echo $bwg; ?>[key]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
1038 |
var is_embed_instagram_post = data_<?php echo $bwg; ?>[key]['filetype'].indexOf('INSTAGRAM_POST') > -1 ? true :false;
|
1039 |
var cur_height = jQuery(current_image_class).height();
|
@@ -1063,7 +1061,6 @@ class BWGViewSlideshow {
|
|
1063 |
post_height = post_width + 88;
|
1064 |
}
|
1065 |
innhtml += spider_display_embed(data_<?php echo $bwg; ?>[key]['filetype'], data_<?php echo $bwg; ?>[key]['filename'], {class:"bwg_embed_frame", 'data-width': data_<?php echo $bwg; ?>[key]['image_width'], 'data-height': data_<?php echo $bwg; ?>[key]['image_height'], frameborder: "0", allowfullscreen: "allowfullscreen", style: "width:" + post_width + "px; height:" + post_height + "px; vertical-align:middle; display:inline-block; position:relative;"});
|
1066 |
-
|
1067 |
}
|
1068 |
else {
|
1069 |
innhtml += spider_display_embed(data_<?php echo $bwg; ?>[key]['filetype'], data_<?php echo $bwg; ?>[key]['filename'], {class:"bwg_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;" });
|
@@ -1128,7 +1125,6 @@ class BWGViewSlideshow {
|
|
1128 |
}
|
1129 |
}
|
1130 |
}
|
1131 |
-
|
1132 |
}
|
1133 |
function bwg_popup_resize_<?php echo $bwg; ?>() {
|
1134 |
var parent_width = jQuery(".bwg_slideshow_image_wrap_<?php echo $bwg; ?>").parent().width();
|
@@ -1218,7 +1214,6 @@ class BWGViewSlideshow {
|
|
1218 |
});
|
1219 |
}
|
1220 |
}
|
1221 |
-
|
1222 |
var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
|
1223 |
var bwg_click = isMobile ? 'touchend' : 'click';
|
1224 |
bwg_popup_resize_<?php echo $bwg; ?>();
|
@@ -1372,11 +1367,19 @@ class BWGViewSlideshow {
|
|
1372 |
}
|
1373 |
var ecommerce = openEcommerce == true ? "&open_ecommerce=1" : "";
|
1374 |
var filterTags = jQuery("#bwg_tags_id_bwg_standart_thumbnails_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_tags_id_bwg_standart_thumbnails_<?php echo $bwg; ?>" ).val() : 0;
|
1375 |
-
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
1376 |
-
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags + ecommerce +
|
1377 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1378 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
1379 |
-
|
1380 |
var bwg_touch_flag = false;
|
1381 |
jQuery(".bwg_lightbox_<?php echo $bwg; ?>").on("click", function () {
|
1382 |
if (!bwg_touch_flag) {
|
@@ -1386,7 +1389,6 @@ class BWGViewSlideshow {
|
|
1386 |
return false;
|
1387 |
}
|
1388 |
});
|
1389 |
-
|
1390 |
jQuery(".bwg_lightbox_<?php echo $bwg; ?> .bwg_ecommerce").on("click", function (event) {
|
1391 |
event.stopPropagation();
|
1392 |
if (!bwg_touch_flag) {
|
@@ -1426,8 +1428,8 @@ class BWGViewSlideshow {
|
|
1426 |
ob_start();
|
1427 |
?>
|
1428 |
#bwg_container1_<?php echo $bwg; ?> {
|
1429 |
-
|
1430 |
-
|
1431 |
#bwg_container1_<?php echo $bwg; ?> * {
|
1432 |
-moz-user-select: none;
|
1433 |
-khtml-user-select: none;
|
233 |
if (!$images_count) {
|
234 |
if ($params['tag']) {
|
235 |
echo WDWLibrary::message(__('There are no images.', 'bwg'), 'wd_error');
|
236 |
+
return;
|
237 |
}
|
238 |
else {
|
239 |
echo WDWLibrary::message(__('There are no images in this gallery.', 'bwg'), 'wd_error');
|
240 |
+
return;
|
241 |
}
|
242 |
}
|
243 |
$current_image_id = ($image_rows ? $image_rows[0]->id : 0);
|
301 |
?>
|
302 |
data_<?php echo $bwg; ?>["<?php echo $key; ?>"] = [];
|
303 |
data_<?php echo $bwg; ?>["<?php echo $key; ?>"]["id"] = "<?php echo $image_row->id; ?>";
|
304 |
+
data_<?php echo $bwg; ?>["<?php echo $key; ?>"]["alt"] = "<?php echo str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->alt); ?>";
|
305 |
data_<?php echo $bwg; ?>["<?php echo $key; ?>"]["description"] = "<?php echo str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->description); ?>";
|
306 |
data_<?php echo $bwg; ?>["<?php echo $key; ?>"]["filetype"] = "<?php echo $image_row->filetype; ?>";
|
307 |
data_<?php echo $bwg; ?>["<?php echo $key; ?>"]["filename"] = "<?php echo $image_row->filename; ?>";
|
348 |
<div class="bwg_slider_<?php echo $bwg; ?>">
|
349 |
<?php
|
350 |
foreach ($image_rows as $key => $image_row) {
|
|
|
351 |
$is_embed = preg_match('/EMBED/',$image_row->filetype)==1 ? true :false;
|
352 |
$is_embed_video = ($is_embed && preg_match('/_VIDEO/',$image_row->filetype)==1) ? true :false;
|
353 |
$is_embed_instagram_post = preg_match('/INSTAGRAM_POST/',$image_row->filetype)==1 ? true :false;
|
440 |
$instagram_post_height = explode(' ', $image_resolution[1]);
|
441 |
$instagram_post_height = $instagram_post_height[0];
|
442 |
}
|
|
|
443 |
WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('class'=>"bwg_embed_frame_".$bwg, 'data-width' => $instagram_post_width, 'data-height' => $instagram_post_height, 'frameborder'=>"0", 'style'=>"width:".$post_width."px; height:".$post_height."px; vertical-align:middle; display:inline-block; position:relative;"));
|
444 |
}
|
445 |
else{
|
571 |
'enable_image_tumblr' => $params['popup_enable_tumblr'],
|
572 |
'watermark_type' => $params['watermark_type'],
|
573 |
'slideshow_effect_duration' => isset($params['popup_effect_duration']) ? $params['popup_effect_duration'] : 1,
|
574 |
+
'tags' => (isset($params['tag']) ? $params['tag'] : 0),
|
575 |
+
'current_url' => urlencode($current_url),
|
576 |
);
|
577 |
+
if ($params['watermark_type'] != 'none') {
|
578 |
+
$params_array['watermark_link'] = urlencode($params['watermark_link']);
|
579 |
+
$params_array['watermark_opacity'] = $params['watermark_opacity'];
|
580 |
+
$params_array['watermark_position'] = $params['watermark_position'];
|
581 |
+
}
|
582 |
+
if ($params['watermark_type'] == 'text') {
|
583 |
+
$params_array['watermark_text'] = urlencode($params['watermark_text']);
|
584 |
+
$params_array['watermark_font_size'] = $params['watermark_font_size'];
|
585 |
+
$params_array['watermark_font'] = $params['watermark_font'];
|
586 |
+
$params_array['watermark_color'] = $params['watermark_color'];
|
587 |
+
}
|
588 |
+
elseif ($params['watermark_type'] == 'image') {
|
589 |
+
$params_array['watermark_url'] = urlencode($params['watermark_url']);
|
590 |
+
$params_array['watermark_width'] = $params['watermark_width'];
|
591 |
+
$params_array['watermark_height'] = $params['watermark_height'];
|
592 |
+
}
|
593 |
+
?>
|
594 |
var bwg_trans_in_progress_<?php echo $bwg; ?> = false;
|
595 |
var bwg_transition_duration_<?php echo $bwg; ?> = <?php echo (($slideshow_interval < 4) && ($slideshow_interval != 0)) ? ($slideshow_interval * 1000) / 4 : ($slideshow_effect_duration * 1000); ?>;
|
596 |
var bwg_playInterval_<?php echo $bwg; ?>;
|
986 |
}
|
987 |
return iterator;
|
988 |
}
|
|
|
989 |
function bwg_change_image_<?php echo $bwg; ?>(current_key, key, data_<?php echo $bwg; ?>, from_effect) {
|
990 |
/* Pause videos.*/
|
991 |
jQuery("#bwg_slideshow_image_container_<?php echo $bwg; ?>").find("iframe").each(function () {
|
1032 |
var next_image_class = "#image_id_<?php echo $bwg; ?>_" + data_<?php echo $bwg; ?>[key]["id"];*/
|
1033 |
var current_image_class = jQuery(".bwg_slideshow_image_spun_<?php echo $bwg; ?>").css("zIndex") == 2 ? ".bwg_slideshow_image_spun_<?php echo $bwg; ?>" : ".bwg_slideshow_image_second_spun_<?php echo $bwg; ?>";
|
1034 |
var next_image_class = current_image_class == ".bwg_slideshow_image_second_spun_<?php echo $bwg; ?>" ? ".bwg_slideshow_image_spun_<?php echo $bwg; ?>" : ".bwg_slideshow_image_second_spun_<?php echo $bwg; ?>";
|
|
|
1035 |
var is_embed = data_<?php echo $bwg; ?>[key]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
1036 |
var is_embed_instagram_post = data_<?php echo $bwg; ?>[key]['filetype'].indexOf('INSTAGRAM_POST') > -1 ? true :false;
|
1037 |
var cur_height = jQuery(current_image_class).height();
|
1061 |
post_height = post_width + 88;
|
1062 |
}
|
1063 |
innhtml += spider_display_embed(data_<?php echo $bwg; ?>[key]['filetype'], data_<?php echo $bwg; ?>[key]['filename'], {class:"bwg_embed_frame", 'data-width': data_<?php echo $bwg; ?>[key]['image_width'], 'data-height': data_<?php echo $bwg; ?>[key]['image_height'], frameborder: "0", allowfullscreen: "allowfullscreen", style: "width:" + post_width + "px; height:" + post_height + "px; vertical-align:middle; display:inline-block; position:relative;"});
|
|
|
1064 |
}
|
1065 |
else {
|
1066 |
innhtml += spider_display_embed(data_<?php echo $bwg; ?>[key]['filetype'], data_<?php echo $bwg; ?>[key]['filename'], {class:"bwg_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;" });
|
1125 |
}
|
1126 |
}
|
1127 |
}
|
|
|
1128 |
}
|
1129 |
function bwg_popup_resize_<?php echo $bwg; ?>() {
|
1130 |
var parent_width = jQuery(".bwg_slideshow_image_wrap_<?php echo $bwg; ?>").parent().width();
|
1214 |
});
|
1215 |
}
|
1216 |
}
|
|
|
1217 |
var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
|
1218 |
var bwg_click = isMobile ? 'touchend' : 'click';
|
1219 |
bwg_popup_resize_<?php echo $bwg; ?>();
|
1367 |
}
|
1368 |
var ecommerce = openEcommerce == true ? "&open_ecommerce=1" : "";
|
1369 |
var filterTags = jQuery("#bwg_tags_id_bwg_standart_thumbnails_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_tags_id_bwg_standart_thumbnails_<?php echo $bwg; ?>" ).val() : 0;
|
1370 |
+
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
1371 |
+
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags + ecommerce + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
1372 |
+
}
|
1373 |
+
var bwg_hash = window.location.hash.substring(1);
|
1374 |
+
if (bwg_hash) {
|
1375 |
+
if (bwg_hash.indexOf("bwg") != "-1") {
|
1376 |
+
bwg_hash_array = bwg_hash.replace("bwg", "").split("/");
|
1377 |
+
if(bwg_hash_array[0] == "<?php echo $params_array['gallery_id']; ?>"){
|
1378 |
+
bwg_gallery_box_<?php echo $bwg; ?>(bwg_hash_array[1]);
|
1379 |
+
}
|
1380 |
+
}
|
1381 |
+
}
|
1382 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
|
|
1383 |
var bwg_touch_flag = false;
|
1384 |
jQuery(".bwg_lightbox_<?php echo $bwg; ?>").on("click", function () {
|
1385 |
if (!bwg_touch_flag) {
|
1389 |
return false;
|
1390 |
}
|
1391 |
});
|
|
|
1392 |
jQuery(".bwg_lightbox_<?php echo $bwg; ?> .bwg_ecommerce").on("click", function (event) {
|
1393 |
event.stopPropagation();
|
1394 |
if (!bwg_touch_flag) {
|
1428 |
ob_start();
|
1429 |
?>
|
1430 |
#bwg_container1_<?php echo $bwg; ?> {
|
1431 |
+
visibility: hidden;
|
1432 |
+
}
|
1433 |
#bwg_container1_<?php echo $bwg; ?> * {
|
1434 |
-moz-user-select: none;
|
1435 |
-khtml-user-select: none;
|
frontend/views/BWGViewThumbnails.php
CHANGED
@@ -427,8 +427,8 @@ class BWGViewThumbnails {
|
|
427 |
?>
|
428 |
function bwg_gallery_box_<?php echo $bwg; ?>(image_id) {
|
429 |
var filterTags = jQuery("#bwg_tags_id_bwg_standart_thumbnails_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_tags_id_bwg_standart_thumbnails_<?php echo $bwg; ?>" ).val() : 0;
|
430 |
-
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
431 |
-
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags +
|
432 |
}
|
433 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
434 |
var bwg_touch_flag = false;
|
427 |
?>
|
428 |
function bwg_gallery_box_<?php echo $bwg; ?>(image_id) {
|
429 |
var filterTags = jQuery("#bwg_tags_id_bwg_standart_thumbnails_<?php echo $bwg; ?>" ).val() ? jQuery("#bwg_tags_id_bwg_standart_thumbnails_<?php echo $bwg; ?>" ).val() : 0;
|
430 |
+
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
431 |
+
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
432 |
}
|
433 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
434 |
var bwg_touch_flag = false;
|
js/bwg_frontend.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_album_id, type, srch_btn, title, sortByParam, load_more) {
|
2 |
var masonry_loaded = 0;
|
3 |
var mosaic_loaded = 0;
|
4 |
if (typeof load_more == "undefined") {
|
@@ -66,6 +66,7 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
|
|
66 |
// There are no images.
|
67 |
if (jQuery("#bwg_search_input_" + current_view).length > 0 && album_gallery_id == 0) { // Search box exists and not album view.
|
68 |
var bwg_images_count = jQuery('#bwg_images_count_' + current_view).val();
|
|
|
69 |
if (bwg_images_count == 0) {
|
70 |
var cont = jQuery("#" + id).parent().html();
|
71 |
var error_msg = '<div style="width:95%"><div class="wd_error"><p><strong>' + bwg_objectL10n.bwg_search_result + '</strong></p></div></div>';
|
@@ -81,7 +82,7 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
|
|
81 |
else if (jQuery(this).attr("data-src") != '') {
|
82 |
jQuery(this).attr("src", jQuery(this).attr("data-src"));
|
83 |
}
|
84 |
-
});
|
85 |
jQuery(".blog_style_image_buttons_conteiner_" + current_view).find(jQuery(".bwg_blog_style_img_" + current_view)).load(function(){
|
86 |
jQuery(".bwg_blog_style_img_" + current_view).closest(jQuery(".blog_style_image_buttons_conteiner_" + current_view)).show();
|
87 |
});
|
1 |
+
function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_album_id, type, srch_btn, title, sortByParam, load_more) {console.log("aaaaaaa");
|
2 |
var masonry_loaded = 0;
|
3 |
var mosaic_loaded = 0;
|
4 |
if (typeof load_more == "undefined") {
|
66 |
// There are no images.
|
67 |
if (jQuery("#bwg_search_input_" + current_view).length > 0 && album_gallery_id == 0) { // Search box exists and not album view.
|
68 |
var bwg_images_count = jQuery('#bwg_images_count_' + current_view).val();
|
69 |
+
debugger;
|
70 |
if (bwg_images_count == 0) {
|
71 |
var cont = jQuery("#" + id).parent().html();
|
72 |
var error_msg = '<div style="width:95%"><div class="wd_error"><p><strong>' + bwg_objectL10n.bwg_search_result + '</strong></p></div></div>';
|
82 |
else if (jQuery(this).attr("data-src") != '') {
|
83 |
jQuery(this).attr("src", jQuery(this).attr("data-src"));
|
84 |
}
|
85 |
+
});
|
86 |
jQuery(".blog_style_image_buttons_conteiner_" + current_view).find(jQuery(".bwg_blog_style_img_" + current_view)).load(function(){
|
87 |
jQuery(".bwg_blog_style_img_" + current_view).closest(jQuery(".blog_style_image_buttons_conteiner_" + current_view)).show();
|
88 |
});
|
photo-gallery.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Photo Gallery
|
5 |
* Plugin URI: https://web-dorado.com/products/wordpress-photo-gallery-plugin.html
|
6 |
* Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
|
7 |
-
* Version: 1.3.
|
8 |
* Author: Photo Gallery Team
|
9 |
* Author URI: https://web-dorado.com/
|
10 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -344,7 +344,7 @@ function bwg_shortcode($params) {
|
|
344 |
'enable_slideshow_autoplay' => 0,
|
345 |
'enable_slideshow_shuffle' => 0,
|
346 |
'enable_slideshow_ctrl' => 1,
|
347 |
-
'enable_slideshow_filmstrip' =>
|
348 |
'slideshow_filmstrip_height' => 70,
|
349 |
'slideshow_enable_title' => 0,
|
350 |
'slideshow_title_full_width' => 0,
|
@@ -497,8 +497,8 @@ function bwg_shortcode($params) {
|
|
497 |
}
|
498 |
ob_start();
|
499 |
bwg_front_end($params);
|
500 |
-
return str_replace(array("\r\n", "\n", "\r"), '', ob_get_clean());
|
501 |
-
|
502 |
}
|
503 |
add_shortcode('Best_Wordpress_Gallery', 'bwg_shortcode');
|
504 |
|
@@ -1605,7 +1605,7 @@ function bwg_activate() {
|
|
1605 |
));
|
1606 |
}
|
1607 |
$version = get_option('wd_bwg_version');
|
1608 |
-
$new_version = '1.3.
|
1609 |
if ($version && version_compare($version, $new_version, '<')) {
|
1610 |
require_once WD_BWG_DIR . "/update/bwg_update.php";
|
1611 |
bwg_update($version);
|
@@ -1657,7 +1657,7 @@ wp_oembed_add_provider( '#https://instagr(\.am|am\.com)/p/.*#i', 'https://api.in
|
|
1657 |
|
1658 |
function bwg_update_hook() {
|
1659 |
$version = get_option('wd_bwg_version');
|
1660 |
-
$new_version = '1.3.
|
1661 |
if ($version && version_compare($version, $new_version, '<')) {
|
1662 |
require_once WD_BWG_DIR . "/update/bwg_update.php";
|
1663 |
bwg_update($version);
|
@@ -2023,6 +2023,7 @@ add_filter('widget_tag_cloud_args', 'bwg_widget_tag_cloud_args');
|
|
2023 |
|
2024 |
// Captcha.
|
2025 |
function bwg_captcha() {
|
|
|
2026 |
if (isset($_GET['action']) && esc_html($_GET['action']) == 'bwg_captcha') {
|
2027 |
$i = (isset($_GET["i"]) ? esc_html($_GET["i"]) : '');
|
2028 |
$r2 = (isset($_GET["r2"]) ? (int) $_GET["r2"] : 0);
|
@@ -2031,7 +2032,6 @@ function bwg_captcha() {
|
|
2031 |
$digit = (isset($_GET["digit"]) ? (int) $_GET["digit"] : 0);
|
2032 |
$cap_width = $digit * 10 + 15;
|
2033 |
$cap_height = 26;
|
2034 |
-
$cap_quality = 100;
|
2035 |
$cap_length_min = $digit;
|
2036 |
$cap_length_max = $digit;
|
2037 |
$cap_digital = 1;
|
@@ -2074,7 +2074,7 @@ function bwg_captcha() {
|
|
2074 |
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
2075 |
header('Pragma: no-cache');
|
2076 |
header('Content-Type: image/jpeg');
|
2077 |
-
imagejpeg($canvas, NULL, $
|
2078 |
die('');
|
2079 |
}
|
2080 |
}
|
4 |
* Plugin Name: Photo Gallery
|
5 |
* Plugin URI: https://web-dorado.com/products/wordpress-photo-gallery-plugin.html
|
6 |
* Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
|
7 |
+
* Version: 1.3.39
|
8 |
* Author: Photo Gallery Team
|
9 |
* Author URI: https://web-dorado.com/
|
10 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
344 |
'enable_slideshow_autoplay' => 0,
|
345 |
'enable_slideshow_shuffle' => 0,
|
346 |
'enable_slideshow_ctrl' => 1,
|
347 |
+
'enable_slideshow_filmstrip' => 0,
|
348 |
'slideshow_filmstrip_height' => 70,
|
349 |
'slideshow_enable_title' => 0,
|
350 |
'slideshow_title_full_width' => 0,
|
497 |
}
|
498 |
ob_start();
|
499 |
bwg_front_end($params);
|
500 |
+
// return str_replace(array("\r\n", "\n", "\r"), '', ob_get_clean());
|
501 |
+
return ob_get_clean();
|
502 |
}
|
503 |
add_shortcode('Best_Wordpress_Gallery', 'bwg_shortcode');
|
504 |
|
1605 |
));
|
1606 |
}
|
1607 |
$version = get_option('wd_bwg_version');
|
1608 |
+
$new_version = '1.3.39';
|
1609 |
if ($version && version_compare($version, $new_version, '<')) {
|
1610 |
require_once WD_BWG_DIR . "/update/bwg_update.php";
|
1611 |
bwg_update($version);
|
1657 |
|
1658 |
function bwg_update_hook() {
|
1659 |
$version = get_option('wd_bwg_version');
|
1660 |
+
$new_version = '1.3.39';
|
1661 |
if ($version && version_compare($version, $new_version, '<')) {
|
1662 |
require_once WD_BWG_DIR . "/update/bwg_update.php";
|
1663 |
bwg_update($version);
|
2023 |
|
2024 |
// Captcha.
|
2025 |
function bwg_captcha() {
|
2026 |
+
global $wd_bwg_options;
|
2027 |
if (isset($_GET['action']) && esc_html($_GET['action']) == 'bwg_captcha') {
|
2028 |
$i = (isset($_GET["i"]) ? esc_html($_GET["i"]) : '');
|
2029 |
$r2 = (isset($_GET["r2"]) ? (int) $_GET["r2"] : 0);
|
2032 |
$digit = (isset($_GET["digit"]) ? (int) $_GET["digit"] : 0);
|
2033 |
$cap_width = $digit * 10 + 15;
|
2034 |
$cap_height = 26;
|
|
|
2035 |
$cap_length_min = $digit;
|
2036 |
$cap_length_max = $digit;
|
2037 |
$cap_digital = 1;
|
2074 |
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
2075 |
header('Pragma: no-cache');
|
2076 |
header('Content-Type: image/jpeg');
|
2077 |
+
imagejpeg($canvas, NULL, $wd_bwg_options->jpeg_quality);
|
2078 |
die('');
|
2079 |
}
|
2080 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-photo-gallery-plugin.html
|
|
4 |
Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 4.7
|
7 |
-
Stable tag: 1.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -188,6 +188,11 @@ To enable the feature of adding Media Library images, go to Photo Gallery > Opti
|
|
188 |
|
189 |
== Changelog ==
|
190 |
|
|
|
|
|
|
|
|
|
|
|
191 |
= 1.3.38 =
|
192 |
* Fixed: Gallery title for old versions.
|
193 |
* Fixed: Conflict with Jetpack Photon module.
|
4 |
Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 4.7
|
7 |
+
Stable tag: 1.3.39
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
188 |
|
189 |
== Changelog ==
|
190 |
|
191 |
+
= 1.3.39 =
|
192 |
+
* Fixed: Removed empty "filter_search_name" from lightbox URL.
|
193 |
+
* Fixed: Don't add Facebook/Instagram libraries if there is no need.
|
194 |
+
* Added: Image quality (optional).
|
195 |
+
|
196 |
= 1.3.38 =
|
197 |
* Fixed: Gallery title for old versions.
|
198 |
* Fixed: Conflict with Jetpack Photon module.
|