Photo Gallery by WD – Responsive Photo Gallery - Version 1.1.7

Version Description

Download this release

Release Info

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

Code changes from version 1.1.6 to 1.1.7

admin/controllers/BWGControllerGalleries_bwg.php CHANGED
@@ -127,10 +127,10 @@ class BWGControllerGalleries_bwg {
127
  global $WD_BWG_UPLOAD_DIR;
128
  global $wpdb;
129
  $image_data = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE id="%d"', $id));
130
- $filename = ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url;
131
- $thumb_filename = ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url;
132
- copy(str_replace('/thumb/', '/.original/', ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url), ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url);
133
- list($width_orig, $height_orig, $type_orig) = getimagesize(htmlspecialchars_decode($filename));
134
  $percent = $width_orig / $thumb_width;
135
  $thumb_height = $height_orig / $percent;
136
  ini_set('memory_limit', '-1');
@@ -308,8 +308,11 @@ class BWGControllerGalleries_bwg {
308
  }
309
 
310
  function set_text_watermark ($original_filename, $dest_filename, $watermark_text, $watermark_font, $watermark_font_size, $watermark_color, $watermark_transparency, $watermark_position) {
 
 
 
311
  $watermark_transparency = 127 - ($watermark_transparency * 1.27);
312
- list($width, $height, $type) = getimagesize(htmlspecialchars_decode($original_filename));
313
  $watermark_image = imagecreatetruecolor($width, $height);
314
 
315
  $watermark_color = $this->bwg_hex2rgb($watermark_color);
@@ -368,8 +371,12 @@ class BWGControllerGalleries_bwg {
368
  }
369
 
370
  function set_image_watermark ($original_filename, $dest_filename, $watermark_url, $watermark_height, $watermark_width, $watermark_position) {
371
- list($width, $height, $type) = getimagesize(htmlspecialchars_decode($original_filename));
372
- list($width_watermark, $height_watermark, $type_watermark) = getimagesize(htmlspecialchars_decode($watermark_url));
 
 
 
 
373
 
374
  $watermark_width = $width * $watermark_width / 100;
375
  $watermark_height = $height_watermark * $watermark_width / $width_watermark;
127
  global $WD_BWG_UPLOAD_DIR;
128
  global $wpdb;
129
  $image_data = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE id="%d"', $id));
130
+ $filename = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
131
+ $thumb_filename = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
132
+ copy(str_replace('/thumb/', '/.original/', $thumb_filename), $filename);
133
+ list($width_orig, $height_orig, $type_orig) = getimagesize($filename);
134
  $percent = $width_orig / $thumb_width;
135
  $thumb_height = $height_orig / $percent;
136
  ini_set('memory_limit', '-1');
308
  }
309
 
310
  function set_text_watermark ($original_filename, $dest_filename, $watermark_text, $watermark_font, $watermark_font_size, $watermark_color, $watermark_transparency, $watermark_position) {
311
+ $original_filename = htmlspecialchars_decode($original_filename, ENT_COMPAT | ENT_QUOTES);
312
+ $dest_filename = htmlspecialchars_decode($dest_filename, ENT_COMPAT | ENT_QUOTES);
313
+
314
  $watermark_transparency = 127 - ($watermark_transparency * 1.27);
315
+ list($width, $height, $type) = getimagesize($original_filename);
316
  $watermark_image = imagecreatetruecolor($width, $height);
317
 
318
  $watermark_color = $this->bwg_hex2rgb($watermark_color);
371
  }
372
 
373
  function set_image_watermark ($original_filename, $dest_filename, $watermark_url, $watermark_height, $watermark_width, $watermark_position) {
374
+ $original_filename = htmlspecialchars_decode($original_filename, ENT_COMPAT | ENT_QUOTES);
375
+ $dest_filename = htmlspecialchars_decode($dest_filename, ENT_COMPAT | ENT_QUOTES);
376
+ $watermark_url = htmlspecialchars_decode($watermark_url, ENT_COMPAT | ENT_QUOTES);
377
+
378
+ list($width, $height, $type) = getimagesize($original_filename);
379
+ list($width_watermark, $height_watermark, $type_watermark) = getimagesize($watermark_url);
380
 
381
  $watermark_width = $width * $watermark_width / 100;
382
  $watermark_height = $height_watermark * $watermark_width / $width_watermark;
admin/controllers/BWGControllerWidgetTags.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BWGControllerWidgetTags extends WP_Widget {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $view;
14
+ private $model;
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct() {
19
+ $widget_ops = array(
20
+ 'classname' => 'bwp_gallery_tags',
21
+ 'description' => 'Add Photo Gallery Tags dynamic cloud to Your widget area.'
22
+ );
23
+ // Widget Control Settings.
24
+ $control_ops = array('id_base' => 'bwp_gallery_tags');
25
+ // Create the widget.
26
+ $this->WP_Widget('bwp_gallery_tags', 'Photo Gallery Tags Cloud', $widget_ops, $control_ops);
27
+ require_once WD_BWG_DIR . "/admin/models/BWGModelWidgetTags.php";
28
+ $this->model = new BWGModelWidgetTags();
29
+
30
+ require_once WD_BWG_DIR . "/admin/views/BWGViewWidgetTags.php";
31
+ $this->view = new BWGViewWidgetTags($this->model);
32
+ }
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Public Methods //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+
37
+ public function widget($args, $instance) {
38
+ $this->view->widget($args, $instance);
39
+ }
40
+
41
+ public function form( $instance ) {
42
+ $this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('type'), parent::get_field_name('type'), parent::get_field_id('show_name'), parent::get_field_name('show_name'), parent::get_field_id('count'), parent::get_field_name('count'), parent::get_field_id('width'), parent::get_field_name('width'), parent::get_field_id('height'), parent::get_field_name('height'), parent::get_field_id('background_transparent'), parent::get_field_name('background_transparent'), parent::get_field_id('background_color'), parent::get_field_name('background_color'), parent::get_field_id('text_color'), parent::get_field_name('text_color'), parent::get_field_id('theme_id'), parent::get_field_name('theme_id'));
43
+ }
44
+
45
+ // Update Settings.
46
+ public function update($new_instance, $old_instance) {
47
+ $instance['title'] = strip_tags($new_instance['title']);
48
+ $instance['type'] = $new_instance['type'];
49
+ $instance['show_name'] = $new_instance['show_name'];
50
+ $instance['count'] = $new_instance['count'];
51
+ $instance['width'] = $new_instance['width'];
52
+ $instance['height'] = $new_instance['height'];
53
+ $instance['background_transparent'] = $new_instance['background_transparent'];
54
+ $instance['background_color'] = $new_instance['background_color'];
55
+ $instance['text_color'] = $new_instance['text_color'];
56
+ $instance['theme_id'] = $new_instance['theme_id'];
57
+ return $instance;
58
+ }
59
+
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ // Getters & Setters //
62
+ ////////////////////////////////////////////////////////////////////////////////////////
63
+ ////////////////////////////////////////////////////////////////////////////////////////
64
+ // Private Methods //
65
+ ////////////////////////////////////////////////////////////////////////////////////////
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
+ // Listeners //
68
+ ////////////////////////////////////////////////////////////////////////////////////////
69
+ }
admin/models/BWGModelWidgetTags.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BWGModelWidgetTags {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_gallery_rows_data() {
23
+ global $wpdb;
24
+ $query = "SELECT * FROM " . $wpdb->prefix . "bwg_gallery WHERE published=1";
25
+ $rows = $wpdb->get_results($query);
26
+ return $rows;
27
+ }
28
+
29
+ public function get_album_rows_data() {
30
+ global $wpdb;
31
+ $query = "SELECT * FROM " . $wpdb->prefix . "bwg_album WHERE published=1";
32
+ $rows = $wpdb->get_results($query);
33
+ return $rows;
34
+ }
35
+
36
+ public function get_theme_rows_data() {
37
+ global $wpdb;
38
+ $query = "SELECT id, name, default_theme FROM " . $wpdb->prefix . "bwg_theme ORDER BY default_theme DESC";
39
+ $rows = $wpdb->get_results($query);
40
+ return $rows;
41
+ }
42
+
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ // Getters & Setters //
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ // Private Methods //
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ ////////////////////////////////////////////////////////////////////////////////////////
50
+ // Listeners //
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ }
admin/views/BWGViewEditThumb.php CHANGED
@@ -84,24 +84,24 @@ class BWGViewEditThumb {
84
  $image_data = new stdClass();
85
  $image_data->image_url = (isset($_GET['image_url']) ? esc_html($_GET['image_url']) : '');
86
  $image_data->thumb_url = (isset($_GET['thumb_url']) ? esc_html($_GET['thumb_url']) : '');
87
- $filename = ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url;
88
- $thumb_filename = ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url;
89
  $form_action = add_query_arg(array('action' => 'editThumb', 'type' => 'crop', 'image_id' => $image_id, 'image_url' => $image_data->image_url, 'thumb_url' => $image_data->thumb_url, 'width' => '800', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
90
  }
91
  else {
92
  $image_data = $this->model->get_image_data($image_id);
93
- $filename = ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url;
94
- $thumb_filename = ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url;
95
  $form_action = add_query_arg(array('action' => 'editThumb', 'type' => 'crop', 'image_id' => $image_id, 'width' => '800', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
96
  }
97
  ini_set('memory_limit', '-1');
98
- list($width_orig, $height_orig, $type_orig) = getimagesize(htmlspecialchars_decode($filename));
99
  if ($edit_type == 'crop') {
100
  if ($type_orig == 2) {
101
  $img_r = imagecreatefromjpeg($filename);
102
  $dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
103
  imagecopyresampled($dst_r, $img_r, 0, 0, $x, $y, $thumb_width, $thumb_height, $w, $h);
104
- imagejpeg($dst_r, $thumb_filename, 100);
105
  imagedestroy($img_r);
106
  imagedestroy($dst_r);
107
  }
@@ -302,25 +302,25 @@ class BWGViewEditThumb {
302
  $image_data = new stdClass();
303
  $image_data->image_url = (isset($_GET['image_url']) ? esc_html($_GET['image_url']) : '');
304
  $image_data->thumb_url = (isset($_GET['thumb_url']) ? esc_html($_GET['thumb_url']) : '');
305
- $filename = ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url;
306
- $thumb_filename = ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url;
307
  $form_action = add_query_arg(array('action' => 'editThumb', 'type' => 'rotate', 'image_id' => $image_id, 'image_url' => $image_data->image_url, 'thumb_url' => $image_data->thumb_url, 'width' => '650', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
308
  }
309
  else {
310
  $image_data = $this->model->get_image_data($image_id);
311
- $filename = ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url;
312
- $thumb_filename = ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url;
313
  $form_action = add_query_arg(array('action' => 'editThumb', 'type' => 'rotate', 'image_id' => $image_id, 'width' => '650', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
314
  }
315
  ini_set('memory_limit', '-1');
316
- list($width_rotate, $height_rotate, $type_rotate) = getimagesize(htmlspecialchars_decode($filename));
317
  if ($edit_type == '270' || $edit_type == '90') {
318
  if ($type_rotate == 2) {
319
  $source = imagecreatefromjpeg($filename);
320
  $thumb_source = imagecreatefromjpeg($thumb_filename);
321
  $rotate = imagerotate($source, $edit_type, 0);
322
  $thumb_rotate = imagerotate($thumb_source, $edit_type, 0);
323
- imagejpeg($thumb_rotate, $thumb_filename, 100);
324
  imagejpeg($rotate, $filename, 100);
325
  imagedestroy($source);
326
  imagedestroy($rotate);
@@ -417,7 +417,7 @@ class BWGViewEditThumb {
417
  imagejpeg($flip, $filename, 100);
418
  $thumb_source = imagecreatefromjpeg($thumb_filename);
419
  $thumb_flip = bwg_image_flip($thumb_source, $edit_type);
420
- imagejpeg($thumb_flip, $thumb_filename, 100);
421
  imagedestroy($source);
422
  imagedestroy($flip);
423
  imagedestroy($thumb_source);
84
  $image_data = new stdClass();
85
  $image_data->image_url = (isset($_GET['image_url']) ? esc_html($_GET['image_url']) : '');
86
  $image_data->thumb_url = (isset($_GET['thumb_url']) ? esc_html($_GET['thumb_url']) : '');
87
+ $filename = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
88
+ $thumb_filename = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
89
  $form_action = add_query_arg(array('action' => 'editThumb', 'type' => 'crop', 'image_id' => $image_id, 'image_url' => $image_data->image_url, 'thumb_url' => $image_data->thumb_url, 'width' => '800', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
90
  }
91
  else {
92
  $image_data = $this->model->get_image_data($image_id);
93
+ $filename = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
94
+ $thumb_filename = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
95
  $form_action = add_query_arg(array('action' => 'editThumb', 'type' => 'crop', 'image_id' => $image_id, 'width' => '800', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
96
  }
97
  ini_set('memory_limit', '-1');
98
+ list($width_orig, $height_orig, $type_orig) = getimagesize($filename);
99
  if ($edit_type == 'crop') {
100
  if ($type_orig == 2) {
101
  $img_r = imagecreatefromjpeg($filename);
102
  $dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
103
  imagecopyresampled($dst_r, $img_r, 0, 0, $x, $y, $thumb_width, $thumb_height, $w, $h);
104
+ imagejpeg($dst_r, $thumb_filename, 90);
105
  imagedestroy($img_r);
106
  imagedestroy($dst_r);
107
  }
302
  $image_data = new stdClass();
303
  $image_data->image_url = (isset($_GET['image_url']) ? esc_html($_GET['image_url']) : '');
304
  $image_data->thumb_url = (isset($_GET['thumb_url']) ? esc_html($_GET['thumb_url']) : '');
305
+ $filename = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
306
+ $thumb_filename = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
307
  $form_action = add_query_arg(array('action' => 'editThumb', 'type' => 'rotate', 'image_id' => $image_id, 'image_url' => $image_data->image_url, 'thumb_url' => $image_data->thumb_url, 'width' => '650', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
308
  }
309
  else {
310
  $image_data = $this->model->get_image_data($image_id);
311
+ $filename = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
312
+ $thumb_filename = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
313
  $form_action = add_query_arg(array('action' => 'editThumb', 'type' => 'rotate', 'image_id' => $image_id, 'width' => '650', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
314
  }
315
  ini_set('memory_limit', '-1');
316
+ list($width_rotate, $height_rotate, $type_rotate) = getimagesize($filename);
317
  if ($edit_type == '270' || $edit_type == '90') {
318
  if ($type_rotate == 2) {
319
  $source = imagecreatefromjpeg($filename);
320
  $thumb_source = imagecreatefromjpeg($thumb_filename);
321
  $rotate = imagerotate($source, $edit_type, 0);
322
  $thumb_rotate = imagerotate($thumb_source, $edit_type, 0);
323
+ imagejpeg($thumb_rotate, $thumb_filename, 90);
324
  imagejpeg($rotate, $filename, 100);
325
  imagedestroy($source);
326
  imagedestroy($rotate);
417
  imagejpeg($flip, $filename, 100);
418
  $thumb_source = imagecreatefromjpeg($thumb_filename);
419
  $thumb_flip = bwg_image_flip($thumb_source, $edit_type);
420
+ imagejpeg($thumb_flip, $thumb_filename, 90);
421
  imagedestroy($source);
422
  imagedestroy($flip);
423
  imagedestroy($thumb_source);
admin/views/BWGViewLicensing_bwg.php CHANGED
@@ -120,12 +120,12 @@ class BWGViewLicensing_bwg {
120
  <td class="icon-replace yes">yes</td>
121
  </tr>
122
  <tr>
123
- <td>Standard Masonry View </td>
124
  <td class="icon-replace no">no</td>
125
  <td class="icon-replace yes">yes</td>
126
  </tr>
127
  <tr class="alt">
128
- <td>Standard Blog Style View</td>
129
  <td class="icon-replace no">no</td>
130
  <td class="icon-replace yes">yes</td>
131
  </tr>
120
  <td class="icon-replace yes">yes</td>
121
  </tr>
122
  <tr>
123
+ <td>Pro Masonry View </td>
124
  <td class="icon-replace no">no</td>
125
  <td class="icon-replace yes">yes</td>
126
  </tr>
127
  <tr class="alt">
128
+ <td>Pro Blog Style View</td>
129
  <td class="icon-replace no">no</td>
130
  <td class="icon-replace yes">yes</td>
131
  </tr>
admin/views/BWGViewWidget.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class BWGViewWidget extends BWGControllerWidget {
4
  ////////////////////////////////////////////////////////////////////////////////////////
5
  // Events //
6
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -135,7 +135,8 @@ class BWGViewWidget extends BWGControllerWidget {
135
  </p>
136
  <p>
137
  <input type="radio" name="<?php echo $name_show; ?>" id="<?php echo $id_show . "_1"; ?>" value="random" onclick="bwg_change_type(event, this)" <?php if ($instance['show'] == "random") echo 'checked="checked"'; ?> /><label for="<?php echo $id_show . "_1"; ?>">Random</label>
138
- <input type="radio" name="<?php echo $name_show; ?>" id="<?php echo $id_show . "_2"; ?>" value="last" onclick="bwg_change_type(event, this)" <?php if ($instance['show'] == "last") echo 'checked="checked"'; ?> /><label for="<?php echo $id_show . "_2"; ?>">Last</label>
 
139
  </p>
140
  <p>
141
  <label for="<?php echo $id_count; ?>">Count:</label>
@@ -147,7 +148,7 @@ class BWGViewWidget extends BWGControllerWidget {
147
  <input class="widefat" style="width:25%;" id="<?php echo $id_height; ?>" name="<?php echo $name_height; ?>'" type="text" value="<?php echo $instance['height']; ?>"/> px
148
  </p>
149
  <p>
150
- <select name="<?php echo $name_theme_id; ?>" id="<?php echo $id_theme_id; ?>" class="widefat" <?php echo (get_option("wd_bwg_theme_version") ? 'title="This option is disabled in free version." disabled="disabled"' : ''); ?>>
151
  <?php
152
  foreach ($theme_rows as $theme_row) {
153
  ?>
1
  <?php
2
 
3
+ class BWGViewWidget {
4
  ////////////////////////////////////////////////////////////////////////////////////////
5
  // Events //
6
  ////////////////////////////////////////////////////////////////////////////////////////
135
  </p>
136
  <p>
137
  <input type="radio" name="<?php echo $name_show; ?>" id="<?php echo $id_show . "_1"; ?>" value="random" onclick="bwg_change_type(event, this)" <?php if ($instance['show'] == "random") echo 'checked="checked"'; ?> /><label for="<?php echo $id_show . "_1"; ?>">Random</label>
138
+ <input type="radio" name="<?php echo $name_show; ?>" id="<?php echo $id_show . "_2"; ?>" value="first" onclick="bwg_change_type(event, this)" <?php if ($instance['show'] == "first") echo 'checked="checked"'; ?> /><label for="<?php echo $id_show . "_2"; ?>">First</label>
139
+ <input type="radio" name="<?php echo $name_show; ?>" id="<?php echo $id_show . "_3"; ?>" value="last" onclick="bwg_change_type(event, this)" <?php if ($instance['show'] == "last") echo 'checked="checked"'; ?> /><label for="<?php echo $id_show . "_3"; ?>">Last</label>
140
  </p>
141
  <p>
142
  <label for="<?php echo $id_count; ?>">Count:</label>
148
  <input class="widefat" style="width:25%;" id="<?php echo $id_height; ?>" name="<?php echo $name_height; ?>'" type="text" value="<?php echo $instance['height']; ?>"/> px
149
  </p>
150
  <p>
151
+ <select name="<?php echo $name_theme_id; ?>" id="<?php echo $id_theme_id; ?>" class="widefat">
152
  <?php
153
  foreach ($theme_rows as $theme_row) {
154
  ?>
admin/views/BWGViewWidgetSlideshow.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class BWGViewWidgetSlideshow extends BWGControllerWidgetSlideshow {
4
  ////////////////////////////////////////////////////////////////////////////////////////
5
  // Events //
6
  ////////////////////////////////////////////////////////////////////////////////////////
1
  <?php
2
 
3
+ class BWGViewWidgetSlideshow {
4
  ////////////////////////////////////////////////////////////////////////////////////////
5
  // Events //
6
  ////////////////////////////////////////////////////////////////////////////////////////
admin/views/BWGViewWidgetTags.php ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BWGViewWidgetTags {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Public Methods //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+
25
+ public function display() {
26
+ }
27
+
28
+ function widget($args, $instance) {
29
+ extract($args);
30
+ $title = $instance['title'];
31
+ $type = (isset($instance['type']) ? $instance['type'] : "text");
32
+ $show_name = (isset($instance['show_name']) ? $instance['show_name'] : 0);
33
+ $count = (isset($instance['count']) ? $instance['count'] : 0);
34
+ $width = (isset($instance['width']) ? $instance['width'] : 250);
35
+ $height = (isset($instance['height']) ? $instance['height'] : 250);
36
+ $background_transparent = (isset($instance['background_transparent']) ? $instance['background_transparent'] : 1);
37
+ $background_color = (isset($instance['background_color']) ? $instance['background_color'] : "000000");
38
+ $text_color = (isset($instance['text_color']) ? $instance['text_color'] : "ffffff");
39
+ $theme_id = (isset($instance['theme_id']) ? $instance['theme_id'] : 0);
40
+ // Before widget.
41
+ echo $before_widget;
42
+ // Title of widget.
43
+ if ($title) {
44
+ echo $before_title . $title . $after_title;
45
+ }
46
+ // Widget output.
47
+ if ($id) {
48
+ require_once(WD_BWG_DIR . '/frontend/controllers/BWGControllerWidget.php');
49
+ $controller_class = 'BWGControllerWidgetFrontEnd';
50
+ $controller = new $controller_class();
51
+ global $bwg;
52
+ $params = array (
53
+ 'type' => $type,
54
+ 'show_name' => $show_name,
55
+ 'count' => $count,
56
+ 'width' => $width,
57
+ 'height' => $height,
58
+ 'background_transparent' => $background_transparent,
59
+ 'background_color' => $background_color,
60
+ 'text_color' => $text_color,
61
+ 'theme_id' => $theme_id);
62
+ $controller->execute($params);
63
+ $bwg++;
64
+ }
65
+ // After widget.
66
+ echo $after_widget;
67
+ }
68
+
69
+ // Widget Control Panel.
70
+ function form($instance, $id_title, $name_title, $id_type, $name_type, $id_show_name, $name_show_name, $id_count, $name_count, $id_width, $name_width, $id_height, $name_height, $id_background_transparent, $name_background_transparent, $id_background_color, $name_background_color, $id_text_color, $name_text_color, $id_theme_id, $name_theme_id) {
71
+ $defaults = array(
72
+ 'title' => 'Photo Gallery Tags Cloud',
73
+ 'type' => 'text',
74
+ 'show_name' => 0,
75
+ 'count' => 0,
76
+ 'width' => 250,
77
+ 'height' => 250,
78
+ 'background_transparent' => 1,
79
+ 'background_color' => '000000',
80
+ 'text_color' => 'ffffff',
81
+ 'theme_id' => 0,
82
+ );
83
+ $instance = wp_parse_args((array) $instance, $defaults);
84
+ $theme_rows = $this->model->get_theme_rows_data();
85
+ ?>
86
+ <script>
87
+ function bwg_change_type_tag(event, obj) {
88
+ var div = jQuery(obj).closest("div");
89
+ if(jQuery(jQuery(div).find(".sel_image")[0]).prop("checked")) {
90
+ jQuery(jQuery(div).find("#p_show_name")).css("display", "");
91
+ }
92
+ else {
93
+ jQuery(jQuery(div).find("#p_show_name")).css("display", "none");
94
+ }
95
+ }
96
+
97
+ function bwg_change_bg_transparency(event, obj) {
98
+ var div = jQuery(obj).closest("div");
99
+ if(jQuery(jQuery(div).find(".bg_transparent")[0]).prop("checked")) {
100
+ jQuery(jQuery(div).find("#p_bg_color")).css("display", "none");
101
+ }
102
+ else {
103
+ jQuery(jQuery(div).find("#p_bg_color")).css("display", "");
104
+ }
105
+ }
106
+ </script>
107
+ <script src="<?php echo WD_BWG_URL . '/js/jscolor/jscolor.js'?>" type="text/javascript" charset="utf-8"></script>
108
+ <p>
109
+ <label for="<?php echo $id_title; ?>">Title:</label>
110
+ <input class="widefat" id="<?php echo $id_title; ?>" name="<?php echo $name_title; ?>'" type="text" value="<?php echo $instance['title']; ?>"/>
111
+ </p>
112
+ <p>
113
+ <input type="radio" name="<?php echo $name_type; ?>" id="<?php echo $id_type . "_1"; ?>" value="text" class="sel_text" <?php if ($instance['type'] == "text") echo 'checked="checked"'; ?> onclick="bwg_change_type_tag(event, this)" /><label for="<?php echo $id_type . "_1"; ?>">Text</label>
114
+ <input type="radio" name="<?php echo $name_type; ?>" id="<?php echo $id_type . "_2"; ?>" value="image" class="sel_image" <?php if ($instance['type'] == "image") echo 'checked="checked"'; ?> onclick="bwg_change_type_tag(event, this)" /><label for="<?php echo $id_type . "_2"; ?>">Image</label>
115
+ </p>
116
+ <p id="p_show_name" style="display:<?php echo ($instance['type'] == 'image') ? "" : "none" ?>;">
117
+ <label>Show Tag Names:</label>
118
+ <input type="radio" name="<?php echo $name_show_name; ?>" id="<?php echo $id_show_name . "_1"; ?>" value="1" <?php if ($instance['show_name']) echo 'checked="checked"'; ?> /><label for="<?php echo $id_show_name . "_1"; ?>">Yes</label>
119
+ <input type="radio" name="<?php echo $name_show_name; ?>" id="<?php echo $id_show_name . "_0"; ?>" value="0" <?php if (!$instance['show_name']) echo 'checked="checked"'; ?> /><label for="<?php echo $id_show_name . "_0"; ?>">No</label>
120
+ </p>
121
+ <p>
122
+ <label for="<?php echo $id_count; ?>">Number (0 for all):</label>
123
+ <input class="widefat" style="width:25%;" id="<?php echo $id_count; ?>" name="<?php echo $name_count; ?>'" type="text" value="<?php echo $instance['count']; ?>"/>
124
+ </p>
125
+ <p>
126
+ <label for="<?php echo $id_width; ?>">Dimensions:</label>
127
+ <input class="widefat" style="width:25%;" id="<?php echo $id_width; ?>" name="<?php echo $name_width; ?>'" type="text" value="<?php echo $instance['width']; ?>"/> x
128
+ <input class="widefat" style="width:25%;" id="<?php echo $id_height; ?>" name="<?php echo $name_height; ?>'" type="text" value="<?php echo $instance['height']; ?>"/> px
129
+ </p>
130
+ <p>
131
+ <label>Transparent Background:</label>
132
+ <input type="radio" name="<?php echo $name_background_transparent; ?>" id="<?php echo $id_background_transparent . "_1"; ?>" value="1" <?php if ($instance['background_transparent']) echo 'checked="checked"'; ?> onclick="bwg_change_bg_transparency(event, this)" class="bg_transparent" /><label for="<?php echo $id_background_transparent . "_1"; ?>">Yes</label>
133
+ <input type="radio" name="<?php echo $name_background_transparent; ?>" id="<?php echo $id_background_transparent . "_0"; ?>" value="0" <?php if (!$instance['background_transparent']) echo 'checked="checked"'; ?> onclick="bwg_change_bg_transparency(event, this)" /><label for="<?php echo $id_background_transparent . "_0"; ?>">No</label>
134
+ </p>
135
+ <p id="p_bg_color" style="display:<?php echo (!$instance['background_transparent']) ? "" : "none" ?>;">
136
+ <label for="<?php echo $id_background_color; ?>">Background Color:</label>
137
+ <input class="color" style="width:25%;" id="<?php echo $id_background_color; ?>" name="<?php echo $name_background_color; ?>'" type="text" value="<?php echo $instance['background_color']; ?>"/>
138
+ </p>
139
+ <p>
140
+ <label for="<?php echo $id_text_color; ?>">Text Color:</label>
141
+ <input class="color" style="width:25%;" id="<?php echo $id_text_color; ?>" name="<?php echo $name_text_color; ?>'" type="text" value="<?php echo $instance['text_color']; ?>"/>
142
+ </p>
143
+ <p>
144
+ <select name="<?php echo $name_theme_id; ?>" id="<?php echo $id_theme_id; ?>" class="widefat">
145
+ <?php
146
+ foreach ($theme_rows as $theme_row) {
147
+ ?>
148
+ <option value="<?php echo $theme_row->id; ?>" <?php echo (($instance['theme_id'] == $theme_row->id || $theme_row->default_theme == 1) ? 'selected="selected"' : ''); ?>><?php echo $theme_row->name; ?></option>
149
+ <?php
150
+ }
151
+ ?>
152
+ </select>
153
+ </p>
154
+ <script>
155
+ jscolor.init();
156
+ </script>
157
+ <?php
158
+ }
159
+
160
+ ////////////////////////////////////////////////////////////////////////////////////////
161
+ // Getters & Setters //
162
+ ////////////////////////////////////////////////////////////////////////////////////////
163
+ ////////////////////////////////////////////////////////////////////////////////////////
164
+ // Private Methods //
165
+ ////////////////////////////////////////////////////////////////////////////////////////
166
+ ////////////////////////////////////////////////////////////////////////////////////////
167
+ // Listeners //
168
+ ////////////////////////////////////////////////////////////////////////////////////////
169
+ }
filemanager/UploadHandler.php CHANGED
@@ -112,7 +112,7 @@ class UploadHandler {
112
  'thumb' => array(
113
  'max_width' => ((isset($_POST['upload_thumb_width']) && (int) $_POST['upload_thumb_width']) ? (int) $_POST['upload_thumb_width'] : 300),
114
  'max_height' => ((isset($_POST['upload_thumb_height']) && (int) $_POST['upload_thumb_height']) ? (int) $_POST['upload_thumb_height'] : 300),
115
- 'jpeg_quality' => 100
116
  ),
117
  )
118
  );
@@ -290,7 +290,7 @@ class UploadHandler {
290
  error_log('Function not found: getimagesize');
291
  return false;
292
  }
293
- list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path));
294
  if (!$img_width || !$img_height) {
295
  return false;
296
  }
@@ -330,7 +330,7 @@ class UploadHandler {
330
  $dst_y = 0 - ($new_height - $max_height) / 2;
331
  $new_img = @imagecreatetruecolor($max_width, $max_height);
332
  }
333
- list($width, $height, $type) = getimagesize(htmlspecialchars_decode($file_path));
334
  // switch (strtolower(substr(strrchr($file_name, '.'), 1))) {
335
  switch ($type) {
336
  case 2:
@@ -431,7 +431,7 @@ class UploadHandler {
431
  $file->error = $this->get_error_message('max_number_of_files');
432
  return false;
433
  }
434
- list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($uploaded_file));
435
  if (is_int($img_width)) {
436
  if ($this->options['max_width'] && $img_width > $this->options['max_width']) {
437
  $file->error = $this->get_error_message('max_width');
@@ -620,7 +620,7 @@ class UploadHandler {
620
  $file_size = $this->get_file_size($file_path, $append_file);
621
  if ($file_size === $file->size) {
622
  $file->url = $this->get_download_url($file->name);
623
- list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path));
624
  if (is_int($img_width)) {
625
  $this->handle_image_file($file_path, $file);
626
  }
112
  'thumb' => array(
113
  'max_width' => ((isset($_POST['upload_thumb_width']) && (int) $_POST['upload_thumb_width']) ? (int) $_POST['upload_thumb_width'] : 300),
114
  'max_height' => ((isset($_POST['upload_thumb_height']) && (int) $_POST['upload_thumb_height']) ? (int) $_POST['upload_thumb_height'] : 300),
115
+ 'jpeg_quality' => 90
116
  ),
117
  )
118
  );
290
  error_log('Function not found: getimagesize');
291
  return false;
292
  }
293
+ list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
294
  if (!$img_width || !$img_height) {
295
  return false;
296
  }
330
  $dst_y = 0 - ($new_height - $max_height) / 2;
331
  $new_img = @imagecreatetruecolor($max_width, $max_height);
332
  }
333
+ list($width, $height, $type) = getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
334
  // switch (strtolower(substr(strrchr($file_name, '.'), 1))) {
335
  switch ($type) {
336
  case 2:
431
  $file->error = $this->get_error_message('max_number_of_files');
432
  return false;
433
  }
434
+ list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($uploaded_file, ENT_COMPAT | ENT_QUOTES));
435
  if (is_int($img_width)) {
436
  if ($this->options['max_width'] && $img_width > $this->options['max_width']) {
437
  $file->error = $this->get_error_message('max_width');
620
  $file_size = $this->get_file_size($file_path, $append_file);
621
  if ($file_size === $file->size) {
622
  $file->url = $this->get_download_url($file->name);
623
+ list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
624
  if (is_int($img_width)) {
625
  $this->handle_image_file($file_path, $file);
626
  }
filemanager/controller.php CHANGED
@@ -89,9 +89,11 @@ class FilemanagerController {
89
  public function rename_item() {
90
  $input_dir = (isset($_REQUEST['dir']) ? stripslashes($_REQUEST['dir']) : '');
91
  $cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
 
92
 
93
  $file_names = explode('**#**', (isset($_REQUEST['file_names']) ? stripslashes($_REQUEST['file_names']) : ''));
94
  $file_name = $file_names[0];
 
95
 
96
  $file_new_name = (isset($_REQUEST['file_new_name']) ? stripslashes($_REQUEST['file_new_name']) : '');
97
 
@@ -127,11 +129,13 @@ class FilemanagerController {
127
  public function remove_items() {
128
  $input_dir = (isset($_REQUEST['dir']) ? stripslashes($_REQUEST['dir']) : '');
129
  $cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
 
130
 
131
  $file_names = explode('**#**', (isset($_REQUEST['file_names']) ? stripslashes($_REQUEST['file_names']) : ''));
132
 
133
  $msg = '';
134
  foreach ($file_names as $file_name) {
 
135
  $file_path = $cur_dir_path . '/' . $file_name;
136
  $thumb_file_path = $cur_dir_path . '/thumb/' . $file_name;
137
  $original_file_path = $cur_dir_path . '/.original/' . $file_name;
@@ -160,13 +164,16 @@ class FilemanagerController {
160
  // $src_dir = $_SESSION['clipboard_src'];
161
  $src_dir = (isset($_REQUEST['clipboard_src']) ? stripslashes($_REQUEST['clipboard_src']) : '');
162
  $src_dir = $src_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $src_dir;
 
163
  // $dest_dir = $_SESSION['clipboard_dest'];
164
  $dest_dir = (isset($_REQUEST['clipboard_dest']) ? stripslashes($_REQUEST['clipboard_dest']) : '');
165
  $dest_dir = $dest_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $dest_dir;
 
166
 
167
  switch ((isset($_REQUEST['clipboard_task']) ? stripslashes($_REQUEST['clipboard_task']) : '')) {
168
  case 'copy':
169
  foreach ($file_names as $file_name) {
 
170
  $src = $src_dir . '/' . $file_name;
171
  if (file_exists($src) == false) {
172
  $msg = "Failed to copy some of the files.";
@@ -210,6 +217,7 @@ class FilemanagerController {
210
  case 'cut':
211
  if ($src_dir != $dest_dir) {
212
  foreach ($file_names as $file_name) {
 
213
  $src = $src_dir . '/' . $file_name;
214
  $dest = $dest_dir . '/' . $file_name;
215
  if (!is_dir($src_dir . '/' . $file_name)) {
89
  public function rename_item() {
90
  $input_dir = (isset($_REQUEST['dir']) ? stripslashes($_REQUEST['dir']) : '');
91
  $cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
92
+ $cur_dir_path = htmlspecialchars_decode($cur_dir_path, ENT_COMPAT | ENT_QUOTES);
93
 
94
  $file_names = explode('**#**', (isset($_REQUEST['file_names']) ? stripslashes($_REQUEST['file_names']) : ''));
95
  $file_name = $file_names[0];
96
+ $file_name = htmlspecialchars_decode($file_name, ENT_COMPAT | ENT_QUOTES);
97
 
98
  $file_new_name = (isset($_REQUEST['file_new_name']) ? stripslashes($_REQUEST['file_new_name']) : '');
99
 
129
  public function remove_items() {
130
  $input_dir = (isset($_REQUEST['dir']) ? stripslashes($_REQUEST['dir']) : '');
131
  $cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
132
+ $cur_dir_path = htmlspecialchars_decode($cur_dir_path, ENT_COMPAT | ENT_QUOTES);
133
 
134
  $file_names = explode('**#**', (isset($_REQUEST['file_names']) ? stripslashes($_REQUEST['file_names']) : ''));
135
 
136
  $msg = '';
137
  foreach ($file_names as $file_name) {
138
+ $file_name = htmlspecialchars_decode($file_name, ENT_COMPAT | ENT_QUOTES);
139
  $file_path = $cur_dir_path . '/' . $file_name;
140
  $thumb_file_path = $cur_dir_path . '/thumb/' . $file_name;
141
  $original_file_path = $cur_dir_path . '/.original/' . $file_name;
164
  // $src_dir = $_SESSION['clipboard_src'];
165
  $src_dir = (isset($_REQUEST['clipboard_src']) ? stripslashes($_REQUEST['clipboard_src']) : '');
166
  $src_dir = $src_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $src_dir;
167
+ $src_dir = htmlspecialchars_decode($src_dir, ENT_COMPAT | ENT_QUOTES);
168
  // $dest_dir = $_SESSION['clipboard_dest'];
169
  $dest_dir = (isset($_REQUEST['clipboard_dest']) ? stripslashes($_REQUEST['clipboard_dest']) : '');
170
  $dest_dir = $dest_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $dest_dir;
171
+ $dest_dir = htmlspecialchars_decode($dest_dir, ENT_COMPAT | ENT_QUOTES);
172
 
173
  switch ((isset($_REQUEST['clipboard_task']) ? stripslashes($_REQUEST['clipboard_task']) : '')) {
174
  case 'copy':
175
  foreach ($file_names as $file_name) {
176
+ $file_name = htmlspecialchars_decode($file_name, ENT_COMPAT | ENT_QUOTES);
177
  $src = $src_dir . '/' . $file_name;
178
  if (file_exists($src) == false) {
179
  $msg = "Failed to copy some of the files.";
217
  case 'cut':
218
  if ($src_dir != $dest_dir) {
219
  foreach ($file_names as $file_name) {
220
+ $file_name = htmlspecialchars_decode($file_name, ENT_COMPAT | ENT_QUOTES);
221
  $src = $src_dir . '/' . $file_name;
222
  $dest = $dest_dir . '/' . $file_name;
223
  if (!is_dir($src_dir . '/' . $file_name)) {
filemanager/css/default.css CHANGED
@@ -151,6 +151,15 @@ html, body, div, span, th, td, a {
151
 
152
  .upload_thumb_dim {
153
  width: 50px;
 
 
 
 
 
 
 
 
 
154
  }
155
 
156
  .upload_thumb {
151
 
152
  .upload_thumb_dim {
153
  width: 50px;
154
+ display: inline-block;
155
+ margin: 0;
156
+ background-repeat: no-repeat;
157
+ min-width: 32px !important;
158
+ height: 32px !important;
159
+ padding: 0;
160
+ vertical-align: middle;
161
+ color: #808080;
162
+ cursor: default;
163
  }
164
 
165
  .upload_thumb {
filemanager/js/default.js CHANGED
@@ -235,13 +235,13 @@ function onBtnRenameItemClick(event, obj) {
235
 
236
  function onBtnCopyClick(event, obj) {
237
  if (filesSelected.length != 0) {
238
- submit("", null, null, null, null, null, null, "copy", filesSelected.join(","), dir, null);
239
  }
240
  }
241
 
242
  function onBtnCutClick(event, obj) {
243
  if (filesSelected.length != 0) {
244
- submit("", null, null, null, null, null, null, "cut", filesSelected.join(","), dir, null);
245
  }
246
  }
247
 
@@ -416,7 +416,7 @@ function onFileDrop(event, obj) {
416
  }
417
  var clipboardTask = (event.ctrlKey == true || event.metaKey == true) ? "copy" : "cut";
418
  var clipboardDest = dir + DS + destDirName;
419
- submit("paste_items", null, null, null, null, null, null, clipboardTask, dragFiles.join(","), dir, clipboardDest);
420
  event.preventDefault();
421
  }
422
 
235
 
236
  function onBtnCopyClick(event, obj) {
237
  if (filesSelected.length != 0) {
238
+ submit("", null, null, null, null, null, null, "copy", filesSelected.join("**#**"), dir, null);
239
  }
240
  }
241
 
242
  function onBtnCutClick(event, obj) {
243
  if (filesSelected.length != 0) {
244
+ submit("", null, null, null, null, null, null, "cut", filesSelected.join("**#**"), dir, null);
245
  }
246
  }
247
 
416
  }
417
  var clipboardTask = (event.ctrlKey == true || event.metaKey == true) ? "copy" : "cut";
418
  var clipboardDest = dir + DS + destDirName;
419
+ submit("paste_items", null, null, null, null, null, null, clipboardTask, dragFiles.join("**#**"), dir, clipboardDest);
420
  event.preventDefault();
421
  }
422
 
filemanager/model.php CHANGED
@@ -150,7 +150,7 @@ class FilemanagerModel {
150
  // $file['size'] = $file_size_kb < 1024 ? (string)$file_size_kb . 'KB' : (string)$file_size_mb . 'MB';
151
  $file['size'] = $file_size_kb . ' KB';
152
  $file['date_modified'] = date('d F Y, H:i', filemtime($parent_dir . '/' . $file_name));
153
- $image_info = getimagesize(htmlspecialchars_decode($parent_dir . '/' . $file_name));
154
  $file['resolution'] = $this->is_img($file['type']) ? $image_info[0] . ' x ' . $image_info[1] . ' px' : '';
155
  $files[] = $file;
156
  }
150
  // $file['size'] = $file_size_kb < 1024 ? (string)$file_size_kb . 'KB' : (string)$file_size_mb . 'MB';
151
  $file['size'] = $file_size_kb . ' KB';
152
  $file['date_modified'] = date('d F Y, H:i', filemtime($parent_dir . '/' . $file_name));
153
+ $image_info = getimagesize(htmlspecialchars_decode($parent_dir . '/' . $file_name, ENT_COMPAT | ENT_QUOTES));
154
  $file['resolution'] = $this->is_img($file['type']) ? $image_info[0] . ' x ' . $image_info[1] . ' px' : '';
155
  $files[] = $file;
156
  }
filemanager/view.php CHANGED
@@ -251,8 +251,8 @@ class FilemanagerView {
251
  <div class="ctrls_bar ctrls_bar_header">
252
  <div class="ctrls_left upload_thumb">
253
  Generated Thumbnail Maximum Dimensions:
254
- <input type="text" class="ctrl_bar_btn upload_thumb_dim" name="upload_thumb_width" id="upload_thumb_width" value="<?php echo $this->controller->get_options_data()->upload_thumb_width; ?>" /> x
255
- <input type="text" class="ctrl_bar_btn upload_thumb_dim" name="upload_thumb_height" id="upload_thumb_height" value="<?php echo $this->controller->get_options_data()->upload_thumb_height; ?>" /> px
256
  </div>
257
  <div class="ctrls_right">
258
  <a class="ctrl_bar_btn btn_back" onclick="onBtnBackClick(event, this);" title="<?php echo 'Back'; ?>"></a>
@@ -287,11 +287,11 @@ class FilemanagerView {
287
  jQuery("#uploader_progress_text").text(messageFilesUploadComplete);
288
  jQuery("#uploader_progress_text").addClass("uploader_text");
289
  });
290
- setTimeout(function () {
291
- onBtnBackClick();
292
- }, 500);
293
  }
294
  },
 
 
 
295
  done: function (e, data) {
296
  jQuery.each(data.result.files, function (index, file) {
297
  if (file.error) {
251
  <div class="ctrls_bar ctrls_bar_header">
252
  <div class="ctrls_left upload_thumb">
253
  Generated Thumbnail Maximum Dimensions:
254
+ <input type="text" class="upload_thumb_dim" name="upload_thumb_width" id="upload_thumb_width" value="<?php echo $this->controller->get_options_data()->upload_thumb_width; ?>" /> x
255
+ <input type="text" class="upload_thumb_dim" name="upload_thumb_height" id="upload_thumb_height" value="<?php echo $this->controller->get_options_data()->upload_thumb_height; ?>" /> px
256
  </div>
257
  <div class="ctrls_right">
258
  <a class="ctrl_bar_btn btn_back" onclick="onBtnBackClick(event, this);" title="<?php echo 'Back'; ?>"></a>
287
  jQuery("#uploader_progress_text").text(messageFilesUploadComplete);
288
  jQuery("#uploader_progress_text").addClass("uploader_text");
289
  });
 
 
 
290
  }
291
  },
292
+ stop: function (e, data) {
293
+ onBtnBackClick();
294
+ },
295
  done: function (e, data) {
296
  jQuery.each(data.result.files, function (index, file) {
297
  if (file.error) {
frontend/controllers/BWGControllerWidget.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BWGControllerWidgetFrontEnd {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute($params = array(), $from_shortcode = "tags") {
22
+ if ($from_shortcode == 'tags') {
23
+ $this->view_tags($params);
24
+ }
25
+ }
26
+
27
+ public function view_tags($params) {
28
+ require_once WD_BWG_DIR . "/frontend/models/BWGModelWidget.php";
29
+ $model = new BWGModelWidgetFrontEnd();
30
+
31
+ require_once WD_BWG_DIR . "/frontend/views/BWGViewWidget.php";
32
+ $view = new BWGViewWidgetFrontEnd($model);
33
+
34
+ $view->view_tags($params);
35
+ }
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ // Getters & Setters //
38
+ ////////////////////////////////////////////////////////////////////////////////////////
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ // Private Methods //
41
+ ////////////////////////////////////////////////////////////////////////////////////////
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ // Listeners //
44
+ ////////////////////////////////////////////////////////////////////////////////////////
45
+ }
frontend/models/BWGModelAlbum_compact_preview.php CHANGED
@@ -29,7 +29,7 @@ class BWGModelAlbum_compact_preview {
29
  return $row;
30
  }
31
 
32
- public function get_alb_gals_row($id, $albums_per_page, $sort_by, $bwg) {
33
  global $wpdb;
34
  if (isset($_POST['page_number_' . $bwg]) && $_POST['page_number_' . $bwg]) {
35
  $limit = ((int) $_POST['page_number_' . $bwg] - 1) * $albums_per_page;
@@ -43,7 +43,7 @@ class BWGModelAlbum_compact_preview {
43
  else {
44
  $limit_str = '';
45
  }
46
- $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_album_gallery WHERE album_id="%d" ORDER BY ' . ($sort_by == "RAND()" ? '' : '`') . $sort_by . ($sort_by == "RAND()" ? '' : '`') . ' ASC ' . $limit_str, $id));
47
  return $row;
48
  }
49
 
@@ -61,7 +61,7 @@ class BWGModelAlbum_compact_preview {
61
  return $row;
62
  }
63
 
64
- public function get_image_rows_data($id, $images_per_page, $sort_by, $bwg) {
65
  global $wpdb;
66
  if (isset($_POST['page_number_' . $bwg]) && $_POST['page_number_' . $bwg]) {
67
  $limit = ((int) $_POST['page_number_' . $bwg] - 1) * $images_per_page;
@@ -75,7 +75,7 @@ class BWGModelAlbum_compact_preview {
75
  else {
76
  $limit_str = '';
77
  }
78
- $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 AND gallery_id="%d" ORDER BY `' . $sort_by . '` ASC ' . $limit_str, $id));
79
  return $row;
80
  }
81
 
29
  return $row;
30
  }
31
 
32
+ public function get_alb_gals_row($id, $albums_per_page, $sort_by, $bwg, $sort_direction = ' ASC ') {
33
  global $wpdb;
34
  if (isset($_POST['page_number_' . $bwg]) && $_POST['page_number_' . $bwg]) {
35
  $limit = ((int) $_POST['page_number_' . $bwg] - 1) * $albums_per_page;
43
  else {
44
  $limit_str = '';
45
  }
46
+ $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_album_gallery WHERE album_id="%d" ORDER BY ' . ($sort_by == "RAND()" ? '' : '`') . $sort_by . ($sort_by == "RAND()" ? '' : '`') . $sort_direction . $limit_str, $id));
47
  return $row;
48
  }
49
 
61
  return $row;
62
  }
63
 
64
+ public function get_image_rows_data($id, $images_per_page, $sort_by, $bwg, $sort_direction = ' ASC ') {
65
  global $wpdb;
66
  if (isset($_POST['page_number_' . $bwg]) && $_POST['page_number_' . $bwg]) {
67
  $limit = ((int) $_POST['page_number_' . $bwg] - 1) * $images_per_page;
75
  else {
76
  $limit_str = '';
77
  }
78
+ $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 AND gallery_id="%d" ORDER BY `' . $sort_by . '` ' . $sort_direction . $limit_str, $id));
79
  return $row;
80
  }
81
 
frontend/models/BWGModelThumbnails.php CHANGED
@@ -35,7 +35,7 @@ class BWGModelThumbnails {
35
  return $row;
36
  }
37
 
38
- public function get_image_rows_data($id, $images_per_page, $sort_by, $bwg, $type) {
39
  global $wpdb;
40
  if ($sort_by == 'size' || $sort_by == 'resolution') {
41
  $sort_by = ' CAST(' . $sort_by . ' AS SIGNED) ';
@@ -56,10 +56,10 @@ class BWGModelThumbnails {
56
  $limit_str = '';
57
  }
58
  if($type == 'tag') {
59
- $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 AND tag.tag_id="%d" ORDER BY ' . $sort_by . ' ASC', $id));
60
  }
61
  else {
62
- $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 AND gallery_id="%d" ORDER BY ' . $sort_by . ' ASC ' . $limit_str, $id));
63
  }
64
  return $row;
65
  }
35
  return $row;
36
  }
37
 
38
+ public function get_image_rows_data($id, $images_per_page, $sort_by, $bwg, $type, $sort_direction = ' ASC ') {
39
  global $wpdb;
40
  if ($sort_by == 'size' || $sort_by == 'resolution') {
41
  $sort_by = ' CAST(' . $sort_by . ' AS SIGNED) ';
56
  $limit_str = '';
57
  }
58
  if($type == 'tag') {
59
+ $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 AND tag.tag_id="%d" ORDER BY ' . $sort_by . $sort_direction, $id));
60
  }
61
  else {
62
+ $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_image WHERE published=1 AND gallery_id="%d" ORDER BY ' . $sort_by . $sort_direction . $limit_str, $id));
63
  }
64
  return $row;
65
  }
frontend/views/BWGViewAlbum_compact_preview.php CHANGED
@@ -33,10 +33,14 @@ class BWGViewAlbum_compact_preview {
33
  }
34
  $from = (isset($params['from']) ? esc_html($params['from']) : 0);
35
  $type = (isset($_POST['type_' . $bwg]) ? esc_html($_POST['type_' . $bwg]) : (isset($params['type']) ? $params['type'] : 'album'));
 
36
  if ($from === "widget") {
37
  $options_row = $this->model->get_options_row_data();
38
  $params['album_id'] = $params['id'];
39
  $params['sort_by'] = $params['show'] == 'random' ? 'RAND()' : 'order';
 
 
 
40
  $params['compuct_albums_per_page'] = $params['count'];
41
  $params['compuct_album_column_number'] = $options_row->album_column_number;
42
  $params['compuct_album_thumb_height'] = $params['height'];
@@ -58,7 +62,7 @@ class BWGViewAlbum_compact_preview {
58
  if ($type == 'gallery') {
59
  $items_per_page = $params['compuct_album_images_per_page'];
60
  $items_col_num = $params['compuct_album_image_column_number'];
61
- $image_rows = $this->model->get_image_rows_data($album_gallery_id, $items_per_page, $params['sort_by'], $bwg);
62
  $page_nav = $this->model->gallery_page_nav($album_gallery_id, $items_per_page, $bwg);
63
  $album_gallery_div_id = 'bwg_album_compact_' . $bwg;
64
  $album_gallery_div_class = 'bwg_standart_thumbnails_' . $bwg;
@@ -66,7 +70,7 @@ class BWGViewAlbum_compact_preview {
66
  else {
67
  $items_per_page = $params['compuct_albums_per_page'];
68
  $items_col_num = $params['compuct_album_column_number'];
69
- $album_galleries_row = $this->model->get_alb_gals_row($album_gallery_id, $items_per_page, $params['sort_by'], $bwg);
70
  $page_nav = $this->model->album_page_nav($album_gallery_id, $items_per_page, $bwg);
71
  $album_gallery_div_id = 'bwg_album_compact_' . $bwg;
72
  $album_gallery_div_class = 'bwg_album_thumbnails_' . $bwg;
@@ -434,7 +438,7 @@ class BWGViewAlbum_compact_preview {
434
  $preview_url = site_url() . '/' . $WD_BWG_UPLOAD_DIR . $preview_image;
435
  $preview_path = ABSPATH . $WD_BWG_UPLOAD_DIR . $preview_image;
436
  }
437
- list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode($preview_path));
438
  $scale = max($params['compuct_album_thumb_width'] / $image_thumb_width, $params['compuct_album_thumb_height'] / $image_thumb_height);
439
  $image_thumb_width *= $scale;
440
  $image_thumb_height *= $scale;
@@ -524,14 +528,14 @@ class BWGViewAlbum_compact_preview {
524
  $params_array['watermark_width'] = $params['watermark_width'];
525
  $params_array['watermark_height'] = $params['watermark_height'];
526
  }
527
- list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url));
528
  $scale = max($params['compuct_album_image_thumb_width'] / $image_thumb_width, $params['compuct_album_image_thumb_height'] / $image_thumb_height);
529
  $image_thumb_width *= $scale;
530
  $image_thumb_height *= $scale;
531
  $thumb_left = ($params['compuct_album_image_thumb_width'] - $image_thumb_width) / 2;
532
  $thumb_top = ($params['compuct_album_image_thumb_height'] - $image_thumb_height) / 2;
533
  ?>
534
- <a style="font-size: 0;" href="javascript:spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5);">
535
  <span class="bwg_standart_thumb_<?php echo $bwg; ?>">
536
  <span class="bwg_standart_thumb_spun1_<?php echo $bwg; ?>">
537
  <span class="bwg_standart_thumb_spun2_<?php echo $bwg; ?>">
33
  }
34
  $from = (isset($params['from']) ? esc_html($params['from']) : 0);
35
  $type = (isset($_POST['type_' . $bwg]) ? esc_html($_POST['type_' . $bwg]) : (isset($params['type']) ? $params['type'] : 'album'));
36
+ $sort_direction = ' ASC ';
37
  if ($from === "widget") {
38
  $options_row = $this->model->get_options_row_data();
39
  $params['album_id'] = $params['id'];
40
  $params['sort_by'] = $params['show'] == 'random' ? 'RAND()' : 'order';
41
+ if ($params['show'] == 'last') {
42
+ $sort_direction = ' DESC ';
43
+ }
44
  $params['compuct_albums_per_page'] = $params['count'];
45
  $params['compuct_album_column_number'] = $options_row->album_column_number;
46
  $params['compuct_album_thumb_height'] = $params['height'];
62
  if ($type == 'gallery') {
63
  $items_per_page = $params['compuct_album_images_per_page'];
64
  $items_col_num = $params['compuct_album_image_column_number'];
65
+ $image_rows = $this->model->get_image_rows_data($album_gallery_id, $items_per_page, $params['sort_by'], $bwg, $sort_direction);
66
  $page_nav = $this->model->gallery_page_nav($album_gallery_id, $items_per_page, $bwg);
67
  $album_gallery_div_id = 'bwg_album_compact_' . $bwg;
68
  $album_gallery_div_class = 'bwg_standart_thumbnails_' . $bwg;
70
  else {
71
  $items_per_page = $params['compuct_albums_per_page'];
72
  $items_col_num = $params['compuct_album_column_number'];
73
+ $album_galleries_row = $this->model->get_alb_gals_row($album_gallery_id, $items_per_page, $params['sort_by'], $bwg, $sort_direction);
74
  $page_nav = $this->model->album_page_nav($album_gallery_id, $items_per_page, $bwg);
75
  $album_gallery_div_id = 'bwg_album_compact_' . $bwg;
76
  $album_gallery_div_class = 'bwg_album_thumbnails_' . $bwg;
438
  $preview_url = site_url() . '/' . $WD_BWG_UPLOAD_DIR . $preview_image;
439
  $preview_path = ABSPATH . $WD_BWG_UPLOAD_DIR . $preview_image;
440
  }
441
+ list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode($preview_path, ENT_COMPAT | ENT_QUOTES));
442
  $scale = max($params['compuct_album_thumb_width'] / $image_thumb_width, $params['compuct_album_thumb_height'] / $image_thumb_height);
443
  $image_thumb_width *= $scale;
444
  $image_thumb_height *= $scale;
528
  $params_array['watermark_width'] = $params['watermark_width'];
529
  $params_array['watermark_height'] = $params['watermark_height'];
530
  }
531
+ list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES));
532
  $scale = max($params['compuct_album_image_thumb_width'] / $image_thumb_width, $params['compuct_album_image_thumb_height'] / $image_thumb_height);
533
  $image_thumb_width *= $scale;
534
  $image_thumb_height *= $scale;
535
  $thumb_left = ($params['compuct_album_image_thumb_width'] - $image_thumb_width) / 2;
536
  $thumb_top = ($params['compuct_album_image_thumb_height'] - $image_thumb_height) / 2;
537
  ?>
538
+ <a style="font-size: 0;" onclick="spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5); return false;">
539
  <span class="bwg_standart_thumb_<?php echo $bwg; ?>">
540
  <span class="bwg_standart_thumb_spun1_<?php echo $bwg; ?>">
541
  <span class="bwg_standart_thumb_spun2_<?php echo $bwg; ?>">
frontend/views/BWGViewAlbum_extended_preview.php CHANGED
@@ -449,7 +449,7 @@ class BWGViewAlbum_extended_preview {
449
  $preview_url = site_url() . '/' . $WD_BWG_UPLOAD_DIR . $preview_image;
450
  $preview_path = ABSPATH . $WD_BWG_UPLOAD_DIR . $preview_image;
451
  }
452
- list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode($preview_path));
453
  $scale = max($params['extended_album_thumb_width'] / $image_thumb_width, $params['extended_album_thumb_height'] / $image_thumb_height);
454
  $image_thumb_width *= $scale;
455
  $image_thumb_height *= $scale;
@@ -559,14 +559,14 @@ class BWGViewAlbum_extended_preview {
559
  $params_array['watermark_width'] = $params['watermark_width'];
560
  $params_array['watermark_height'] = $params['watermark_height'];
561
  }
562
- list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url));
563
  $scale = max($params['extended_album_image_thumb_width'] / $image_thumb_width, $params['extended_album_image_thumb_height'] / $image_thumb_height);
564
  $image_thumb_width *= $scale;
565
  $image_thumb_height *= $scale;
566
  $thumb_left = ($params['extended_album_image_thumb_width'] - $image_thumb_width) / 2;
567
  $thumb_top = ($params['extended_album_image_thumb_height'] - $image_thumb_height) / 2;
568
  ?>
569
- <a style="font-size: 0;" href="javascript:spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5);">
570
  <span class="bwg_standart_thumb_<?php echo $bwg; ?>">
571
  <span class="bwg_standart_thumb_spun1_<?php echo $bwg; ?>">
572
  <span class="bwg_standart_thumb_spun2_<?php echo $bwg; ?>">
449
  $preview_url = site_url() . '/' . $WD_BWG_UPLOAD_DIR . $preview_image;
450
  $preview_path = ABSPATH . $WD_BWG_UPLOAD_DIR . $preview_image;
451
  }
452
+ list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode($preview_path, ENT_COMPAT | ENT_QUOTES));
453
  $scale = max($params['extended_album_thumb_width'] / $image_thumb_width, $params['extended_album_thumb_height'] / $image_thumb_height);
454
  $image_thumb_width *= $scale;
455
  $image_thumb_height *= $scale;
559
  $params_array['watermark_width'] = $params['watermark_width'];
560
  $params_array['watermark_height'] = $params['watermark_height'];
561
  }
562
+ list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES));
563
  $scale = max($params['extended_album_image_thumb_width'] / $image_thumb_width, $params['extended_album_image_thumb_height'] / $image_thumb_height);
564
  $image_thumb_width *= $scale;
565
  $image_thumb_height *= $scale;
566
  $thumb_left = ($params['extended_album_image_thumb_width'] - $image_thumb_width) / 2;
567
  $thumb_top = ($params['extended_album_image_thumb_height'] - $image_thumb_height) / 2;
568
  ?>
569
+ <a style="font-size: 0;" onclick="spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5); return false;">
570
  <span class="bwg_standart_thumb_<?php echo $bwg; ?>">
571
  <span class="bwg_standart_thumb_spun1_<?php echo $bwg; ?>">
572
  <span class="bwg_standart_thumb_spun2_<?php echo $bwg; ?>">
frontend/views/BWGViewGalleryBox.php CHANGED
@@ -279,6 +279,13 @@ class BWGViewGalleryBox {
279
  text-align: center;
280
  width: inherit;
281
  }
 
 
 
 
 
 
 
282
  .bwg_comment_wrap {
283
  bottom: 0;
284
  left: 0;
@@ -1319,6 +1326,23 @@ class BWGViewGalleryBox {
1319
  }
1320
  }
1321
  jQuery(document).ready(function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1322
  bwg_reset_zoom();
1323
  var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
1324
  var bwg_click = isMobile ? 'touchend' : 'click';
@@ -1341,12 +1365,14 @@ class BWGViewGalleryBox {
1341
  /* Set image container height.*/
1342
  jQuery(".bwg_image_container").height(jQuery(".bwg_image_wrap").height() - <?php echo $image_filmstrip_height; ?>);
1343
  /* Show image info in cloud.*/
1344
- jQuery(".bwg_info").tooltip({
1345
- track: true,
1346
- content: function () {
1347
- return jQuery(this).prop('title');
1348
- }
1349
- });
 
 
1350
  /* Change default scrollbar in comments.*/
1351
  jQuery(".bwg_comments").mCustomScrollbar({scrollInertia: 150});
1352
  var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel" /*FF doesn't recognize mousewheel as of FF3.x*/
279
  text-align: center;
280
  width: inherit;
281
  }
282
+ .bwg_image_wrap * {
283
+ -moz-user-select: none;
284
+ -khtml-user-select: none;
285
+ -webkit-user-select: none;
286
+ -ms-user-select: none;
287
+ user-select: none;
288
+ }
289
  .bwg_comment_wrap {
290
  bottom: 0;
291
  left: 0;
1326
  }
1327
  }
1328
  jQuery(document).ready(function () {
1329
+ /* Disable right click.*/
1330
+ jQuery(".bwg_image_wrap").bind("contextmenu", function (e) {
1331
+ return false;
1332
+ });
1333
+ /*if (typeof jQuery().swiperight !== 'undefined' && jQuery.isFunction(jQuery().swiperight)) {
1334
+ jQuery('body').find('.bwg_image_wrap *').on('swiperight', function () {
1335
+ bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), parseInt(jQuery('#bwg_current_image_key').val()) - 1, data)
1336
+ return false;
1337
+ });
1338
+ }
1339
+ if (typeof jQuery().swipeleft !== 'undefined' && jQuery.isFunction(jQuery().swipeleft)) {
1340
+ jQuery('body').find('.bwg_image_wrap *').on('swipeleft', function () {
1341
+ bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), parseInt(jQuery('#bwg_current_image_key').val()) + 1, data);
1342
+ return false;
1343
+ });
1344
+ }*/
1345
+
1346
  bwg_reset_zoom();
1347
  var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
1348
  var bwg_click = isMobile ? 'touchend' : 'click';
1365
  /* Set image container height.*/
1366
  jQuery(".bwg_image_container").height(jQuery(".bwg_image_wrap").height() - <?php echo $image_filmstrip_height; ?>);
1367
  /* Show image info in cloud.*/
1368
+ if (typeof jQuery().tooltip !== 'undefined' && jQuery.isFunction(jQuery().tooltip)) {
1369
+ jQuery(".bwg_info").tooltip({
1370
+ track: true,
1371
+ content: function () {
1372
+ return jQuery(this).prop('title');
1373
+ }
1374
+ });
1375
+ }
1376
  /* Change default scrollbar in comments.*/
1377
  jQuery(".bwg_comments").mCustomScrollbar({scrollInertia: 150});
1378
  var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel" /*FF doesn't recognize mousewheel as of FF3.x*/
frontend/views/BWGViewImage_browser.php CHANGED
@@ -416,7 +416,7 @@ class BWGViewImage_browser {
416
  <?php
417
  }
418
  ?>
419
- <a style="position:relative;" href="javascript:spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5);">
420
  <img class="bwg_image_browser_img_<?php echo $bwg; ?>" src="<?php echo site_url() . '/' . $WD_BWG_UPLOAD_DIR . $image_row->image_url; ?>" alt="<?php echo $image_row->alt; ?>" />
421
  </a>
422
  <script>
@@ -502,6 +502,14 @@ class BWGViewImage_browser {
502
  <div id="spider_popup_overlay_<?php echo $bwg; ?>" class="spider_popup_overlay" onclick="spider_destroypopup(1000)"></div>
503
  </div>
504
  </div>
 
 
 
 
 
 
 
 
505
  <?php
506
  if ($from_shortcode) {
507
  return;
416
  <?php
417
  }
418
  ?>
419
+ <a style="position:relative;" onclick="spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5); return false;">
420
  <img class="bwg_image_browser_img_<?php echo $bwg; ?>" src="<?php echo site_url() . '/' . $WD_BWG_UPLOAD_DIR . $image_row->image_url; ?>" alt="<?php echo $image_row->alt; ?>" />
421
  </a>
422
  <script>
502
  <div id="spider_popup_overlay_<?php echo $bwg; ?>" class="spider_popup_overlay" onclick="spider_destroypopup(1000)"></div>
503
  </div>
504
  </div>
505
+ <script>
506
+ jQuery(window).load(function () {
507
+ /* Disable right click.*/
508
+ jQuery('div[id^="bwg_container"]').bind("contextmenu", function (e) {
509
+ return false;
510
+ });
511
+ });
512
+ </script>
513
  <?php
514
  if ($from_shortcode) {
515
  return;
frontend/views/BWGViewSlideshow.php CHANGED
@@ -136,6 +136,13 @@ class BWGViewSlideshow {
136
  #bwg_container1_<?php echo $bwg; ?> {
137
  visibility: hidden;
138
  }
 
 
 
 
 
 
 
139
  #bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg_slideshow_image_wrap_<?php echo $bwg; ?> * {
140
  box-sizing: border-box;
141
  -moz-box-sizing: border-box;
@@ -679,7 +686,7 @@ class BWGViewSlideshow {
679
  <div style="display:table; margin:0 auto;">
680
  <span class="bwg_slideshow_title_spun_<?php echo $bwg; ?>">
681
  <div class="bwg_slideshow_title_text_<?php echo $bwg; ?>" style="<?php if (!$current_image_alt) echo 'display:none;'; ?>">
682
- <?php echo $current_image_alt; ?>
683
  </div>
684
  </span>
685
  </div>
@@ -916,6 +923,7 @@ class BWGViewSlideshow {
916
  function bwg_none_<?php echo $bwg; ?>(current_image_class, next_image_class, direction) {
917
  jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
918
  jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
 
919
  /* Set active thumbnail.*/
920
  jQuery(".bwg_slideshow_filmstrip_thumbnail_<?php echo $bwg; ?>").removeClass("bwg_slideshow_thumb_active_<?php echo $bwg; ?>").addClass("bwg_slideshow_thumb_deactive_<?php echo $bwg; ?>");
921
  jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key_<?php echo $bwg; ?> + "_<?php echo $bwg; ?>").removeClass("bwg_slideshow_thumb_deactive_<?php echo $bwg; ?>").addClass("bwg_slideshow_thumb_active_<?php echo $bwg; ?>");
@@ -1131,7 +1139,7 @@ class BWGViewSlideshow {
1131
  bwg_current_key_<?php echo $bwg; ?> = key;
1132
  /* Change image id, title, description.*/
1133
  jQuery("#bwg_slideshow_image_<?php echo $bwg; ?>").attr('image_id', data_<?php echo $bwg; ?>[key]["id"]);
1134
- jQuery(".bwg_slideshow_title_text_<?php echo $bwg; ?>").text(data_<?php echo $bwg; ?>[key]["alt"]);
1135
  jQuery(".bwg_slideshow_description_text_<?php echo $bwg; ?>").html(jQuery('<div />').html(data_<?php echo $bwg; ?>[key]["description"]).text());
1136
  var current_image_class = "#image_id_<?php echo $bwg; ?>_" + data_<?php echo $bwg; ?>[current_key]["id"];
1137
  var next_image_class = "#image_id_<?php echo $bwg; ?>_" + data_<?php echo $bwg; ?>[key]["id"];
@@ -1200,6 +1208,23 @@ class BWGViewSlideshow {
1200
  bwg_popup_resize_<?php echo $bwg; ?>();
1201
  });
1202
  jQuery(window).load(function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1203
  var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
1204
  var bwg_click = isMobile ? 'touchend' : 'click';
1205
  bwg_popup_resize_<?php echo $bwg; ?>();
136
  #bwg_container1_<?php echo $bwg; ?> {
137
  visibility: hidden;
138
  }
139
+ #bwg_container1_<?php echo $bwg; ?> * {
140
+ -moz-user-select: none;
141
+ -khtml-user-select: none;
142
+ -webkit-user-select: none;
143
+ -ms-user-select: none;
144
+ user-select: none;
145
+ }
146
  #bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg_slideshow_image_wrap_<?php echo $bwg; ?> * {
147
  box-sizing: border-box;
148
  -moz-box-sizing: border-box;
686
  <div style="display:table; margin:0 auto;">
687
  <span class="bwg_slideshow_title_spun_<?php echo $bwg; ?>">
688
  <div class="bwg_slideshow_title_text_<?php echo $bwg; ?>" style="<?php if (!$current_image_alt) echo 'display:none;'; ?>">
689
+ <?php echo html_entity_decode($current_image_alt); ?>
690
  </div>
691
  </span>
692
  </div>
923
  function bwg_none_<?php echo $bwg; ?>(current_image_class, next_image_class, direction) {
924
  jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
925
  jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
926
+ bwg_change_watermark_container_<?php echo $bwg; ?>();
927
  /* Set active thumbnail.*/
928
  jQuery(".bwg_slideshow_filmstrip_thumbnail_<?php echo $bwg; ?>").removeClass("bwg_slideshow_thumb_active_<?php echo $bwg; ?>").addClass("bwg_slideshow_thumb_deactive_<?php echo $bwg; ?>");
929
  jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key_<?php echo $bwg; ?> + "_<?php echo $bwg; ?>").removeClass("bwg_slideshow_thumb_deactive_<?php echo $bwg; ?>").addClass("bwg_slideshow_thumb_active_<?php echo $bwg; ?>");
1139
  bwg_current_key_<?php echo $bwg; ?> = key;
1140
  /* Change image id, title, description.*/
1141
  jQuery("#bwg_slideshow_image_<?php echo $bwg; ?>").attr('image_id', data_<?php echo $bwg; ?>[key]["id"]);
1142
+ jQuery(".bwg_slideshow_title_text_<?php echo $bwg; ?>").html(jQuery('<div />').html(data_<?php echo $bwg; ?>[key]["alt"]).text());
1143
  jQuery(".bwg_slideshow_description_text_<?php echo $bwg; ?>").html(jQuery('<div />').html(data_<?php echo $bwg; ?>[key]["description"]).text());
1144
  var current_image_class = "#image_id_<?php echo $bwg; ?>_" + data_<?php echo $bwg; ?>[current_key]["id"];
1145
  var next_image_class = "#image_id_<?php echo $bwg; ?>_" + data_<?php echo $bwg; ?>[key]["id"];
1208
  bwg_popup_resize_<?php echo $bwg; ?>();
1209
  });
1210
  jQuery(window).load(function () {
1211
+ /* Disable right click.*/
1212
+ jQuery('div[id^="bwg_container"]').bind("contextmenu", function () {
1213
+ return false;
1214
+ });
1215
+ /*if (typeof jQuery().swiperight !== 'undefined' && jQuery.isFunction(jQuery().swiperight)) {
1216
+ jQuery('#bwg_container1_<?php echo $bwg; ?>').swiperight(function () {
1217
+ bwg_change_image_<?php echo $bwg; ?>(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) - iterator_<?php echo $bwg; ?>()) >= 0 ? (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) - iterator_<?php echo $bwg; ?>()) % data_<?php echo $bwg; ?>.length : data_<?php echo $bwg; ?>.length - 1, data_<?php echo $bwg; ?>);
1218
+ return false;
1219
+ });
1220
+ }
1221
+ if (typeof jQuery().swipeleft !== 'undefined' && jQuery.isFunction(jQuery().swipeleft)) {
1222
+ jQuery('#bwg_container1_<?php echo $bwg; ?>').swipeleft(function () {
1223
+ bwg_change_image_<?php echo $bwg; ?>(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) + iterator_<?php echo $bwg; ?>()) % data_<?php echo $bwg; ?>.length, data_<?php echo $bwg; ?>);
1224
+ return false;
1225
+ });
1226
+ }*/
1227
+
1228
  var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
1229
  var bwg_click = isMobile ? 'touchend' : 'click';
1230
  bwg_popup_resize_<?php echo $bwg; ?>();
frontend/views/BWGViewThumbnails.php CHANGED
@@ -32,11 +32,15 @@ class BWGViewThumbnails {
32
  $params['image_title'] = 'none';
33
  }
34
  $from = (isset($params['from']) ? esc_html($params['from']) : 0);
 
35
  if ($from) {
36
  $options_row = $this->model->get_options_row_data();
37
  $params['gallery_id'] = $params['id'];
38
  $params['images_per_page'] = $params['count'];
39
  $params['sort_by'] = (($params['show'] == 'random') ? 'RAND()' : 'order');
 
 
 
40
  $params['image_enable_page'] = 0;
41
  $params['image_title'] = $options_row->image_title_show_hover;
42
  $params['thumb_height'] = $params['height'];
@@ -82,7 +86,7 @@ class BWGViewThumbnails {
82
  echo WDWLibrary::message(__('There is no gallery selected or the gallery was deleted.', 'bwg'), 'error');
83
  return;
84
  }
85
- $image_rows = $this->model->get_image_rows_data($params['gallery_id'], $params['images_per_page'], $params['sort_by'], $bwg, $type);
86
  if (!$image_rows) {
87
  echo WDWLibrary::message(__('There are no images in this gallery.', 'bwg'), 'error');
88
  }
@@ -321,14 +325,14 @@ class BWGViewThumbnails {
321
  $params_array['watermark_width'] = $params['watermark_width'];
322
  $params_array['watermark_height'] = $params['watermark_height'];
323
  }
324
- list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url));
325
  $scale = max($params['thumb_width'] / $image_thumb_width, $params['thumb_height'] / $image_thumb_height);
326
  $image_thumb_width *= $scale;
327
  $image_thumb_height *= $scale;
328
  $thumb_left = ($params['thumb_width'] - $image_thumb_width) / 2;
329
  $thumb_top = ($params['thumb_height'] - $image_thumb_height) / 2;
330
  ?>
331
- <a style="font-size: 0;" href="javascript:spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5);">
332
  <span class="bwg_standart_thumb_<?php echo $bwg; ?>">
333
  <span class="bwg_standart_thumb_spun1_<?php echo $bwg; ?>">
334
  <span class="bwg_standart_thumb_spun2_<?php echo $bwg; ?>">
32
  $params['image_title'] = 'none';
33
  }
34
  $from = (isset($params['from']) ? esc_html($params['from']) : 0);
35
+ $sort_direction = ' ASC ';
36
  if ($from) {
37
  $options_row = $this->model->get_options_row_data();
38
  $params['gallery_id'] = $params['id'];
39
  $params['images_per_page'] = $params['count'];
40
  $params['sort_by'] = (($params['show'] == 'random') ? 'RAND()' : 'order');
41
+ if ($params['show'] == 'last') {
42
+ $sort_direction = ' DESC ';
43
+ }
44
  $params['image_enable_page'] = 0;
45
  $params['image_title'] = $options_row->image_title_show_hover;
46
  $params['thumb_height'] = $params['height'];
86
  echo WDWLibrary::message(__('There is no gallery selected or the gallery was deleted.', 'bwg'), 'error');
87
  return;
88
  }
89
+ $image_rows = $this->model->get_image_rows_data($params['gallery_id'], $params['images_per_page'], $params['sort_by'], $bwg, $type, $sort_direction);
90
  if (!$image_rows) {
91
  echo WDWLibrary::message(__('There are no images in this gallery.', 'bwg'), 'error');
92
  }
325
  $params_array['watermark_width'] = $params['watermark_width'];
326
  $params_array['watermark_height'] = $params['watermark_height'];
327
  }
328
+ list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES));
329
  $scale = max($params['thumb_width'] / $image_thumb_width, $params['thumb_height'] / $image_thumb_height);
330
  $image_thumb_width *= $scale;
331
  $image_thumb_height *= $scale;
332
  $thumb_left = ($params['thumb_width'] - $image_thumb_width) / 2;
333
  $thumb_top = ($params['thumb_height'] - $image_thumb_height) / 2;
334
  ?>
335
+ <a style="font-size: 0;" onclick="spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5); return false;">
336
  <span class="bwg_standart_thumb_<?php echo $bwg; ?>">
337
  <span class="bwg_standart_thumb_spun1_<?php echo $bwg; ?>">
338
  <span class="bwg_standart_thumb_spun2_<?php echo $bwg; ?>">
js/3DEngine/3DEngine.js ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /*
3
+ * DisplayObject3D ----------------------------------------------
4
+ */
5
+ var DisplayObject3D = function(){
6
+ return this;
7
+ };
8
+
9
+ DisplayObject3D.prototype._x = 0;
10
+ DisplayObject3D.prototype._y = 0;
11
+
12
+ //Create 3d Points
13
+ DisplayObject3D.prototype.make3DPoint = function(x,y,z) {
14
+ var point = {};
15
+ point.x = x;
16
+ point.y = y;
17
+ point.z = z;
18
+ return point;
19
+ };
20
+
21
+ //Create 2d Points
22
+ DisplayObject3D.prototype.make2DPoint = function(x, y, depth, scaleFactor){
23
+ var point = {};
24
+ point.x = x;
25
+ point.y = y;
26
+ point.depth = depth;
27
+ point.scaleFactor = scaleFactor;
28
+ return point;
29
+ };
30
+
31
+ DisplayObject3D.prototype.container = undefined;
32
+ DisplayObject3D.prototype.pointsArray = [];
33
+
34
+ DisplayObject3D.prototype.init = function (container){
35
+
36
+ this.container = container;
37
+ this.containerId = this.container.attr("id");
38
+
39
+ //if there isn't a ul than it creates a list of +'s
40
+ if (container.has("ul").length === 0){
41
+ for (i=0; i < this.pointsArray.length; i++){
42
+ this.container.append('<b id="tags_cloud_item'+i+'">+</b>');
43
+ }
44
+ }
45
+ };
46
+
47
+ /*
48
+ * DisplayObject3D End ----------------------------------------------
49
+ */
50
+
51
+
52
+ /*
53
+ * Camera3D ----------------------------------------------
54
+ */
55
+ var Camera3D = function (){};
56
+
57
+ Camera3D.prototype.x = 0;
58
+ Camera3D.prototype.y = 0;
59
+ Camera3D.prototype.z = 500;
60
+ Camera3D.prototype.focalLength = 1000;
61
+
62
+ Camera3D.prototype.scaleRatio = function(item){
63
+ return this.focalLength / (this.focalLength + item.z - this.z);
64
+ };
65
+
66
+ Camera3D.prototype.init = function (x, y, z, focalLength){
67
+ this.x = x;
68
+ this.y = y;
69
+ this.z = z;
70
+ this.focalLength = focalLength;
71
+ };
72
+
73
+
74
+ /*
75
+ * Camera3D End ----------------------------------------------
76
+ */
77
+
78
+
79
+ /*
80
+ * Object3D ----------------------------------------------
81
+ */
82
+ var Object3D = function (container){
83
+ this.container = container;
84
+ };
85
+
86
+ Object3D.prototype.objects = [];
87
+
88
+ Object3D.prototype.addChild = function (object3D){
89
+ this.objects.push(object3D);
90
+ object3D.init(this.container);
91
+ return object3D;
92
+ };
93
+
94
+ /*
95
+ * Object3D End ----------------------------------------------
96
+ */
97
+
98
+
99
+ /*
100
+ * Scene3D ----------------------------------------------
101
+ */
102
+
103
+ var Scene3D = function (){};
104
+
105
+ Scene3D.prototype.sceneItems = [];
106
+ Scene3D.prototype.addToScene = function (object){
107
+ this.sceneItems.push(object);
108
+ };
109
+
110
+ Scene3D.prototype.Transform3DPointsTo2DPoints = function(points, axisRotations, camera){
111
+ var TransformedPointsArray = [];
112
+ var sx = Math.sin(axisRotations.x);
113
+ var cx = Math.cos(axisRotations.x);
114
+ var sy = Math.sin(axisRotations.y);
115
+ var cy = Math.cos(axisRotations.y);
116
+ var sz = Math.sin(axisRotations.z);
117
+ var cz = Math.cos(axisRotations.z);
118
+ var x,y,z, xy,xz, yx,yz, zx,zy, scaleFactor;
119
+
120
+ var i = points.length;
121
+
122
+ while (i--){
123
+ x = points[i].x;
124
+ y = points[i].y;
125
+ z = points[i].z;
126
+
127
+ // rotation around x
128
+ xy = cx * y - sx * z;
129
+ xz = sx * y + cx * z;
130
+ // rotation around y
131
+ yz = cy * xz - sy * x;
132
+ yx = sy * xz + cy * x;
133
+ // rotation around z
134
+ zx = cz * yx - sz * xy;
135
+ zy = sz * yx + cz * xy;
136
+
137
+ scaleFactor = camera.focalLength / (camera.focalLength + yz);
138
+ x = zx * scaleFactor;
139
+ y = zy * scaleFactor;
140
+ z = yz;
141
+
142
+ var displayObject = new DisplayObject3D();
143
+ TransformedPointsArray[i] = displayObject.make2DPoint(x, y, -z, scaleFactor);
144
+ }
145
+
146
+ return TransformedPointsArray;
147
+ };
148
+
149
+ Scene3D.prototype.renderCamera = function (camera){
150
+
151
+ for(var i = 0 ; i < this.sceneItems.length; i++){
152
+
153
+ var obj = this.sceneItems[i].objects[0];
154
+
155
+ var screenPoints = this.Transform3DPointsTo2DPoints(obj.pointsArray, axisRotation, camera);
156
+
157
+ var hasList = (document.getElementById(obj.containerId).getElementsByTagName("ul").length > 0);
158
+
159
+ for (k=0; k < obj.pointsArray.length; k++){
160
+ var currItem = null;
161
+
162
+ if (hasList){
163
+ currItem = document.getElementById(obj.containerId).getElementsByTagName("ul")[0].getElementsByTagName("li")[k];
164
+ }else{
165
+ currItem = document.getElementById(obj.containerId).getElementsByTagName("*")[k];
166
+ }
167
+
168
+ if(currItem){
169
+
170
+ currItem._x = screenPoints[k].x;
171
+ currItem._y = screenPoints[k].y;
172
+ currItem.scale = screenPoints[k].scaleFactor;
173
+
174
+ currItem.style.position = "absolute";
175
+ currItem.style.top = (currItem._y + jQuery("#" + obj.containerId).height() * 0.4)+'px';
176
+ currItem.style.left = (currItem._x + jQuery("#" + obj.containerId).width() * 0.4)+'px';
177
+ currItem.style.fontSize = 100 * currItem.scale + '%';
178
+
179
+ jQuery(currItem).css({opacity:(currItem.scale-.5)});
180
+
181
+ curChild = jQuery(currItem).find("#imgg");
182
+ if (curChild) {
183
+ jQuery(currItem).css("zIndex", Math.round(currItem.scale * 100));
184
+ curChild.css({maxWidth:(currItem.scale*50)});
185
+ curChild.css({maxHeight:(currItem.scale*50)});
186
+ }
187
+ }
188
+ }
189
+ }
190
+ };
191
+
192
+ /*
193
+ * Scene3D End ----------------------------------------------
194
+ */
195
+
196
+
197
+ //Center for rotation
198
+ var axisRotation = new DisplayObject3D().make3DPoint(0,0,0);
js/3DEngine/Sphere.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var Sphere = function (radius, sides, numOfItems){
2
+
3
+ for (var j = sides ; j > 0; j--){
4
+ for (var i = numOfItems / sides ; i > 0; i--)
5
+ {
6
+ var angle = i * Math.PI / (numOfItems / sides + 1);
7
+ var angleB = j * Math.PI * 2 / (sides);
8
+
9
+ var x = Math.sin(angleB) * Math.sin(angle) * radius;
10
+ var y = Math.cos(angleB) * Math.sin(angle) * radius;
11
+ var z = Math.cos(angle) * radius;
12
+
13
+ this.pointsArray.push(this.make3DPoint(x,y,z));
14
+ }
15
+ };
16
+ };
17
+
18
+ Sphere.prototype = new DisplayObject3D();
js/jquery.mobile.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! jQuery Mobile v1.3.2 | Copyright 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */
2
+ (function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function x(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function T(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=x(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;d<v;d++)l=u[d],t[l]=h[l]}return t}function N(t){var n={},r,s;while(t){r=e.data(t,i);for(s in r)r[s]&&(n[s]=n.hasVirtualBinding=!0);t=t.parentNode}return n}function C(t,n){var r;while(t){r=e.data(t,i);if(r&&(!n||r[n]))return t;t=t.parentNode}return null}function k(){g=!1}function L(){g=!0}function A(){E=0,v.length=0,m=!1,L()}function O(){k()}function M(){_(),c=setTimeout(function(){c=0,A()},e.vmouse.resetTimerDuration)}function _(){c&&(clearTimeout(c),c=0)}function D(t,n,r){var i;if(r&&r[t]||!r&&C(n.target,t))i=T(n,t),e(n.target).trigger(i);return i}function P(t){var n=e.data(t.target,s);if(!m&&(!E||E!==n)){var r=D("v"+t.type,t);r&&(r.isDefaultPrevented()&&t.preventDefault(),r.isPropagationStopped()&&t.stopPropagation(),r.isImmediatePropagationStopped()&&t.stopImmediatePropagation())}}function H(t){var n=x(t).touches,r,i;if(n&&n.length===1){r=t.target,i=N(r);if(i.hasVirtualBinding){E=w++,e.data(r,s,E),_(),O(),d=!1;var o=x(t).touches[0];h=o.pageX,p=o.pageY,D("vmouseover",t,i),D("vmousedown",t,i)}}}function B(e){if(g)return;d||D("vmousecancel",e,N(e.target)),d=!0,M()}function j(t){if(g)return;var n=x(t).touches[0],r=d,i=e.vmouse.moveDistanceThreshold,s=N(t.target);d=d||Math.abs(n.pageX-h)>i||Math.abs(n.pageY-p)>i,d&&!r&&D("vmousecancel",t,s),D("vmousemove",t,s),M()}function F(e){if(g)return;L();var t=N(e.target),n;D("vmouseup",e,t);if(!d){var r=D("vclick",e,t);r&&r.isDefaultPrevented()&&(n=x(e).changedTouches[0],v.push({touchID:E,x:n.clientX,y:n.clientY}),m=!0)}D("vmouseout",e,t),d=!1,M()}function I(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function q(){}function R(t){var n=t.substr(1);return{setup:function(r,s){I(this)||e.data(this,i,{});var o=e.data(this,i);o[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,P),e(this).bind(n,q),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",H).bind("touchend",F).bind("touchmove",j).bind("scroll",B))},teardown:function(r,s){--l[t],l[t]||b.unbind(n,P),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",H).unbind("touchmove",j).unbind("touchend",F).unbind("scroll",B));var o=e(this),u=e.data(this,i);u&&(u[t]=!1),o.unbind(n,q),I(this)||o.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(var U=0;U<o.length;U++)e.event.special[o[U]]=R(o[U]);y&&n.addEventListener("click",function(t){var n=v.length,r=t.target,i,o,u,a,f,l;if(n){i=t.clientX,o=t.clientY,S=e.vmouse.clickDistanceThreshold,u=r;while(u){for(a=0;a<n;a++){f=v[a],l=0;if(u===r&&Math.abs(f.x-i)<S&&Math.abs(f.y-o)<S||e.data(u,s)===f.touchID){t.preventDefault(),t.stopPropagation();return}}u=u.parentNode}}},!0)})(e,t,n),function(e){e.mobile={}}(e),function(e,t){var r={touch:"ontouchend"in n};e.mobile.support=e.mobile.support||{},e.extend(e.support,r),e.extend(e.mobile.support,r)}(e),function(e,t,r){function l(t,n,r){var i=r.type;r.type=n,e.event.dispatch.call(t,r),r.type=i}var i=e(n);e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)});var s=e.mobile.support.touch,o="touchmove scroll",u=s?"touchstart":"mousedown",a=s?"touchend":"mouseup",f=s?"touchmove":"mousemove";e.event.special.scrollstart={enabled:!0,setup:function(){function s(e,n){r=n,l(t,r?"scrollstart":"scrollstop",e)}var t=this,n=e(t),r,i;n.bind(o,function(t){if(!e.event.special.scrollstart.enabled)return;r||s(t,!0),clearTimeout(i),i=setTimeout(function(){s(t,!1)},50)})}},e.event.special.tap={tapholdThreshold:750,setup:function(){var t=this,n=e(t);n.bind("vmousedown",function(r){function a(){clearTimeout(u)}function f(){a(),n.unbind("vclick",c).unbind("vmouseup",a),i.unbind("vmousecancel",f)}function c(e){f(),s===e.target&&l(t,"tap",e)}if(r.which&&r.which!==1)return!1;var s=r.target,o=r.originalEvent,u;n.bind("vmouseup",a).bind("vclick",c),i.bind("vmousecancel",f),u=setTimeout(function(){l(t,"taphold",e.Event("taphold",{target:s}))},e.event.special.tap.tapholdThreshold)})}},e.event.special.swipe={scrollSupressionThreshold:10,durationThreshold:1000,horizontalDistanceThreshold:10,verticalDistanceThreshold:475,start:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t;return{time:(new Date).getTime(),coords:[n.pageX,n.pageY],origin:e(t.target)}},stop:function(e){var t=e.originalEvent.touches?e.originalEvent.touches[0]:e;return{time:(new Date).getTime(),coords:[t.pageX,t.pageY]}},handleSwipe:function(t,n){n.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-n.coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])<e.event.special.swipe.verticalDistanceThreshold&&t.origin.trigger("swipe").trigger(t.coords[0]>n.coords[0]?"swipeleft":"swiperight")},setup:function(){var t=this,n=e(t);n.bind(u,function(t){function o(t){if(!i)return;s=e.event.special.swipe.stop(t),Math.abs(i.coords[0]-s.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()}var i=e.event.special.swipe.start(t),s;n.bind(f,o).one(a,function(){n.unbind(f,o),i&&s&&e.event.special.swipe.handleSwipe(i,s),i=s=r})})}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)}}})}(e,this)});
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.6
8
  * Author: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
@@ -983,6 +983,7 @@ function bwg_activate() {
983
  '%d',
984
  '%d',
985
  '%d',
 
986
 
987
  '%d',
988
  '%d',
@@ -1059,7 +1060,7 @@ function bwg_activate() {
1059
 
1060
  '%d',
1061
  '%d',
1062
- '%d'
1063
  ));
1064
  }
1065
  $exists_default = $wpdb->get_var('SELECT count(id) FROM ' . $wpdb->prefix . 'bwg_theme');
@@ -2381,7 +2382,7 @@ function bwg_activate() {
2381
  ));
2382
  }
2383
  $version = str_replace('.', '', get_option("wd_bwg_version"));
2384
- $new_version = 116;
2385
  if ($version && $version < $new_version) {
2386
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2387
  for ($i = $version; $i < $new_version; $i++) {
@@ -2390,10 +2391,10 @@ function bwg_activate() {
2390
  $func_name();
2391
  }
2392
  }
2393
- update_option("wd_bwg_version", '1.1.6');
2394
  }
2395
  else {
2396
- add_option("wd_bwg_version", '1.1.6', '', 'no');
2397
  add_option("wd_bwg_theme_version", '1.0.0', '', 'no');
2398
  }
2399
  }
@@ -2462,6 +2463,7 @@ function bwg_front_end_scripts() {
2462
 
2463
  // Styles/Scripts for popup.
2464
  wp_enqueue_style('font-awesome', WD_BWG_URL . '/css/font-awesome-4.0.1/font-awesome.css');
 
2465
  wp_enqueue_script('bwg_mCustomScrollbar', WD_BWG_URL . '/js/jquery.mCustomScrollbar.concat.min.js', array(), get_option("wd_bwg_version"));
2466
  wp_enqueue_style('bwg_mCustomScrollbar', WD_BWG_URL . '/css/jquery.mCustomScrollbar.css');
2467
  wp_enqueue_script('jquery-fullscreen', WD_BWG_URL . '/js/jquery.fullscreen-0.4.1.js', array(), '0.4.1');
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.7
8
  * Author: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
983
  '%d',
984
  '%d',
985
  '%d',
986
+ '%s',
987
 
988
  '%d',
989
  '%d',
1060
 
1061
  '%d',
1062
  '%d',
1063
+ '%d',
1064
  ));
1065
  }
1066
  $exists_default = $wpdb->get_var('SELECT count(id) FROM ' . $wpdb->prefix . 'bwg_theme');
2382
  ));
2383
  }
2384
  $version = str_replace('.', '', get_option("wd_bwg_version"));
2385
+ $new_version = 117;
2386
  if ($version && $version < $new_version) {
2387
  require_once WD_BWG_DIR . "/update/bwg_update.php";
2388
  for ($i = $version; $i < $new_version; $i++) {
2391
  $func_name();
2392
  }
2393
  }
2394
+ update_option("wd_bwg_version", '1.1.7');
2395
  }
2396
  else {
2397
+ add_option("wd_bwg_version", '1.1.7', '', 'no');
2398
  add_option("wd_bwg_theme_version", '1.0.0', '', 'no');
2399
  }
2400
  }
2463
 
2464
  // Styles/Scripts for popup.
2465
  wp_enqueue_style('font-awesome', WD_BWG_URL . '/css/font-awesome-4.0.1/font-awesome.css');
2466
+ // wp_enqueue_script('jquery_mobile', WD_BWG_URL . '/js/jquery.mobile.js', array(), get_option("wd_bwg_version"));
2467
  wp_enqueue_script('bwg_mCustomScrollbar', WD_BWG_URL . '/js/jquery.mCustomScrollbar.concat.min.js', array(), get_option("wd_bwg_version"));
2468
  wp_enqueue_style('bwg_mCustomScrollbar', WD_BWG_URL . '/css/jquery.mCustomScrollbar.css');
2469
  wp_enqueue_script('jquery-fullscreen', WD_BWG_URL . '/js/jquery.fullscreen-0.4.1.js', array(), '0.4.1');
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.8.1
7
- Stable tag: 1.1.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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.8.1
7
+ Stable tag: 1.1.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10