Photo Gallery by WD – Responsive Photo Gallery - Version 1.1.24

Version Description

Improve translation, Add tags to all images

Download this release

Release Info

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

Code changes from version 1.1.23 to 1.1.24

admin/controllers/BWGControllerGalleries_bwg.php CHANGED
@@ -90,6 +90,12 @@ class BWGControllerGalleries_bwg {
90
  }
91
  }
92
  $this->save_image_db();
 
 
 
 
 
 
93
  $this->save_order_images($_POST['current_id']);
94
  if (isset($_POST['ajax_task']) && esc_html($_POST['ajax_task']) != '') {
95
  $ajax_task = esc_html($_POST['ajax_task']);
@@ -99,7 +105,46 @@ class BWGControllerGalleries_bwg {
99
  }
100
  $this->edit();
101
  }
102
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  public function recover() {
104
  global $wpdb;
105
  $id = ((isset($_POST['image_current_id'])) ? esc_html(stripslashes($_POST['image_current_id'])) : 0);
90
  }
91
  }
92
  $this->save_image_db();
93
+ if (isset($_POST['check_all_items'])) {
94
+ $tag_ids = (isset($_POST['added_tags_select_all']) ? esc_html(stripslashes($_POST['added_tags_select_all'])) : '');
95
+ if ($tag_ids != '') {
96
+ $this->save_tags_if_select_all($tag_ids);
97
+ }
98
+ }
99
  $this->save_order_images($_POST['current_id']);
100
  if (isset($_POST['ajax_task']) && esc_html($_POST['ajax_task']) != '') {
101
  $ajax_task = esc_html($_POST['ajax_task']);
105
  }
106
  $this->edit();
107
  }
