Photo Gallery by WD – Responsive Photo Gallery - Version 1.2.61

Version Description

Added: Filter by tags in frontend.

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Photo Gallery by WD – Responsive Photo Gallery
Version 1.2.61
Comparing to
See all releases

Code changes from version 1.2.60 to 1.2.61

admin/controllers/BWGControllerOptions_bwg.php CHANGED
@@ -133,7 +133,7 @@ class BWGControllerOptions_bwg {
133
  $slideshow_filmstrip_height = (isset($_POST['slideshow_filmstrip_height']) ? esc_html(stripslashes($_POST['slideshow_filmstrip_height'])) : 70);
134
  $slideshow_enable_title = (isset($_POST['slideshow_enable_title']) ? esc_html(stripslashes($_POST['slideshow_enable_title'])) : 0);
135
  $slideshow_title_position = (isset($_POST['slideshow_title_position']) ? esc_html(stripslashes($_POST['slideshow_title_position'])) : 'top-right');
136
- $slideshow_title_full_width = (isset($_POST['slideshow_title_full_width']) ? esc_html(stripslashes($_POST['slideshow_title_full_width'])) : 0);
137
  $slideshow_enable_description = (isset($_POST['slideshow_enable_description']) ? esc_html(stripslashes($_POST['slideshow_enable_description'])) : 1);
138
  $slideshow_description_position = (isset($_POST['slideshow_description_position']) ? esc_html(stripslashes($_POST['slideshow_description_position'])) : 'bottom-right');
139
  $slideshow_enable_music = (isset($_POST['slideshow_enable_music']) ? esc_html(stripslashes($_POST['slideshow_enable_music'])) : 0);
@@ -228,6 +228,7 @@ class BWGControllerOptions_bwg {
228
  $carousel_prev_next_butt = (isset($_POST['carousel_prev_next_butt']) ? esc_html(stripslashes($_POST['carousel_prev_next_butt'])) : 1);
229
  $carousel_play_pause_butt = (isset($_POST['carousel_play_pause_butt']) ? esc_html(stripslashes($_POST['carousel_play_pause_butt'])) : 1);
230
  $bwg_permissions = (isset($_POST['permissions']) ? esc_html(stripslashes($_POST['permissions'])) : 'manage_options');
 
231
 
232
  $save = $wpdb->update($wpdb->prefix . 'bwg_option', array(
233
  'images_directory' => $images_directory,
@@ -362,6 +363,7 @@ class BWGControllerOptions_bwg {
362
  'carousel_prev_next_butt' => $carousel_prev_next_butt,
363
  'carousel_play_pause_butt' => $carousel_play_pause_butt,
364
  'permissions' => $bwg_permissions,
 
365
  ), array('id' => 1));
366
 
367
  if ($save !== FALSE) {
133
  $slideshow_filmstrip_height = (isset($_POST['slideshow_filmstrip_height']) ? esc_html(stripslashes($_POST['slideshow_filmstrip_height'])) : 70);
134
  $slideshow_enable_title = (isset($_POST['slideshow_enable_title']) ? esc_html(stripslashes($_POST['slideshow_enable_title'])) : 0);
135
  $slideshow_title_position = (isset($_POST['slideshow_title_position']) ? esc_html(stripslashes($_POST['slideshow_title_position'])) : 'top-right');
136
+ $slideshow_title_full_width = (isset($_POST['slideshow_title_full_width']) ? esc_html(stripslashes($_POST['slideshow_title_full_width'])) : 0);
137
  $slideshow_enable_description = (isset($_POST['slideshow_enable_description']) ? esc_html(stripslashes($_POST['slideshow_enable_description'])) : 1);
138
  $slideshow_description_position = (isset($_POST['slideshow_description_position']) ? esc_html(stripslashes($_POST['slideshow_description_position'])) : 'bottom-right');
139
  $slideshow_enable_music = (isset($_POST['slideshow_enable_music']) ? esc_html(stripslashes($_POST['slideshow_enable_music'])) : 0);
228
  $carousel_prev_next_butt = (isset($_POST['carousel_prev_next_butt']) ? esc_html(stripslashes($_POST['carousel_prev_next_butt'])) : 1);
229
  $carousel_play_pause_butt = (isset($_POST['carousel_play_pause_butt']) ? esc_html(stripslashes($_POST['carousel_play_pause_butt'])) : 1);
230
  $bwg_permissions = (isset($_POST['permissions']) ? esc_html(stripslashes($_POST['permissions'])) : 'manage_options');
231
+ $show_tag_box = (isset($_POST['show_tag_box']) ? esc_html(stripslashes($_POST['show_tag_box'])) : 0);
232
 
233
  $save = $wpdb->update($wpdb->prefix . 'bwg_option', array(
234
  'images_directory' => $images_directory,
363
  'carousel_prev_next_butt' => $carousel_prev_next_butt,
364
  'carousel_play_pause_butt' => $carousel_play_pause_butt,
365
  'permissions' => $bwg_permissions,
366
+ 'show_tag_box' => $show_tag_box,
367
  ), array('id' => 1));
368
 
369
  if ($save !== FALSE) {
admin/models/BWGModelAlbums_bwg.php CHANGED
@@ -30,7 +30,7 @@ class BWGModelAlbums_bwg {
30
  ////////////////////////////////////////////////////////////////////////////////////////
31
  public function get_rows_data() {
32
  global $wpdb;
33
- if (!current_user_can('manage_options') && $wpdb->get_var("SELECT gallery_role FROM " . $wpdb->prefix . "bwg_option")) {
34
  $where = " WHERE author=" . get_current_user_id();
35
  }
36
  else {
@@ -55,7 +55,7 @@ class BWGModelAlbums_bwg {
55
  public function get_row_data($id) {
56
  global $wpdb;
57
  if ($id != 0) {
58
- if (!current_user_can('manage_options') && $wpdb->get_var("SELECT gallery_role FROM " . $wpdb->prefix . "bwg_option")) {
59
  $where = " WHERE author=" . get_current_user_id();
60
  }
61
  else {
@@ -79,7 +79,7 @@ class BWGModelAlbums_bwg {
79
 
80
  public function get_albums_galleries_rows_data($album_id) {
81
  global $wpdb;
82
- if (!current_user_can('manage_options') && $wpdb->get_var("SELECT gallery_role FROM " . $wpdb->prefix . "bwg_option")) {
83
  $where = " AND author=" . get_current_user_id();
84
  }
85
  else {
30
  ////////////////////////////////////////////////////////////////////////////////////////
31
  public function get_rows_data() {
32
  global $wpdb;
33
+ if (!current_user_can('manage_options') && $wpdb->get_var("SELECT album_role FROM " . $wpdb->prefix . "bwg_option")) {
34
  $where = " WHERE author=" . get_current_user_id();
35
  }
36
  else {
55
  public function get_row_data($id) {
56
  global $wpdb;
57
  if ($id != 0) {
58
+ if (!current_user_can('manage_options') && $wpdb->get_var("SELECT album_role FROM " . $wpdb->prefix . "bwg_option")) {
59
  $where = " WHERE author=" . get_current_user_id();
60
  }
61
  else {
79
 
80
  public function get_albums_galleries_rows_data($album_id) {
81
  global $wpdb;
82
+ if (!current_user_can('manage_options') && $wpdb->get_var("SELECT album_role FROM " . $wpdb->prefix . "bwg_option")) {
83
  $where = " AND author=" . get_current_user_id();
84
  }
85
  else {
admin/models/BWGModelOptions_bwg.php CHANGED
@@ -155,13 +155,10 @@ class BWGModelOptions_bwg {
155
  $row->enable_loop = 1;
156
  $row->enable_addthis = 0;
157
  $row->addthis_profile_id = '';
158
-
159
- //carousel
160
-
161
  $row->carousel_interval = 5;
162
  $row->carousel_width = 300;
163
  $row->carousel_height = 300;
164
- /*$row->carousel_title_full_width = 620;*/
165
  $row->carousel_image_column_number = 5;
166
  $row->carousel_image_par = 0.75;
167
  $row->carousel_enable_autoplay = 0;
@@ -171,6 +168,9 @@ class BWGModelOptions_bwg {
171
  $row->carousel_prev_next_butt = 1;
172
  $row->carousel_play_pause_butt = 1;
173
  $row->permissions = 'manage_options';
 
 
 
174
  }
175
  return $row;
176
  }
155
  $row->enable_loop = 1;
156
  $row->enable_addthis = 0;
157
  $row->addthis_profile_id = '';
158
+
 
 
159
  $row->carousel_interval = 5;
160
  $row->carousel_width = 300;
161
  $row->carousel_height = 300;
 
162
  $row->carousel_image_column_number = 5;
163
  $row->carousel_image_par = 0.75;
164
  $row->carousel_enable_autoplay = 0;
168
  $row->carousel_prev_next_butt = 1;
169
  $row->carousel_play_pause_butt = 1;
170
  $row->permissions = 'manage_options';
171
+ $row->facebook_app_id = '';
172
+ $row->facebook_app_secret = '';
173
+ $row->show_tag_box = 0;
174
  }
175
  return $row;
176
  }
admin/views/BWGViewBWGShortcode.php CHANGED
@@ -230,12 +230,17 @@ class BWGViewBWGShortcode {
230
  <input type="radio" name="show_search_box" id="show_search_box_0" value="0" <?php if (!$option_row->show_search_box) echo 'checked="checked"'; ?> onchange="bwg_show_search_box()" /><label for="show_search_box_0">No</label>
231
  </td>
232
  </tr>
233
-
234
  <tr id="tr_search_box_width">
235
  <td class="spider_label"><label for="search_box_width">Search box width: </label></td>
236
  <td><input type="text" name="search_box_width" id="search_box_width" value="<?php echo $option_row->search_box_width; ?>" class="spider_int_input" /> px</td>
237
  </tr>
238
-
 
 
 
 
 
 
239
  <tr id="tr_show_sort_images">
240
  <td class="spider_label"><label>Show "Order by" dropdown list: </label></td>
241
  <td>
@@ -243,7 +248,6 @@ class BWGViewBWGShortcode {
243
  <input type="radio" name="show_sort_images" id="show_sort_images_0" value="0" <?php if (!$option_row->show_sort_images) echo 'checked="checked"'; ?> onchange="" /><label for="show_sort_images_0">No</label>
244
  </td>
245
  </tr>
246
-
247
  <!--Thumbnails, Masonry viewies-->
248
  <tr id="tr_masonry_hor_ver">
249
  <td class="spider_label"><label>Masonry: </label></td>
@@ -1131,6 +1135,12 @@ class BWGViewBWGShortcode {
1131
  else {
1132
  jQuery("#show_sort_images_0").attr('checked', 'checked');
1133
  }
 
 
 
 
 
 
1134
  if (short_code['search_box_width']) {
1135
  jQuery("#search_box_width").val(short_code['search_box_width']);
1136
  }
@@ -1328,6 +1338,12 @@ class BWGViewBWGShortcode {
1328
  else {
1329
  jQuery("#compuct_album_resizable_mosaic_0").attr('checked', 'checked');
1330
  }
 
 
 
 
 
 
1331
  jQuery("#compuct_album_mosaic_total_width").val(short_code['compuct_album_mosaic_total_width']);
1332
  break;
1333
 
@@ -1408,6 +1424,12 @@ class BWGViewBWGShortcode {
1408
  else {
1409
  jQuery("#extended_album_resizable_mosaic_0").attr('checked', 'checked');
1410
  }
 
 
 
 
 
 
1411
  jQuery("#extended_album_mosaic_total_width").val(short_code['extended_album_mosaic_total_width']);
1412
  break;
1413
 
@@ -1456,7 +1478,13 @@ class BWGViewBWGShortcode {
1456
  else {
1457
  jQuery("#popup_info_no").attr('checked', 'checked');
1458
  }
1459
- if (short_code['popup_info_full_width'] == 1) {
 
 
 
 
 
 
1460
  jQuery("#popup_info_full_width_1").attr('checked', 'checked');
1461
  }
1462
  else {
@@ -1624,6 +1652,7 @@ class BWGViewBWGShortcode {
1624
  tagtext += ' thumb_height="' + jQuery("#thumb_height").val() + '"';
1625
  title = ' gal_title="' + jQuery.trim(jQuery('#gallery option:selected').text().replace("'", "").replace('"', '')) + '"';
1626
  tagtext += ' load_more_image_count="' + jQuery("#load_more_image_count").val() + '"';
 
1627
  break;
1628
 
1629
  }
@@ -1688,6 +1717,7 @@ class BWGViewBWGShortcode {
1688
  tagtext += ' compuct_album_enable_page="' + jQuery("input[name=compuct_album_enable_page]:checked").val() + '"';
1689
  tagtext += ' compuct_album_load_more_image_count="' + jQuery("#compuct_album_load_more_image_count").val() + '"';
1690
  tagtext += ' compuct_albums_per_page_load_more="' + jQuery("#compuct_albums_per_page_load_more").val() + '"';
 
1691
  title = ' gal_title="' + jQuery.trim(jQuery('#album option:selected').text().replace("'", "").replace('"', '')) + '"';
1692
  break;
1693
 
@@ -1716,6 +1746,7 @@ class BWGViewBWGShortcode {
1716
  tagtext += ' extended_album_enable_page="' + jQuery("input[name=extended_album_enable_page]:checked").val() + '"';
1717
  tagtext += ' extended_album_load_more_image_count="' + jQuery("#extended_album_load_more_image_count").val() + '"';
1718
  tagtext += ' extended_albums_per_page_load_more="' + jQuery("#extended_albums_per_page_load_more").val() + '"';
 
1719
  title = ' gal_title="' + jQuery.trim(jQuery('#album option:selected').text().replace("'", "").replace('"', '')) + '"';
1720
  break;
1721
 
@@ -1746,6 +1777,7 @@ class BWGViewBWGShortcode {
1746
  tagtext += ' popup_enable_google="' + jQuery("input[name=popup_enable_google]:checked").val() + '"';
1747
  tagtext += ' popup_enable_pinterest="' + jQuery("input[name=popup_enable_pinterest]:checked").val() + '"';
1748
  tagtext += ' popup_enable_tumblr="' + jQuery("input[name=popup_enable_tumblr]:checked").val() + '"';
 
1749
  }
1750
  // Watermark parameters.
1751
  tagtext += ' watermark_type="' + jQuery("input[name=watermark_type]:checked").val() + '"';
230
  <input type="radio" name="show_search_box" id="show_search_box_0" value="0" <?php if (!$option_row->show_search_box) echo 'checked="checked"'; ?> onchange="bwg_show_search_box()" /><label for="show_search_box_0">No</label>
231
  </td>
232
  </tr>
 
233
  <tr id="tr_search_box_width">
234
  <td class="spider_label"><label for="search_box_width">Search box width: </label></td>
235
  <td><input type="text" name="search_box_width" id="search_box_width" value="<?php echo $option_row->search_box_width; ?>" class="spider_int_input" /> px</td>
236
  </tr>
237
+ <tr id="tr_show_tag_box">
238
+ <td class="spider_label"><label>Show tag box: </label></td>
239
+ <td>
240
+ <input type="radio" name="show_tag_box" id="show_tag_box_1" value="1" <?php if ($option_row->show_tag_box) echo 'checked="checked"'; ?> /><label for="show_tag_box_1">Yes</label>
241
+ <input type="radio" name="show_tag_box" id="show_tag_box_0" value="0" <?php if (!$option_row->show_tag_box) echo 'checked="checked"'; ?> /><label for="show_search_box_0">No</label>
242
+ </td>
243
+ </tr>
244
  <tr id="tr_show_sort_images">
245
  <td class="spider_label"><label>Show "Order by" dropdown list: </label></td>
246
  <td>
248
  <input type="radio" name="show_sort_images" id="show_sort_images_0" value="0" <?php if (!$option_row->show_sort_images) echo 'checked="checked"'; ?> onchange="" /><label for="show_sort_images_0">No</label>
249
  </td>
250
  </tr>
 
251
  <!--Thumbnails, Masonry viewies-->
252
  <tr id="tr_masonry_hor_ver">
253
  <td class="spider_label"><label>Masonry: </label></td>
1135
  else {
1136
  jQuery("#show_sort_images_0").attr('checked', 'checked');
1137
  }
1138
+ if (short_code['show_tag_box'] == 1) {
1139
+ jQuery("#show_tag_box_1").attr('checked', 'checked');
1140
+ }
1141
+ else {
1142
+ jQuery("#show_tag_box_0").attr('checked', 'checked');
1143
+ }
1144
  if (short_code['search_box_width']) {
1145
  jQuery("#search_box_width").val(short_code['search_box_width']);
1146
  }
1338
  else {
1339
  jQuery("#compuct_album_resizable_mosaic_0").attr('checked', 'checked');
1340
  }
1341
+ if (short_code['show_tag_box'] == 1) {
1342
+ jQuery("#show_tag_box_1").attr('checked', 'checked');
1343
+ }
1344
+ else {
1345
+ jQuery("#show_tag_box_0").attr('checked', 'checked');
1346
+ }
1347
  jQuery("#compuct_album_mosaic_total_width").val(short_code['compuct_album_mosaic_total_width']);
1348
  break;
1349
 
1424
  else {
1425
  jQuery("#extended_album_resizable_mosaic_0").attr('checked', 'checked');
1426
  }
1427
+ if (short_code['show_tag_box'] == 1) {
1428
+ jQuery("#show_tag_box_1").attr('checked', 'checked');
1429
+ }
1430
+ else {
1431
+ jQuery("#show_tag_box_0").attr('checked', 'checked');
1432
+ }
1433
  jQuery("#extended_album_mosaic_total_width").val(short_code['extended_album_mosaic_total_width']);
1434
  break;
1435
 
1478
  else {
1479
  jQuery("#popup_info_no").attr('checked', 'checked');
1480
  }
1481
+ if (short_code['show_tag_box'] == 0 || !short_code['show_tag_box']) {
1482
+ jQuery("#show_tag_box_0").attr('checked', 'checked');
1483
+ }
1484
+ else {
1485
+ jQuery("#show_tag_box_1").attr('checked', 'checked');
1486
+ }
1487
+ if (short_code['popup_info_full_width'] == 1) {
1488
  jQuery("#popup_info_full_width_1").attr('checked', 'checked');
1489
  }
1490
  else {
1652
  tagtext += ' thumb_height="' + jQuery("#thumb_height").val() + '"';
1653
  title = ' gal_title="' + jQuery.trim(jQuery('#gallery option:selected').text().replace("'", "").replace('"', '')) + '"';
1654
  tagtext += ' load_more_image_count="' + jQuery("#load_more_image_count").val() + '"';
1655
+ tagtext += ' show_tag_box="' + jQuery("input[name=show_tag_box]:checked").val() + '"';
1656
  break;
1657
 
1658
  }
1717
  tagtext += ' compuct_album_enable_page="' + jQuery("input[name=compuct_album_enable_page]:checked").val() + '"';
1718
  tagtext += ' compuct_album_load_more_image_count="' + jQuery("#compuct_album_load_more_image_count").val() + '"';
1719
  tagtext += ' compuct_albums_per_page_load_more="' + jQuery("#compuct_albums_per_page_load_more").val() + '"';
1720
+ tagtext += ' show_tag_box="' + jQuery("input[name=show_tag_box]:checked").val() + '"';
1721
  title = ' gal_title="' + jQuery.trim(jQuery('#album option:selected').text().replace("'", "").replace('"', '')) + '"';
1722
  break;
1723
 
1746
  tagtext += ' extended_album_enable_page="' + jQuery("input[name=extended_album_enable_page]:checked").val() + '"';
1747
  tagtext += ' extended_album_load_more_image_count="' + jQuery("#extended_album_load_more_image_count").val() + '"';
1748
  tagtext += ' extended_albums_per_page_load_more="' + jQuery("#extended_albums_per_page_load_more").val() + '"';
1749
+ tagtext += ' show_tag_box="' + jQuery("input[name=show_tag_box]:checked").val() + '"';
1750
  title = ' gal_title="' + jQuery.trim(jQuery('#album option:selected').text().replace("'", "").replace('"', '')) + '"';
1751
  break;
1752
 
1777
  tagtext += ' popup_enable_google="' + jQuery("input[name=popup_enable_google]:checked").val() + '"';
1778
  tagtext += ' popup_enable_pinterest="' + jQuery("input[name=popup_enable_pinterest]:checked").val() + '"';
1779
  tagtext += ' popup_enable_tumblr="' + jQuery("input[name=popup_enable_tumblr]:checked").val() + '"';
1780
+ tagtext += ' show_tag_box="' + jQuery("input[name=show_tag_box]:checked").val() + '"';
1781
  }
1782
  // Watermark parameters.
1783
  tagtext += ' watermark_type="' + jQuery("input[name=watermark_type]:checked").val() + '"';
admin/views/BWGViewOptions_bwg.php CHANGED
@@ -207,6 +207,16 @@ class BWGViewOptions_bwg {
207
  <div class="spider_description"></div>
208
  </td>
209
  </tr>
 
 
 
 
 
 
 
 
 
 
210
  <tr>
211
  <td class="spider_label_options">
212
  <label>Preload images:</label>
@@ -226,7 +236,7 @@ class BWGViewOptions_bwg {
226
  <div class="spider_description">Count of images to preload (0 for all).</div>
227
  </td>
228
  </tr>
229
- <tr>
230
  <td class="spider_label_options">
231
  <label>Import from Media Library:</label>
232
  </td>
@@ -237,16 +247,16 @@ class BWGViewOptions_bwg {
237
  </td>
238
  </tr>
239
  <tr>
240
- <td class="spider_label_options">
241
- <label>Enable href attribute:</label>
242
- </td>
243
- <td>
244
- <input type="radio" name="enable_seo" id="enable_seo_1" value="1" <?php if ($row->enable_seo) echo 'checked="checked"'; ?> /><label for="enable_seo_1">Yes</label>
245
- <input type="radio" name="enable_seo" id="enable_seo_0" value="0" <?php if (!$row->enable_seo) echo 'checked="checked"'; ?> /><label for="enable_seo_0">No</label>
246
- <div class="spider_description">Disable this option only if it conflicts with your theme.</div>
247
- </td>
248
- </tr>
249
- <tr>
250
  <td class="spider_label_options">
251
  <label>Meta auto-fill:</label>
252
  </td>
@@ -288,12 +298,12 @@ class BWGViewOptions_bwg {
288
  </td>
289
  <td>
290
  <input type="text" id="built_in_watermark_url" name="built_in_watermark_url" style="width: 68%;" value="<?php echo $row->built_in_watermark_url; ?>" style="display:inline-block;" onchange="preview_built_in_watermark()" />
291
- <?php
292
- $query_url = add_query_arg(array('action' => 'addImages', 'width' => '700', 'height' => '550', 'extensions' => 'png', 'callback' => 'bwg_add_built_in_watermark_image'), admin_url('admin-ajax.php'));
293
- $query_url = wp_nonce_url( $query_url, 'addImages', 'bwg_nonce' );
294
- $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url );
295
- ?>
296
- <a href="<?php echo $query_url; ?>" id="button_add_built_in_watermark_image" class="button-primary thickbox thickbox-preview"
297
  title="Add image"
298
  onclick="return false;"
299
  style="margin-bottom:5px;">
@@ -441,11 +451,13 @@ class BWGViewOptions_bwg {
441
  </td>
442
  <td>
443
  <input type="text" id="watermark_url" name="watermark_url" style="width: 68%;" value="<?php echo $row->watermark_url; ?>" style="display:inline-block;" onchange="preview_watermark()" />
 
444
  <?php
445
  $query_url = add_query_arg(array('action' => 'addImages', 'width' => '700', 'height' => '550', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => 'bwg_add_watermark_image'), admin_url('admin-ajax.php'));
446
  $query_url = wp_nonce_url( $query_url, 'addImages', 'bwg_nonce' );
447
  $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url );
448
  ?>
 
449
  <a href="<?php echo $query_url; ?>" id="button_add_watermark_image" class="button-primary thickbox thickbox-preview"
450
  title="Add image"
451
  onclick="return false;"
@@ -881,7 +893,7 @@ class BWGViewOptions_bwg {
881
  <div class="spider_description"></div>
882
  </td>
883
  </tr>
884
- <tr id="tr_image_cycle">
885
  <td class="spider_label_options">
886
  <label>Enable loop:</label>
887
  </td>
@@ -891,7 +903,7 @@ class BWGViewOptions_bwg {
891
  <div class="spider_description"></div>
892
  </td>
893
  </tr>
894
- <tr>
895
  <td class="spider_label_options spider_free_version_label">
896
  <label>Enable AddThis:</label>
897
  </td>
207
  <div class="spider_description"></div>
208
  </td>
209
  </tr>
210
+ <tr>
211
+ <td class="spider_label_options">
212
+ <label>Show tag box:</label>
213
+ </td>
214
+ <td>
215
+ <input type="radio" name="show_tag_box" id="show_tag_box_1" value="1" <?php if ($row->show_tag_box) echo 'checked="checked"'; ?> /><label for="show_tag_box_1">Yes</label>
216
+ <input type="radio" name="show_tag_box" id="show_tag_box_0" value="0" <?php if (!$row->show_tag_box) echo 'checked="checked"'; ?> /><label for="show_tag_box_0">No</label>
217
+ <div class="spider_description"></div>
218
+ </td>
219
+ </tr>
220
  <tr>
221
  <td class="spider_label_options">
222
  <label>Preload images:</label>
236
  <div class="spider_description">Count of images to preload (0 for all).</div>
237
  </td>
238
  </tr>
239
+ <tr>
240
  <td class="spider_label_options">
241
  <label>Import from Media Library:</label>
242
  </td>
247
  </td>
248
  </tr>
249
  <tr>
250
+ <td class="spider_label_options">
251
+ <label>Enable href attribute:</label>
252
+ </td>
253
+ <td>
254
+ <input type="radio" name="enable_seo" id="enable_seo_1" value="1" <?php if ($row->enable_seo) echo 'checked="checked"'; ?> /><label for="enable_seo_1">Yes</label>
255
+ <input type="radio" name="enable_seo" id="enable_seo_0" value="0" <?php if (!$row->enable_seo) echo 'checked="checked"'; ?> /><label for="enable_seo_0">No</label>
256
+ <div class="spider_description">Disable this option only if it conflicts with your theme.</div>
257
+ </td>
258
+ </tr>
259
+ <tr>
260
  <td class="spider_label_options">
261
  <label>Meta auto-fill:</label>
262
  </td>
298
  </td>
299
  <td>
300
  <input type="text" id="built_in_watermark_url" name="built_in_watermark_url" style="width: 68%;" value="<?php echo $row->built_in_watermark_url; ?>" style="display:inline-block;" onchange="preview_built_in_watermark()" />
301
+ <?php
302
+ $query_url = add_query_arg(array('action' => 'addImages', 'width' => '700', 'height' => '550', 'extensions' => 'png', 'callback' => 'bwg_add_built_in_watermark_image'), admin_url('admin-ajax.php'));
303
+ $query_url = wp_nonce_url( $query_url, 'addImages', 'bwg_nonce' );
304
+ $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url );
305
+ ?>
306
+ <a href="<?php echo $query_url; ?>" id="button_add_built_in_watermark_image" class="button-primary thickbox thickbox-preview"
307
  title="Add image"
308
  onclick="return false;"
309
  style="margin-bottom:5px;">
451
  </td>
452
  <td>
453
  <input type="text" id="watermark_url" name="watermark_url" style="width: 68%;" value="<?php echo $row->watermark_url; ?>" style="display:inline-block;" onchange="preview_watermark()" />
454
+
455
  <?php
456
  $query_url = add_query_arg(array('action' => 'addImages', 'width' => '700', 'height' => '550', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => 'bwg_add_watermark_image'), admin_url('admin-ajax.php'));
457
  $query_url = wp_nonce_url( $query_url, 'addImages', 'bwg_nonce' );
458
  $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url );
459
  ?>
460
+
461
  <a href="<?php echo $query_url; ?>" id="button_add_watermark_image" class="button-primary thickbox thickbox-preview"
462
  title="Add image"
463
  onclick="return false;"
893
  <div class="spider_description"></div>
894
  </td>
895
  </tr>
896
+ <tr id="tr_image_cycle">
897
  <td class="spider_label_options">
898
  <label>Enable loop:</label>
899
  </td>
903
  <div class="spider_description"></div>
904
  </td>
905
  </tr>
906
+ <tr>
907
  <td class="spider_label_options spider_free_version_label">
908
  <label>Enable AddThis:</label>
909
  </td>
css/sumoselect.css ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .SlectBox { width: 200px; padding: 5px 8px;}
2
+
3
+ /*this is applied on that hidden select. DO NOT USE display:none; or visiblity:hidden; and Do not override any of these properties. */
4
+ .SelectClass { position: absolute; top: 0px; left: 0px; right: 0px; height: 100%; width: 100%; border: none; z-index: 1; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); -moz-opacity: 0; -khtml-opacity: 0; opacity: 0; }
5
+
6
+ .SumoSelect > .optWrapper > .options > li label, .SumoSelect > .CaptionCont { user-select: none; -o-user-select: none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; }
7
+
8
+ .SumoSelect { display: inline-block; margin-top: 5px;position: relative;outline:none;}
9
+ .SumoSelect:focus > .CaptionCont,.SumoSelect:hover > .CaptionCont {}
10
+ .SumoSelect > .CaptionCont { position: relative; border: min-height: 14px; background-color: #fff;border-radius:2px;margin:0px;}
11
+ .SumoSelect > .CaptionCont > span { display: block; padding-right: 30px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;cursor:default;}
12
+ /*placeholder style*/
13
+ .SumoSelect > .CaptionCont > span.placeholder { color: #ccc; font-style: italic; }
14
+
15
+ .SumoSelect > .CaptionCont > label { position: absolute; top: 0px; right: 0px; bottom: 0px; width: 30px;}
16
+ .SumoSelect > .CaptionCont > label > i { background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMdBhAJ/fwnjwAAAGFJREFUKM9jYBh+gBFKuzEwMKQwMDB8xaOWlYGB4T4DA0MrsuapDAwM//HgNwwMDDbYTJuGQ8MHBgYGJ1xOYGNgYJiBpuEpAwODHSF/siDZ+ISBgcGClEDqZ2Bg8B6CkQsAPRga0cpRtDEAAAAASUVORK5CYII=');
17
+ background-position: center center; width: 16px; height: 16px; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; margin: auto;background-repeat: no-repeat;opacity: 0.8;}
18
+
19
+ .SumoSelect > .optWrapper { top: 30px; width: 100%; position: absolute; left: 0; opacity: 0; visibility: hidden; transition: opacity 200ms ease-out, top 200ms ease-out, visibility 200ms ease-out; -webkit-transition: opacity 200ms ease-out, top 200ms ease-out, visibility 200ms ease-out; -moz-transition: opacity 200ms ease-out, top 200ms ease-out, visibility 200ms ease-out; -ms-transition: opacity 200ms ease-out, top 200ms ease-out, visibility 200ms ease-out; -o-transition: opacity 200ms ease-out, top 200ms ease-out, visibility 200ms ease-out; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; z-index: -100; background: #fff; border: 1px solid #ddd; box-shadow: 2px 3px 3px rgba(0, 0, 0, 0.11); border-radius: 3px;overflow: hidden;}
20
+ .SumoSelect > .optWrapper.open { top: 35px; visibility: visible; opacity: 1; z-index: 1000; }
21
+
22
+ .SumoSelect > .optWrapper > .options { list-style: none; display: block; padding: 0px; margin: 0px; overflow: auto; border-radius: 2px;
23
+ /*Set the height of pop up here (only for desktop mode)*/
24
+ max-height: 250px;
25
+ /*height*/ }
26
+ .SumoSelect > .optWrapper.isFloating > .options {max-height: 100%;box-shadow: 0px 0px 100px #595959;}
27
+ .SumoSelect > .optWrapper > .options > li { padding: 6px 6px; border-bottom: 1px solid #F3F3F3; position: relative; }
28
+ .SumoSelect > .optWrapper > .options > li:first-child { border-radius: 2px 2px 0px 0px; }
29
+ .SumoSelect > .optWrapper > .options > li:last-child { border-bottom: none; border-radius: 0px 0px 2px 2px; }
30
+ .SumoSelect > .optWrapper > .options > li:hover { background-color: #E4E4E4; }
31
+ .SumoSelect > .optWrapper > .options > li.sel{background-color: #a1c0e4;}
32
+
33
+ .SumoSelect > .optWrapper > .options > li label { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; display: block;cursor: pointer;}
34
+ .SumoSelect > .optWrapper > .options > li span { display: none; }
35
+
36
+ /*Floating styles*/
37
+ .SumoSelect > .optWrapper.isFloating { position: fixed; top: 0px; left: 0px; right: 0px; width: 90%; bottom: 0px; margin: auto; max-height: 90%; }
38
+
39
+ /*Hover*/
40
+ /*.SumoSelect:hover > .CaptionCont > label { background-color: #F1F1F1; }*/
41
+
42
+ /*disabled state*/
43
+ .SumoSelect > .optWrapper > .options > li.disabled { background-color: inherit;pointer-events: none;}
44
+ .SumoSelect > .optWrapper > .options > li.disabled * { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; /* IE 5-7 */ filter: alpha(opacity=50); /* Netscape */ -moz-opacity: 0.5; /* Safari 1.x */ -khtml-opacity: 0.5; /* Good browsers */ opacity: 0.5; }
45
+
46
+
47
+ /*styling for multiple select*/
48
+ .SumoSelect > .optWrapper.multiple > .options > li { padding-left: 35px;cursor: pointer;}
49
+ .SumoSelect > .optWrapper.multiple > .options > li span,
50
+ .SumoSelect .select-all > span{position:absolute;display:block;width:30px;top:0px;bottom:0px;margin-left:-35px;}
51
+ .SumoSelect > .optWrapper.multiple > .options > li span i,
52
+ .SumoSelect .select-all > span i{position: absolute;margin: auto;left: 0px;right: 0px;top: 0px;bottom: 0px;width: 14px;height: 14px;border: 1px solid #AEAEAE;border-radius: 2px;box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.15);background-color: #fff;}
53
+ .SumoSelect > .optWrapper > .MultiControls { display: none; border-top: 1px solid #ddd; background-color: #fff; box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.13); border-radius: 0px 0px 3px 3px; }
54
+ .SumoSelect > .optWrapper.multiple.isFloating > .MultiControls { display: block; margin-top: 5px; position: absolute; bottom: 0px; width: 100%; }
55
+
56
+ .SumoSelect > .optWrapper.multiple.okCancelInMulti > .MultiControls { display: block; }
57
+ .SumoSelect > .optWrapper.multiple.okCancelInMulti > .MultiControls > p { padding: 6px; }
58
+
59
+ .SumoSelect > .optWrapper.multiple > .MultiControls > p { display: inline-block; cursor: pointer; padding: 12px; width: 50%; box-sizing: border-box; text-align: center !important; }
60
+ .SumoSelect > .optWrapper.multiple > .MultiControls > p:hover { background-color: #f1f1f1; }
61
+ .SumoSelect > .optWrapper.multiple > .MultiControls > p.btnOk { border-right: 1px solid #DBDBDB; border-radius: 0px 0px 0px 3px; }
62
+ .SumoSelect > .optWrapper.multiple > .MultiControls > p.btnCancel { border-radius: 0px 0px 3px 0px; }
63
+ /*styling for select on popup mode*/
64
+ .SumoSelect > .optWrapper.isFloating > .options > li { padding: 12px 6px; }
65
+
66
+ /*styling for only multiple select on popup mode*/
67
+ .SumoSelect > .optWrapper.multiple.isFloating > .options > li { padding-left: 35px; }
68
+ .SumoSelect > .optWrapper.multiple.isFloating { padding-bottom: 43px; }
69
+ /*selected state
70
+ .SumoSelect > .optWrapper.multiple > .options > li.selected span i:after,
71
+ .SumoSelect .select-all.selected > span i:after{content: '';position: absolute;width: 11px;height: 11px;top: 2px;left: 2px;background-color: #CCCCCC ;border-radius: 2px;box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.15);}
72
+ */
73
+ .SumoSelect > .optWrapper.multiple > .options > li.selected span i,
74
+ .SumoSelect .select-all.selected > span i,
75
+ .SumoSelect .select-all.partial > span i{background-color: #CCCCCC;box-shadow: none;border-color: transparent;background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAABMSURBVAiZfc0xDkAAFIPhd2Kr1WRjcAExuIgzGUTIZ/AkImjSofnbNBAfHvzAHjOKNzhiQ42IDFXCDivaaxAJd0xYshT3QqBxqnxeHvhunpu23xnmAAAAAElFTkSuQmCC');background-repeat: no-repeat;background-position: center center;}
76
+ /*disabled state*/
77
+ .SumoSelect.disabled { opacity: 0.7;cursor: not-allowed;}
78
+ .SumoSelect.disabled > .CaptionCont{border-color:#ccc;box-shadow:none;}
79
+
80
+ /**Select all button**/
81
+ .SumoSelect .select-all{border-radius: 3px 3px 0px 0px;position: relative;border-bottom: 1px solid #ddd;background-color: #fff;padding: 8px 0px 3px 35px;height: 20px;}
82
+ .SumoSelect .select-all > span i{cursor:pointer;}
83
+ .SumoSelect .select-all.partial > span i{background-color:#ccc;}
84
+
85
+
86
+
87
+ /*styling for optgroups*/
88
+ .SumoSelect > .optWrapper > .options > li.optGroup { padding-left: 5px; text-decoration: underline; }
89
+
framework/WDWLibrary.php CHANGED
@@ -733,6 +733,85 @@ class WDWLibrary {
733
  <?php
734
  }
735
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
  public static function ajax_html_frontend_sort_box($form_id, $current_view, $cur_gal_id, $sort_by = '', $search_box_width = 180) {
737
  $bwg_search = ((isset($_POST['bwg_search_' . $current_view]) && esc_html($_POST['bwg_search_' . $current_view]) != '') ? esc_html($_POST['bwg_search_' . $current_view]) : '');
738
  $type = (isset($_POST['type_' . $current_view]) ? esc_html($_POST['type_' . $current_view]) : 'album');
733
  <?php
734
  }
735
 
736
+ public static function ajax_html_frontend_search_tags($form_id, $current_view, $cur_gal_id, $images_count, $tags_rows) {
737
+ $type = (isset($_POST['type_' . $current_view]) ? esc_html($_POST['type_' . $current_view]) : 'album');
738
+ $bwg_search_tags = (isset($_POST['bwg_tag_id_' . $cur_gal_id]) && $_POST['bwg_tag_id_' . $cur_gal_id] != '' )? $_POST['bwg_tag_id_' . $cur_gal_id] : array();
739
+ $album_gallery_id = (isset($_POST['album_gallery_id_' . $current_view]) ? esc_html($_POST['album_gallery_id_' . $current_view]) : 0);
740
+ ?>
741
+ <style>
742
+ #bwg_tag_wrap{
743
+ background-color: #FFFFFF;
744
+ width: 100%;
745
+ font-family: inherit;
746
+ margin:0 -5px 20px 5px;
747
+ z-index:200;
748
+ position:relative
749
+ }
750
+ .bwg_search_loupe_container,.bwg_search_reset_container{
751
+ font-size: 18px;
752
+ color: #CCCCCC;
753
+ cursor: pointer;
754
+ position: relative;
755
+ top: -4px;
756
+ }
757
+ #bwg_tag_container p{
758
+ text-align:center
759
+ }
760
+ #bwg_tag_container {
761
+ border: 1px solid #CCCCCC;
762
+ box-shadow: 0 0 3px 1px #CCCCCC;
763
+ border-radius: 4px;
764
+ width:256px;
765
+ float:right
766
+ }
767
+ </style>
768
+ <div id="bwg_tag_wrap" >
769
+ <div id="bwg_tag_container">
770
+ <select class="search_tags" id="bwg_tag_id_<?php echo $cur_gal_id; ?>" multiple="multiple" >
771
+ <?php
772
+ foreach($tags_rows as $tags_row){
773
+ $selected = (in_array($tags_row->term_id ? $tags_row->term_id : '' ,$bwg_search_tags)) ? 'selected="selected"' : "";
774
+ ?>
775
+ <option value="<?php echo $tags_row->term_id ?>" <?php echo $selected;?>><?php echo $tags_row->name ?></option>
776
+ <?php
777
+ }
778
+ ?>
779
+ </select>
780
+ <span class="bwg_search_loupe_container" >
781
+ <i title="<?php echo __('Search', 'bwg'); ?>" class="bwg_search fa fa-search" onclick="select_tag('<?php echo $current_view; ?>' ,'<?php echo $form_id; ?>', '<?php echo $cur_gal_id; ?>', <?php echo $album_gallery_id; ?>,'<?php echo $type; ?>');"></i>
782
+ </span>
783
+ <span class="bwg_search_reset_container" >
784
+ <i title="<?php echo __('Reset', 'bwg'); ?>" class="bwg_reset fa fa-times" onclick="clear_input_<?php echo $cur_gal_id; ?>('<?php echo $cur_gal_id; ?>'),spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $cur_gal_id; ?>', <?php echo $album_gallery_id; ?>, '', '<?php echo $type; ?>', 1)"></i>
785
+ </span>
786
+ <input type="hidden" id="bwg_tags_id_<?php echo $cur_gal_id; ?>" value=""/>
787
+ </div>
788
+ <div style="clear:both"></div>
789
+ </div>
790
+ <script>
791
+ jQuery(".search_tags").SumoSelect();
792
+ function select_tag( current_view, form_id, cur_gal_id, album_gallery_id, type ){
793
+ spider_frontend_ajax(form_id, current_view, cur_gal_id, album_gallery_id, '', type, 1);
794
+ };
795
+ function clear_input_<?php echo $cur_gal_id; ?> (cur_gal_id) {
796
+ jQuery("#bwg_tag_id_" + cur_gal_id).val(1);
797
+ }
798
+ function searchTags(obj){
799
+ var valthis = jQuery(obj).val().toLowerCase();
800
+ var num = 0;
801
+ jQuery('#bwg_tag_container .options li label').each(function () {
802
+ var text = jQuery(this).text().toLowerCase();
803
+ if(text.indexOf(valthis) != -1) {
804
+ jQuery(this).closest("li").show();
805
+ }
806
+ else{
807
+ jQuery(this).closest("li").hide();
808
+ }
809
+ });
810
+ }
811
+ </script>
812
+ <?php
813
+ }
814
+
815
  public static function ajax_html_frontend_sort_box($form_id, $current_view, $cur_gal_id, $sort_by = '', $search_box_width = 180) {
816
  $bwg_search = ((isset($_POST['bwg_search_' . $current_view]) && esc_html($_POST['bwg_search_' . $current_view]) != '') ? esc_html($_POST['bwg_search_' . $current_view]) : '');
817
  $type = (isset($_POST['type_' . $current_view]) ? esc_html($_POST['type_' . $current_view]) : 'album');
frontend/models/BWGModelAlbum_compact_preview.php CHANGED
@@ -86,7 +86,13 @@ class BWGModelAlbum_compact_preview {
86
  else {
87
  $where = '';
88
  }
89
- $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 ' . $where . ' AND gallery_id="%d" ORDER BY `' . $sort_by . '` ' . $sort_direction . $limit_str, $id));
 
 
 
 
 
 
90
  return $row;
91
  }
92
 
@@ -99,7 +105,12 @@ class BWGModelAlbum_compact_preview {
99
  else {
100
  $where = '';
101
  }
102
- $total = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 ' . $where . ' AND gallery_id="%d"', $id));
 
 
 
 
 
103
  $page_nav['total'] = $total;
104
  if (isset($_REQUEST['page_number_' . $bwg]) && $_REQUEST['page_number_' . $bwg]) {
105
  $page_nav['limit'] = (int) $_REQUEST['page_number_' . $bwg];
@@ -154,6 +165,11 @@ class BWGModelAlbum_compact_preview {
154
  return get_permalink($bwg_post_id->ID);
155
  }
156
 
 
 
 
 
 
157
  ////////////////////////////////////////////////////////////////////////////////////////
158
  // Getters & Setters //
159
  ////////////////////////////////////////////////////////////////////////////////////////
86
  else {
87
  $where = '';
88
  }
89
+ if (isset($_REQUEST['bwg_tag_id_bwg_album_compact_' . $bwg]) && $_REQUEST['bwg_tag_id_bwg_album_compact_' . $bwg]) {
90
+ $row = $wpdb->get_results($wpdb->prepare('SELECT image.* FROM ' . $wpdb->prefix . 'bwg_image as image INNER JOIN
91
+ (SELECT GROUP_CONCAT( tag_id SEPARATOR ",") AS tags, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag WHERE gallery_id="' . $id . '" GROUP BY image_id) AS tag ON image.id=tag.image_id WHERE image.published=1 ' . $where . ' AND CONCAT(",", tag.tags, ",") REGEXP ",('.implode("|",$_REQUEST['bwg_tag_id_bwg_album_compact_' . $bwg]).')," AND image.gallery_id="%d" ORDER BY image.' . $sort_by . ' ' . $sort_direction . ' ' . $limit_str,$id));
92
+ }
93
+ else {
94
+ $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 ' . $where . ' AND gallery_id="%d" ORDER BY `' . $sort_by . '` ' . $sort_direction . $limit_str, $id));
95
+ }
96
  return $row;
97
  }
98
 
105
  else {
106
  $where = '';
107
  }
108
+ if (isset($_REQUEST['bwg_tag_id_bwg_album_compact_' . $bwg]) && $_REQUEST['bwg_tag_id_bwg_album_compact_' . $bwg]) {
109
+ $total = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image as image INNER JOIN (SELECT GROUP_CONCAT( tag_id SEPARATOR ",") AS tags, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag GROUP BY image_id) AS tag ON image.id=tag.image_id WHERE image.published=1 ' . $where . ' AND CONCAT(",", tag.tags, ",") REGEXP ",('.implode("|",$_REQUEST['bwg_tag_id_bwg_album_compact_' . $bwg]).')," ');
110
+ }
111
+ else {
112
+ $total = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 ' . $where . ' AND gallery_id="%d"', $id));
113
+ }
114
  $page_nav['total'] = $total;
115
  if (isset($_REQUEST['page_number_' . $bwg]) && $_REQUEST['page_number_' . $bwg]) {
116
  $page_nav['limit'] = (int) $_REQUEST['page_number_' . $bwg];
165
  return get_permalink($bwg_post_id->ID);
166
  }
167
 
168
+ public function get_tags_rows_data($gallery_id) {
169
+ global $wpdb;
170
+ $row = $wpdb->get_results('Select t1.* FROM ' . $wpdb->prefix . 'terms AS t1 LEFT JOIN ' . $wpdb->prefix . 'term_taxonomy AS t2 ON t1.term_id = t2.term_id LEFT JOIN ( SELECT DISTINCT tag_id , gallery_id FROM ' . $wpdb->prefix . 'bwg_image_tag) AS t3 ON t1.term_id=t3.tag_id WHERE taxonomy = "bwg_tag" AND t3.gallery_id="' . $gallery_id . '"');
171
+ return $row;
172
+ }
173
  ////////////////////////////////////////////////////////////////////////////////////////
174
  // Getters & Setters //
175
  ////////////////////////////////////////////////////////////////////////////////////////
frontend/models/BWGModelAlbum_extended_preview.php CHANGED
@@ -75,7 +75,14 @@ class BWGModelAlbum_extended_preview {
75
  else {
76
  $limit_str = '';
77
  }
78
- $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 ' . $where . ' AND gallery_id="%d" ORDER BY `' . $sort_by . '` ' . $sort_direction . $limit_str, $id));
 
 
 
 
 
 
 
79
  return $row;
80
  }
81
 
@@ -88,7 +95,12 @@ class BWGModelAlbum_extended_preview {
88
  else {
89
  $where = '';
90
  }
91
- $total = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 ' . $where . ' AND gallery_id="%d"', $id));
 
 
 
 
 
92
  $page_nav['total'] = $total;
93
  if (isset($_REQUEST['page_number_' . $bwg]) && $_REQUEST['page_number_' . $bwg]) {
94
  $page_nav['limit'] = (int) $_REQUEST['page_number_' . $bwg];
@@ -117,6 +129,11 @@ class BWGModelAlbum_extended_preview {
117
  return $row;
118
  }
119
 
 
 
 
 
 
120
  ////////////////////////////////////////////////////////////////////////////////////////
121
  // Getters & Setters //
122
  ////////////////////////////////////////////////////////////////////////////////////////
75
  else {
76
  $limit_str = '';
77
  }
78
+
79
+ if (isset($_REQUEST['bwg_tag_id_bwg_album_extended_' . $bwg]) && $_REQUEST['bwg_tag_id_bwg_album_extended_' . $bwg]) {
80
+ $row = $wpdb->get_results($wpdb->prepare('SELECT image.* FROM ' . $wpdb->prefix . 'bwg_image as image INNER JOIN
81
+ (SELECT GROUP_CONCAT( tag_id SEPARATOR ",") AS tags, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag WHERE gallery_id="' . $id . '" GROUP BY image_id) AS tag ON image.id=tag.image_id WHERE image.published=1 ' . $where . ' AND CONCAT(",", tag.tags, ",") REGEXP ",('.implode("|",$_REQUEST['bwg_tag_id_bwg_album_extended_' . $bwg]).')," AND image.gallery_id="%d" ORDER BY image.' . $sort_by . ' ' . $sort_direction . ' ' . $limit_str, $id));
82
+ }
83
+ else {
84
+ $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 ' . $where . ' AND gallery_id="%d" ORDER BY `' . $sort_by . '` ' . $sort_direction . $limit_str, $id));
85
+ }
86
  return $row;
87
  }
88
 
95
  else {
96
  $where = '';
97
  }
98
+ if (isset($_REQUEST['bwg_tag_id_bwg_album_extended_' . $bwg]) && $_REQUEST['bwg_tag_id_bwg_album_extended_' . $bwg]) {
99
+ $total = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image as image INNER JOIN (SELECT GROUP_CONCAT( tag_id SEPARATOR ",") AS tags, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag GROUP BY image_id) AS tag ON image.id=tag.image_id WHERE image.published=1 ' . $where . ' AND CONCAT(",", tag.tags, ",") REGEXP ",('.implode("|",$_REQUEST['bwg_tag_id_bwg_album_extended_' . $bwg]).')," ');
100
+ }
101
+ else {
102
+ $total = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 ' . $where . ' AND gallery_id="%d"', $id));
103
+ }
104
  $page_nav['total'] = $total;
105
  if (isset($_REQUEST['page_number_' . $bwg]) && $_REQUEST['page_number_' . $bwg]) {
106
  $page_nav['limit'] = (int) $_REQUEST['page_number_' . $bwg];
129
  return $row;
130
  }
131
 
132
+ public function get_tags_rows_data($gallery_id) {
133
+ global $wpdb;
134
+ $row = $wpdb->get_results('Select t1.* FROM ' . $wpdb->prefix . 'terms AS t1 LEFT JOIN ' . $wpdb->prefix . 'term_taxonomy AS t2 ON t1.term_id = t2.term_id LEFT JOIN ( SELECT DISTINCT tag_id , gallery_id FROM ' . $wpdb->prefix . 'bwg_image_tag) AS t3 ON t1.term_id=t3.tag_id WHERE taxonomy = "bwg_tag" AND t3.gallery_id="' . $gallery_id . '"');
135
+ return $row;
136
+ }
137
  ////////////////////////////////////////////////////////////////////////////////////////
138
  // Getters & Setters //
139
  ////////////////////////////////////////////////////////////////////////////////////////
frontend/models/BWGModelGalleryBox.php CHANGED
@@ -41,7 +41,7 @@ class BWGModelGalleryBox {
41
  return $row;
42
  }
43
 
44
- public function get_image_rows_data($gallery_id, $sort_by, $order_by = 'asc') {
45
  global $wpdb;
46
  if ($sort_by == 'size' || $sort_by == 'resolution') {
47
  $sort_by = ' CAST(t1.' . $sort_by . ' AS SIGNED) ';
@@ -52,7 +52,15 @@ class BWGModelGalleryBox {
52
  if (preg_replace('/\s+/', '', $order_by) != 'asc') {
53
  $order_by = 'desc';
54
  }
55
- $row = $wpdb->get_results($wpdb->prepare('SELECT t1.*,t2.rate FROM ' . $wpdb->prefix . 'bwg_image as t1 LEFT JOIN (SELECT rate, image_id FROM ' . $wpdb->prefix . 'bwg_image_rate WHERE ip="%s") as t2 ON t1.id=t2.image_id WHERE t1.published=1 AND t1.gallery_id="%d" ORDER BY ' . $sort_by . ' ' . $order_by, $_SERVER['REMOTE_ADDR'], $gallery_id));
 
 
 
 
 
 
 
 
56
  return $row;
57
  }
58
 
41
  return $row;
42
  }
43
 
44
+ public function get_image_rows_data($gallery_id, $bwg, $sort_by, $order_by = 'asc') {
45
  global $wpdb;
46
  if ($sort_by == 'size' || $sort_by == 'resolution') {
47
  $sort_by = ' CAST(t1.' . $sort_by . ' AS SIGNED) ';
52
  if (preg_replace('/\s+/', '', $order_by) != 'asc') {
53
  $order_by = 'desc';
54
  }
55
+
56
+ $filter_tags = (isset($_REQUEST['filter_tag_'. $bwg]) && $_REQUEST['filter_tag_'. $bwg] ) ? explode(",",$_REQUEST['filter_tag_'. $bwg]) : array();
57
+
58
+ if ($filter_tags) {
59
+ $row = $wpdb->get_results($wpdb->prepare('SELECT t1.*,t2.rate FROM ' . $wpdb->prefix . 'bwg_image as t1 LEFT JOIN (SELECT rate, image_id FROM ' . $wpdb->prefix . 'bwg_image_rate WHERE ip="%s") as t2 ON t1.id=t2.image_id INNER JOIN (SELECT GROUP_CONCAT( tag_id SEPARATOR ",") AS tags, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag WHERE gallery_id="' . $gallery_id . '" GROUP BY image_id) AS tag ON t1.id=tag.image_id WHERE t1.published=1 AND CONCAT(",", tag.tags, ",") REGEXP ",('.implode("|",$filter_tags).')," AND t1.gallery_id="%d" ORDER BY ' . $sort_by . ' ' . $order_by, $_SERVER['REMOTE_ADDR'], $gallery_id));
60
+ }
61
+ else {
62
+ $row = $wpdb->get_results($wpdb->prepare('SELECT t1.*,t2.rate FROM ' . $wpdb->prefix . 'bwg_image as t1 LEFT JOIN (SELECT rate, image_id FROM ' . $wpdb->prefix . 'bwg_image_rate WHERE ip="%s") as t2 ON t1.id=t2.image_id WHERE t1.published=1 AND t1.gallery_id="%d" ORDER BY ' . $sort_by . ' ' . $order_by, $_SERVER['REMOTE_ADDR'], $gallery_id));
63
+ }
64
  return $row;
65
  }
66
 
frontend/models/BWGModelThumbnails.php CHANGED
@@ -79,7 +79,12 @@ class BWGModelThumbnails {
79
  else {
80
  $limit_str = '';
81
  }
82
- if($type == 'tag') {
 
 
 
 
 
83
  $row = $wpdb->get_results($wpdb->prepare('SELECT image.* FROM ' . $wpdb->prefix . 'bwg_image as image INNER JOIN ' . $wpdb->prefix . 'bwg_image_tag as tag ON image.id=tag.image_id WHERE image.published=1 ' . $where . ' AND tag.tag_id="%d" ORDER BY ' . $sort_by . ' ' . $sort_direction . ' ' . $limit_str, $id));
84
  }
85
  else {
@@ -107,7 +112,10 @@ class BWGModelThumbnails {
107
  $where = '';
108
  }
109
  }
110
- if ($type == 'tag') {
 
 
 
111
  $total = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image as image INNER JOIN ' . $wpdb->prefix . 'bwg_image_tag as tag ON image.id=tag.image_id WHERE image.published=1 ' . $where . ' AND tag.tag_id="%d"', $id));
112
  }
113
  else {
@@ -129,6 +137,11 @@ class BWGModelThumbnails {
129
  return $row;
130
  }
131
 
 
 
 
 
 
132
  ////////////////////////////////////////////////////////////////////////////////////////
133
  // Getters & Setters //
134
  ////////////////////////////////////////////////////////////////////////////////////////
79
  else {
80
  $limit_str = '';
81
  }
82
+
83
+ if( isset($_REQUEST['bwg_tag_id_bwg_standart_thumbnails_' . $bwg]) && $_REQUEST['bwg_tag_id_bwg_standart_thumbnails_' . $bwg] ){
84
+ $row = $wpdb->get_results('SELECT image.* FROM ' . $wpdb->prefix . 'bwg_image as image INNER JOIN
85
+ (SELECT GROUP_CONCAT( tag_id SEPARATOR ",") AS tags, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag WHERE gallery_id="' . $id . '" GROUP BY image_id) AS tag ON image.id=tag.image_id WHERE image.published=1 ' . $where . ' AND CONCAT(",", tag.tags, ",") REGEXP ",('.implode("|",$_REQUEST['bwg_tag_id_bwg_standart_thumbnails_' . $bwg]).')," ORDER BY ' . $sort_by . ' ' . $sort_direction . ' ' . $limit_str);
86
+ }
87
+ elseif($type == 'tag') {
88
  $row = $wpdb->get_results($wpdb->prepare('SELECT image.* FROM ' . $wpdb->prefix . 'bwg_image as image INNER JOIN ' . $wpdb->prefix . 'bwg_image_tag as tag ON image.id=tag.image_id WHERE image.published=1 ' . $where . ' AND tag.tag_id="%d" ORDER BY ' . $sort_by . ' ' . $sort_direction . ' ' . $limit_str, $id));
89
  }
90
  else {
112
  $where = '';
113
  }
114
  }
115
+ if( isset($_REQUEST['bwg_tag_id_bwg_standart_thumbnails_' . $bwg]) && $_REQUEST['bwg_tag_id_bwg_standart_thumbnails_' . $bwg] ){
116
+ $total = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image as image INNER JOIN (SELECT GROUP_CONCAT( tag_id SEPARATOR ",") AS tags, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag GROUP BY image_id) AS tag ON image.id=tag.image_id WHERE image.published=1 ' . $where . ' AND CONCAT(",", tag.tags, ",") REGEXP ",('.implode("|",$_REQUEST['bwg_tag_id_bwg_standart_thumbnails_' . $bwg]).')," ');
117
+ }
118
+ elseif ($type == 'tag') {
119
  $total = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image as image INNER JOIN ' . $wpdb->prefix . 'bwg_image_tag as tag ON image.id=tag.image_id WHERE image.published=1 ' . $where . ' AND tag.tag_id="%d"', $id));
120
  }
121
  else {
137
  return $row;
138
  }
139
 
140
+ public function get_tags_rows_data($gallery_id) {
141
+ global $wpdb;
142
+ $row = $wpdb->get_results('Select t1.* FROM ' . $wpdb->prefix . 'terms AS t1 LEFT JOIN ' . $wpdb->prefix . 'term_taxonomy AS t2 ON t1.term_id = t2.term_id LEFT JOIN ( SELECT DISTINCT tag_id , gallery_id FROM ' . $wpdb->prefix . 'bwg_image_tag) AS t3 ON t1.term_id=t3.tag_id WHERE taxonomy = "bwg_tag" AND t3.gallery_id="' . $gallery_id . '"');
143
+ return $row;
144
+ }
145
  ////////////////////////////////////////////////////////////////////////////////////////
146
  // Getters & Setters //
147
  ////////////////////////////////////////////////////////////////////////////////////////
frontend/views/BWGViewAlbum_compact_preview.php CHANGED
@@ -85,6 +85,9 @@ class BWGViewAlbum_compact_preview {
85
  if (!isset($params['compuct_album_enable_page'])) {
86
  $params['compuct_album_enable_page'] = 1;
87
  }
 
 
 
88
  $options_row = $this->model->get_options_row_data();
89
  if (!isset($params['show_album_name'])) {
90
  $params['show_album_name'] = $options_row->show_album_name;
@@ -267,6 +270,7 @@ class BWGViewAlbum_compact_preview {
267
  $params_array['watermark_height'] = $params['watermark_height'];
268
  }
269
  $params_array_hash = $params_array;
 
270
  ?>
271
  <style>
272
  #bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg_album_thumb_<?php echo $bwg; ?> {
@@ -576,6 +580,9 @@ class BWGViewAlbum_compact_preview {
576
  if (isset($params['show_sort_images']) && $params['show_sort_images'] && $type == 'gallery') {
577
  WDWLibrary::ajax_html_frontend_sort_box('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $params['sort_by'], $params['search_box_width']);
578
  }
 
 
 
579
  ?>
580
  <div id="<?php echo $form_child_div_id; ?>" style="<?php echo $form_child_div_style; ?>">
581
  <div id="ajax_loading_<?php echo $bwg; ?>" style="position:absolute;width: 100%; z-index: 115; text-align: center; height: 100%; vertical-align: middle; display: none;">
@@ -843,7 +850,8 @@ class BWGViewAlbum_compact_preview {
843
  </div>
844
  <script>
845
  function bwg_gallery_box_<?php echo $bwg; ?>(gallery_id, image_id) {
846
- spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&gallery_id=' + gallery_id + '&image_id=' + image_id, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5);
 
847
  }
848
  function bwg_document_ready_<?php echo $bwg; ?>() {
849
  var bwg_touch_flag = false;
85
  if (!isset($params['compuct_album_enable_page'])) {
86
  $params['compuct_album_enable_page'] = 1;
87
  }
88
+ if (!isset($params['show_tag_box'])) {
89
+ $params['show_tag_box'] = 0;
90
+ }
91
  $options_row = $this->model->get_options_row_data();
92
  if (!isset($params['show_album_name'])) {
93
  $params['show_album_name'] = $options_row->show_album_name;
270
  $params_array['watermark_height'] = $params['watermark_height'];
271
  }
272
  $params_array_hash = $params_array;
273
+ $tags_rows = $this->model->get_tags_rows_data($album_gallery_id);
274
  ?>
275
  <style>
276
  #bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg_album_thumb_<?php echo $bwg; ?> {
580
  if (isset($params['show_sort_images']) && $params['show_sort_images'] && $type == 'gallery') {
581
  WDWLibrary::ajax_html_frontend_sort_box('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $params['sort_by'], $params['search_box_width']);
582
  }
583
+ if (isset($params['show_tag_box']) && $params['show_tag_box'] && $type == 'gallery') {
584
+ WDWLibrary::ajax_html_frontend_search_tags('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $images_count, $tags_rows);
585
+ }
586
  ?>
587
  <div id="<?php echo $form_child_div_id; ?>" style="<?php echo $form_child_div_style; ?>">
588
  <div id="ajax_loading_<?php echo $bwg; ?>" style="position:absolute;width: 100%; z-index: 115; text-align: center; height: 100%; vertical-align: middle; display: none;">
850
  </div>
851
  <script>
852
  function bwg_gallery_box_<?php echo $bwg; ?>(gallery_id, image_id) {
853
+ 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;
854
+ 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, '<?php echo $bwg; ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5);
855
  }
856
  function bwg_document_ready_<?php echo $bwg; ?>() {
857
  var bwg_touch_flag = false;
frontend/views/BWGViewAlbum_extended_preview.php CHANGED
@@ -84,6 +84,9 @@ class BWGViewAlbum_extended_preview {
84
  if (!isset($params['show_sort_images'])) {
85
  $params['show_sort_images'] = 0;
86
  }
 
 
 
87
  if (!isset($params['extended_album_enable_page'])) {
88
  $params['extended_album_enable_page'] = 1;
89
  }
@@ -211,6 +214,7 @@ class BWGViewAlbum_extended_preview {
211
  $params_array['watermark_width'] = $params['watermark_width'];
212
  $params_array['watermark_height'] = $params['watermark_height'];
213
  }
 
214
  ?>
215
  <style>
216
  #bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg_album_extended_thumbnails_<?php echo $bwg; ?> * {
@@ -557,6 +561,9 @@ class BWGViewAlbum_extended_preview {
557
  if (isset($params['show_sort_images']) && $params['show_sort_images'] && $type == 'gallery') {
558
  WDWLibrary::ajax_html_frontend_sort_box('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $params['sort_by'], $params['search_box_width']);
559
  }
 
 
 
560
  ?>
561
  <div id="<?php echo $form_child_div_id; ?>" style="<?php echo $form_child_div_style; ?>">
562
  <div id="ajax_loading_<?php echo $bwg; ?>" style="position:absolute;width: 100%; z-index: 115; text-align: center; height: 100%; vertical-align: middle; display: none;">
@@ -762,7 +769,7 @@ class BWGViewAlbum_extended_preview {
762
  <span class="bwg_standart_thumb_spun1_<?php echo $bwg; ?>">
763
  <span class="bwg_standart_thumb_spun2_<?php echo $bwg; ?>">
764
  <?php
765
- if ($play_icon && $is_embed_video) {
766
  ?>
767
  <span class="bwg_play_icon_spun_<?php echo $bwg; ?>">
768
  <i title="<?php echo __('Play', 'bwg'); ?>" class="fa fa-play bwg_play_icon_<?php echo $bwg; ?>"></i>
@@ -827,7 +834,8 @@ class BWGViewAlbum_extended_preview {
827
  </div>
828
  <script>
829
  function bwg_gallery_box_<?php echo $bwg; ?>(gallery_id, image_id) {
830
- spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&gallery_id=' + gallery_id + '&image_id=' + image_id, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5);
 
831
  }
832
  function bwg_document_ready_<?php echo $bwg; ?>() {
833
  var bwg_touch_flag = false;
84
  if (!isset($params['show_sort_images'])) {
85
  $params['show_sort_images'] = 0;
86
  }
87
+ if (!isset($params['show_tag_box'])) {
88
+ $params['show_tag_box'] = 0;
89
+ }
90
  if (!isset($params['extended_album_enable_page'])) {
91
  $params['extended_album_enable_page'] = 1;
92
  }
214
  $params_array['watermark_width'] = $params['watermark_width'];
215
  $params_array['watermark_height'] = $params['watermark_height'];
216
  }
217
+ $tags_rows = $this->model->get_tags_rows_data($album_gallery_id);
218
  ?>
219
  <style>
220
  #bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg_album_extended_thumbnails_<?php echo $bwg; ?> * {
561
  if (isset($params['show_sort_images']) && $params['show_sort_images'] && $type == 'gallery') {
562
  WDWLibrary::ajax_html_frontend_sort_box('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $params['sort_by'], $params['search_box_width']);
563
  }
564
+ if (isset($params['show_tag_box']) && $params['show_tag_box'] && $type == 'gallery') {
565
+ WDWLibrary::ajax_html_frontend_search_tags('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $images_count, $tags_rows);
566
+ }
567
  ?>
568
  <div id="<?php echo $form_child_div_id; ?>" style="<?php echo $form_child_div_style; ?>">
569
  <div id="ajax_loading_<?php echo $bwg; ?>" style="position:absolute;width: 100%; z-index: 115; text-align: center; height: 100%; vertical-align: middle; display: none;">
769
  <span class="bwg_standart_thumb_spun1_<?php echo $bwg; ?>">
770
  <span class="bwg_standart_thumb_spun2_<?php echo $bwg; ?>">
771
  <?php
772
+ if ($play_icon && $is_embed_video) {
773
  ?>
774
  <span class="bwg_play_icon_spun_<?php echo $bwg; ?>">
775
  <i title="<?php echo __('Play', 'bwg'); ?>" class="fa fa-play bwg_play_icon_<?php echo $bwg; ?>"></i>
834
  </div>
835
  <script>
836
  function bwg_gallery_box_<?php echo $bwg; ?>(gallery_id, image_id) {
837
+ 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;
838
+ 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, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5);
839
  }
840
  function bwg_document_ready_<?php echo $bwg; ?>() {
841
  var bwg_touch_flag = false;
frontend/views/BWGViewGalleryBox.php CHANGED
@@ -46,6 +46,7 @@ class BWGViewGalleryBox {
46
  $popup_info_full_width = (isset($_GET['popup_info_full_width']) ? esc_html($_GET['popup_info_full_width']) : 0);
47
  $popup_enable_rate = (isset($_GET['popup_enable_rate']) ? esc_html($_GET['popup_enable_rate']) : 0);
48
  $popup_hit_counter = (isset($_GET['popup_hit_counter']) ? esc_html($_GET['popup_hit_counter']) : 0);
 
49
 
50
  if ($enable_image_filmstrip) {
51
  $image_filmstrip_height = (isset($_GET['image_filmstrip_height']) ? esc_html($_GET['image_filmstrip_height']) : '20');
@@ -86,7 +87,7 @@ class BWGViewGalleryBox {
86
  $image_rows = $this->model->get_image_rows_data_tag($tag_id, $sort_by, $order_by);
87
  }
88
  else {
89
- $image_rows = $this->model->get_image_rows_data($gallery_id, $sort_by, $order_by);
90
  }
91
  $image_id = (isset($_POST['image_id']) ? (int) $_POST['image_id'] : $current_image_id);
92
  $comment_rows = $this->model->get_comment_rows_data($image_id);
46
  $popup_info_full_width = (isset($_GET['popup_info_full_width']) ? esc_html($_GET['popup_info_full_width']) : 0);
47
  $popup_enable_rate = (isset($_GET['popup_enable_rate']) ? esc_html($_GET['popup_enable_rate']) : 0);
48
  $popup_hit_counter = (isset($_GET['popup_hit_counter']) ? esc_html($_GET['popup_hit_counter']) : 0);
49
+ $show_tag_box = (isset($_GET['show_tag_box']) ? esc_html($_GET['show_tag_box']) : 0);
50
 
51
  if ($enable_image_filmstrip) {
52
  $image_filmstrip_height = (isset($_GET['image_filmstrip_height']) ? esc_html($_GET['image_filmstrip_height']) : '20');
87
  $image_rows = $this->model->get_image_rows_data_tag($tag_id, $sort_by, $order_by);
88
  }
89
  else {
90
+ $image_rows = $this->model->get_image_rows_data($gallery_id, $bwg, $sort_by, $order_by);
91
  }
92
  $image_id = (isset($_POST['image_id']) ? (int) $_POST['image_id'] : $current_image_id);
93
  $comment_rows = $this->model->get_comment_rows_data($image_id);
frontend/views/BWGViewThumbnails.php CHANGED
@@ -79,6 +79,9 @@ class BWGViewThumbnails {
79
  if (!isset($params['image_enable_page'])) {
80
  $params['image_enable_page'] = 1;
81
  }
 
 
 
82
  $from = (isset($params['from']) ? esc_html($params['from']) : 0);
83
  $sort_direction = ' ' . $params['order_by'] . ' ';
84
  $options_row = $this->model->get_options_row_data();
@@ -173,6 +176,7 @@ class BWGViewThumbnails {
173
  }
174
  $rgb_page_nav_font_color = WDWLibrary::spider_hex2rgb($theme_row->page_nav_font_color);
175
  $rgb_thumbs_bg_color = WDWLibrary::spider_hex2rgb($theme_row->thumbs_bg_color);
 
176
  ?>
177
  <style>
178
  #bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg_standart_thumbnails_<?php echo $bwg; ?> * {
@@ -374,6 +378,9 @@ class BWGViewThumbnails {
374
  if (isset($params['show_sort_images']) && $params['show_sort_images']) {
375
  WDWLibrary::ajax_html_frontend_sort_box('gal_front_form_' . $bwg, $bwg, 'bwg_standart_thumbnails_' . $bwg, $params['sort_by'], $params['search_box_width']);
376
  }
 
 
 
377
  ?>
378
  <div class="bwg_back_<?php echo $bwg; ?>"><?php echo $options_row->showthumbs_name ? $gallery_row->name : ''; ?></div>
379
  <div style="background-color:rgba(0, 0, 0, 0); text-align: <?php echo $theme_row->thumb_align; ?>; width:100%; position: relative;">
@@ -544,7 +551,8 @@ class BWGViewThumbnails {
544
  }
545
  ?>
546
  function bwg_gallery_box_<?php echo $bwg; ?>(image_id) {
547
- spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&image_id=' + image_id, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5);
 
548
  }
549
  function bwg_document_ready_<?php echo $bwg; ?>() {
550
  var bwg_touch_flag = false;
79
  if (!isset($params['image_enable_page'])) {
80
  $params['image_enable_page'] = 1;
81
  }
82
+ if (!isset($params['show_tag_box'])) {
83
+ $params['show_tag_box'] = 0;
84
+ }
85
  $from = (isset($params['from']) ? esc_html($params['from']) : 0);
86
  $sort_direction = ' ' . $params['order_by'] . ' ';
87
  $options_row = $this->model->get_options_row_data();
176
  }
177
  $rgb_page_nav_font_color = WDWLibrary::spider_hex2rgb($theme_row->page_nav_font_color);
178
  $rgb_thumbs_bg_color = WDWLibrary::spider_hex2rgb($theme_row->thumbs_bg_color);
179
+ $tags_rows = $this->model->get_tags_rows_data($params['gallery_id']);
180
  ?>
181
  <style>
182
  #bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg_standart_thumbnails_<?php echo $bwg; ?> * {
378
  if (isset($params['show_sort_images']) && $params['show_sort_images']) {
379
  WDWLibrary::ajax_html_frontend_sort_box('gal_front_form_' . $bwg, $bwg, 'bwg_standart_thumbnails_' . $bwg, $params['sort_by'], $params['search_box_width']);
380
  }
381
+ if (isset($params['show_tag_box']) && $params['show_tag_box']) {
382
+ WDWLibrary::ajax_html_frontend_search_tags('gal_front_form_' . $bwg, $bwg, 'bwg_standart_thumbnails_' . $bwg, $images_count,$tags_rows);
383
+ }
384
  ?>
385
  <div class="bwg_back_<?php echo $bwg; ?>"><?php echo $options_row->showthumbs_name ? $gallery_row->name : ''; ?></div>
386
  <div style="background-color:rgba(0, 0, 0, 0); text-align: <?php echo $theme_row->thumb_align; ?>; width:100%; position: relative;">
551
  }
552
  ?>
553
  function bwg_gallery_box_<?php echo $bwg; ?>(image_id) {
554
+ 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;
555
+ 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, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5);
556
  }
557
  function bwg_document_ready_<?php echo $bwg; ?>() {
558
  var bwg_touch_flag = false;
js/bwg.js CHANGED
@@ -1077,14 +1077,10 @@ function bwg_get_embed_info(input_id) {
1077
 
1078
  // get from the server data for the url. Here we use the server as a proxy, since Cross-Origin Resource Sharing AJAX is forbidden.
1079
  jQuery.post(ajax_url, data, function(response) {
1080
-
1081
-
1082
  if(response == false){
1083
-
1084
  alert('Error: cannot get response from the server.');
1085
  jQuery('#opacity_div').hide();
1086
  jQuery('#loading_div').hide();
1087
-
1088
  return '';
1089
  }
1090
  else{
1077
 
1078
  // get from the server data for the url. Here we use the server as a proxy, since Cross-Origin Resource Sharing AJAX is forbidden.
1079
  jQuery.post(ajax_url, data, function(response) {
 
 
1080
  if(response == false){
 
1081
  alert('Error: cannot get response from the server.');
1082
  jQuery('#opacity_div').hide();
1083
  jQuery('#loading_div').hide();
 
1084
  return '';
1085
  }
1086
  else{
js/bwg_frontend.js CHANGED
@@ -44,6 +44,7 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
44
  if (jQuery("#bwg_search_input_" + current_view).length > 0) { // Search box exists.
45
  post_data["bwg_search_" + current_view] = jQuery("#bwg_search_input_" + current_view).val();
46
  }
 
47
  // Loading.
48
  jQuery("#ajax_loading_" + current_view).css('display', '');
49
  jQuery.post(
@@ -72,6 +73,8 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
72
  }
73
  ).success(function(jqXHR, textStatus, errorThrown) {
74
  jQuery("#ajax_loading_" + current_view).css('display', 'none');
 
 
75
  if (jQuery(".pagination-links_" + current_view).length) {
76
  jQuery("html, body").animate({scrollTop: jQuery('#' + form_id).offset().top - 150}, 500);
77
  }
44
  if (jQuery("#bwg_search_input_" + current_view).length > 0) { // Search box exists.
45
  post_data["bwg_search_" + current_view] = jQuery("#bwg_search_input_" + current_view).val();
46
  }
47
+ post_data["bwg_tag_id_" + id] = jQuery("#bwg_tag_id_" + id).val();
48
  // Loading.
49
  jQuery("#ajax_loading_" + current_view).css('display', '');
50
  jQuery.post(
73
  }
74
  ).success(function(jqXHR, textStatus, errorThrown) {
75
  jQuery("#ajax_loading_" + current_view).css('display', 'none');
76
+ jQuery("#bwg_tags_id_" + id).val(jQuery("#bwg_tag_id_" + id).val());
77
+
78
  if (jQuery(".pagination-links_" + current_view).length) {
79
  jQuery("html, body").animate({scrollTop: jQuery('#' + form_id).offset().top - 150}, 500);
80
  }
js/bwg_gallery_box.js CHANGED
@@ -88,6 +88,8 @@ function spider_ajax_save(form_id) {
88
  post_data["ajax_task"] = jQuery("#ajax_task").val();
89
  post_data["image_id"] = jQuery("#image_id").val();
90
  post_data["comment_id"] = jQuery("#comment_id").val();
 
 
91
  // Loading.
92
  jQuery("#ajax_loading").css('height', jQuery(".bwg_comments").css('height'));
93
  jQuery("#opacity_div").css('width', jQuery(".bwg_comments").css('width'));
88
  post_data["ajax_task"] = jQuery("#ajax_task").val();
89
  post_data["image_id"] = jQuery("#image_id").val();
90
  post_data["comment_id"] = jQuery("#comment_id").val();
91
+ post_data["bwg_tag_id_" + id] = jQuery("#bwg_tag_id_" + id).val();
92
+
93
  // Loading.
94
  jQuery("#ajax_loading").css('height', jQuery(".bwg_comments").css('height'));
95
  jQuery("#opacity_div").css('width', jQuery(".bwg_comments").css('width'));
js/bwg_shortcode.js CHANGED
@@ -407,6 +407,7 @@ function bwg_gallery_type(gallery_type) {
407
  jQuery("#tr_thumb_width_height").css('display', '');
408
  jQuery("#tr_show_sort_images").css('display', '');
409
  jQuery("#tr_load_more_image_count").css('display', '');
 
410
  bwg_show_search_box();
411
  jQuery("#bwg_pro_version").html('Thumbnails');
412
  jQuery("#bwg_pro_version_link").attr("href", "http://wpdemo.web-dorado.com/thumbnails-view-2/");
@@ -419,6 +420,7 @@ function bwg_gallery_type(gallery_type) {
419
  jQuery("#tr_order_by").css('display', '');
420
  jQuery("#tr_show_search_box").css('display', '');
421
  jQuery("#tr_show_sort_images").css('display', '');
 
422
  if (jQuery("input[name=masonry_hor_ver]:checked").val() == 'horizontal') {
423
  bwg_change_label('image_column_number_label', 'Number of image rows: ');
424
  bwg_change_label('thumb_width_height_label', 'Image thumbnail height: ');
@@ -449,6 +451,7 @@ function bwg_gallery_type(gallery_type) {
449
  jQuery("#tr_order_by").css('display', '');
450
  jQuery("#tr_show_search_box").css('display', '');
451
  jQuery("#tr_show_sort_images").css('display', '');
 
452
  if (jQuery("input[name=mosaic_hor_ver]:checked").val() == 'horizontal') {
453
  bwg_change_label('thumb_width_height_label', 'Image thumbnail height: ');
454
  jQuery('#thumb_width').hide();
@@ -487,6 +490,7 @@ function bwg_gallery_type(gallery_type) {
487
  jQuery("#tr_enable_slideshow_ctrl").css('display', '');
488
  jQuery("#tr_enable_slideshow_filmstrip").css('display', '');
489
  jQuery("#tr_show_sort_images").css('display', 'none');
 
490
  if (jQuery("input[name=enable_slideshow_filmstrip]:checked").val() == 1) {
491
  bwg_enable_disable('', 'tr_slideshow_filmstrip_height', 'slideshow_filmstrip_yes');
492
  }
@@ -527,6 +531,7 @@ function bwg_gallery_type(gallery_type) {
527
  jQuery("#tr_image_browser_width_height").css('display', '');
528
  jQuery("#tr_image_browser_title_enable").css('display', '');
529
  jQuery("#tr_image_browser_description_enable").css('display', '');
 
530
  bwg_show_search_box();
531
  jQuery("#bwg_pro_version").html('Image Browser');
532
  jQuery("#bwg_pro_version_link").attr("href", "http://wpdemo.web-dorado.com/image-browser-view/");
@@ -555,6 +560,7 @@ function bwg_gallery_type(gallery_type) {
555
  jQuery("#tr_compuct_album_mosaic_total_width").css('display', '');
556
  jQuery("#tr_compuct_album_load_more_image_count").css('display', '');
557
  jQuery("#tr_compuct_albums_per_page_load_more").css('display', '');
 
558
  bwg_change_compuct_album_view_type();
559
  bwg_show_search_box();
560
  jQuery("#bwg_pro_version").html('Compact Album');
@@ -583,6 +589,7 @@ function bwg_gallery_type(gallery_type) {
583
  jQuery("#tr_extended_album_mosaic_total_width").css('display', '');
584
  jQuery("#tr_extended_album_load_more_image_count").css('display', '');
585
  jQuery("#tr_extended_albums_per_page_load_more").css('display', '');
 
586
  bwg_change_extended_album_view_type();
587
  bwg_show_search_box();
588
  jQuery("#bwg_pro_version").html('Extended Album');
@@ -605,6 +612,7 @@ function bwg_gallery_type(gallery_type) {
605
  jQuery("#tr_show_sort_images").css('display', '');
606
  jQuery("#tr_masonry_album_load_more_image_count").css('display', '');
607
  jQuery("#tr_masonry_albums_per_page_load_more").css('display', '');
 
608
  //bwg_change_masonry_album_view_type();
609
  bwg_show_search_box();
610
  break;
@@ -621,6 +629,7 @@ function bwg_gallery_type(gallery_type) {
621
  jQuery("#tr_blog_style_enable_page").css('display', '');
622
  jQuery("#tr_show_sort_images").css('display', '');
623
  jQuery("#tr_blog_style_load_more_image_count").css('display', '');
 
624
  bwg_show_search_box();
625
  break;
626
  }
@@ -639,6 +648,7 @@ function bwg_gallery_type(gallery_type) {
639
  jQuery("#tr_carousel_fit_containerWidth").css('display', '');
640
  jQuery("#tr_carousel_prev_next_butt").css('display', '');
641
  jQuery("#tr_carousel_play_pause_butt").css('display', '');
 
642
  break;
643
  }
644
 
407
  jQuery("#tr_thumb_width_height").css('display', '');
408
  jQuery("#tr_show_sort_images").css('display', '');
409
  jQuery("#tr_load_more_image_count").css('display', '');
410
+ jQuery("#tr_show_tag_box").css('display', '');
411
  bwg_show_search_box();
412
  jQuery("#bwg_pro_version").html('Thumbnails');
413
  jQuery("#bwg_pro_version_link").attr("href", "http://wpdemo.web-dorado.com/thumbnails-view-2/");
420
  jQuery("#tr_order_by").css('display', '');
421
  jQuery("#tr_show_search_box").css('display', '');
422
  jQuery("#tr_show_sort_images").css('display', '');
423
+ jQuery("#tr_show_tag_box").css('display', '');
424
  if (jQuery("input[name=masonry_hor_ver]:checked").val() == 'horizontal') {
425
  bwg_change_label('image_column_number_label', 'Number of image rows: ');
426
  bwg_change_label('thumb_width_height_label', 'Image thumbnail height: ');
451
  jQuery("#tr_order_by").css('display', '');
452
  jQuery("#tr_show_search_box").css('display', '');
453
  jQuery("#tr_show_sort_images").css('display', '');
454
+ jQuery("#tr_show_tag_box").css('display', '');
455
  if (jQuery("input[name=mosaic_hor_ver]:checked").val() == 'horizontal') {
456
  bwg_change_label('thumb_width_height_label', 'Image thumbnail height: ');
457
  jQuery('#thumb_width').hide();
490
  jQuery("#tr_enable_slideshow_ctrl").css('display', '');
491
  jQuery("#tr_enable_slideshow_filmstrip").css('display', '');
492
  jQuery("#tr_show_sort_images").css('display', 'none');
493
+ jQuery("#tr_show_tag_box").css('display', 'none');
494
  if (jQuery("input[name=enable_slideshow_filmstrip]:checked").val() == 1) {
495
  bwg_enable_disable('', 'tr_slideshow_filmstrip_height', 'slideshow_filmstrip_yes');
496
  }
531
  jQuery("#tr_image_browser_width_height").css('display', '');
532
  jQuery("#tr_image_browser_title_enable").css('display', '');
533
  jQuery("#tr_image_browser_description_enable").css('display', '');
534
+ jQuery("#tr_show_tag_box").css('display', 'none');
535
  bwg_show_search_box();
536
  jQuery("#bwg_pro_version").html('Image Browser');
537
  jQuery("#bwg_pro_version_link").attr("href", "http://wpdemo.web-dorado.com/image-browser-view/");
560
  jQuery("#tr_compuct_album_mosaic_total_width").css('display', '');
561
  jQuery("#tr_compuct_album_load_more_image_count").css('display', '');
562
  jQuery("#tr_compuct_albums_per_page_load_more").css('display', '');
563
+ jQuery("#tr_show_tag_box").css('display', '');
564
  bwg_change_compuct_album_view_type();
565
  bwg_show_search_box();
566
  jQuery("#bwg_pro_version").html('Compact Album');
589
  jQuery("#tr_extended_album_mosaic_total_width").css('display', '');
590
  jQuery("#tr_extended_album_load_more_image_count").css('display', '');
591
  jQuery("#tr_extended_albums_per_page_load_more").css('display', '');
592
+ jQuery("#tr_show_tag_box").css('display', '');
593
  bwg_change_extended_album_view_type();
594
  bwg_show_search_box();
595
  jQuery("#bwg_pro_version").html('Extended Album');
612
  jQuery("#tr_show_sort_images").css('display', '');
613
  jQuery("#tr_masonry_album_load_more_image_count").css('display', '');
614
  jQuery("#tr_masonry_albums_per_page_load_more").css('display', '');
615
+ jQuery("#tr_show_tag_box").css('display', '');
616
  //bwg_change_masonry_album_view_type();
617
  bwg_show_search_box();
618
  break;
629
  jQuery("#tr_blog_style_enable_page").css('display', '');
630
  jQuery("#tr_show_sort_images").css('display', '');
631
  jQuery("#tr_blog_style_load_more_image_count").css('display', '');
632
+ jQuery("#tr_show_tag_box").css('display', '');
633
  bwg_show_search_box();
634
  break;
635
  }
648
  jQuery("#tr_carousel_fit_containerWidth").css('display', '');
649
  jQuery("#tr_carousel_prev_next_butt").css('display', '');
650
  jQuery("#tr_carousel_play_pause_butt").css('display', '');
651
+ jQuery("#tr_show_tag_box").css('display', 'none');
652
  break;
653
  }
654
 
js/jquery.sumoselect.min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*!
2
+ * jquery.sumoselect - v2.1.0
3
+ * http://hemantnegi.github.io/jquery.sumoselect
4
+ */
5
+
6
+ !function(e){"namespace sumo";e.fn.SumoSelect=function(t){var l=e.extend({placeholder:bwg_objectsL10n.bwg_select_tag,csvDispCount:3,captionFormat:"{0} Selected",floatWidth:400,forceCustomRendering:!1,nativeOnDevice:["Android","BlackBerry","iPhone","iPad","iPod","Opera Mini","IEMobile","Silk"],outputAsCSV:!1,csvSepChar:",",okCancelInMulti:!1,triggerChangeCombined:!0,selectAll:!1,selectAlltext:"Select All"},t),s=this.each(function(){var t=this;!this.sumo&&e(this).is("select")&&(this.sumo={E:e(t),is_multi:e(t).attr("multiple"),select:"",caption:"",placeholder:"",optDiv:"",CaptionCont:"",is_floating:!1,is_opened:!1,mob:!1,Pstate:[],createElems:function(){var t=this;return t.E.wrap('<div class="SumoSelect" tabindex="0">'),t.select=t.E.parent(),t.caption=e("<span></span>"),t.CaptionCont=e('<p class="CaptionCont"><label><i></i></label></p>').addClass("SlectBox").attr("style",t.E.attr("style")).prepend(t.caption),t.select.append(t.CaptionCont),t.E.attr("disabled")&&t.select.addClass("disabled").removeAttr("tabindex"),l.outputAsCSV&&t.is_multi&&t.E.attr("name")&&(t.select.append(e('<input class="HEMANT123" type="hidden" />').attr("name",t.E.attr("name")).val(t.getSelStr())),t.E.removeAttr("name")),t.isMobile()&&!l.forceCustomRendering?void t.setNativeMobile():(t.E.hide(),t.optDiv=e('<div class="optWrapper">'),t.floatingList(),ul=e('<p><input type="text" style="width: 100%; border-radius: 4px; box-shadow: 0 0 3px 1px #CCCCCC; border: 1px solid #CCCCCC;" class="search_tag" onkeypress="searchTags(this);" onkeyup="searchTags(this);"></p><ul class="options">'),t.optDiv.append(ul),l.selectAll&&t.selAll(),e(t.E.children("option")).each(function(l,i){i=e(i),t.createLi(i)}),t.is_multi&&t.multiSelelect(),t.select.append(t.optDiv),t.basicEvents(),void t.selAllState())},createLi:function(t,l){var i=this;return t.attr("value")||t.attr("value",t.val()),li=e('<li data-val="'+t.val()+'"><label>'+t.text()+"</label></li>"),i.is_multi&&li.prepend("<span><i></i></span>"),t[0].disabled&&(li=li.addClass("disabled")),i.onOptClick(li),t[0].selected&&li.addClass("selected"),t.attr("class")&&li.addClass(t.attr("class")),ul=i.optDiv.children("ul.options"),"undefined"==typeof l?ul.append(li):ul.children("li").eq(l).before(li),li},getSelStr:function(){return sopt=[],this.E.children("option:selected").each(function(){sopt.push(e(this).val())}),sopt.join(l.csvSepChar)},multiSelelect:function(){var t=this;t.optDiv.addClass("multiple"),t.okbtn=e('<p class="btnOk">OK</p>').click(function(){l.triggerChangeCombined&&(changed=!1,t.E.children("option:selected").length!=t.Pstate.length?changed=!0:t.E.children("option:selected").each(function(){t.Pstate.indexOf(e(this).val())<0&&(changed=!0)}),changed&&(t.E.trigger("change").trigger("click"),t.setText())),t.hideOpts()}),t.cancelBtn=e('<p class="btnCancel">Cancel</p>').click(function(){t._cnbtn(),t.hideOpts()}),t.optDiv.append(e('<div class="MultiControls">').append(t.okbtn).append(t.cancelBtn))},_cnbtn:function(){var e=this;for(e.E.children("option:selected").each(function(){this.selected=!1}),e.optDiv.find("li.selected").removeClass("selected"),i=0;i<e.Pstate.length;i++)e.E.children('option[value="'+e.Pstate[i]+'"]')[0].selected=!0,e.optDiv.find('li[data-val="'+e.Pstate[i]+'"]').addClass("selected");e.selAllState()},selAll:function(){var t=this;t.is_multi&&(t.chkAll=e("<i>"),t.selAll=e('<p class="select-all"><label>'+l.selectAlltext+"</label></p>").prepend(e("<span></span>").append(t.chkAll)),t.chkAll.on("click",function(){t.selAll.toggleClass("selected"),t.optDiv.find("ul.options li").each(function(l,i){i=e(i),t.selAll.hasClass("selected")?i.hasClass("selected")||i.trigger("click"):i.hasClass("selected")&&i.trigger("click")})}),t.optDiv.prepend(t.selAll))},selAllState:function(){var t=this;if(l.selectAll){var i=0,s=0;t.optDiv.find("ul.options li").each(function(t,l){e(l).hasClass("selected")&&i++,e(l).hasClass("disabled")||s++}),i==s?t.selAll.removeClass("partial").addClass("selected"):0==i?t.selAll.removeClass("selected partial"):t.selAll.addClass("partial")}},showOpts:function(){var t=this;t.E.attr("disabled")||(t.is_opened=!0,t.optDiv.addClass("open"),e(document).on("click.sumo",function(e){if(!t.select.is(e.target)&&0===t.select.has(e.target).length){if(!t.is_opened)return;t.hideOpts(),t.is_multi&&l.okCancelInMulti&&t._cnbtn()}}),t.is_floating&&(H=t.optDiv.children("ul").outerHeight()+2,t.is_multi&&(H+=parseInt(t.optDiv.css("padding-bottom"))),t.optDiv.css("height",H)),t.is_multi&&(t.is_floating||l.okCancelInMulti)&&(t.Pstate=[],t.E.children("option:selected").each(function(){t.Pstate.push(e(this).val())})))},hideOpts:function(){var t=this;t.is_opened=!1,t.optDiv.removeClass("open").find("ul li.sel").removeClass("sel"),e(document).off("click.sumo")},setOnOpen:function(){var e=this,t=e.optDiv.find("ul li").eq(e.E[0].selectedIndex);t.addClass("sel"),e.showOpts()},nav:function(e){var t,l=this,i=l.optDiv.find("ul li.sel");if(l.is_opened&&i.length){if(t=e?i.prevAll("li:not(.disabled)"):i.nextAll("li:not(.disabled)"),!t.length)return;i.removeClass("sel"),i=t.first().addClass("sel");var s=l.optDiv.find("ul"),n=s.scrollTop(),o=i.position().top+n;o>=n+s.height()-i.outerHeight()&&s.scrollTop(o-s.height()+i.outerHeight()),n>o&&s.scrollTop(o)}else l.setOnOpen()},basicEvents:function(){var t=this;t.CaptionCont.click(function(e){t.E.trigger("click"),t.is_opened?t.hideOpts():t.showOpts(),e.stopPropagation()}),t.select.on("keydown",function(e){switch(e.which){case 38:t.nav(!0);break;case 40:t.nav(!1);break;case 13:t.is_opened?t.optDiv.find("ul li.sel").trigger("click"):t.setOnOpen();break;case 9:case 27:return t.is_multi&&l.okCancelInMulti&&t._cnbtn(),void t.hideOpts();default:return}e.preventDefault()}),e(window).on("resize.sumo",function(){t.floatingList()})},onOptClick:function(t){var i=this;t.click(function(){var t=e(this);t.hasClass("disabled")||(txt="",i.is_multi?(t.toggleClass("selected"),i.E.children('option[value="'+t.data("val")+'"]')[0].selected=t.hasClass("selected"),i.selAllState()):(t.parent().find("li.selected").removeClass("selected"),t.toggleClass("selected"),i.E.val(t.attr("data-val"))),i.is_multi&&l.triggerChangeCombined&&(i.is_floating||l.okCancelInMulti)||(i.setText(),i.E.trigger("change").trigger("click")),i.is_multi||i.hideOpts())})},setText:function(){var t=this;if(t.placeholder="",t.is_multi){for(sels=t.E.children(":selected").not(":disabled"),i=0;i<sels.length;i++){if(i>=l.csvDispCount&&l.csvDispCount){t.placeholder=l.captionFormat.replace("{0}",sels.length);break}t.placeholder+=e(sels[i]).text()+", "}t.placeholder=t.placeholder.replace(/,([^,]*)$/,"$1")}else t.placeholder=t.E.children(":selected").not(":disabled").text();return is_placeholder=!1,t.placeholder||(is_placeholder=!0,t.placeholder=t.E.attr("placeholder"),t.placeholder||(t.placeholder=t.E.children("option:disabled:selected").text())),t.placeholder=t.placeholder?t.placeholder:l.placeholder,t.caption.text(t.placeholder),csvField=t.select.find("input.HEMANT123"),csvField.length&&csvField.val(t.getSelStr()),is_placeholder?t.caption.addClass("placeholder"):t.caption.removeClass("placeholder"),t.placeholder},isMobile:function(){for(var e=navigator.userAgent||navigator.vendor||window.opera,t=0;t<l.nativeOnDevice.length;t++)if(e.toString().toLowerCase().indexOf(l.nativeOnDevice[t].toLowerCase())>0)return l.nativeOnDevice[t];return!1},setNativeMobile:function(){var e=this;e.E.addClass("SelectClass"),e.mob=!0,e.E.change(function(){e.setText()})},floatingList:function(){var t=this;t.is_floating=e(window).width()<=l.floatWidth,t.optDiv.toggleClass("isFloating",t.is_floating),t.is_floating||t.optDiv.css("height",""),t.optDiv.toggleClass("okCancelInMulti",l.okCancelInMulti&&!t.is_floating)},vRange:function(e){var t=this;if(opts=t.E.children("option"),opts.length<=e||0>e)throw"index out of bounds";return t},toggSel:function(e,t){var l=this.vRange(t);l.E.children("option")[t].disabled||(l.E.children("option")[t].selected=e,l.mob||l.optDiv.find("ul.options li").eq(t).toggleClass("selected",e),l.setText())},toggDis:function(e,t){var l=this.vRange(t);l.E.children("option")[t].disabled=e,e&&(l.E.children("option")[t].selected=!1),l.mob||l.optDiv.find("ul.options li").eq(t).toggleClass("disabled",e).removeClass("selected"),l.setText()},toggSumo:function(e){var t=this;return t.enabled=e,t.select.toggleClass("disabled",e),e?(t.E.attr("disabled","disabled"),t.select.removeAttr("tabindex")):(t.E.removeAttr("disabled"),t.select.attr("tabindex","0")),t},toggSelAll:function(t){var i=this;i.E.find("option").each(function(l,s){i.E.find("option")[e(this).index()].disabled||(i.E.find("option")[e(this).index()].selected=t,i.mob||i.optDiv.find("ul.options li").eq(e(this).index()).toggleClass("selected",t),i.setText())}),!i.mob&&l.selectAll&&i.selAll.removeClass("partial").toggleClass("selected",t)},reload:function(){var t=this.unload();return e(t).SumoSelect(l)},unload:function(){var e=this;return e.select.before(e.E),e.E.show(),l.outputAsCSV&&e.is_multi&&e.select.find("input.HEMANT123").length&&e.E.attr("name",e.select.find("input.HEMANT123").attr("name")),e.select.remove(),delete t.sumo,t},add:function(l,i,s){if("undefined"==typeof l)throw"No value to add";var n=this;if(opts=n.E.children("option"),"number"==typeof i&&(s=i,i=l),"undefined"==typeof i&&(i=l),opt=e("<option></option>").val(l).html(i),opts.length<s)throw"index out of bounds";return"undefined"==typeof s||opts.length==s?(n.E.append(opt),n.mob||n.createLi(opt)):(opts.eq(s).before(opt),n.mob||n.createLi(opt,s)),t},remove:function(e){var t=this.vRange(e);t.E.children("option").eq(e).remove(),t.mob||t.optDiv.find("ul.options li").eq(e).remove(),t.setText()},selectItem:function(e){this.toggSel(!0,e)},unSelectItem:function(e){this.toggSel(!1,e)},selectAll:function(){this.toggSelAll(!0)},unSelectAll:function(){this.toggSelAll(!1)},disableItem:function(e){this.toggDis(!0,e)},enableItem:function(e){this.toggDis(!1,e)},enabled:!0,enable:function(){return this.toggSumo(!1)},disable:function(){return this.toggSumo(!0)},init:function(){var e=this;return e.createElems(),e.setText(),e}},t.sumo.init())});return 1==s.length?s[0]:s}}(jQuery);
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.2.60
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -340,7 +340,8 @@ function bwg_shortcode($params) {
340
  'enable_image_twitter' => 1,
341
  'enable_image_google' => 1,
342
  'watermark_type' => 'none',
343
- 'load_more_image_count' => 15
 
344
  ), $params);
345
  break;
346
 
@@ -786,6 +787,7 @@ function bwg_activate() {
786
  `permissions` varchar(20) NOT NULL,
787
  `facebook_app_id` varchar(64) NOT NULL,
788
  `facebook_app_secret` varchar(64) NOT NULL,
 
789
  PRIMARY KEY (`id`)
790
  ) DEFAULT CHARSET=utf8;";
791
  $wpdb->query($bwg_option);
@@ -1417,6 +1419,9 @@ function bwg_activate() {
1417
  'carousel_prev_next_butt' => 1,
1418
  'carousel_play_pause_butt' => 1,
1419
  'permissions' => 'manage_options',
 
 
 
1420
  ));
1421
  }
1422
  $exists_default = $wpdb->get_var('SELECT count(id) FROM ' . $wpdb->prefix . 'bwg_theme');
@@ -2330,7 +2335,7 @@ function bwg_activate() {
2330
  ));
2331
  }
2332
  $version = get_option("wd_bwg_version");
2333
- $new_version = '1.2.60';
2334
  if ($version && version_compare($version, $new_version, '<')) {
2335
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2336
  bwg_update($version);
@@ -2378,7 +2383,7 @@ wp_oembed_add_provider( '#https://instagr(\.am|am\.com)/p/.*#i', 'https://api.in
2378
 
2379
  function bwg_update_hook() {
2380
  $version = get_option("wd_bwg_version");
2381
- $new_version = '1.2.60';
2382
  if ($version && version_compare($version, $new_version, '<')) {
2383
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2384
  bwg_update($version);
@@ -2551,7 +2556,8 @@ function bwg_front_end_scripts() {
2551
 
2552
  wp_enqueue_script('bwg_frontend', WD_BWG_FRONT_URL . '/js/bwg_frontend.js', array(), $version);
2553
  wp_enqueue_style('bwg_frontend', WD_BWG_FRONT_URL . '/css/bwg_frontend.css', array(), $version);
2554
-
 
2555
  // Styles/Scripts for popup.
2556
  wp_enqueue_style('bwg_font-awesome', WD_BWG_FRONT_URL . '/css/font-awesome/font-awesome.css', array(), '4.2.0');
2557
  wp_enqueue_script('bwg_jquery_mobile', WD_BWG_FRONT_URL . '/js/jquery.mobile.js', array(), $version);
@@ -2564,6 +2570,9 @@ function bwg_front_end_scripts() {
2564
  'bwg_mail_validation' => __('This is not a valid email address.', 'bwg'),
2565
  'bwg_search_result' => __('There are no images matching your search.', 'bwg'),
2566
  ));
 
 
 
2567
  }
2568
  add_action('wp_enqueue_scripts', 'bwg_front_end_scripts');
2569
 
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.2.61
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
340
  'enable_image_twitter' => 1,
341
  'enable_image_google' => 1,
342
  'watermark_type' => 'none',
343
+ 'load_more_image_count' => 15,
344
+ 'show_tag_box' => 0
345
  ), $params);
346
  break;
347
 
787
  `permissions` varchar(20) NOT NULL,
788
  `facebook_app_id` varchar(64) NOT NULL,
789
  `facebook_app_secret` varchar(64) NOT NULL,
790
+ `show_tag_box` tinyint(1) NOT NULL,
791
  PRIMARY KEY (`id`)
792
  ) DEFAULT CHARSET=utf8;";
793
  $wpdb->query($bwg_option);
1419
  'carousel_prev_next_butt' => 1,
1420
  'carousel_play_pause_butt' => 1,
1421
  'permissions' => 'manage_options',
1422
+ 'facebook_app_id' => '',
1423
+ 'facebook_app_secret' => '',
1424
+ 'show_tag_box' => 0,
1425
  ));
1426
  }
1427
  $exists_default = $wpdb->get_var('SELECT count(id) FROM ' . $wpdb->prefix . 'bwg_theme');
2335
  ));
2336
  }
2337
  $version = get_option("wd_bwg_version");
2338
+ $new_version = '1.2.61';
2339
  if ($version && version_compare($version, $new_version, '<')) {
2340
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2341
  bwg_update($version);
2383
 
2384
  function bwg_update_hook() {
2385
  $version = get_option("wd_bwg_version");
2386
+ $new_version = '1.2.61';
2387
  if ($version && version_compare($version, $new_version, '<')) {
2388
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2389
  bwg_update($version);
2556
 
2557
  wp_enqueue_script('bwg_frontend', WD_BWG_FRONT_URL . '/js/bwg_frontend.js', array(), $version);
2558
  wp_enqueue_style('bwg_frontend', WD_BWG_FRONT_URL . '/css/bwg_frontend.css', array(), $version);
2559
+ wp_enqueue_script('bwg_sumoselect', WD_BWG_FRONT_URL . '/js/jquery.sumoselect.min.js', array(), $version);
2560
+ wp_enqueue_style('bwg_sumoselect', WD_BWG_FRONT_URL . '/css/sumoselect.css', array(), $version);
2561
  // Styles/Scripts for popup.
2562
  wp_enqueue_style('bwg_font-awesome', WD_BWG_FRONT_URL . '/css/font-awesome/font-awesome.css', array(), '4.2.0');
2563
  wp_enqueue_script('bwg_jquery_mobile', WD_BWG_FRONT_URL . '/js/jquery.mobile.js', array(), $version);
2570
  'bwg_mail_validation' => __('This is not a valid email address.', 'bwg'),
2571
  'bwg_search_result' => __('There are no images matching your search.', 'bwg'),
2572
  ));
2573
+ wp_localize_script('bwg_sumoselect', 'bwg_objectsL10n', array(
2574
+ 'bwg_select_tag' => __('Select Tag.', 'bwg'),
2575
+ ));
2576
  }
2577
  add_action('wp_enqueue_scripts', 'bwg_front_end_scripts');
2578
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-photo-gallery-plugin.html
4
  Tags: photo, photo gallery, image gallery, video gallery, gallery, galleries, wordpress gallery plugin, images gallery, album, photo albums, simple gallery, best gallery plugin, free photo gallery, wp gallery, wordpress gallery, website gallery, gallery shortcode, best gallery, picture, pictures, gallery slider, photo album, photogallery, widget gallery, image, images, photos, gallery lightbox, photoset, wordpress photo gallery plugin, wp gallery plugins, responsive wordpress photo gallery, media, image album, filterable gallery, banner rotator, fullscreen gallery, fotogalerie, galleria, galerie, galeri, responsive gallery, add album, add gallery, add pictures, fotoalbum, foto, gallery decription, multiple pictures, photoalbum, upload images, upload photos, view images, view pictures, admin, AJAX, comments, gallery image, image lightbox, image rotate, image slideshow, image slider, jquery, jquery gallery, slide show, slideshow, thumbnail, thumbnail view, thumbnails, thumbs, responsive, watermarking, watermarks,fullscreen slider, lightbox, photography, sidebar, slide, youtube, vimeo, videos, instagram, facebook, mosaic
5
  Requires at least: 3.4
6
  Tested up to: 4.3
7
- Stable tag: 1.2.60
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -102,8 +102,8 @@ Upgrade to [WordPress Photo Gallery Pro](https://web-dorado.com/products/wordpre
102
  * Commenting possibility with Captcha protection possibility.
103
  * Social sharing possibility (Facebook, Google+, Twitter, Pinterest and Tumblr).
104
  * Dynamic Photo Gallery Tag Cloud widget with image tag cloud and text tag cloud options.
105
- * Possibility to include both videos and images within a single gallery.
106
- * Add on support.
107
 
108
  ### Supported languages
109
 
@@ -163,7 +163,7 @@ Vietnamese (vi)
163
  #### Thank you for your interest in Photo Gallery.
164
 
165
  ### Minimum requirements.
166
- * Wordpress 3.0+
167
  * PHP 5.x
168
  * MySQL 5.x
169
 
@@ -214,6 +214,9 @@ Yes, it is possible to add advertising and/or watermark over the images. In both
214
 
215
  == Changelog ==
216
 
 
 
 
217
  = 1.2.60 =
218
  Changed: Notices show order.
219
 
@@ -542,7 +545,7 @@ This vulnerability was discovered by Fortinet's FortiGuard Labs.
542
 
543
  = Step 1: Installing the Gallery =
544
  1.1 Minimum requirements.
545
- Wordpress 3.0+
546
  PHP 5.x
547
  MySQL 5.x
548
 
4
  Tags: photo, photo gallery, image gallery, video gallery, gallery, galleries, wordpress gallery plugin, images gallery, album, photo albums, simple gallery, best gallery plugin, free photo gallery, wp gallery, wordpress gallery, website gallery, gallery shortcode, best gallery, picture, pictures, gallery slider, photo album, photogallery, widget gallery, image, images, photos, gallery lightbox, photoset, wordpress photo gallery plugin, wp gallery plugins, responsive wordpress photo gallery, media, image album, filterable gallery, banner rotator, fullscreen gallery, fotogalerie, galleria, galerie, galeri, responsive gallery, add album, add gallery, add pictures, fotoalbum, foto, gallery decription, multiple pictures, photoalbum, upload images, upload photos, view images, view pictures, admin, AJAX, comments, gallery image, image lightbox, image rotate, image slideshow, image slider, jquery, jquery gallery, slide show, slideshow, thumbnail, thumbnail view, thumbnails, thumbs, responsive, watermarking, watermarks,fullscreen slider, lightbox, photography, sidebar, slide, youtube, vimeo, videos, instagram, facebook, mosaic
5
  Requires at least: 3.4
6
  Tested up to: 4.3
7
+ Stable tag: 1.2.61
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
102
  * Commenting possibility with Captcha protection possibility.
103
  * Social sharing possibility (Facebook, Google+, Twitter, Pinterest and Tumblr).
104
  * Dynamic Photo Gallery Tag Cloud widget with image tag cloud and text tag cloud options.
105
+ * Possibility to include both videos and images within a single gallery.
106
+ * Add ons support.
107
 
108
  ### Supported languages
109
 
163
  #### Thank you for your interest in Photo Gallery.
164
 
165
  ### Minimum requirements.
166
+ * Wordpress 3.4+
167
  * PHP 5.x
168
  * MySQL 5.x
169
 
214
 
215
  == Changelog ==
216
 
217
+ = 1.2.61 =
218
+ Added: Filter by tags in frontend.
219
+
220
  = 1.2.60 =
221
  Changed: Notices show order.
222
 
545
 
546
  = Step 1: Installing the Gallery =
547
  1.1 Minimum requirements.
548
+ Wordpress 3.4+
549
  PHP 5.x
550
  MySQL 5.x
551
 
update/bwg_update.php CHANGED
@@ -314,6 +314,9 @@ function bwg_update($version) {
314
  $wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `facebook_app_secret` varchar(64) NOT NULL DEFAULT ''");
315
  $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "bwg_gallery` CHANGE `gallery_source` `gallery_source` varchar(256) NOT NULL");
316
  }
 
 
 
317
  return;
318
  }
319
 
314
  $wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `facebook_app_secret` varchar(64) NOT NULL DEFAULT ''");
315
  $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "bwg_gallery` CHANGE `gallery_source` `gallery_source` varchar(256) NOT NULL");
316
  }
317
+ if (version_compare($version, '1.2.61') == -1) {
318
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `show_tag_box` tinyint(1) NOT NULL DEFAULT 0");
319
+ }
320
  return;
321
  }
322