Gallery Bank: WordPress Photo Gallery Plugin - Version 3.0.82

Version Description

  • Major Bug Fixed Related to Multisite Wordpress.
Download this release

Release Info

Developer Gallery-Bank
Plugin Icon 128x128 Gallery Bank: WordPress Photo Gallery Plugin
Version 3.0.82
Comparing to
See all releases

Code changes from version 3.0.81 to 3.0.82

gallery-bank.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin URI: http://tech-banker.com
5
  Description: Gallery Bank is an easy to use Responsive WordPress Gallery Plugin for photos, videos, galleries and albums.
6
  Author: Tech Banker
7
- Version: 3.0.81
8
  Author URI: http://tech-banker.com
9
  */
10
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -45,10 +45,10 @@ if (file_exists(GALLERY_BK_PLUGIN_DIR . "/lib/gallery-bank-class.php")) {
45
  require_once(GALLERY_BK_PLUGIN_DIR . "/lib/gallery-bank-class.php");
46
  }
47
  /*************************************************************************************/
48
- function plugin_install_script_for_gallery_bank($network_wide)
49
  {
50
  global $wpdb;
51
- if (is_multisite() && $network_wide)
52
  {
53
  $blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
54
  foreach($blog_ids as $blog_id)
@@ -56,7 +56,7 @@ function plugin_install_script_for_gallery_bank($network_wide)
56
  switch_to_blog($blog_id);
57
  if(file_exists(GALLERY_BK_PLUGIN_DIR. "/lib/install-script.php"))
58
  {
59
- include_once GALLERY_BK_PLUGIN_DIR . "/lib/install-script.php";
60
  }
61
  restore_current_blog();
62
  }
@@ -110,11 +110,17 @@ function add_gallery_bank_icon($meta = TRUE)
110
  (
111
  "SELECT count(album_id) FROM ".gallery_bank_albums()
112
  );
113
-
114
- $role = $wpdb->prefix . "capabilities";
115
- $current_user->role = array_keys($current_user->$role);
116
- $role = $current_user->role[0];
117
-
 
 
 
 
 
 
118
  switch ($role) {
119
  case "administrator":
120
  $wp_admin_bar->add_menu(array(
@@ -335,10 +341,6 @@ function add_gallery_bank_icon($meta = TRUE)
335
  "title" => __("Our Other Services", gallery_bank))
336
  );
337
  break;
338
- case "contributor":
339
- break;
340
- case "subscriber":
341
- break;
342
  }
343
  }
344
  function gallery_bank_custom_plugin_row($links,$file)
4
  Plugin URI: http://tech-banker.com
5
  Description: Gallery Bank is an easy to use Responsive WordPress Gallery Plugin for photos, videos, galleries and albums.
6
  Author: Tech Banker
7
+ Version: 3.0.82
8
  Author URI: http://tech-banker.com
9
  */
10
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
45
  require_once(GALLERY_BK_PLUGIN_DIR . "/lib/gallery-bank-class.php");
46
  }
47
  /*************************************************************************************/
48
+ function plugin_install_script_for_gallery_bank()
49
  {
50
  global $wpdb;
51
+ if (is_multisite())
52
  {
53
  $blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
54
  foreach($blog_ids as $blog_id)
56
  switch_to_blog($blog_id);
57
  if(file_exists(GALLERY_BK_PLUGIN_DIR. "/lib/install-script.php"))
58
  {
59
+ include GALLERY_BK_PLUGIN_DIR . "/lib/install-script.php";
60
  }
61
  restore_current_blog();
62
  }
110
  (
111
  "SELECT count(album_id) FROM ".gallery_bank_albums()
112
  );
113
+
114
+ if(is_super_admin())
115
+ {
116
+ $role = "administrator";
117
+ }
118
+ else
119
+ {
120
+ $role = $wpdb->prefix . "capabilities";
121
+ $current_user->role = array_keys($current_user->$role);
122
+ $role = $current_user->role[0];
123
+ }
124
  switch ($role) {
125
  case "administrator":
126
  $wp_admin_bar->add_menu(array(
341
  "title" => __("Our Other Services", gallery_bank))
342
  );
343
  break;
 
 
 
 
344
  }
345
  }
346
  function gallery_bank_custom_plugin_row($links,$file)
lib/gallery-bank-class.php CHANGED
@@ -6,10 +6,16 @@
6
  function create_global_menus_for_gallery_bank()
7
  {
8
  global $wpdb,$current_user;
9
- $role = $wpdb->prefix . "capabilities";
10
- $current_user->role = array_keys($current_user->$role);
11
- $role = $current_user->role[0];
12
-
 
 
 
 
 
 
13
  switch ($role) {
14
  case "administrator":
15
  add_menu_page("Gallery Bank", __("Gallery Bank", gallery_bank), "read", "gallery_bank", "", plugins_url("/assets/images/icon.png" , dirname(__FILE__)));
@@ -56,10 +62,6 @@ function create_global_menus_for_gallery_bank()
56
  add_submenu_page("", "", "", "read", "save_album", "save_album");
57
  add_submenu_page("", "", "", "read", "images_sorting", "images_sorting");
58
  break;
59
- case "contributor":
60
- break;
61
- case "subscriber":
62
- break;
63
  }
64
  }