108
+
109
+ public function save_tags_if_select_all($tag_ids) {
110
+ global $wpdb;
111
+ $gal_id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
112
+ $image_ids = (isset($_POST['ids_string']) ? esc_html(stripslashes($_POST['ids_string'])) : '');
113
+ $current_page_image_ids = explode(',', $image_ids);
114
+ $tag_ids_array = explode(',', $tag_ids);
115
+ $query_image = $wpdb->prepare('SELECT id FROM ' . $wpdb->prefix . 'bwg_image WHERE gallery_id="%d"', $gal_id);
116
+ $image_id_array = $wpdb->get_results($query_image);
117
+ foreach ($image_id_array as $image_id) {
118
+ $flag = FALSE;
119
+ foreach ($current_page_image_ids as $current_page_image_id) {
120
+ if ($current_page_image_id == $image_id->id) {
121
+ $flag = TRUE;
122
+ }
123
+ }
124
+ if ($flag) {
125
+ continue;
126
+ }
127
+ foreach ($tag_ids_array as $tag_id) {
128
+ if ($tag_id) {
129
+ $exist_tag = $wpdb->get_var($wpdb->prepare('SELECT id FROM ' . $wpdb->prefix . 'bwg_image_tag WHERE tag_id="%d" AND image_id="%d" AND gallery_id="%d"', $tag_id,$image_id->id, $gal_id));
130
+ if ($exist_tag == NULL) {
131
+ $save = $wpdb->insert($wpdb->prefix . 'bwg_image_tag', array(
132
+ 'tag_id' => $tag_id,
133
+ 'image_id' => $image_id->id,
134
+ 'gallery_id' => $gal_id,
135
+ ), array(
136
+ '%d',
137
+ '%d',
138
+ '%d',
139
+ ));
140
+ // Increase tag count in term_taxonomy table.
141
+ $wpdb->query($wpdb->prepare('UPDATE ' . $wpdb->prefix . 'term_taxonomy SET count="%d" WHERE term_id="%d"', $wpdb->get_var($wpdb->prepare('SELECT COUNT(image_id) FROM ' . $wpdb->prefix . 'bwg_image_tag WHERE tag_id="%d"', $tag_id)), $tag_id));
142
+ }
143
+ }
144
+ }
145
+ }
146
+ }
147
+
148
  public function recover() {
149
  global $wpdb;
150
  $id = ((isset($_POST['image_current_id'])) ? esc_html(stripslashes($_POST['image_current_id'])) : 0);
admin/views/BWGViewGalleries_bwg.php CHANGED
@@ -623,6 +623,7 @@ class BWGViewGalleries_bwg {
623
  <input class="button-secondary" type="submit" onclick="spider_set_input_value('ajax_task', 'image_recover_all');
624
  spider_ajax_save('galleries_form');
625
  return false;" value="Reset" />
 
626
  <input class="button-secondary" type="submit" onclick="spider_set_input_value('ajax_task', 'image_publish_all');
627
  spider_ajax_save('galleries_form');
628
  return false;" value="Publish" />
@@ -806,6 +807,7 @@ class BWGViewGalleries_bwg {
806
  <input id="image_order_by" name="image_order_by" type="hidden" value="<?php echo $image_order_by; ?>" />
807
  <input id="ajax_task" name="ajax_task" type="hidden" value="" />
808
  <input id="image_current_id" name="image_current_id" type="hidden" value="" />
 
809
  </tbody>
810
  </table>
811
  <script>
623
  <input class="button-secondary" type="submit" onclick="spider_set_input_value('ajax_task', 'image_recover_all');
624
  spider_ajax_save('galleries_form');
625
  return false;" value="Reset" />
626
+ <a onclick="return bwg_check_checkboxes();" href="<?php echo add_query_arg(array('action' => 'addTags', 'width' => '650', 'height' => '500'), admin_url('admin-ajax.php')); ?>&TB_iframe=1" class="button-primary thickbox thickbox-preview">Add tag</a>
627
  <input class="button-secondary" type="submit" onclick="spider_set_input_value('ajax_task', 'image_publish_all');
628
  spider_ajax_save('galleries_form');
629
  return false;" value="Publish" />
807
  <input id="image_order_by" name="image_order_by" type="hidden" value="<?php echo $image_order_by; ?>" />
808
  <input id="ajax_task" name="ajax_task" type="hidden" value="" />
809
  <input id="image_current_id" name="image_current_id" type="hidden" value="" />
810
+ <input id="added_tags_select_all" name="added_tags_select_all" type="hidden" value="" />
811
  </tbody>
812
  </table>
813
  <script>
js/bwg.js CHANGED
@@ -120,6 +120,7 @@ function spider_ajax_save(form_id, tr_group) {
120
  var flag = false;
121
  if (jQuery("#check_all_items").attr('checked') == 'checked') {
122
  post_data["check_all_items"] = jQuery("#check_all_items").val();
 
123
  flag = true;
124
  jQuery('#check_all_items').attr('checked', false);
125
  }
@@ -619,9 +620,16 @@ function bwg_get_tags(image_id, e) {
619
 
620
  function bwg_add_tag(image_id, tagIds, titles) {
621
  if (image_id == '0') {
 
622
  var ids_string = jQuery("#ids_string").val();
623
  ids_array = ids_string.split(",");
624
- var flag = false;
 
 
 
 
 
 
625
  }
626
  else {
627
  image_id = image_id + ',';
120
  var flag = false;
121
  if (jQuery("#check_all_items").attr('checked') == 'checked') {
122
  post_data["check_all_items"] = jQuery("#check_all_items").val();
123
+ post_data["added_tags_select_all"] = jQuery("#added_tags_select_all").val();
124
  flag = true;
125
  jQuery('#check_all_items').attr('checked', false);
126
  }
620
 
621
  function bwg_add_tag(image_id, tagIds, titles) {
622
  if (image_id == '0') {
623
+ var flag = false;
624
  var ids_string = jQuery("#ids_string").val();
625
  ids_array = ids_string.split(",");
626
+ if (jQuery("#check_all_items").attr("checked")) {
627
+ var added_tags = '';
628
+ for (i = 0; i < tagIds.length; i++) {
629
+ added_tags = added_tags + tagIds[i] + ',';
630
+ }
631
+ jQuery("#added_tags_select_all").val(added_tags);
632
+ }
633
  }
634
  else {
635
  image_id = image_id + ',';
photo-gallery.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Photo Gallery
5
  * Plugin URI: http://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.1.23
8
  * Author: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
@@ -2685,7 +2685,7 @@ function bwg_activate() {
2685
  ));
2686
  }
2687
  $version = get_option("wd_bwg_version");
2688
- $new_version = '1.1.19';
2689
  if ($version && version_compare($version, $new_version, '<')) {
2690
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2691
  bwg_update($version);
@@ -2700,7 +2700,7 @@ register_activation_hook(__FILE__, 'bwg_activate');
2700
 
2701
  function bwg_update_hook() {
2702
  $version = get_option("wd_bwg_version");
2703
- $new_version = '1.1.19';
2704
  if ($version && version_compare($version, $new_version, '<')) {
2705
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2706
  bwg_update($version);
4
  * Plugin Name: Photo Gallery
5
  * Plugin URI: http://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.1.24
8
  * Author: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
2685
  ));
2686
  }
2687
  $version = get_option("wd_bwg_version");
2688
+ $new_version = '1.1.24';
2689
  if ($version && version_compare($version, $new_version, '<')) {
2690
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2691
  bwg_update($version);
2700
 
2701
  function bwg_update_hook() {
2702
  $version = get_option("wd_bwg_version");
2703
+ $new_version = '1.1.24';
2704
  if ($version && version_compare($version, $new_version, '<')) {
2705
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2706
  bwg_update($version);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://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
5
  Requires at least: 3.0
6
  Tested up to: 3.9
7
- Stable tag: 1.1.23
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -170,14 +170,23 @@ If any problem occurs, please contact us at [info@web-dorado.com](mailto:info@w
170
 
171
  == Changelog ==
172
 
 
 
 
 
 
 
 
 
 
173
  = 1.1.21 =
174
- * added option for sorting gallery images within album
175
 
176
  = 1.1.20 =
177
- * bug fixed on lightbox
178
 
179
  = 1.1.19 =
180
- * preload images count options
181
 
182
  = 1.1.18 =
183
  * redirect url optional
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
5
  Requires at least: 3.0
6
  Tested up to: 3.9
7
+ Stable tag: 1.1.24
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
170
 
171
  == Changelog ==
172
 
173
+ = 1.1.24 =
174
+ Improve translation, Add tags to all images
175
+
176
+ = 1.1.23 =
177
+ redirect from widget, unique tags name
178
+
179
+ = 1.1.22 =
180
+ order option for album images
181
+
182
  = 1.1.21 =
183
+ * added option for sorting gallery images within album
184
 
185
  = 1.1.20 =
186
+ * bug fixed on lightbox
187
 
188
  = 1.1.19 =
189
+ * preload images count options
190
 
191
  = 1.1.18 =
192
  * redirect url optional