Version Description
- Updated Languages
- Fixed Few Bugs Related to Thumbnails generation
- Fixed Copy Images for existing albums to new folder
- Fixed Problem of loosing images when upgrading to latest versions.
Download this release
Release Info
Developer | Gallery-Bank |
Plugin | Gallery Bank: WordPress Photo Gallery Plugin |
Version | 3.0.4 |
Comparing to | |
See all releases |
Code changes from version 3.0.3 to 3.0.4
- gallery-bank.php +26 -9
- lib/add-new-album-class.php +6 -6
- lib/install-script.php +65 -107
- readme.txt +9 -2
- upload.php +1 -1
- views/header.php +1 -1
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.
|
8 |
Author URI: http://tech-banker.com
|
9 |
*/
|
10 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
@@ -13,6 +13,10 @@
|
|
13 |
if (!defined("GALLERY_DEBUG_MODE")) define("GALLERY_DEBUG_MODE", false);
|
14 |
if (!defined("GALLERY_BK_FILE")) define("GALLERY_BK_FILE", __FILE__);
|
15 |
if (!defined("GALLERY_CONTENT_DIR")) define("GALLERY_CONTENT_DIR", ABSPATH . "wp-content");
|
|
|
|
|
|
|
|
|
16 |
if (!defined("GALLERY_CONTENT_URL")) define("GALLERY_CONTENT_URL", site_url() . "/wp-content");
|
17 |
if (!defined("GALLERY_PLUGIN_DIR")) define("GALLERY_PLUGIN_DIR", GALLERY_CONTENT_DIR . "/plugins");
|
18 |
if (!defined("GALLERY_PLUGIN_URL")) define("GALLERY_PLUGIN_URL", GALLERY_CONTENT_URL . "/plugins");
|
@@ -20,14 +24,28 @@ if (!defined("GALLERY_BK_PLUGIN_FILENAME")) define("GALLERY_BK_PLUGIN_FILENAME",
|
|
20 |
if (!defined("GALLERY_BK_PLUGIN_DIRNAME")) define("GALLERY_BK_PLUGIN_DIRNAME", plugin_basename(dirname(__FILE__)));
|
21 |
if (!defined("GALLERY_BK_PLUGIN_DIR")) define("GALLERY_BK_PLUGIN_DIR", GALLERY_PLUGIN_DIR . "/" . GALLERY_BK_PLUGIN_DIRNAME);
|
22 |
if (!defined("GALLERY_BK_PLUGIN_URL")) define("GALLERY_BK_PLUGIN_URL", site_url() . "/wp-content/plugins/" . GALLERY_BK_PLUGIN_DIRNAME);
|
23 |
-
|
24 |
-
if (!defined("
|
25 |
-
if (!defined("
|
26 |
-
if (!defined("
|
27 |
-
if (!defined("GALLERY_BK_THUMB_SMALL_URL")) define("GALLERY_BK_THUMB_SMALL_URL", site_url() . "/wp-content/plugins/" . GALLERY_BK_PLUGIN_DIRNAME . "/thumbs/");
|
28 |
-
if (!defined("GALLERY_BK_ALBUM_THUMB_URL")) define("GALLERY_BK_ALBUM_THUMB_URL", site_url() . "/wp-content/plugins/" . GALLERY_BK_PLUGIN_DIRNAME . "/album-thumbs/");
|
29 |
if (!defined("gallery_bank")) define("gallery_bank", "gallery-bank");
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
/*************************************************************************************/
|
32 |
if (file_exists(GALLERY_BK_PLUGIN_DIR . "/lib/gallery-bank-class.php")) {
|
33 |
require_once(GALLERY_BK_PLUGIN_DIR . "/lib/gallery-bank-class.php");
|
@@ -40,7 +58,6 @@ function plugin_install_script_for_gallery_bank()
|
|
40 |
/*************************************************************************************/
|
41 |
function plugin_uninstall_script_for_gallery_bank()
|
42 |
{
|
43 |
-
include_once GALLERY_BK_PLUGIN_DIR . "/lib/uninstall-script.php";
|
44 |
}
|
45 |
/*************************************************************************************/
|
46 |
function gallery_bank_plugin_load_text_domain()
|
@@ -107,7 +124,7 @@ function add_gallery_bank_icon($meta = TRUE)
|
|
107 |
);
|
108 |
}
|
109 |
$version = get_option("gallery-bank-pro-edition");
|
110 |
-
if($version
|
111 |
{
|
112 |
add_action('admin_init', 'plugin_install_script_for_gallery_bank');
|
113 |
}
|
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.4
|
8 |
Author URI: http://tech-banker.com
|
9 |
*/
|
10 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
13 |
if (!defined("GALLERY_DEBUG_MODE")) define("GALLERY_DEBUG_MODE", false);
|
14 |
if (!defined("GALLERY_BK_FILE")) define("GALLERY_BK_FILE", __FILE__);
|
15 |
if (!defined("GALLERY_CONTENT_DIR")) define("GALLERY_CONTENT_DIR", ABSPATH . "wp-content");
|
16 |
+
if (!defined("GALLERY_MAIN_DIR")) define("GALLERY_MAIN_DIR", ABSPATH . "wp-content/gallery-bank");
|
17 |
+
if (!defined("GALLERY_MAIN_UPLOAD_DIR")) define("GALLERY_MAIN_UPLOAD_DIR", ABSPATH . "wp-content/gallery-bank/gallery-uploads/");
|
18 |
+
if (!defined("GALLERY_MAIN_THUMB_DIR")) define("GALLERY_MAIN_THUMB_DIR", ABSPATH . "wp-content/gallery-bank/thumbs/");
|
19 |
+
if (!defined("GALLERY_MAIN_ALB_THUMB_DIR")) define("GALLERY_MAIN_ALB_THUMB_DIR", ABSPATH . "wp-content/gallery-bank/album-thumbs/");
|
20 |
if (!defined("GALLERY_CONTENT_URL")) define("GALLERY_CONTENT_URL", site_url() . "/wp-content");
|
21 |
if (!defined("GALLERY_PLUGIN_DIR")) define("GALLERY_PLUGIN_DIR", GALLERY_CONTENT_DIR . "/plugins");
|
22 |
if (!defined("GALLERY_PLUGIN_URL")) define("GALLERY_PLUGIN_URL", GALLERY_CONTENT_URL . "/plugins");
|
24 |
if (!defined("GALLERY_BK_PLUGIN_DIRNAME")) define("GALLERY_BK_PLUGIN_DIRNAME", plugin_basename(dirname(__FILE__)));
|
25 |
if (!defined("GALLERY_BK_PLUGIN_DIR")) define("GALLERY_BK_PLUGIN_DIR", GALLERY_PLUGIN_DIR . "/" . GALLERY_BK_PLUGIN_DIRNAME);
|
26 |
if (!defined("GALLERY_BK_PLUGIN_URL")) define("GALLERY_BK_PLUGIN_URL", site_url() . "/wp-content/plugins/" . GALLERY_BK_PLUGIN_DIRNAME);
|
27 |
+
|
28 |
+
if (!defined("GALLERY_BK_THUMB_URL")) define("GALLERY_BK_THUMB_URL", site_url() . "/wp-content/gallery-bank/gallery-uploads/");
|
29 |
+
if (!defined("GALLERY_BK_THUMB_SMALL_URL")) define("GALLERY_BK_THUMB_SMALL_URL", site_url() . "/wp-content/gallery-bank/thumbs/");
|
30 |
+
if (!defined("GALLERY_BK_ALBUM_THUMB_URL")) define("GALLERY_BK_ALBUM_THUMB_URL", site_url() . "/wp-content/gallery-bank/album-thumbs/");
|
|
|
|
|
31 |
if (!defined("gallery_bank")) define("gallery_bank", "gallery-bank");
|
32 |
|
33 |
+
if (!is_dir(GALLERY_MAIN_DIR))
|
34 |
+
{
|
35 |
+
wp_mkdir_p(GALLERY_MAIN_DIR);
|
36 |
+
}
|
37 |
+
if (!is_dir(GALLERY_MAIN_UPLOAD_DIR))
|
38 |
+
{
|
39 |
+
wp_mkdir_p(GALLERY_MAIN_UPLOAD_DIR);
|
40 |
+
}
|
41 |
+
if (!is_dir(GALLERY_MAIN_THUMB_DIR))
|
42 |
+
{
|
43 |
+
wp_mkdir_p(GALLERY_MAIN_THUMB_DIR);
|
44 |
+
}
|
45 |
+
if (!is_dir(GALLERY_MAIN_ALB_THUMB_DIR))
|
46 |
+
{
|
47 |
+
wp_mkdir_p(GALLERY_MAIN_ALB_THUMB_DIR);
|
48 |
+
}
|
49 |
/*************************************************************************************/
|
50 |
if (file_exists(GALLERY_BK_PLUGIN_DIR . "/lib/gallery-bank-class.php")) {
|
51 |
require_once(GALLERY_BK_PLUGIN_DIR . "/lib/gallery-bank-class.php");
|
58 |
/*************************************************************************************/
|
59 |
function plugin_uninstall_script_for_gallery_bank()
|
60 |
{
|
|
|
61 |
}
|
62 |
/*************************************************************************************/
|
63 |
function gallery_bank_plugin_load_text_domain()
|
124 |
);
|
125 |
}
|
126 |
$version = get_option("gallery-bank-pro-edition");
|
127 |
+
if($version == "" || $version == "3.0")
|
128 |
{
|
129 |
add_action('admin_init', 'plugin_install_script_for_gallery_bank');
|
130 |
}
|
lib/add-new-album-class.php
CHANGED
@@ -302,16 +302,16 @@ else
|
|
302 |
}
|
303 |
function process_image_upload($image, $width, $height)
|
304 |
{
|
305 |
-
$temp_image_path =
|
306 |
$temp_image_name = $image;
|
307 |
list(, , $temp_image_type) = getimagesize($temp_image_path);
|
308 |
if ($temp_image_type === NULL) {
|
309 |
return false;
|
310 |
}
|
311 |
-
$uploaded_image_path =
|
312 |
move_uploaded_file($temp_image_path, $uploaded_image_path);
|
313 |
$type = explode(".", $image);
|
314 |
-
$thumbnail_image_path =
|
315 |
|
316 |
$result = generate_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
|
317 |
return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
|
@@ -320,16 +320,16 @@ function process_image_upload($image, $width, $height)
|
|
320 |
/******************************************Code for Album cover thumbs Creation**********************/
|
321 |
function process_album_upload($album_image, $width, $height)
|
322 |
{
|
323 |
-
$temp_image_path =
|
324 |
$temp_image_name = $album_image;
|
325 |
list(, , $temp_image_type) = getimagesize($temp_image_path);
|
326 |
if ($temp_image_type === NULL) {
|
327 |
return false;
|
328 |
}
|
329 |
-
$uploaded_image_path =
|
330 |
move_uploaded_file($temp_image_path, $uploaded_image_path);
|
331 |
$type = explode(".", $album_image);
|
332 |
-
$thumbnail_image_path =
|
333 |
|
334 |
$result = generate_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
|
335 |
return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
|
302 |
}
|
303 |
function process_image_upload($image, $width, $height)
|
304 |
{
|
305 |
+
$temp_image_path = GALLERY_MAIN_UPLOAD_DIR . $image;
|
306 |
$temp_image_name = $image;
|
307 |
list(, , $temp_image_type) = getimagesize($temp_image_path);
|
308 |
if ($temp_image_type === NULL) {
|
309 |
return false;
|
310 |
}
|
311 |
+
$uploaded_image_path = GALLERY_MAIN_UPLOAD_DIR . $temp_image_name;
|
312 |
move_uploaded_file($temp_image_path, $uploaded_image_path);
|
313 |
$type = explode(".", $image);
|
314 |
+
$thumbnail_image_path = GALLERY_MAIN_THUMB_DIR . preg_replace("{\\.[^\\.]+$}", ".".$type[1], $temp_image_name);
|
315 |
|
316 |
$result = generate_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
|
317 |
return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
|
320 |
/******************************************Code for Album cover thumbs Creation**********************/
|
321 |
function process_album_upload($album_image, $width, $height)
|
322 |
{
|
323 |
+
$temp_image_path = GALLERY_MAIN_UPLOAD_DIR . $album_image;
|
324 |
$temp_image_name = $album_image;
|
325 |
list(, , $temp_image_type) = getimagesize($temp_image_path);
|
326 |
if ($temp_image_type === NULL) {
|
327 |
return false;
|
328 |
}
|
329 |
+
$uploaded_image_path = GALLERY_MAIN_UPLOAD_DIR . $temp_image_name;
|
330 |
move_uploaded_file($temp_image_path, $uploaded_image_path);
|
331 |
$type = explode(".", $album_image);
|
332 |
+
$thumbnail_image_path = GALLERY_MAIN_ALB_THUMB_DIR . preg_replace("{\\.[^\\.]+$}", ".".$type[1], $temp_image_name);
|
333 |
|
334 |
$result = generate_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
|
335 |
return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
|
lib/install-script.php
CHANGED
@@ -3,7 +3,7 @@ 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");
|
5 |
$version = get_option("gallery-bank-pro-edition");
|
6 |
-
if($version
|
7 |
{
|
8 |
if (count($wpdb->get_var("SHOW TABLES LIKE '" . gallery_bank_albums() . "'")) == 0)
|
9 |
{
|
@@ -69,126 +69,79 @@ if($version != "3.0")
|
|
69 |
$album_id = 0;
|
70 |
for($flag = 0; $flag < count($album_pics); $flag++)
|
71 |
{
|
72 |
-
|
73 |
{
|
74 |
-
|
75 |
-
|
76 |
-
$wpdb->
|
77 |
-
(
|
78 |
-
$wpdb->prepare
|
79 |
-
(
|
80 |
-
"INSERT INTO " . gallery_bank_pics() . "(pic_id, album_id, title, description, thumbnail_url,
|
81 |
-
sorting_order, date, url, video, tags, pic_name, album_cover) VALUES(%d, %d, %s, %s, %s, %d, %s,
|
82 |
-
%s, %d, %s, %s, %d)",
|
83 |
-
$album_pics[$flag]->pic_id,
|
84 |
-
$album_pics[$flag]->album_id,
|
85 |
-
$album_pics[$flag]->title,
|
86 |
-
$album_pics[$flag]->description,
|
87 |
-
$album_pics[$flag]->thumbnail_url,
|
88 |
-
$album_pics[$flag]->sorting_order,
|
89 |
-
$album_pics[$flag]->date,
|
90 |
-
$album_pics[$flag]->url,
|
91 |
-
$album_pics[$flag]->video,
|
92 |
-
isset($album_pics[$flag]->tags) ? $album_pics[$flag]->tags : "" ,
|
93 |
-
isset($album_pics[$flag]->pic_path) ? $album_pics[$flag]->pic_path : "",
|
94 |
-
0
|
95 |
-
)
|
96 |
-
);
|
97 |
-
}
|
98 |
-
else
|
99 |
-
{
|
100 |
-
$file_path = explode("/", $album_pics[$flag]->pic_path);
|
101 |
-
$destination = UPLOADED_IMAGE_DESTINATION . $file_path[count($file_path) - 1];
|
102 |
-
|
103 |
-
if (PHP_VERSION > 5)
|
104 |
-
{
|
105 |
-
copy($album_pics[$flag]->pic_path, $destination);
|
106 |
-
}
|
107 |
-
else
|
108 |
-
{
|
109 |
-
$content = file_get_contents($album_pics[$flag]->pic_path);
|
110 |
-
$fp = fopen($destination, "w");
|
111 |
-
fwrite($fp, $content);
|
112 |
-
fclose($fp);
|
113 |
-
}
|
114 |
-
if(file_exists($destination))
|
115 |
-
{
|
116 |
-
process_image_upload($file_path[count($file_path) - 1], 160, 120);
|
117 |
-
}
|
118 |
-
|
119 |
-
$wpdb->query
|
120 |
(
|
121 |
-
|
122 |
-
(
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
)
|
139 |
-
);
|
140 |
-
if($album_id != $album_pics[$flag]->album_id)
|
141 |
-
{
|
142 |
-
process_album_upload($file_path[count($file_path) - 1], 160, 120);
|
143 |
-
}
|
144 |
-
$album_id = $album_pics[$flag]->album_id;
|
145 |
-
}
|
146 |
}
|
147 |
else
|
148 |
{
|
149 |
-
$file_path =
|
150 |
-
|
|
|
|
|
|
|
|
|
151 |
|
152 |
if (PHP_VERSION > 5)
|
153 |
{
|
154 |
-
copy(
|
155 |
}
|
156 |
else
|
157 |
{
|
158 |
-
$content = file_get_contents(
|
159 |
$fp = fopen($destination, "w");
|
160 |
fwrite($fp, $content);
|
161 |
fclose($fp);
|
162 |
}
|
163 |
if(file_exists($destination))
|
164 |
{
|
165 |
-
process_image_upload($
|
166 |
}
|
167 |
|
168 |
$wpdb->query
|
|
|
|
|
169 |
(
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
)
|
188 |
-
);
|
189 |
if($album_id != $album_pics[$flag]->album_id)
|
190 |
{
|
191 |
-
process_album_upload($
|
192 |
}
|
193 |
$album_id = $album_pics[$flag]->album_id;
|
194 |
}
|
@@ -206,37 +159,42 @@ if($version != "3.0")
|
|
206 |
|
207 |
create_table_album_settings();
|
208 |
}
|
|
|
|
|
|
|
|
|
|
|
209 |
}
|
210 |
-
|
211 |
/******************************************Code for Thumbnails Creation**********************/
|
|
|
212 |
function process_image_upload($image, $width, $height)
|
213 |
{
|
214 |
-
$temp_image_path =
|
215 |
$temp_image_name = $image;
|
216 |
list(, , $temp_image_type) = getimagesize($temp_image_path);
|
217 |
if ($temp_image_type === NULL) {
|
218 |
return false;
|
219 |
}
|
220 |
-
$uploaded_image_path =
|
221 |
move_uploaded_file($temp_image_path, $uploaded_image_path);
|
222 |
$type = explode(".", $image);
|
223 |
-
$thumbnail_image_path =
|
224 |
|
225 |
$result = generate_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
|
226 |
return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
|
227 |
}
|
228 |
function process_album_upload($album_image, $width, $height)
|
229 |
{
|
230 |
-
$temp_image_path =
|
231 |
$temp_image_name = $album_image;
|
232 |
list(, , $temp_image_type) = getimagesize($temp_image_path);
|
233 |
if ($temp_image_type === NULL) {
|
234 |
return false;
|
235 |
}
|
236 |
-
$uploaded_image_path =
|
237 |
move_uploaded_file($temp_image_path, $uploaded_image_path);
|
238 |
$type = explode(".", $album_image);
|
239 |
-
$thumbnail_image_path =
|
240 |
|
241 |
$result = generate_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
|
242 |
return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
|
@@ -291,7 +249,7 @@ if($version != "3.0")
|
|
291 |
album_name VARCHAR(100),
|
292 |
author VARCHAR(100),
|
293 |
album_date DATE,
|
294 |
-
description TEXT,
|
295 |
album_order INTEGER(10),
|
296 |
PRIMARY KEY (album_id)
|
297 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
|
@@ -330,5 +288,5 @@ if($version != "3.0")
|
|
330 |
include_once (GALLERY_BK_PLUGIN_DIR . "/lib/include_settings.php");
|
331 |
|
332 |
}
|
333 |
-
|
334 |
?>
|
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");
|
5 |
$version = get_option("gallery-bank-pro-edition");
|
6 |
+
if($version == "")
|
7 |
{
|
8 |
if (count($wpdb->get_var("SHOW TABLES LIKE '" . gallery_bank_albums() . "'")) == 0)
|
9 |
{
|
69 |
$album_id = 0;
|
70 |
for($flag = 0; $flag < count($album_pics); $flag++)
|
71 |
{
|
72 |
+
if($album_pics[$flag]->video == 1)
|
73 |
{
|
74 |
+
$wpdb->query
|
75 |
+
(
|
76 |
+
$wpdb->prepare
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
(
|
78 |
+
"INSERT INTO " . gallery_bank_pics() . "(pic_id, album_id, title, description, thumbnail_url,
|
79 |
+
sorting_order, date, url, video, tags, pic_name, album_cover) VALUES(%d, %d, %s, %s, %s, %d, %s,
|
80 |
+
%s, %d, %s, %s, %d)",
|
81 |
+
$album_pics[$flag]->pic_id,
|
82 |
+
$album_pics[$flag]->album_id,
|
83 |
+
$album_pics[$flag]->title,
|
84 |
+
$album_pics[$flag]->description,
|
85 |
+
$album_pics[$flag]->thumbnail_url,
|
86 |
+
$album_pics[$flag]->sorting_order,
|
87 |
+
$album_pics[$flag]->date,
|
88 |
+
$album_pics[$flag]->url,
|
89 |
+
isset($album_pics[$flag]->video) ? $album_pics[$flag]->video : 0,
|
90 |
+
isset($album_pics[$flag]->tags) ? $album_pics[$flag]->tags : "" ,
|
91 |
+
isset($album_pics[$flag]->pic_path) ? $album_pics[$flag]->pic_path : "",
|
92 |
+
0
|
93 |
+
)
|
94 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
else
|
97 |
{
|
98 |
+
$file_path = $album_pics[$flag]->pic_path;
|
99 |
+
|
100 |
+
$file_name_exct = explode("/", $album_pics[$flag]->pic_path);
|
101 |
+
$file_name = $file_name_exct[count($file_name_exct) - 1];
|
102 |
+
$src = str_replace(site_url("/"), "", $file_path);
|
103 |
+
$destination = GALLERY_MAIN_UPLOAD_DIR.$file_name;
|
104 |
|
105 |
if (PHP_VERSION > 5)
|
106 |
{
|
107 |
+
copy(ABSPATH.$src, $destination);
|
108 |
}
|
109 |
else
|
110 |
{
|
111 |
+
$content = file_get_contents(ABSPATH.$src);
|
112 |
$fp = fopen($destination, "w");
|
113 |
fwrite($fp, $content);
|
114 |
fclose($fp);
|
115 |
}
|
116 |
if(file_exists($destination))
|
117 |
{
|
118 |
+
process_image_upload($file_name, 160, 120);
|
119 |
}
|
120 |
|
121 |
$wpdb->query
|
122 |
+
(
|
123 |
+
$wpdb->prepare
|
124 |
(
|
125 |
+
"INSERT INTO " . gallery_bank_pics() . "(pic_id, album_id, title, description, thumbnail_url,
|
126 |
+
sorting_order, date, url, video, tags, pic_name, album_cover) VALUES(%d, %d, %s, %s, %s, %d, %s,
|
127 |
+
%s, %d, %s, %s, %d)",
|
128 |
+
$album_pics[$flag]->pic_id,
|
129 |
+
$album_pics[$flag]->album_id,
|
130 |
+
$album_pics[$flag]->title,
|
131 |
+
$album_pics[$flag]->description,
|
132 |
+
$file_name,
|
133 |
+
$album_pics[$flag]->sorting_order,
|
134 |
+
$album_pics[$flag]->date,
|
135 |
+
$album_pics[$flag]->url,
|
136 |
+
$album_pics[$flag]->video,
|
137 |
+
isset($album_pics[$flag]->tags) ? $album_pics[$flag]->tags : "" ,
|
138 |
+
$file_name,
|
139 |
+
$album_id == $album_pics[$flag]->album_id ? 0 : 1
|
140 |
+
)
|
141 |
+
);
|
|
|
|
|
142 |
if($album_id != $album_pics[$flag]->album_id)
|
143 |
{
|
144 |
+
process_album_upload($file_name, 160, 120);
|
145 |
}
|
146 |
$album_id = $album_pics[$flag]->album_id;
|
147 |
}
|
159 |
|
160 |
create_table_album_settings();
|
161 |
}
|
162 |
+
update_option("gallery-bank-pro-edition", "3.1");
|
163 |
+
}
|
164 |
+
else if($version == "3.0")
|
165 |
+
{
|
166 |
+
update_option("gallery-bank-pro-edition", "3.1");
|
167 |
}
|
|
|
168 |
/******************************************Code for Thumbnails Creation**********************/
|
169 |
+
|
170 |
function process_image_upload($image, $width, $height)
|
171 |
{
|
172 |
+
$temp_image_path = GALLERY_MAIN_UPLOAD_DIR . $image;
|
173 |
$temp_image_name = $image;
|
174 |
list(, , $temp_image_type) = getimagesize($temp_image_path);
|
175 |
if ($temp_image_type === NULL) {
|
176 |
return false;
|
177 |
}
|
178 |
+
$uploaded_image_path = GALLERY_MAIN_UPLOAD_DIR . $temp_image_name;
|
179 |
move_uploaded_file($temp_image_path, $uploaded_image_path);
|
180 |
$type = explode(".", $image);
|
181 |
+
$thumbnail_image_path = GALLERY_MAIN_THUMB_DIR . preg_replace('{\\.[^\\.]+$}', '.'.$type[1], $temp_image_name);
|
182 |
|
183 |
$result = generate_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
|
184 |
return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
|
185 |
}
|
186 |
function process_album_upload($album_image, $width, $height)
|
187 |
{
|
188 |
+
$temp_image_path = GALLERY_MAIN_UPLOAD_DIR . $album_image;
|
189 |
$temp_image_name = $album_image;
|
190 |
list(, , $temp_image_type) = getimagesize($temp_image_path);
|
191 |
if ($temp_image_type === NULL) {
|
192 |
return false;
|
193 |
}
|
194 |
+
$uploaded_image_path = GALLERY_MAIN_UPLOAD_DIR . $temp_image_name;
|
195 |
move_uploaded_file($temp_image_path, $uploaded_image_path);
|
196 |
$type = explode(".", $album_image);
|
197 |
+
$thumbnail_image_path = GALLERY_MAIN_ALB_THUMB_DIR . preg_replace("{\\.[^\\.]+$}", ".".$type[1], $temp_image_name);
|
198 |
|
199 |
$result = generate_thumbnail($uploaded_image_path, $thumbnail_image_path, $width, $height);
|
200 |
return $result ? array($uploaded_image_path, $thumbnail_image_path) : false;
|
249 |
album_name VARCHAR(100),
|
250 |
author VARCHAR(100),
|
251 |
album_date DATE,
|
252 |
+
description TEXT ,
|
253 |
album_order INTEGER(10),
|
254 |
PRIMARY KEY (album_id)
|
255 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
|
288 |
include_once (GALLERY_BK_PLUGIN_DIR . "/lib/include_settings.php");
|
289 |
|
290 |
}
|
291 |
+
|
292 |
?>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Gallery-Bank,contact-banker
|
|
3 |
Tags: admin, album, best gallery plugin, best portfolio plugin, comments, easy media gallery, filterable gallery, filterable portfolio, gallery, gallery album, gallery bank, gallery wordpress plugin, google, grid gallery, html5 mp3 player, html5, mp4 player, image, image album, image slider, images, links, media, nextgen, page, pagination gallery, pagination portfolio, photo album, photo albums, photo gallery, photo slider, photos, pictures, plugin, portfolio, portfolio gallery, portfolio wordpress plugin, post, posts, responsive gallery, seo image,sidebar, slideshow, thumbnails, twitter, videos, widget, wordpress gallery plugin, wordpress portfolio plugin, wp gallery, wp gallery plugin
|
4 |
Requires at least: 3.3
|
5 |
Tested up to: 3.8.1
|
6 |
-
Stable tag: 3.0.
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -45,7 +45,7 @@ It provides a powerful engine for uploading and managing galleries of images & v
|
|
45 |
|
46 |
Gallery Bank is designed to adapt each portfolio to any situation and can be easily used on mobiles as it is a Responsive Plugin.
|
47 |
|
48 |
-
***March
|
49 |
|
50 |
<a href="http://tech-banker.com/forum/gallery-bank-support/" target="_blank">Support Desk - feel free to ask your Queries</a>
|
51 |
|
@@ -220,6 +220,13 @@ With Global Settings, you can define different settings for Thumbnails, Albums,
|
|
220 |
|
221 |
== Changelog ==
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
= 3.0.3 =
|
224 |
|
225 |
* Updated Spanish Languages
|
3 |
Tags: admin, album, best gallery plugin, best portfolio plugin, comments, easy media gallery, filterable gallery, filterable portfolio, gallery, gallery album, gallery bank, gallery wordpress plugin, google, grid gallery, html5 mp3 player, html5, mp4 player, image, image album, image slider, images, links, media, nextgen, page, pagination gallery, pagination portfolio, photo album, photo albums, photo gallery, photo slider, photos, pictures, plugin, portfolio, portfolio gallery, portfolio wordpress plugin, post, posts, responsive gallery, seo image,sidebar, slideshow, thumbnails, twitter, videos, widget, wordpress gallery plugin, wordpress portfolio plugin, wp gallery, wp gallery plugin
|
4 |
Requires at least: 3.3
|
5 |
Tested up to: 3.8.1
|
6 |
+
Stable tag: 3.0.4
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
45 |
|
46 |
Gallery Bank is designed to adapt each portfolio to any situation and can be easily used on mobiles as it is a Responsive Plugin.
|
47 |
|
48 |
+
***March 18, 2014: We're happy to announce that Gallery Bank reached 91,550+ plugin downloads in only 10 months. We frequently receive positive feedback from people using our Gallery Bank Plugin for WordPress. Thanks so much for your support!***
|
49 |
|
50 |
<a href="http://tech-banker.com/forum/gallery-bank-support/" target="_blank">Support Desk - feel free to ask your Queries</a>
|
51 |
|
220 |
|
221 |
== Changelog ==
|
222 |
|
223 |
+
= 3.0.4 =
|
224 |
+
|
225 |
+
* Updated Languages
|
226 |
+
* Fixed Few Bugs Related to Thumbnails generation
|
227 |
+
* Fixed Copy Images for existing albums to new folder
|
228 |
+
* Fixed Problem of loosing images when upgrading to latest versions.
|
229 |
+
|
230 |
= 3.0.3 =
|
231 |
|
232 |
* Updated Spanish Languages
|
upload.php
CHANGED
@@ -38,7 +38,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
|
|
38 |
// usleep(5000);
|
39 |
|
40 |
// Settings
|
41 |
-
$targetDir = dirname(__FILE__) . "/gallery-uploads";
|
42 |
$cleanupTargetDir = true; // Remove old files
|
43 |
$maxFileAge = 5 * 3600; // Temp file age in seconds
|
44 |
|
38 |
// usleep(5000);
|
39 |
|
40 |
// Settings
|
41 |
+
$targetDir = (dirname(dirname(dirname(__FILE__)))) . "/gallery-bank/gallery-uploads/";
|
42 |
$cleanupTargetDir = true; // Remove old files
|
43 |
$maxFileAge = 5 * 3600; // Temp file age in seconds
|
44 |
|
views/header.php
CHANGED
@@ -32,6 +32,6 @@ if(in_array($language, $gb_lang))
|
|
32 |
</div>
|
33 |
<div class="message red" style="display: block;margin-top:15px">
|
34 |
<span>
|
35 |
-
<strong>If you are getting problems with thumbnails, then you need to set 777(write) permissions to
|
36 |
</span>
|
37 |
</div>
|
32 |
</div>
|
33 |
<div class="message red" style="display: block;margin-top:15px">
|
34 |
<span>
|
35 |
+
<strong>If you are getting problems with thumbnails, then you need to set 777(write) permissions to <?php echo GALLERY_MAIN_DIR ?> (recursive files & directories) in order to save the images/thumbnails. </strong>
|
36 |
</span>
|
37 |
</div>
|