Photo Gallery by WD – Responsive Photo Gallery - Version 1.2.2

Version Description

Download this release

Release Info

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

Code changes from version 1.2.1 to 1.2.2

admin/controllers/BWGControllerOptions_bwg.php CHANGED
@@ -90,6 +90,8 @@ class BWGControllerOptions_bwg {
90
  $thumb_height = (isset($_POST['thumb_height']) ? esc_html(stripslashes($_POST['thumb_height'])) : 90);
91
  $upload_thumb_width = (isset($_POST['upload_thumb_width']) ? esc_html(stripslashes($_POST['upload_thumb_width'])) : 300);
92
  $upload_thumb_height = (isset($_POST['upload_thumb_height']) ? esc_html(stripslashes($_POST['upload_thumb_height'])) : 300);
 
 
93
  $image_enable_page = (isset($_POST['image_enable_page']) ? esc_html(stripslashes($_POST['image_enable_page'])) : 1);
94
  $image_title_show_hover = (isset($_POST['image_title_show_hover']) ? esc_html(stripslashes($_POST['image_title_show_hover'])) : 'none');
95
  $album_column_number = (isset($_POST['album_column_number']) ? esc_html(stripslashes($_POST['album_column_number'])) : 5);
@@ -192,6 +194,8 @@ class BWGControllerOptions_bwg {
192
  'thumb_height' => $thumb_height,
193
  'upload_thumb_width' => $upload_thumb_width,
194
  'upload_thumb_height' => $upload_thumb_height,
 
 
195
  'image_enable_page' => $image_enable_page,
196
  'image_title_show_hover' => $image_title_show_hover,
197
  'album_column_number' => $album_column_number,
90
  $thumb_height = (isset($_POST['thumb_height']) ? esc_html(stripslashes($_POST['thumb_height'])) : 90);
91
  $upload_thumb_width = (isset($_POST['upload_thumb_width']) ? esc_html(stripslashes($_POST['upload_thumb_width'])) : 300);
92
  $upload_thumb_height = (isset($_POST['upload_thumb_height']) ? esc_html(stripslashes($_POST['upload_thumb_height'])) : 300);
93
+ $upload_img_width = (isset($_POST['upload_img_width']) ? esc_html(stripslashes($_POST['upload_img_width'])) : 1200);
94
+ $upload_img_height = (isset($_POST['upload_img_height']) ? esc_html(stripslashes($_POST['upload_img_height'])) : 1200);
95
  $image_enable_page = (isset($_POST['image_enable_page']) ? esc_html(stripslashes($_POST['image_enable_page'])) : 1);
96
  $image_title_show_hover = (isset($_POST['image_title_show_hover']) ? esc_html(stripslashes($_POST['image_title_show_hover'])) : 'none');
97
  $album_column_number = (isset($_POST['album_column_number']) ? esc_html(stripslashes($_POST['album_column_number'])) : 5);
194
  'thumb_height' => $thumb_height,
195
  'upload_thumb_width' => $upload_thumb_width,
196
  'upload_thumb_height' => $upload_thumb_height,
197
+ 'upload_img_width' => $upload_img_width,
198
+ 'upload_img_height' => $upload_img_height,
199
  'image_enable_page' => $image_enable_page,
200
  'image_title_show_hover' => $image_title_show_hover,
201
  'album_column_number' => $album_column_number,
admin/models/BWGModelOptions_bwg.php CHANGED
@@ -36,6 +36,8 @@ class BWGModelOptions_bwg {
36
  $row->thumb_height = 90;
37
  $row->upload_thumb_width = 300;
38
  $row->upload_thumb_height = 300;
 
 
39
  $row->image_enable_page = 1;
40
  $row->image_title_show_hover = 'none';
41
 
36
  $row->thumb_height = 90;
37
  $row->upload_thumb_width = 300;
38
  $row->upload_thumb_height = 300;
39
+ $row->upload_img_width = 1200;
40
+ $row->upload_img_height = 1200;
41
  $row->image_enable_page = 1;
42
  $row->image_title_show_hover = 'none';
43
 
admin/views/BWGViewAlbums_bwg.php CHANGED
@@ -33,7 +33,7 @@ class BWGViewAlbums_bwg {
33
  $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
34
  $ids_string = '';
35
  ?>
36
- <div style="clear: both; float: left; width: 95%;">
37
  <div style="float:left; font-size: 14px; font-weight: bold;">
38
  This section allows you to create, edit and delete albums.
39
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-4.html">Read More in User Manual</a>
@@ -44,7 +44,7 @@ class BWGViewAlbums_bwg {
44
  </a>
45
  </div>
46
  </div>
47
- <form class="wrap" id="albums_form" method="post" action="admin.php?page=albums_bwg" style="float: left; width: 95%;">
48
  <span class="album-icon"></span>
49
  <h2>
50
  Albums
@@ -188,7 +188,7 @@ class BWGViewAlbums_bwg {
188
  $row = $this->model->get_row_data($id);
189
  $page_title = (($id != 0) ? 'Edit album ' . $row->name : 'Create new album');
190
  ?>
191
- <div style="clear: both; float: left; width: 95%;">
192
  <div style="float:left; font-size: 14px; font-weight: bold;">
193
  This section allows you to add/edit album.
194
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-4.html">Read More in User Manual</a>
@@ -254,7 +254,7 @@ class BWGViewAlbums_bwg {
254
  tb_remove();
255
  }
256
  </script>
257
- <form class="wrap" method="post" action="admin.php?page=albums_bwg" style="float: left; width: 95%;">
258
  <span class="album-icon"></span>
259
  <h2><?php echo $page_title; ?></h2>
260
  <div style="float:right;">
33
  $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
34
  $ids_string = '';
35
  ?>
36
+ <div style="clear: both; float: left; width: 99%;">
37
  <div style="float:left; font-size: 14px; font-weight: bold;">
38
  This section allows you to create, edit and delete albums.
39
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-4.html">Read More in User Manual</a>
44
  </a>
45
  </div>
46
  </div>
47
+ <form class="wrap" id="albums_form" method="post" action="admin.php?page=albums_bwg" style="float: left; width: 99%;">
48
  <span class="album-icon"></span>
49
  <h2>
50
  Albums
188
  $row = $this->model->get_row_data($id);
189
  $page_title = (($id != 0) ? 'Edit album ' . $row->name : 'Create new album');
190
  ?>
191
+ <div style="clear: both; float: left; width: 99%;">
192
  <div style="float:left; font-size: 14px; font-weight: bold;">
193
  This section allows you to add/edit album.
194
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-4.html">Read More in User Manual</a>
254
  tb_remove();
255
  }
256
  </script>
257
+ <form class="wrap" method="post" action="admin.php?page=albums_bwg" style="float: left; width: 99%;">
258
  <span class="album-icon"></span>
259
  <h2><?php echo $page_title; ?></h2>
260
  <div style="float:right;">
admin/views/BWGViewGalleries_bwg.php CHANGED
@@ -33,7 +33,7 @@ class BWGViewGalleries_bwg {
33
  $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
34
  $ids_string = '';
35
  ?>
36
- <div style="clear: both; float: left; width: 95%;">
37
  <div style="float:left; font-size: 14px; font-weight: bold;">
38
  This section allows you to create, edit and delete galleries.
39
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-2.html">Read More in User Manual</a>
@@ -44,7 +44,7 @@ class BWGViewGalleries_bwg {
44
  </a>
45
  </div>
46
  </div>
47
- <form class="wrap" id="galleries_form" method="post" action="admin.php?page=galleries_bwg" style="float: left; width: 95%;">
48
  <span class="gallery-icon"></span>
49
  <h2>
50
  Galleries
@@ -202,7 +202,7 @@ class BWGViewGalleries_bwg {
202
  $option_row = $this->model->get_option_row_data();
203
  $page_title = (($id != 0) ? 'Edit gallery ' . $row->name : 'Create new gallery');
204
  ?>
205
- <div style="clear: both; float: left; width: 95%;">
206
  <div id="message_div" class="updated" style="display: none;"></div>
207
  <div style="float:left; font-size: 14px; font-weight: bold;">
208
  This section allows you to add/edit gallery.
@@ -489,7 +489,7 @@ class BWGViewGalleries_bwg {
489
  spider_show_hide_weights();
490
  }
491
  </script>
492
- <form class="wrap" method="post" id="galleries_form" action="admin.php?page=galleries_bwg" style="float: left; width: 95%;">
493
  <span class="gallery-icon"></span>
494
  <h2><?php echo $page_title; ?></h2>
495
  <div style="float:right;">
33
  $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
34
  $ids_string = '';
35
  ?>
36
+ <div style="clear: both; float: left; width: 99%;">
37
  <div style="float:left; font-size: 14px; font-weight: bold;">
38
  This section allows you to create, edit and delete galleries.
39
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-2.html">Read More in User Manual</a>
44
  </a>
45
  </div>
46
  </div>
47
+ <form class="wrap" id="galleries_form" method="post" action="admin.php?page=galleries_bwg" style="float: left; width: 99%;">
48
  <span class="gallery-icon"></span>
49
  <h2>
50
  Galleries
202
  $option_row = $this->model->get_option_row_data();
203
  $page_title = (($id != 0) ? 'Edit gallery ' . $row->name : 'Create new gallery');
204
  ?>
205
+ <div style="clear: both; float: left; width: 99%;">
206
  <div id="message_div" class="updated" style="display: none;"></div>
207
  <div style="float:left; font-size: 14px; font-weight: bold;">
208
  This section allows you to add/edit gallery.
489
  spider_show_hide_weights();
490
  }
491
  </script>
492
+ <form class="wrap" method="post" id="galleries_form" action="admin.php?page=galleries_bwg" style="float: left; width: 99%;">
493
  <span class="gallery-icon"></span>
494
  <h2><?php echo $page_title; ?></h2>
495
  <div style="float:right;">
admin/views/BWGViewOptions_bwg.php CHANGED
@@ -25,7 +25,7 @@ class BWGViewOptions_bwg {
25
  public function display($reset = FALSE) {
26
  global $WD_BWG_UPLOAD_DIR;
27
  ?>
28
- <div style="clear: both; float: left; width: 95%;">
29
  <div style="float:left; font-size: 14px; font-weight: bold;">
30
  This section allows you to change settings for different views and general options.
31
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-5/5-1.html">Read More in User Manual</a>
@@ -85,7 +85,7 @@ class BWGViewOptions_bwg {
85
  'random' => 'Random',
86
  );
87
  ?>
88
- <form method="post" class="wrap" action="admin.php?page=options_bwg" style="float: left; width: 95%;">
89
  <span class="option-icon"></span>
90
  <h2>Edit options</h2>
91
  <div style="display: inline-block; width: 100%;">
@@ -125,6 +125,16 @@ class BWGViewOptions_bwg {
125
  <div class="spider_description">Input an existing directory inside the Wordpress directory to store uploaded images.<br />Old directory content will be moved to the new one.</div>
126
  </td>
127
  </tr>
 
 
 
 
 
 
 
 
 
 
128
  <tr>
129
  <td class="spider_label_options">
130
  <label>Right click protection:</label>
25
  public function display($reset = FALSE) {
26
  global $WD_BWG_UPLOAD_DIR;
27
  ?>
28
+ <div style="clear: both; float: left; width: 99%;">
29
  <div style="float:left; font-size: 14px; font-weight: bold;">
30
  This section allows you to change settings for different views and general options.
31
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-5/5-1.html">Read More in User Manual</a>
85
  'random' => 'Random',
86
  );
87
  ?>
88
+ <form method="post" class="wrap" action="admin.php?page=options_bwg" style="float: left; width: 99%;">
89
  <span class="option-icon"></span>
90
  <h2>Edit options</h2>
91
  <div style="display: inline-block; width: 100%;">
125
  <div class="spider_description">Input an existing directory inside the Wordpress directory to store uploaded images.<br />Old directory content will be moved to the new one.</div>
126
  </td>
127
  </tr>
128
+ <tr>
129
+ <td class="spider_label_options">
130
+ <label for="upload_img_width">Image dimensions: </label>
131
+ </td>
132
+ <td>
133
+ <input type="text" name="upload_img_width" id="upload_img_width" value="<?php echo $row->upload_img_width; ?>" class="spider_int_input" /> x
134
+ <input type="text" name="upload_img_height" id="upload_img_height" value="<?php echo $row->upload_img_height; ?>" class="spider_int_input" /> px
135
+ <div class="spider_description">The maximum size of the uploaded image (0 for original size).</div>
136
+ </td>
137
+ </tr>
138
  <tr>
139
  <td class="spider_label_options">
140
  <label>Right click protection:</label>
admin/views/BWGViewTags_bwg.php CHANGED
@@ -34,7 +34,7 @@ class BWGViewTags_bwg {
34
  <script>
35
  var ajax_url = "<?php echo add_query_arg(array('action' => ''), admin_url('admin-ajax.php')); ?>"
36
  </script>
37
- <div style="clear: both; float: left; width: 95%;">
38
  <div style="float:left; font-size: 14px; font-weight: bold;">
39
  This section allows you to create, edit and delete tags.
40
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-3.html">Read More in User Manual</a>
@@ -45,8 +45,8 @@ class BWGViewTags_bwg {
45
  </a>
46
  </div>
47
  </div>
48
- <div id="wordpress_message_1" style="width:95%;display:none"><div id="wordpress_message_2" class="updated"><p><strong>Item Succesfully Saved.</strong></p></div></div>
49
- <form class="wrap" id="tags_form" method="post" action="admin.php?page=tags_bwg" style="float:left; width: 95%;">
50
  <span class="tag_icon"></span>
51
  <h2>Tags</h2>
52
  <div class="buttons_div">
34
  <script>
35
  var ajax_url = "<?php echo add_query_arg(array('action' => ''), admin_url('admin-ajax.php')); ?>"
36
  </script>
37
+ <div style="clear: both; float: left; width: 99%;">
38
  <div style="float:left; font-size: 14px; font-weight: bold;">
39
  This section allows you to create, edit and delete tags.
40
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-3.html">Read More in User Manual</a>
45
  </a>
46
  </div>
47
  </div>
48
+ <div id="wordpress_message_1" style="width:99%;display:none"><div id="wordpress_message_2" class="updated"><p><strong>Item Succesfully Saved.</strong></p></div></div>
49
+ <form class="wrap" id="tags_form" method="post" action="admin.php?page=tags_bwg" style="float:left; width: 99%;">
50
  <span class="tag_icon"></span>
51
  <h2>Tags</h2>
52
  <div class="buttons_div">
admin/views/BWGViewThemes_bwg.php CHANGED
@@ -32,7 +32,7 @@ class BWGViewThemes_bwg {
32
  $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
  $ids_string = '';
34
  ?>
35
- <div style="clear: both; float: left; width: 95%;">
36
  <div style="float:left; font-size: 14px; font-weight: bold;">
37
  This section allows you to create, edit and delete themes.
38
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-6/6-1.html">Read More in User Manual</a>
@@ -69,7 +69,7 @@ class BWGViewThemes_bwg {
69
  die();
70
  }
71
  ?>
72
- <form class="wrap" id="themes_form" method="post" action="admin.php?page=themes_bwg" style="float: left; width: 95%;">
73
  <span class="theme_icon"></span>
74
  <h2>
75
  Themes
32
  $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
  $ids_string = '';
34
  ?>
35
+ <div style="clear: both; float: left; width: 99%;">
36
  <div style="float:left; font-size: 14px; font-weight: bold;">
37
  This section allows you to create, edit and delete themes.
38
  <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-6/6-1.html">Read More in User Manual</a>
69
  die();
70
  }
71
  ?>
72
+ <form class="wrap" id="themes_form" method="post" action="admin.php?page=themes_bwg" style="float: left; width: 99%;">
73
  <span class="theme_icon"></span>
74
  <h2>
75
  Themes
admin/views/BWGViewUninstall_bwg.php CHANGED
@@ -26,7 +26,7 @@ class BWGViewUninstall_bwg {
26
  global $wpdb;
27
  $prefix = $wpdb->prefix;
28
  ?>
29
- <form method="post" action="admin.php?page=uninstall_bwg" style="width:95%;">
30
  <?php wp_nonce_field('best_wordpress_gallery uninstall');?>
31
  <div class="wrap">
32
  <span class="uninstall_icon"></span>
26
  global $wpdb;
27
  $prefix = $wpdb->prefix;
28
  ?>
29
+ <form method="post" action="admin.php?page=uninstall_bwg" style="width:99%;">
30
  <?php wp_nonce_field('best_wordpress_gallery uninstall');?>
31
  <div class="wrap">
32
  <span class="uninstall_icon"></span>
filemanager/UploadHandler.php CHANGED
@@ -87,14 +87,20 @@ class UploadHandler {
87
  // The maximum number of files for the upload directory:
88
  'max_number_of_files' => null,
89
  // Image resolution restrictions:
90
- 'max_width' => null,
91
- 'max_height' => null,
92
  'min_width' => 1,
93
  'min_height' => 1,
94
  // Set the following option to false to enable resumable uploads:
95
  'discard_aborted_uploads' => true,
96
  // Set to true to rotate images based on EXIF meta data, if available:
97
  'orient_image' => false,
 
 
 
 
 
 
98
  'image_versions' => array(
99
  // Uncomment the following version to restrict the size of
100
  // uploaded images:
@@ -114,13 +120,13 @@ class UploadHandler {
114
  ),
115
  */
116
  '.original' => array(
117
- 'max_width' => NULL,
118
- 'max_height' => NULL,
119
  'jpeg_quality' => 100
120
  ),
121
  'thumb' => array(
122
- 'max_width' => ((isset($_REQUEST['file_namesML'])) ? (int) $_REQUEST['importer_thumb_width'] : ((isset($_POST['upload_thumb_width']) && (int) $_POST['upload_thumb_width']) ? (int) $_POST['upload_thumb_width'] : 300)),
123
- 'max_height' => ((isset($_REQUEST['file_namesML'])) ? (int) $_REQUEST['importer_thumb_height'] : ((isset($_POST['upload_thumb_height']) && (int) $_POST['upload_thumb_height']) ? (int) $_POST['upload_thumb_height'] : 300)),
124
  'jpeg_quality' => 90
125
  ),
126
  )
@@ -286,7 +292,7 @@ class UploadHandler {
286
 
287
  protected function create_scaled_image($file_name, $version, $options) {
288
  $file_path = $this->get_upload_path($file_name);
289
- if (!empty($version)) {
290
  $version_dir = $this->get_upload_path(null, $version);
291
  if (!is_dir($version_dir)) {
292
  mkdir($version_dir, $this->options['mkdir_mode'], true);
@@ -310,7 +316,7 @@ class UploadHandler {
310
  $max_height / $img_height
311
  );
312
  ini_set('memory_limit', '-1');
313
- if (($scale >= 1) || (($max_width === NULL) && ($max_height === NULL))) {
314
  if ($file_path !== $new_file_path) {
315
  return copy($file_path, $new_file_path);
316
  }
@@ -442,14 +448,14 @@ class UploadHandler {
442
  }
443
  list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($uploaded_file, ENT_COMPAT | ENT_QUOTES));
444
  if (is_int($img_width)) {
445
- if ($this->options['max_width'] && $img_width > $this->options['max_width']) {
446
- $file->error = $this->get_error_message('max_width');
447
- return false;
448
- }
449
- if ($this->options['max_height'] && $img_height > $this->options['max_height']) {
450
- $file->error = $this->get_error_message('max_height');
451
- return false;
452
- }
453
  if ($this->options['min_width'] && $img_width < $this->options['min_width']) {
454
  $file->error = $this->get_error_message('min_width');
455
  return false;
@@ -625,6 +631,12 @@ class UploadHandler {
625
  $file->type = $type;
626
  $file->url = $this->get_download_url($file->name);
627
  list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($ex_file, ENT_COMPAT | ENT_QUOTES));
 
 
 
 
 
 
628
  if (is_int($img_width)) {
629
  $this->handle_image_file($ex_file, $file);
630
  }
@@ -656,6 +668,12 @@ class UploadHandler {
656
 
657
  copy($parent_dir . '/' . $uploaded_file, $file_path);
658
  list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
 
 
 
 
 
 
659
  if (is_int($img_width)) {
660
  $this->handle_image_file($file_path, $file);
661
  }
@@ -701,6 +719,10 @@ class UploadHandler {
701
  }
702
  $file_size = $this->get_file_size($file_path, $append_file);
703
  if ($file_size === $file->size) {
 
 
 
 
704
  $file->url = $this->get_download_url($file->name);
705
  list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
706
  if (is_int($img_width)) {
87
  // The maximum number of files for the upload directory:
88
  'max_number_of_files' => null,
89
  // Image resolution restrictions:
90
+ 'max_width' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_img_width']) ? (int) $_REQUEST['importer_img_width'] : 1200) : (isset($_POST['upload_img_width']) ? (int) $_POST['upload_img_width'] : 1200)),
91
+ 'max_height' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_img_height']) ? (int) $_REQUEST['importer_img_height'] : 1200) : (isset($_POST['upload_img_height']) ? (int) $_POST['upload_img_height'] : 1200)),
92
  'min_width' => 1,
93
  'min_height' => 1,
94
  // Set the following option to false to enable resumable uploads:
95
  'discard_aborted_uploads' => true,
96
  // Set to true to rotate images based on EXIF meta data, if available:
97
  'orient_image' => false,
98
+ );
99
+ if (!$this->options['max_width'] || !$this->options['max_height']) {
100
+ $this->options['max_width'] = NULL;
101
+ $this->options['max_height'] = NULL;
102
+ }
103
+ $this->options += array(
104
  'image_versions' => array(
105
  // Uncomment the following version to restrict the size of
106
  // uploaded images:
120
  ),
121
  */
122
  '.original' => array(
123
+ 'max_width' => $this->options['max_width'],
124
+ 'max_height' => $this->options['max_height'],
125
  'jpeg_quality' => 100
126
  ),
127
  'thumb' => array(
128
+ 'max_width' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_thumb_width']) ? (int) $_REQUEST['importer_thumb_width'] : 300) : ((isset($_POST['upload_thumb_width']) && (int) $_POST['upload_thumb_width']) ? (int) $_POST['upload_thumb_width'] : 300)),
129
+ 'max_height' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_thumb_height']) ? (int) $_REQUEST['importer_thumb_height'] : 300) : ((isset($_POST['upload_thumb_height']) && (int) $_POST['upload_thumb_height']) ? (int) $_POST['upload_thumb_height'] : 300)),
130
  'jpeg_quality' => 90
131
  ),
132
  )
292
 
293
  protected function create_scaled_image($file_name, $version, $options) {
294
  $file_path = $this->get_upload_path($file_name);
295
+ if (!empty($version) && ($version != 'main')) {
296
  $version_dir = $this->get_upload_path(null, $version);
297
  if (!is_dir($version_dir)) {
298
  mkdir($version_dir, $this->options['mkdir_mode'], true);
316
  $max_height / $img_height
317
  );
318
  ini_set('memory_limit', '-1');
319
+ if (($scale >= 1) || (($max_width == NULL) && ($max_height == NULL))) {
320
  if ($file_path !== $new_file_path) {
321
  return copy($file_path, $new_file_path);
322
  }
448
  }
449
  list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($uploaded_file, ENT_COMPAT | ENT_QUOTES));
450
  if (is_int($img_width)) {
451
+ // if ($this->options['max_width'] && $img_width > $this->options['max_width']) {
452
+ // $file->error = $this->get_error_message('max_width');
453
+ // return false;
454
+ // }
455
+ // if ($this->options['max_height'] && $img_height > $this->options['max_height']) {
456
+ // $file->error = $this->get_error_message('max_height');
457
+ // return false;
458
+ // }
459
  if ($this->options['min_width'] && $img_width < $this->options['min_width']) {
460
  $file->error = $this->get_error_message('min_width');
461
  return false;
631
  $file->type = $type;
632
  $file->url = $this->get_download_url($file->name);
633
  list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($ex_file, ENT_COMPAT | ENT_QUOTES));
634
+
635
+ if ($this->options['max_width'] && $this->options['max_height']) {
636
+ // Zip Upload.
637
+ $this->create_scaled_image($file->name, 'main', $this->options);
638
+ }
639
+
640
  if (is_int($img_width)) {
641
  $this->handle_image_file($ex_file, $file);
642
  }
668
 
669
  copy($parent_dir . '/' . $uploaded_file, $file_path);
670
  list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
671
+
672
+ if ($this->options['max_width'] && $this->options['max_height']) {
673
+ // Media libruary Upload.
674
+ $this->create_scaled_image($file->name, 'main', $this->options);
675
+ }
676
+
677
  if (is_int($img_width)) {
678
  $this->handle_image_file($file_path, $file);
679
  }
719
  }
720
  $file_size = $this->get_file_size($file_path, $append_file);
721
  if ($file_size === $file->size) {
722
+ if ($this->options['max_width'] && $this->options['max_height']) {
723
+ // Upload.
724
+ $this->create_scaled_image($file->name, 'main', $this->options);
725
+ }
726
  $file->url = $this->get_download_url($file->name);
727
  list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
728
  if (is_int($img_width)) {
filemanager/controller.php CHANGED
@@ -249,7 +249,7 @@ class FilemanagerController {
249
  }
250
 
251
  public function import_items() {
252
- header('Location: ' . add_query_arg(array('action' => 'bwg_UploadHandler', 'importer_thumb_width' => esc_html($_REQUEST['importer_thumb_width']), 'importer_thumb_height' => esc_html($_REQUEST['importer_thumb_height']), 'callback' => esc_html($_REQUEST['callback']), 'file_namesML' => esc_html($_REQUEST['file_namesML']), 'import' => 'true', 'redir' => esc_html($_REQUEST['dir']), 'dir' => $this->get_uploads_dir() . '/' . esc_html($_REQUEST['dir']) . '/'), admin_url('admin-ajax.php')));
253
  exit;
254
  }
255
 
249
  }
250
 
251
  public function import_items() {
252
+ header('Location: ' . add_query_arg(array('action' => 'bwg_UploadHandler', 'importer_thumb_width' => esc_html($_REQUEST['importer_thumb_width']), 'importer_thumb_height' => esc_html($_REQUEST['importer_thumb_height']), 'callback' => esc_html($_REQUEST['callback']), 'file_namesML' => esc_html($_REQUEST['file_namesML']), 'importer_img_width' => esc_html($_REQUEST['importer_img_width']), 'importer_img_height' => esc_html($_REQUEST['importer_img_height']), 'import' => 'true', 'redir' => esc_html($_REQUEST['dir']), 'dir' => $this->get_uploads_dir() . '/' . esc_html($_REQUEST['dir']) . '/'), admin_url('admin-ajax.php')));
253
  exit;
254
  }
255
 
filemanager/css/default.css CHANGED
@@ -131,6 +131,7 @@ html, body, div, span, th, td, a {
131
  float: left;
132
  margin: 0;
133
  padding: 0;
 
134
  }
135
 
136
  .ctrls_bar .ctrls_right {
@@ -139,6 +140,13 @@ html, body, div, span, th, td, a {
139
  padding: 0;
140
  }
141
 
 
 
 
 
 
 
 
142
  .ctrl_bar_divider {
143
  display: table-cell;
144
  margin: 0;
131
  float: left;
132
  margin: 0;
133
  padding: 0;
134
+ margin-left: 5px;
135
  }
136
 
137
  .ctrls_bar .ctrls_right {
140
  padding: 0;
141
  }
142
 
143
+ .ctrls_bar .ctrls_right_img {
144
+ float: right;
145
+ margin: 0;
146
+ padding: 0;
147
+ margin-right: 10px;
148
+ }
149
+
150
  .ctrl_bar_divider {
151
  display: table-cell;
152
  margin: 0;
filemanager/model.php CHANGED
@@ -192,7 +192,7 @@ class FilemanagerModel {
192
  $file_type_array = explode('.', $file_name);
193
  $file['type'] = strtolower(end($file_type_array));
194
  // $file['thumb'] = wp_get_attachment_thumb_url($image->ID);
195
- if ($file_meta['sizes']['thumbnail']['file']) {
196
  $file_pos = strrpos($file_meta['file'], '/');
197
  $sub_folder = substr($file_meta['file'], 0, $file_pos);
198
  $file['thumb'] = $upload_dir['baseurl'] . '/' . $sub_folder . '/' . $file_meta['sizes']['thumbnail']['file'];
192
  $file_type_array = explode('.', $file_name);
193
  $file['type'] = strtolower(end($file_type_array));
194
  // $file['thumb'] = wp_get_attachment_thumb_url($image->ID);
195
+ if (!empty($file_meta['sizes']) && $file_meta['sizes']['thumbnail']['file']) {
196
  $file_pos = strrpos($file_meta['file'], '/');
197
  $sub_folder = substr($file_meta['file'], 0, $file_pos);
198
  $file['thumb'] = $upload_dir['baseurl'] . '/' . $sub_folder . '/' . $file_meta['sizes']['thumbnail']['file'];
filemanager/view.php CHANGED
@@ -256,13 +256,18 @@ class FilemanagerView {
256
  <div id="importer_bg"></div>
257
  <div class="ctrls_bar ctrls_bar_header">
258
  <div class="ctrls_left upload_thumb">
259
- Generated Thumbnail Maximum Dimensions:
260
  <input type="text" class="upload_thumb_dim" name="importer_thumb_width" id="importer_thumb_width" value="<?php echo $bwg_options->upload_thumb_width; ?>" /> x
261
  <input type="text" class="upload_thumb_dim" name="importer_thumb_height" id="importer_thumb_height" value="<?php echo $bwg_options->upload_thumb_height; ?>" /> px
262
  </div>
263
  <div class="ctrls_right">
264
  <a class="ctrl_bar_btn btn_back" onclick="onBtnBackClick(event, this);" title="<?php echo 'Back'; ?>"></a>
265
  </div>
 
 
 
 
 
266
  </div>
267
  <div id="importer_body_wrapper">
268
  <div id="importer_body_container">
@@ -324,13 +329,18 @@ class FilemanagerView {
324
  <div id="uploader_bg"></div>
325
  <div class="ctrls_bar ctrls_bar_header">
326
  <div class="ctrls_left upload_thumb">
327
- Generated Thumbnail Maximum Dimensions:
328
  <input type="text" class="upload_thumb_dim" name="upload_thumb_width" id="upload_thumb_width" value="<?php echo $bwg_options->upload_thumb_width; ?>" /> x
329
  <input type="text" class="upload_thumb_dim" name="upload_thumb_height" id="upload_thumb_height" value="<?php echo $bwg_options->upload_thumb_height; ?>" /> px
330
  </div>
331
  <div class="ctrls_right">
332
  <a class="ctrl_bar_btn btn_back" onclick="onBtnBackClick(event, this);" title="<?php echo 'Back'; ?>"></a>
333
  </div>
 
 
 
 
 
334
  </div>
335
  <label for="jQueryUploader">
336
  <div id="uploader_hitter">
256
  <div id="importer_bg"></div>
257
  <div class="ctrls_bar ctrls_bar_header">
258
  <div class="ctrls_left upload_thumb">
259
+ Thumbnail Maximum Dimensions:
260
  <input type="text" class="upload_thumb_dim" name="importer_thumb_width" id="importer_thumb_width" value="<?php echo $bwg_options->upload_thumb_width; ?>" /> x
261
  <input type="text" class="upload_thumb_dim" name="importer_thumb_height" id="importer_thumb_height" value="<?php echo $bwg_options->upload_thumb_height; ?>" /> px
262
  </div>
263
  <div class="ctrls_right">
264
  <a class="ctrl_bar_btn btn_back" onclick="onBtnBackClick(event, this);" title="<?php echo 'Back'; ?>"></a>
265
  </div>
266
+ <div class="ctrls_right_img upload_thumb">
267
+ Image Maximum Dimensions:
268
+ <input type="text" class="upload_thumb_dim" name="importer_img_width" id="importer_img_width" value="<?php echo $bwg_options->upload_img_width; ?>" /> x
269
+ <input type="text" class="upload_thumb_dim" name="importer_img_height" id="importer_img_height" value="<?php echo $bwg_options->upload_img_height; ?>" /> px
270
+ </div>
271
  </div>
272
  <div id="importer_body_wrapper">
273
  <div id="importer_body_container">
329
  <div id="uploader_bg"></div>
330
  <div class="ctrls_bar ctrls_bar_header">
331
  <div class="ctrls_left upload_thumb">
332
+ Thumbnail Maximum Dimensions:
333
  <input type="text" class="upload_thumb_dim" name="upload_thumb_width" id="upload_thumb_width" value="<?php echo $bwg_options->upload_thumb_width; ?>" /> x
334
  <input type="text" class="upload_thumb_dim" name="upload_thumb_height" id="upload_thumb_height" value="<?php echo $bwg_options->upload_thumb_height; ?>" /> px
335
  </div>
336
  <div class="ctrls_right">
337
  <a class="ctrl_bar_btn btn_back" onclick="onBtnBackClick(event, this);" title="<?php echo 'Back'; ?>"></a>
338
  </div>
339
+ <div class="ctrls_right_img upload_thumb">
340
+ Image Maximum Dimensions:
341
+ <input type="text" class="upload_thumb_dim" name="upload_img_width" id="upload_img_width" value="<?php echo $bwg_options->upload_img_width; ?>" /> x
342
+ <input type="text" class="upload_thumb_dim" name="upload_img_height" id="upload_img_height" value="<?php echo $bwg_options->upload_img_height; ?>" /> px
343
+ </div>
344
  </div>
345
  <label for="jQueryUploader">
346
  <div id="uploader_hitter">
framework/WDWLibrary.php CHANGED
@@ -150,7 +150,7 @@ class WDWLibrary {
150
  }
151
 
152
  public static function message($message, $type) {
153
- return '<div style="width:95%"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
154
  }
155
 
156
  public static function search($search_by, $search_value, $form_id) {
150
  }
151
 
152
  public static function message($message, $type) {
153
+ return '<div style="width:99%"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
154
  }
155
 
156
  public static function search($search_by, $search_value, $form_id) {
js/bwg_editor_button.js CHANGED
@@ -61,7 +61,7 @@
61
  }
62
  return e
63
  })
64
- },
65
  });
66
  tinymce.PluginManager.add('bwg_mce', tinymce.plugins.bwg_mce);
67
  })();
61
  }
62
  return e
63
  })
64
+ }
65
  });
66
  tinymce.PluginManager.add('bwg_mce', tinymce.plugins.bwg_mce);
67
  })();
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.2.1
8
  * Author: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
@@ -165,7 +165,8 @@ function bwg_shortcode($params) {
165
  $shortcode = $wpdb->get_var($wpdb->prepare("SELECT tagtext FROM " . $wpdb->prefix . "bwg_shortcode WHERE id='%d'", $params['id']));
166
  $shortcode_params = explode('" ', $shortcode);
167
  foreach ($shortcode_params as $shortcode_param) {
168
- $shortcode_elem = explode('="', $shortcode_param);
 
169
  $params[str_replace(' ', '', $shortcode_elem[0])] = $shortcode_elem[1];
170
  }
171
  }
@@ -596,6 +597,8 @@ function bwg_activate() {
596
  `showthumbs_name` tinyint(1) NOT NULL,
597
  `show_album_name` tinyint(1) NOT NULL,
598
  `show_image_counts` tinyint(1) NOT NULL,
 
 
599
  PRIMARY KEY (`id`)
600
  ) DEFAULT CHARSET=utf8;";
601
  $wpdb->query($bwg_option);
@@ -2728,7 +2731,7 @@ function bwg_activate() {
2728
  ));
2729
  }
2730
  $version = get_option("wd_bwg_version");
2731
- $new_version = '1.2.1';
2732
  if ($version && version_compare($version, $new_version, '<')) {
2733
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2734
  bwg_update($version);
@@ -2743,7 +2746,7 @@ register_activation_hook(__FILE__, 'bwg_activate');
2743
 
2744
  function bwg_update_hook() {
2745
  $version = get_option("wd_bwg_version");
2746
- $new_version = '1.2.1';
2747
  if ($version && version_compare($version, $new_version, '<')) {
2748
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2749
  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.2.2
8
  * Author: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
165
  $shortcode = $wpdb->get_var($wpdb->prepare("SELECT tagtext FROM " . $wpdb->prefix . "bwg_shortcode WHERE id='%d'", $params['id']));
166
  $shortcode_params = explode('" ', $shortcode);
167
  foreach ($shortcode_params as $shortcode_param) {
168
+ $shortcode_param = str_replace('"', '', $shortcode_param);
169
+ $shortcode_elem = explode('=', $shortcode_param);
170
  $params[str_replace(' ', '', $shortcode_elem[0])] = $shortcode_elem[1];
171
  }
172
  }
597
  `showthumbs_name` tinyint(1) NOT NULL,
598
  `show_album_name` tinyint(1) NOT NULL,
599
  `show_image_counts` tinyint(1) NOT NULL,
600
+ `upload_img_width` int(4) NOT NULL,
601
+ `upload_img_height` int(4) NOT NULL,
602
  PRIMARY KEY (`id`)
603
  ) DEFAULT CHARSET=utf8;";
604
  $wpdb->query($bwg_option);
2731
  ));
2732
  }
2733
  $version = get_option("wd_bwg_version");
2734
+ $new_version = '1.2.2';
2735
  if ($version && version_compare($version, $new_version, '<')) {
2736
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2737
  bwg_update($version);
2746
 
2747
  function bwg_update_hook() {
2748
  $version = get_option("wd_bwg_version");
2749
+ $new_version = '1.2.2';
2750
  if ($version && version_compare($version, $new_version, '<')) {
2751
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2752
  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: 4.0
7
- Stable tag: 1.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -73,7 +73,7 @@ Photo Gallery product in addition to the main plugin includes 4 specific widgets
73
  * Right-click enabling option for the image downloads protection.
74
  * Possibility to display images in the albums in thumbnail or masonry view upon opening
75
  * WordPress Search Integration by gallery and album title
76
-
77
 
78
  Upgrade to [WordPress Photo Gallery Pro](http://web-dorado.com/products/wordpress-photo-gallery-plugin.html) to add features:
79
 
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: 4.0
7
+ Stable tag: 1.2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
73
  * Right-click enabling option for the image downloads protection.
74
  * Possibility to display images in the albums in thumbnail or masonry view upon opening
75
  * WordPress Search Integration by gallery and album title
76
+ * Possibility to display the number of the images in the lighbox (optional feature)
77
 
78
  Upgrade to [WordPress Photo Gallery Pro](http://web-dorado.com/products/wordpress-photo-gallery-plugin.html) to add features:
79
 
update/bwg_update.php CHANGED
@@ -141,6 +141,11 @@ function bwg_update($version) {
141
  ) DEFAULT CHARSET=utf8;";
142
  $wpdb->query($bwg_shortcode);
143
  }
 
 
 
 
 
144
  return;
145
  }
146
 
141
  ) DEFAULT CHARSET=utf8;";
142
  $wpdb->query($bwg_shortcode);
143
  }
144
+ if (version_compare($version, '1.2.2') == -1) {
145
+ // Upload images with custom size.
146
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `upload_img_width` int(4) NOT NULL DEFAULT 1200");
147
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `upload_img_height` int(4) NOT NULL DEFAULT 1200");
148
+ }
149
  return;
150
  }
151