65
  //--------------------------------------------------------------------------------------------------------------//
@@ -90,9 +92,16 @@ function gallery_bank_settings()
90
  function gallery_bank()
91
  {
92
  global $wpdb,$current_user,$user_role_permission;
93
- $role = $wpdb->prefix . "capabilities";
94
- $current_user->role = array_keys($current_user->$role);
95
- $role = $current_user->role[0];
 
 
 
 
 
 
 
96
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
97
  include_once GALLERY_BK_PLUGIN_DIR . "/views/dashboard.php";
98
  }
@@ -101,25 +110,38 @@ function gallery_bank()
101
  function gallery_bank_shortcode()
102
  {
103
  global $wpdb, $current_user,$wp_version;
104
- $role = $wpdb->prefix . "capabilities";
105
- $current_user->role = array_keys($current_user->$role);
106
- $role = $current_user->role[0];
 
 
 
 
 
 
 
107
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
108
  include_once GALLERY_BK_PLUGIN_DIR . "/views/shortcode.php";
109
  }
110
  function save_album()
111
  {
112
- global $wpdb;
 
 
 
 
 
 
 
 
 
 
113
  $album_count = $wpdb->get_var
114
  (
115
  "SELECT count(album_id) FROM ".gallery_bank_albums()
116
  );
117
  if($album_count <= 3)
118
  {
119
- global $wpdb,$current_user,$user_role_permission;
120
- $role = $wpdb->prefix . "capabilities";
121
- $current_user->role = array_keys($current_user->$role);
122
- $role = $current_user->role[0];
123
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
124
  include_once GALLERY_BK_PLUGIN_DIR . "/views/edit-album.php";
125
  }
@@ -132,9 +154,16 @@ function save_album()
132
  function global_settings()
133
  {
134
  global $wpdb, $current_user,$wp_version;
135
- $role = $wpdb->prefix . "capabilities";
136
- $current_user->role = array_keys($current_user->$role);
137
- $role = $current_user->role[0];
 
 
 
 
 
 
 
138
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
139
  include_once GALLERY_BK_PLUGIN_DIR . "/views/settings.php";
140
  }
@@ -142,9 +171,16 @@ function global_settings()
142
  function gallery_album_sorting()
143
  {
144
  global $wpdb,$current_user,$user_role_permission;
145
- $role = $wpdb->prefix . "capabilities";
146
- $current_user->role = array_keys($current_user->$role);
147
- $role = $current_user->role[0];
 
 
 
 
 
 
 
148
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
149
  include_once GALLERY_BK_PLUGIN_DIR . "/views/album-sorting.php";
150
  }
@@ -152,9 +188,16 @@ function gallery_album_sorting()
152
  function images_sorting()
153
  {
154
  global $wpdb,$current_user,$user_role_permission;
155
- $role = $wpdb->prefix . "capabilities";
156
- $current_user->role = array_keys($current_user->$role);
157
- $role = $current_user->role[0];
 
 
 
 
 
 
 
158
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
159
  include_once GALLERY_BK_PLUGIN_DIR . "/views/images-sorting.php";
160
  }
@@ -162,9 +205,16 @@ function images_sorting()
162
  function album_preview()
163
  {
164
  global $wpdb,$current_user,$user_role_permission;
165
- $role = $wpdb->prefix . "capabilities";
166
- $current_user->role = array_keys($current_user->$role);
167
- $role = $current_user->role[0];
 
 
 
 
 
 
 
168
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
169
  include_once GALLERY_BK_PLUGIN_DIR . "/views/album-preview.php";
170
  }
@@ -173,9 +223,16 @@ function album_preview()
173
  function gallery_bank_system_status()
174
  {
175
  global $wpdb,$wp_version,$current_user,$user_role_permission;
176
- $role = $wpdb->prefix . "capabilities";
177
- $current_user->role = array_keys($current_user->$role);
178
- $role = $current_user->role[0];
 
 
 
 
 
 
 
179
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
180
  include_once GALLERY_BK_PLUGIN_DIR . "/views/gallery-bank-system-report.php";
181
  }
@@ -183,9 +240,16 @@ function gallery_bank_system_status()
183
  function gallery_bank_purchase()
184
  {
185
  global $wpdb,$current_user,$user_role_permission;
186
- $role = $wpdb->prefix . "capabilities";
187
- $current_user->role = array_keys($current_user->$role);
188
- $role = $current_user->role[0];
 
 
 
 
 
 
 
189
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
190
  include_once GALLERY_BK_PLUGIN_DIR . "/views/purchase_pro_version.php";
191
  }
@@ -193,9 +257,16 @@ function gallery_bank_purchase()
193
  function gallery_bank_recommended_plugins()
194
  {
195
  global $wpdb,$current_user,$user_role_permission;
196
- $role = $wpdb->prefix . "capabilities";
197
- $current_user->role = array_keys($current_user->$role);
198
- $role = $current_user->role[0];
 
 
 
 
 
 
 
199
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
200
  include_once GALLERY_BK_PLUGIN_DIR . "/views/recommended-plugins.php";
201
  }
@@ -203,9 +274,16 @@ function gallery_bank_recommended_plugins()
203
  function gallery_bank_other_services()
204
  {
205
  global $wpdb,$current_user,$user_role_permission;
206
- $role = $wpdb->prefix . "capabilities";
207
- $current_user->role = array_keys($current_user->$role);
208
- $role = $current_user->role[0];
 
 
 
 
 
 
 
209
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
210
  include_once GALLERY_BK_PLUGIN_DIR . "/views/other-services.php";
211
  }
@@ -273,9 +351,16 @@ if (isset($_REQUEST["action"])) {
273
  function album_gallery_library()
274
  {
275
  global $wpdb,$current_user,$user_role_permission;
276
- $role = $wpdb->prefix . "capabilities";
277
- $current_user->role = array_keys($current_user->$role);
278
- $role = $current_user->role[0];
 
 
 
 
 
 
 
279
  include_once GALLERY_BK_PLUGIN_DIR . "/lib/add-new-album-class.php";
280
  }
281
  break;
@@ -291,10 +376,16 @@ if (isset($_REQUEST["action"])) {
291
  function upload_library()
292
  {
293
  global $wpdb,$current_user,$user_role_permission;
294
- $role = $wpdb->prefix . "capabilities";
295
- $current_user->role = array_keys($current_user->$role);
296
- $role = $current_user->role[0];
297
-
 
 
 
 
 
 
298
  $filetype = $_REQUEST["file_type"];
299
  if($filetype == "image/jpeg" || $filetype == "image/jpg" || $filetype == "image/png" || $filetype == "image/gif" )
300
  {
@@ -401,4 +492,5 @@ add_action("admin_init", "backend_scripts_calls");
401
  add_action("admin_init", "backend_css_calls");
402
  add_action("init", "frontend_plugin_js_scripts_gallery_bank");
403
  add_action("init", "frontend_plugin_css_scripts_gallery_bank");
404
- add_action("admin_menu", "create_global_menus_for_gallery_bank");
 
6
  function create_global_menus_for_gallery_bank()
7
  {
8
  global $wpdb,$current_user;
9
+ if(is_super_admin())
10
+ {
11
+ $role = "administrator";
12
+ }
13
+ else
14
+ {
15
+ $role = $wpdb->prefix . "capabilities";
16
+ $current_user->role = array_keys($current_user->$role);
17
+ $role = $current_user->role[0];
18
+ }
19
  switch ($role) {
20
  case "administrator":
21
  add_menu_page("Gallery Bank", __("Gallery Bank", gallery_bank), "read", "gallery_bank", "", plugins_url("/assets/images/icon.png" , dirname(__FILE__)));
62
  add_submenu_page("", "", "", "read", "save_album", "save_album");
63
  add_submenu_page("", "", "", "read", "images_sorting", "images_sorting");
64
  break;
 
 
 
 
65
  }
66
  }
67
  //--------------------------------------------------------------------------------------------------------------//
92
  function gallery_bank()
93
  {
94
  global $wpdb,$current_user,$user_role_permission;
95
+ if(is_super_admin())
96
+ {
97
+ $role = "administrator";
98
+ }
99
+ else
100
+ {
101
+ $role = $wpdb->prefix . "capabilities";
102
+ $current_user->role = array_keys($current_user->$role);
103
+ $role = $current_user->role[0];
104
+ }
105
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
106
  include_once GALLERY_BK_PLUGIN_DIR . "/views/dashboard.php";
107
  }
110
  function gallery_bank_shortcode()
111
  {
112
  global $wpdb, $current_user,$wp_version;
113
+ if(is_super_admin())
114
+ {
115
+ $role = "administrator";
116
+ }
117
+ else
118
+ {
119
+ $role = $wpdb->prefix . "capabilities";
120
+ $current_user->role = array_keys($current_user->$role);
121
+ $role = $current_user->role[0];
122
+ }
123
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
124
  include_once GALLERY_BK_PLUGIN_DIR . "/views/shortcode.php";
125
  }
126
  function save_album()
127
  {
128
+ global $wpdb,$current_user,$user_role_permission;
129
+ if(is_super_admin())
130
+ {
131
+ $role = "administrator";
132
+ }
133
+ else
134
+ {
135
+ $role = $wpdb->prefix . "capabilities";
136
+ $current_user->role = array_keys($current_user->$role);
137
+ $role = $current_user->role[0];
138
+ }
139
  $album_count = $wpdb->get_var
140
  (
141
  "SELECT count(album_id) FROM ".gallery_bank_albums()
142
  );
143
  if($album_count <= 3)
144
  {
 
 
 
 
145
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
146
  include_once GALLERY_BK_PLUGIN_DIR . "/views/edit-album.php";
147
  }
154
  function global_settings()
155
  {
156
  global $wpdb, $current_user,$wp_version;
157
+ if(is_super_admin())
158
+ {
159
+ $role = "administrator";
160
+ }
161
+ else
162
+ {
163
+ $role = $wpdb->prefix . "capabilities";
164
+ $current_user->role = array_keys($current_user->$role);
165
+ $role = $current_user->role[0];
166
+ }
167
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
168
  include_once GALLERY_BK_PLUGIN_DIR . "/views/settings.php";
169
  }
171
  function gallery_album_sorting()
172
  {
173
  global $wpdb,$current_user,$user_role_permission;
174
+ if(is_super_admin())
175
+ {
176
+ $role = "administrator";
177
+ }
178
+ else
179
+ {
180
+ $role = $wpdb->prefix . "capabilities";
181
+ $current_user->role = array_keys($current_user->$role);
182
+ $role = $current_user->role[0];
183
+ }
184
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
185
  include_once GALLERY_BK_PLUGIN_DIR . "/views/album-sorting.php";
186
  }
188
  function images_sorting()
189
  {
190
  global $wpdb,$current_user,$user_role_permission;
191
+ if(is_super_admin())
192
+ {
193
+ $role = "administrator";
194
+ }
195
+ else
196
+ {
197
+ $role = $wpdb->prefix . "capabilities";
198
+ $current_user->role = array_keys($current_user->$role);
199
+ $role = $current_user->role[0];
200
+ }
201
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
202
  include_once GALLERY_BK_PLUGIN_DIR . "/views/images-sorting.php";
203
  }
205
  function album_preview()
206
  {
207
  global $wpdb,$current_user,$user_role_permission;
208
+ if(is_super_admin())
209
+ {
210
+ $role = "administrator";
211
+ }
212
+ else
213
+ {
214
+ $role = $wpdb->prefix . "capabilities";
215
+ $current_user->role = array_keys($current_user->$role);
216
+ $role = $current_user->role[0];
217
+ }
218
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
219
  include_once GALLERY_BK_PLUGIN_DIR . "/views/album-preview.php";
220
  }
223
  function gallery_bank_system_status()
224
  {
225
  global $wpdb,$wp_version,$current_user,$user_role_permission;
226
+ if(is_super_admin())
227
+ {
228
+ $role = "administrator";
229
+ }
230
+ else
231
+ {
232
+ $role = $wpdb->prefix . "capabilities";
233
+ $current_user->role = array_keys($current_user->$role);
234
+ $role = $current_user->role[0];
235
+ }
236
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
237
  include_once GALLERY_BK_PLUGIN_DIR . "/views/gallery-bank-system-report.php";
238
  }
240
  function gallery_bank_purchase()
241
  {
242
  global $wpdb,$current_user,$user_role_permission;
243
+ if(is_super_admin())
244
+ {
245
+ $role = "administrator";
246
+ }
247
+ else
248
+ {
249
+ $role = $wpdb->prefix . "capabilities";
250
+ $current_user->role = array_keys($current_user->$role);
251
+ $role = $current_user->role[0];
252
+ }
253
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
254
  include_once GALLERY_BK_PLUGIN_DIR . "/views/purchase_pro_version.php";
255
  }
257
  function gallery_bank_recommended_plugins()
258
  {
259
  global $wpdb,$current_user,$user_role_permission;
260
+ if(is_super_admin())
261
+ {
262
+ $role = "administrator";
263
+ }
264
+ else
265
+ {
266
+ $role = $wpdb->prefix . "capabilities";
267
+ $current_user->role = array_keys($current_user->$role);
268
+ $role = $current_user->role[0];
269
+ }
270
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
271
  include_once GALLERY_BK_PLUGIN_DIR . "/views/recommended-plugins.php";
272
  }
274
  function gallery_bank_other_services()
275
  {
276
  global $wpdb,$current_user,$user_role_permission;
277
+ if(is_super_admin())
278
+ {
279
+ $role = "administrator";
280
+ }
281
+ else
282
+ {
283
+ $role = $wpdb->prefix . "capabilities";
284
+ $current_user->role = array_keys($current_user->$role);
285
+ $role = $current_user->role[0];
286
+ }
287
  include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
288
  include_once GALLERY_BK_PLUGIN_DIR . "/views/other-services.php";
289
  }
351
  function album_gallery_library()
352
  {
353
  global $wpdb,$current_user,$user_role_permission;
354
+ if(is_super_admin())
355
+ {
356
+ $role = "administrator";
357
+ }
358
+ else
359
+ {
360
+ $role = $wpdb->prefix . "capabilities";
361
+ $current_user->role = array_keys($current_user->$role);
362
+ $role = $current_user->role[0];
363
+ }
364
  include_once GALLERY_BK_PLUGIN_DIR . "/lib/add-new-album-class.php";
365
  }
366
  break;
376
  function upload_library()
377
  {
378
  global $wpdb,$current_user,$user_role_permission;
379
+ if(is_super_admin())
380
+ {
381
+ $role = "administrator";
382
+ }
383
+ else
384
+ {
385
+ $role = $wpdb->prefix . "capabilities";
386
+ $current_user->role = array_keys($current_user->$role);
387
+ $role = $current_user->role[0];
388
+ }
389
  $filetype = $_REQUEST["file_type"];
390
  if($filetype == "image/jpeg" || $filetype == "image/jpg" || $filetype == "image/png" || $filetype == "image/gif" )
391
  {
492
  add_action("admin_init", "backend_css_calls");
493
  add_action("init", "frontend_plugin_js_scripts_gallery_bank");
494
  add_action("init", "frontend_plugin_css_scripts_gallery_bank");
495
+ add_action("admin_menu", "create_global_menus_for_gallery_bank");
496
+ add_action( "network_admin_menu", "create_global_menus_for_gallery_bank" );
lib/install-script.php CHANGED
@@ -1,4 +1,148 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  global $wpdb;
3
  require_once(ABSPATH . "wp-admin/includes/upgrade.php");
4
  update_option("gallery-bank-updation-check-url","http://tech-banker.com/wp-admin/admin-ajax.php");
@@ -109,7 +253,7 @@ if($version == "")
109
  }
110
  if(file_exists($destination))
111
  {
112
- process_image_upload($file_name, 160, 120);
113
  }
114
 
115
  $wpdb->query
@@ -135,7 +279,7 @@ if($version == "")
135
  );
136
  if($album_id != $album_pics[$flag]->album_id)
137
  {
138
- process_album_upload($file_name, 160, 120);
139
  }
140
  $album_id = $album_pics[$flag]->album_id;
141
  }
@@ -159,128 +303,4 @@ else if($version == "3.0")
159
  {
160
  update_option("gallery-bank-pro-edition", "3.1");
161
  }
162
- /******************************************Code for Thumbnails Creation**********************/
163
-
164
- function process_image_upload($image, $width, $height)
165
- {
166
- $temp_image_path = GALLERY_MAIN_UPLOAD_DIR . $image;
167
- $temp_image_name = $image;
168
- list(, , $temp_image_type) = getimagesize($temp_image_path);
169
- if ($temp_image_type === NULL) {
170
- return false;
171
- }
172
- $uploaded_image_path = GALLERY_MAIN_UPLOAD_DIR . $temp_image_name;
173
- move_uploaded_file($temp_image_path, $uploaded_image_path);
174
- $type = explode(".", $image);
175
- $thumbnail_image_path = GALLERY_MAIN_THUMB_DIR . preg_replace('{\\.[^\\.]+$}', '.'.$type[1], $temp_image_name);
176
-
177
- $result = generate_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
178
- return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
179
- }
180
- function process_album_upload($album_image, $width, $height)
181
- {
182
- $temp_image_path = GALLERY_MAIN_UPLOAD_DIR . $album_image;
183
- $temp_image_name = $album_image;
184
- list(, , $temp_image_type) = getimagesize($temp_image_path);
185
- if ($temp_image_type === NULL) {
186
- return false;
187
- }
188
- $uploaded_image_path = GALLERY_MAIN_UPLOAD_DIR . $temp_image_name;
189
- move_uploaded_file($temp_image_path, $uploaded_image_path);
190
- $type = explode(".", $album_image);
191
- $thumbnail_image_path = GALLERY_MAIN_ALB_THUMB_DIR . preg_replace("{\\.[^\\.]+$}", ".".$type[1], $temp_image_name);
192
-
193
- $result = generate_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
194
- return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
195
- }
196
- /****************************** COMMON FUNCTION TO GENERATE THUMBNAILS********************************/
197
- function generate_thumbnail($source_image_path, $thumbnail_image_path, $imageWidth, $imageHeight)
198
- {
199
- list($source_image_width, $source_image_height, $source_image_type) = getimagesize($source_image_path);
200
- $source_gd_image = false;
201
- switch ($source_image_type) {
202
-
203
- case IMAGETYPE_GIF:
204
- $source_gd_image = imagecreatefromgif($source_image_path);
205
- break;
206
- case IMAGETYPE_JPEG:
207
- $source_gd_image = imagecreatefromjpeg($source_image_path);
208
- break;
209
- case IMAGETYPE_PNG:
210
- $source_gd_image = imagecreatefrompng($source_image_path);
211
- break;
212
- }
213
- if ($source_gd_image === false) {
214
- return false;
215
- }
216
- $source_aspect_ratio = $source_image_width / $source_image_height;
217
- if ($source_image_width > $source_image_height) {
218
- (int)$real_height = $imageHeight;
219
- (int)$real_width = $imageHeight * $source_aspect_ratio;
220
- } else if ($source_image_height > $source_image_width) {
221
- (int)$real_height = $imageWidth / $source_aspect_ratio;
222
- (int)$real_width = $imageWidth;
223
-
224
- } else {
225
-
226
- (int)$real_height = $imageHeight > $imageWidth ? $imageHeight : $imageWidth;
227
- (int)$real_width = $imageWidth > $imageHeight ? $imageWidth : $imageHeight;
228
- }
229
- $thumbnail_gd_image = imagecreatetruecolor($real_width, $real_height);
230
- $bg_color = imagecolorallocate($thumbnail_gd_image, 255, 255, 255);
231
- imagefilledrectangle($thumbnail_gd_image, 0, 0, $real_width, $real_height, $bg_color);
232
- imagecopyresampled($thumbnail_gd_image, $source_gd_image, 0, 0, 0, 0, $real_width, $real_height, $source_image_width, $source_image_height);
233
-
234
- imagejpeg($thumbnail_gd_image, $thumbnail_image_path, 100);
235
- imagedestroy($source_gd_image);
236
- imagedestroy($thumbnail_gd_image);
237
- return true;
238
- }
239
- function create_table_albums()
240
- {
241
- $sql = "CREATE TABLE " . gallery_bank_albums() . "(
242
- album_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
243
- album_name VARCHAR(100),
244
- author VARCHAR(100),
245
- album_date DATE,
246
- description TEXT ,
247
- album_order INTEGER(10),
248
- PRIMARY KEY (album_id)
249
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
250
- dbDelta($sql);
251
- }
252
- function create_table_album_pics()
253
- {
254
- $sql = "CREATE TABLE " . gallery_bank_pics() . "(
255
- pic_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
256
- album_id INTEGER(10) UNSIGNED NOT NULL,
257
- title TEXT,
258
- description TEXT,
259
- thumbnail_url TEXT NOT NULL,
260
- sorting_order INTEGER(20),
261
- date DATE,
262
- url VARCHAR(250),
263
- video INTEGER(10) NOT NULL,
264
- tags TEXT,
265
- pic_name TEXT NOT NULL,
266
- album_cover INTEGER(1) NOT NULL,
267
- PRIMARY KEY(pic_id)
268
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
269
- dbDelta($sql);
270
- }
271
- function create_table_album_settings()
272
- {
273
- global $wpdb;
274
- $sql = "CREATE TABLE " . gallery_bank_settings() . "(
275
- setting_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
276
- setting_key VARCHAR(100) NOT NULL,
277
- setting_value TEXT NOT NULL,
278
- PRIMARY KEY (setting_id)
279
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
280
- dbDelta($sql);
281
-
282
- include_once (GALLERY_BK_PLUGIN_DIR . "/lib/include_settings.php");
283
-
284
- }
285
-
286
  ?>
1
  <?php
2
+ /******************************************Code for Thumbnails Creation**********************/
3
+ if(!function_exists("process_gallery_image_upload"))
4
+ {
5
+ function process_gallery_image_upload($image, $width, $height)
6
+ {
7
+ $temp_image_path = GALLERY_MAIN_UPLOAD_DIR . $image;
8
+ $temp_image_name = $image;
9
+ list(, , $temp_image_type) = getimagesize($temp_image_path);
10
+ if ($temp_image_type === NULL) {
11
+ return false;
12
+ }
13
+ $uploaded_image_path = GALLERY_MAIN_UPLOAD_DIR . $temp_image_name;
14
+ move_uploaded_file($temp_image_path, $uploaded_image_path);
15
+ $type = explode(".", $image);
16
+ $thumbnail_image_path = GALLERY_MAIN_THUMB_DIR . preg_replace('{\\.[^\\.]+$}', '.'.$type[1], $temp_image_name);
17
+
18
+ $result = generate_gallery_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
19
+ return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
20
+ }
21
+ }
22
+ if(!function_exists("process_gallery_album_upload"))
23
+ {
24
+ function process_gallery_album_upload($album_image, $width, $height)
25
+ {
26
+ $temp_image_path = GALLERY_MAIN_UPLOAD_DIR . $album_image;
27
+ $temp_image_name = $album_image;
28
+ list(, , $temp_image_type) = getimagesize($temp_image_path);
29
+ if ($temp_image_type === NULL) {
30
+ return false;
31
+ }
32
+ $uploaded_image_path = GALLERY_MAIN_UPLOAD_DIR . $temp_image_name;
33
+ move_uploaded_file($temp_image_path, $uploaded_image_path);
34
+ $type = explode(".", $album_image);
35
+ $thumbnail_image_path = GALLERY_MAIN_ALB_THUMB_DIR . preg_replace("{\\.[^\\.]+$}", ".".$type[1], $temp_image_name);
36
+
37
+ $result = generate_gallery_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
38
+ return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
39
+ }
40
+ }
41
+ /****************************** COMMON FUNCTION TO GENERATE THUMBNAILS********************************/
42
+ if(!function_exists("generate_gallery_thumbnail"))
43
+ {
44
+ function generate_gallery_thumbnail($source_image_path, $thumbnail_image_path, $imageWidth, $imageHeight)
45
+ {
46
+ list($source_image_width, $source_image_height, $source_image_type) = getimagesize($source_image_path);
47
+ $source_gd_image = false;
48
+ switch ($source_image_type) {
49
+
50
+ case IMAGETYPE_GIF:
51
+ $source_gd_image = imagecreatefromgif($source_image_path);
52
+ break;
53
+ case IMAGETYPE_JPEG:
54
+ $source_gd_image = imagecreatefromjpeg($source_image_path);
55
+ break;
56
+ case IMAGETYPE_PNG:
57
+ $source_gd_image = imagecreatefrompng($source_image_path);
58
+ break;
59
+ }
60
+ if ($source_gd_image === false) {
61
+ return false;
62
+ }
63
+ $source_aspect_ratio = $source_image_width / $source_image_height;
64
+ if ($source_image_width > $source_image_height) {
65
+ (int)$real_height = $imageHeight;
66
+ (int)$real_width = $imageHeight * $source_aspect_ratio;
67
+ } else if ($source_image_height > $source_image_width) {
68
+ (int)$real_height = $imageWidth / $source_aspect_ratio;
69
+ (int)$real_width = $imageWidth;
70
+
71
+ } else {
72
+
73
+ (int)$real_height = $imageHeight > $imageWidth ? $imageHeight : $imageWidth;
74
+ (int)$real_width = $imageWidth > $imageHeight ? $imageWidth : $imageHeight;
75
+ }
76
+ $thumbnail_gd_image = imagecreatetruecolor($real_width, $real_height);
77
+ $bg_color = imagecolorallocate($thumbnail_gd_image, 255, 255, 255);
78
+ imagefilledrectangle($thumbnail_gd_image, 0, 0, $real_width, $real_height, $bg_color);
79
+ imagecopyresampled($thumbnail_gd_image, $source_gd_image, 0, 0, 0, 0, $real_width, $real_height, $source_image_width, $source_image_height);
80
+
81
+ imagejpeg($thumbnail_gd_image, $thumbnail_image_path, 100);
82
+ imagedestroy($source_gd_image);
83
+ imagedestroy($thumbnail_gd_image);
84
+ return true;
85
+ }
86
+ }
87
+ /******************************************End of Code for Thumbnails Creation **********************/
88
+
89
+ /****************************************** Code for Table Creation **********************/
90
+ if(!function_exists("create_table_albums"))
91
+ {
92
+ function create_table_albums()
93
+ {
94
+ $sql = "CREATE TABLE " . gallery_bank_albums() . "(
95
+ album_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
96
+ album_name VARCHAR(100),
97
+ author VARCHAR(100),
98
+ album_date DATE,
99
+ description TEXT ,
100
+ album_order INTEGER(10),
101
+ PRIMARY KEY (album_id)
102
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
103
+ dbDelta($sql);
104
+ }
105
+ }
106
+ if(!function_exists("create_table_album_pics"))
107
+ {
108
+ function create_table_album_pics()
109
+ {
110
+ $sql = "CREATE TABLE " . gallery_bank_pics() . "(
111
+ pic_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
112
+ album_id INTEGER(10) UNSIGNED NOT NULL,
113
+ title TEXT,
114
+ description TEXT,
115
+ thumbnail_url TEXT NOT NULL,
116
+ sorting_order INTEGER(20),
117
+ date DATE,
118
+ url VARCHAR(250),
119
+ video INTEGER(10) NOT NULL,
120
+ tags TEXT,
121
+ pic_name TEXT NOT NULL,
122
+ album_cover INTEGER(1) NOT NULL,
123
+ PRIMARY KEY(pic_id)
124
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
125
+ dbDelta($sql);
126
+ }
127
+ }
128
+ if(!function_exists("create_table_album_settings"))
129
+ {
130
+ function create_table_album_settings()
131
+ {
132
+ global $wpdb;
133
+ $sql = "CREATE TABLE " . gallery_bank_settings() . "(
134
+ setting_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
135
+ setting_key VARCHAR(100) NOT NULL,
136
+ setting_value TEXT NOT NULL,
137
+ PRIMARY KEY (setting_id)
138
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
139
+ dbDelta($sql);
140
+
141
+ include (GALLERY_BK_PLUGIN_DIR . "/lib/include_settings.php");
142
+
143
+ }
144
+ }
145
+ /******************************************End of Code for Table Creation**********************/
146
  global $wpdb;
147
  require_once(ABSPATH . "wp-admin/includes/upgrade.php");
148
  update_option("gallery-bank-updation-check-url","http://tech-banker.com/wp-admin/admin-ajax.php");
253
  }
254
  if(file_exists($destination))
255
  {
256
+ process_gallery_image_upload($file_name, 160, 120);
257
  }
258
 
259
  $wpdb->query
279
  );
280
  if($album_id != $album_pics[$flag]->album_id)
281
  {
282
+ process_gallery_album_upload($file_name, 160, 120);
283
  }
284
  $album_id = $album_pics[$flag]->album_id;
285
  }
303
  {
304
  update_option("gallery-bank-pro-edition", "3.1");
305
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  ?>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Gallery-Bank,contact-banker
3
  Tags: add album, add gallery, add picture, add pictures, admin, AJAX, album, best gallery, best gallery plugin, best image slider, best portfolio, bilder, comments, easy media gallery, fancy gallery, filterable gallery, filterable portfolio, foto, fotoalbum, galary, galerie, galerij, galery, gallary, Galleria, gallerie, gallery, gallery decription, gallery image, gallery lightbox, Gallery Plugin, gelary, gellary, gellery, google, grid gallery, html5 player, html5 video, html5-audio, image, image album, image gallery, image gallery plugin, image lightbox, image rotate, image slider, image slideshow, images, jquery, jquery gallery, jquery slider, jquery slideshow, lightbox, links, media gallery, multiple pictures, nextgen gallery, page, pagination gallery, pagination portfolio, photo, photo album, photo albums, photo gallery, Photo Slider, photoalbum, photogallery, photos, photoset, picture, pictures, plugin, plugin for gallery, plugin gallery, portfolio, portfolio gallery, portfolio plugin, Post, posts, responsive gallery, responsive image gallery, responsive slider, responsive slideshow, seo, seo image, shortcode, sidebar, slide show, slideshow, thumbnail, twitter, upload images, upload photos, view images, view pictures, website gallery, widget, wordpress gallery plugin, wordpress portfolio plugin, wordpress seo, wp gallery, wp gallery plugin, wp slider
4
  Requires at least: 3.3
5
  Tested up to: 4.0.1
6
- Stable tag: 3.0.81
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -487,6 +487,10 @@ is False in shortcode.
487
 
488
  == Changelog ==
489
 
 
 
 
 
490
  = 3.0.81 =
491
 
492
  * Multisite Compatibility Added.
3
  Tags: add album, add gallery, add picture, add pictures, admin, AJAX, album, best gallery, best gallery plugin, best image slider, best portfolio, bilder, comments, easy media gallery, fancy gallery, filterable gallery, filterable portfolio, foto, fotoalbum, galary, galerie, galerij, galery, gallary, Galleria, gallerie, gallery, gallery decription, gallery image, gallery lightbox, Gallery Plugin, gelary, gellary, gellery, google, grid gallery, html5 player, html5 video, html5-audio, image, image album, image gallery, image gallery plugin, image lightbox, image rotate, image slider, image slideshow, images, jquery, jquery gallery, jquery slider, jquery slideshow, lightbox, links, media gallery, multiple pictures, nextgen gallery, page, pagination gallery, pagination portfolio, photo, photo album, photo albums, photo gallery, Photo Slider, photoalbum, photogallery, photos, photoset, picture, pictures, plugin, plugin for gallery, plugin gallery, portfolio, portfolio gallery, portfolio plugin, Post, posts, responsive gallery, responsive image gallery, responsive slider, responsive slideshow, seo, seo image, shortcode, sidebar, slide show, slideshow, thumbnail, twitter, upload images, upload photos, view images, view pictures, website gallery, widget, wordpress gallery plugin, wordpress portfolio plugin, wordpress seo, wp gallery, wp gallery plugin, wp slider
4
  Requires at least: 3.3
5
  Tested up to: 4.0.1
6
+ Stable tag: 3.0.82
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
487
 
488
  == Changelog ==
489
 
490
+ = 3.0.82 =
491
+
492
+ * Major Bug Fixed Related to Multisite Wordpress.
493
+
494
  = 3.0.81 =
495
 
496
  * Multisite Compatibility Added.
views/edit-album.php CHANGED
@@ -18,7 +18,6 @@
18
  }
19
  else
20
  {
21
-
22
  $album_id = intval($_REQUEST["album_id"]);
23
  $last_albums_id = $wpdb->get_var
24
  (
18
  }
19
  else
20
  {
 
21
  $album_id = intval($_REQUEST["album_id"]);
22
  $last_albums_id = $wpdb->get_var
23
  (
views/purchase_pro_version.php CHANGED
@@ -10,12 +10,6 @@ switch($role)
10
  case "author":
11
  $user_role_permission = "publish_posts";
12
  break;
13
- case "contributor":
14
- $user_role_permission = "edit_posts";
15
- break;
16
- case "subscriber":
17
- $user_role_permission = "read";
18
- break;
19
  }
20
  if (!current_user_can($user_role_permission))
21
  {
10
  case "author":
11
  $user_role_permission = "publish_posts";
12
  break;
 
 
 
 
 
 
13
  }
14
  if (!current_user_can($user_role_permission))
15
  {
views/recommended-plugins.php CHANGED
@@ -10,12 +10,6 @@ switch($role)
10
  case "author":
11
  $user_role_permission = "publish_posts";
12
  break;
13
- case "contributor":
14
- $user_role_permission = "edit_posts";
15
- break;
16
- case "subscriber":
17
- $user_role_permission = "read";
18
- break;
19
  }
20
  if (!current_user_can($user_role_permission))
21
  {
10
  case "author":
11
  $user_role_permission = "publish_posts";
12
  break;
 
 
 
 
 
 
13
  }
14
  if (!current_user_can($user_role_permission))
15
  {