Gallery – Flagallery Photo Portfolio - Version 4.00

Version Description

Download this release

Release Info

Developer pasyuk
Plugin Icon 128x128 Gallery – Flagallery Photo Portfolio
Version 4.00
Comparing to
See all releases

Code changes from version 3.20 to 4.00

Files changed (60) hide show
  1. admin/addgallery.php +14 -4
  2. admin/admin.php +0 -2
  3. admin/ajax.php +3 -4
  4. admin/banner-box.php +1 -1
  5. admin/banner-sort.php +0 -1
  6. admin/banner.functions.php +0 -2
  7. admin/db_skin_color_scheme.php +1 -1
  8. admin/facebook-tool.php +0 -3
  9. admin/flag_install.php +28 -31
  10. admin/functions.php +128 -47
  11. admin/get_skin.php +0 -2
  12. admin/grab_meta.php +0 -1
  13. admin/jgallery.php +8 -3
  14. admin/js/script.js +3 -3
  15. admin/manage-banner.php +0 -2
  16. admin/manage-galleries.php +1 -1
  17. admin/manage-images.php +11 -4
  18. admin/manage-playlist.php +0 -2
  19. admin/manage-sort.php +0 -1
  20. admin/manage-video.php +0 -2
  21. admin/manage.php +15 -6
  22. admin/media-upload.php +0 -1
  23. admin/meta_box.php +9 -15
  24. admin/music-box.php +1 -1
  25. admin/overview.php +0 -1
  26. admin/playlist-sort.php +0 -1
  27. admin/playlist.functions.php +0 -2
  28. admin/settings.php +11 -8
  29. admin/showmeta.php +2 -2
  30. admin/skin_install.php +0 -2
  31. admin/skin_options.php +34 -8
  32. admin/skins.php +6 -2
  33. admin/tinymce/tinymce.php +0 -3
  34. admin/tuning.php +0 -1
  35. admin/upgrade.php +0 -2
  36. admin/upload.php +0 -2
  37. admin/video-box.php +1 -1
  38. admin/video-sort.php +0 -1
  39. admin/video.functions.php +0 -2
  40. admin/wpmu.php +0 -1
  41. flag-config.php +0 -1
  42. flag.php +53 -55
  43. flagshow.php +0 -1
  44. lib/app.php +85 -11
  45. lib/class.swfobject.php +0 -1
  46. lib/constructor.php +0 -2
  47. lib/core.php +50 -10
  48. lib/flag-db.php +7 -8
  49. lib/flv.php +0 -1
  50. lib/gallery.php +0 -2
  51. lib/gd.thumbnail.inc.php +0 -1
  52. lib/hitcounter.php +0 -1
  53. lib/image.php +2 -1
  54. lib/media-rss.php +0 -2
  55. lib/meta.php +65 -51
  56. lib/shortcodes.php +3 -3
  57. lib/swfobject.php +0 -2
  58. readme.txt +12 -4
  59. widgets/widgets.php +0 -3
  60. xml/media-rss.php +0 -1
admin/addgallery.php CHANGED
@@ -24,6 +24,12 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
24
  }
25
  if ($_POST['uploadimage']){
26
  check_admin_referer('flag_upload');
 
 
 
 
 
 
27
  if ($_FILES['MF__F_0_0']['error'] == 0) {
28
  flagAdmin::upload_images();
29
  }
@@ -51,7 +57,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
51
  }
52
 
53
  //get all galleries (after we added new ones)
54
- $gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
55
 
56
  ?>
57
 
@@ -115,7 +121,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
115
  <?php wp_nonce_field('flag_upload'); ?>
116
  <table class="form-table">
117
  <tr valign="top">
118
- <td style="width: 216px;"><label for="galleryselect"><?php _e('in to', 'flag'); ?></label>
119
  <select name="galleryselect" id="galleryselect" style="width: 200px">
120
  <option value="0" ><?php _e('Choose gallery', 'flag'); ?></option>
121
  <?php $ingallery = isset($_GET['gid']) ? (int) $_GET['gid'] : '';
@@ -131,6 +137,11 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
131
  </select>
132
  <?php echo $maxsize; ?>
133
  <br /><?php if ((IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck')) display_space_usage(); ?>
 
 
 
 
 
134
 
135
  <div class="submit">
136
  <span class="useflashupload">
@@ -192,7 +203,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
192
 
193
  UploadFile: function(up, file) {
194
  console.log('[UploadFile]', file);
195
- up.settings.multipart_params = { galleryselect: jQuery('#galleryselect').val(), last: files_remaining };
196
  files_remaining--;
197
  // You can override settings before the file is uploaded
198
  // up.settings.url = 'upload.php?id=' + file.id;
@@ -334,4 +345,3 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
334
  </div>
335
  <?php
336
  }
337
- ?>
24
  }
25
  if ($_POST['uploadimage']){
26
  check_admin_referer('flag_upload');
27
+
28
+ $flag->options['thumbWidth'] = intval($_POST['thumbWidth'])? intval($_POST['thumbWidth']) : 100;
29
+ $flag->options['thumbHeight'] = intval($_POST['thumbHeight'])? intval($_POST['thumbHeight']) : 100;
30
+ $flag->options['thumbFix'] = isset($_POST['thumbFix'])? 1 : 0;
31
+ update_option('flag_options', $flag->options);
32
+
33
  if ($_FILES['MF__F_0_0']['error'] == 0) {
34
  flagAdmin::upload_images();
35
  }
57
  }
58
 
59
  //get all galleries (after we added new ones)
60
+ $gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir'], false, 0, 0, 0, true);
61
 
62
  ?>
63
 
121
  <?php wp_nonce_field('flag_upload'); ?>
122
  <table class="form-table">
123
  <tr valign="top">
124
+ <td style="width: 216px;"><label for="galleryselect"><?php _e('Upload images in', 'flag'); ?> *</label>
125
  <select name="galleryselect" id="galleryselect" style="width: 200px">
126
  <option value="0" ><?php _e('Choose gallery', 'flag'); ?></option>
127
  <?php $ingallery = isset($_GET['gid']) ? (int) $_GET['gid'] : '';
137
  </select>
138
  <?php echo $maxsize; ?>
139
  <br /><?php if ((IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck')) display_space_usage(); ?>
140
+ <br />
141
+ <p><?php _e('Thumbnail WIDTH x HEIGHT (in pixel)','flag'); ?> *
142
+ <br /><input type="text" size="5" maxlength="5" name="thumbWidth" id="thumbWidth" value="<?php echo $flag->options['thumbWidth']; ?>" /> x <input type="text" size="5" maxlength="5" name="thumbHeight" id="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>" />
143
+ <br /><small><?php _e('These values are maximum values ','flag'); ?></small></p>
144
+ <p><label><input type="checkbox" name="thumbFix" id="thumbFix" value="1" <?php checked('1', $flag->options['thumbFix']); ?> /> <?php _e('Ignore the aspect ratio, no portrait thumbnails','flag'); ?></label></p>
145
 
146
  <div class="submit">
147
  <span class="useflashupload">
203
 
204
  UploadFile: function(up, file) {
205
  console.log('[UploadFile]', file);
206
+ up.settings.multipart_params = { galleryselect: jQuery('#galleryselect').val(), thumbw: jQuery('#thumbWidth').val(), thumbh: jQuery('#thumbHeight').val(), thumbf: jQuery('#thumbFix').prop("checked"), last: files_remaining };
207
  files_remaining--;
208
  // You can override settings before the file is uploaded
209
  // up.settings.url = 'upload.php?id=' + file.id;
345
  </div>
346
  <?php
347
  }
 
admin/admin.php CHANGED
@@ -295,5 +295,3 @@ function flag_wpmu_site_admin() {
295
 
296
  return false;
297
  }
298
-
299
- ?>
295
 
296
  return false;
297
  }
 
 
admin/ajax.php CHANGED
@@ -23,11 +23,12 @@ function flag_ajax_operation() {
23
  switch ( $_POST['operation'] ) {
24
  case 'create_thumbnail' :
25
  $result = flagAdmin::create_thumbnail($picture);
26
- do_action('flag_thumbnail_created', $picture);
27
  break;
28
  case 'resize_image' :
29
  $result = flagAdmin::resize_image($picture);
30
- do_action('flag_image_resized', $picture);
 
 
31
  break;
32
  case 'import_metadata' :
33
  $result = flagAdmin::import_MetaData( $id );
@@ -268,5 +269,3 @@ function flag_ajax_file_browser() {
268
 
269
  die();
270
  }
271
-
272
- ?>
23
  switch ( $_POST['operation'] ) {
24
  case 'create_thumbnail' :
25
  $result = flagAdmin::create_thumbnail($picture);
 
26
  break;
27
  case 'resize_image' :
28
  $result = flagAdmin::resize_image($picture);
29
+ break;
30
+ case 'webview_image' :
31
+ $result = flagAdmin::webview_image($picture);
32
  break;
33
  case 'import_metadata' :
34
  $result = flagAdmin::import_MetaData( $id );
269
 
270
  die();
271
  }
 
 
admin/banner-box.php CHANGED
@@ -549,4 +549,4 @@ if($bannerlist) {
549
  </form>
550
  </div>
551
  <!-- /#new_playlist -->
552
- <?php } ?>
549
  </form>
550
  </div>
551
  <!-- /#new_playlist -->
552
+ <?php }
admin/banner-sort.php CHANGED
@@ -113,4 +113,3 @@ if(count($items_a)) {
113
 
114
  <?php
115
  }
116
- ?>
113
 
114
  <?php
115
  }
 
admin/banner.functions.php CHANGED
@@ -193,5 +193,3 @@ function flag_b_playlist_delete($playlist) {
193
  }
194
  }
195
  }
196
-
197
- ?>
193
  }
194
  }
195
  }
 
 
admin/db_skin_color_scheme.php CHANGED
@@ -119,4 +119,4 @@ jQuery(document).ready(function() {
119
  <div class="clear"> &nbsp; </div>
120
  <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
121
  </div></form>
122
- <?php } ?>
119
  <div class="clear"> &nbsp; </div>
120
  <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
121
  </div></form>
122
+ <?php }
admin/facebook-tool.php CHANGED
@@ -268,6 +268,3 @@ function fb_url(galleries,skin,h,l) {
268
  </table>
269
  </fieldset></form>
270
  </div>
271
- <?php
272
-
273
- ?>
268
  </table>
269
  </fieldset></form>
270
  </div>
 
 
 
admin/flag_install.php CHANGED
@@ -32,7 +32,7 @@ function flag_install () {
32
  $charset_collate .= " COLLATE $wpdb->collate";
33
  }
34
 
35
- $flagpictures = $wpdb->prefix . 'flag_pictures';
36
  $flaggallery = $wpdb->prefix . 'flag_gallery';
37
  $flagcomments = $wpdb->prefix . 'flag_comments';
38
  $flagalbum = $wpdb->prefix . 'flag_album';
@@ -219,45 +219,46 @@ function flag_list_options() {
219
  $flag_options['flashHeight'] = '500';
220
 
221
  // Image Settings
222
- $flag_options['imgWidth'] = 800; // Image Width
223
  $flag_options['imgHeight'] = 600; // Image height
224
  $flag_options['imgQuality'] = 85; // Image Quality
225
-
 
226
  // Thumbnail Settings
227
  $flag_options['thumbWidth'] = 100; // Thumb Width
228
  $flag_options['thumbHeight'] = 100; // Thumb height
229
- $flag_options['thumbFix'] = true; // Fix the dimension
230
  $flag_options['thumbQuality'] = 100; // Thumb Quality
231
 
232
  // Flash default skin colors settings TODO remove old settings
233
  $flag_options['flashBacktransparent'] = false;
234
- $flag_options['flashBackcolor'] = '262626';
235
- $flag_options['buttonsBG'] = '000000';
236
- $flag_options['buttonsMouseOver'] = '7485c2';
237
- $flag_options['buttonsMouseOut'] = '717171';
238
- $flag_options['catButtonsMouseOver'] = '000000';
239
- $flag_options['catButtonsMouseOut'] = '000000';
240
  $flag_options['catButtonsTextMouseOver']= '7485c2';
241
  $flag_options['catButtonsTextMouseOut'] = 'bcbcbc';
242
- $flag_options['thumbMouseOver'] = '7485c2';
243
- $flag_options['thumbMouseOut'] = '000000';
244
- $flag_options['mainTitle'] = 'ffffff';
245
- $flag_options['categoryTitle'] = '7485c2';
246
- $flag_options['itemBG'] = 'eae6ef';
247
- $flag_options['itemTitle'] = '7485c2';
248
- $flag_options['itemDescription'] = 'e0e0e0';
249
 
250
  // Alternative gallery colors
251
  $flag_options['jAlterGal'] = true;
252
- $flag_options['jAlterGalScript'] = 1; // If '0' - use FancyBox script
253
- $flag_options['disableViews'] = 0;
254
- $flag_options['BarsBG'] = '292929';
255
  $flag_options['CatBGColor'] = '292929';
256
- $flag_options['CatBGColorOver'] = '737373';
257
- $flag_options['CatColor'] = 'ffffff';
258
  $flag_options['CatColorOver'] = 'ffffff';
259
- $flag_options['ThumbBG'] = 'ffffff';
260
- $flag_options['ThumbLoaderColor'] = '4a4a4a';
261
  $flag_options['TitleColor'] = 'ff9900';
262
  $flag_options['DescrColor'] = 'cfcfcf';
263
 
@@ -265,14 +266,14 @@ function flag_list_options() {
265
  $flag_options['videoBG'] = '000000';
266
  $flag_options['vmColor1'] = 'ffffff';
267
  $flag_options['vmColor2'] = '3283A7';
268
- $flag_options['vmAutoplay'] = 'true';
269
  $flag_options['vmWidth'] = '520';
270
  $flag_options['vmHeight'] = '304';
271
 
272
- $flag_options['mpBG'] = '4f4f4f';
273
  $flag_options['mpColor1'] = 'ffffff';
274
  $flag_options['mpColor2'] = '3283A7';
275
- $flag_options['mpAutoplay'] = 'false';
276
 
277
  $flag_options['advanced'] = false; // Advanced options
278
 
@@ -336,7 +337,3 @@ function flag_uninstall() {
336
  flag_remove_capability("FlAG Manage banners");
337
  flag_remove_capability("FlAG Facebook page");
338
  }
339
-
340
-
341
-
342
- ?>
32
  $charset_collate .= " COLLATE $wpdb->collate";
33
  }
34
 
35
+ $flagpictures = $wpdb->prefix . 'flag_pictures';
36
  $flaggallery = $wpdb->prefix . 'flag_gallery';
37
  $flagcomments = $wpdb->prefix . 'flag_comments';
38
  $flagalbum = $wpdb->prefix . 'flag_album';
219
  $flag_options['flashHeight'] = '500';
220
 
221
  // Image Settings
222
+ $flag_options['imgWidth'] = 800; // Image Width
223
  $flag_options['imgHeight'] = 600; // Image height
224
  $flag_options['imgQuality'] = 85; // Image Quality
225
+ $flag_options['optimized_imgs'] = false; // Image Quality
226
+
227
  // Thumbnail Settings
228
  $flag_options['thumbWidth'] = 100; // Thumb Width
229
  $flag_options['thumbHeight'] = 100; // Thumb height
230
+ $flag_options['thumbFix'] = true; // Fix the dimension
231
  $flag_options['thumbQuality'] = 100; // Thumb Quality
232
 
233
  // Flash default skin colors settings TODO remove old settings
234
  $flag_options['flashBacktransparent'] = false;
235
+ $flag_options['flashBackcolor'] = '262626';
236
+ $flag_options['buttonsBG'] = '000000';
237
+ $flag_options['buttonsMouseOver'] = '7485c2';
238
+ $flag_options['buttonsMouseOut'] = '717171';
239
+ $flag_options['catButtonsMouseOver'] = '000000';
240
+ $flag_options['catButtonsMouseOut'] = '000000';
241
  $flag_options['catButtonsTextMouseOver']= '7485c2';
242
  $flag_options['catButtonsTextMouseOut'] = 'bcbcbc';
243
+ $flag_options['thumbMouseOver'] = '7485c2';
244
+ $flag_options['thumbMouseOut'] = '000000';
245
+ $flag_options['mainTitle'] = 'ffffff';
246
+ $flag_options['categoryTitle'] = '7485c2';
247
+ $flag_options['itemBG'] = 'eae6ef';
248
+ $flag_options['itemTitle'] = '7485c2';
249
+ $flag_options['itemDescription'] = 'e0e0e0';
250
 
251
  // Alternative gallery colors
252
  $flag_options['jAlterGal'] = true;
253
+ $flag_options['jAlterGalScript'] = 1; // If '0' - use FancyBox script
254
+ $flag_options['disableViews'] = 0;
255
+ $flag_options['BarsBG'] = '292929';
256
  $flag_options['CatBGColor'] = '292929';
257
+ $flag_options['CatBGColorOver'] = '737373';
258
+ $flag_options['CatColor'] = 'ffffff';
259
  $flag_options['CatColorOver'] = 'ffffff';
260
+ $flag_options['ThumbBG'] = 'ffffff';
261
+ $flag_options['ThumbLoaderColor'] = '4a4a4a';
262
  $flag_options['TitleColor'] = 'ff9900';
263
  $flag_options['DescrColor'] = 'cfcfcf';
264
 
266
  $flag_options['videoBG'] = '000000';
267
  $flag_options['vmColor1'] = 'ffffff';
268
  $flag_options['vmColor2'] = '3283A7';
269
+ $flag_options['vmAutoplay'] = 'true';
270
  $flag_options['vmWidth'] = '520';
271
  $flag_options['vmHeight'] = '304';
272
 
273
+ $flag_options['mpBG'] = '4f4f4f';
274
  $flag_options['mpColor1'] = 'ffffff';
275
  $flag_options['mpColor2'] = '3283A7';
276
+ $flag_options['mpAutoplay'] = 'false';
277
 
278
  $flag_options['advanced'] = false; // Advanced options
279
 
337
  flag_remove_capability("FlAG Manage banners");
338
  flag_remove_capability("FlAG Facebook page");
339
  }
 
 
 
 
admin/functions.php CHANGED
@@ -5,6 +5,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
5
  /**
6
  * flagAdmin - Class for admin operation
7
  */
 
8
  class flagAdmin{
9
 
10
  /**
@@ -16,7 +17,7 @@ class flagAdmin{
16
  * @param bool $output if the function should show an error messsage or not
17
  * @return bool|int
18
  */
19
- static function create_gallery($gallery, $defaultpath, $output = true) {
20
  global $wpdb, $user_ID;
21
 
22
  // get the current user ID
@@ -81,6 +82,12 @@ class flagAdmin{
81
  $txt .= __('Unable to create directory ', 'flag').' <strong>' . $flagpath . '/thumbs !</strong>';
82
  }
83
 
 
 
 
 
 
 
84
  if (SAFE_MODE) {
85
  $help = __('The server setting Safe-Mode is on !', 'flag');
86
  $help .= '<br />'.__('If you have problems, please create directory', 'flag').' <strong>' . $flagpath . '</strong> ';
@@ -113,7 +120,7 @@ class flagAdmin{
113
 
114
  if ($result) {
115
  $message = __('Gallery \'%1$s\' successfully created.<br/>You can show this gallery with the tag %2$s.<br/>','flag');
116
- $message = sprintf($message, esc_html(stripcslashes($gallery)), '[flagallery gid=' . $gallery_id . ']');
117
  $message .= '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
118
  $message .= __('Edit gallery','flag');
119
  $message .= '</a>';
@@ -136,7 +143,7 @@ class flagAdmin{
136
  * @param string $galleryfolder contains relative path
137
  * @return void
138
  */
139
- static function import_gallery($galleryfolder) {
140
 
141
  global $wpdb, $user_ID;
142
 
@@ -223,7 +230,7 @@ class flagAdmin{
223
  * @param string $folder contains relative path
224
  * @return void
225
  */
226
- static function import_video($folder) {
227
 
228
 
229
  $created_msg = '';
@@ -265,7 +272,7 @@ class flagAdmin{
265
  * @param string $folder contains relative path
266
  * @return void
267
  */
268
- static function import_mp3($folder) {
269
 
270
  $created_msg = '';
271
  // remove trailing slash at the end, if somebody use it
@@ -306,7 +313,7 @@ class flagAdmin{
306
  * @param string $folder contains relative path
307
  * @return array
308
  */
309
- static function import_banner($folder) {
310
 
311
  $created_msg = '';
312
  // remove trailing slash at the end, if somebody use it
@@ -329,7 +336,7 @@ class flagAdmin{
329
  }
330
 
331
  //Handle an individual file import.
332
- function handle_import_file($file, $post_id = 0) {
333
  set_time_limit(120);
334
  $time = current_time('mysql');
335
  if ( $post = get_post($post_id) ) {
@@ -445,7 +452,7 @@ class flagAdmin{
445
  * @param array $ext
446
  * @return array
447
  */
448
- function scandir($dirname = '.', $ext = array()) {
449
  // thx to php.net :-)
450
  if(empty($ext))
451
  $ext = array('jpeg', 'jpg', 'png', 'gif');
@@ -467,18 +474,24 @@ class flagAdmin{
467
  * @param object | int $image contain all information about the image or the id
468
  * @return string result code
469
  */
470
- static function create_thumbnail($image) {
471
 
472
  global $flag;
473
-
474
- if(! class_exists('flag_Thumbnail'))
475
- require_once( flagGallery::graphic_library() );
476
-
477
  if ( is_numeric($image) )
478
  $image = flagdb::find_image( $image );
479
 
480
- if ( !is_object($image) )
481
  return __('Object didn\'t contain correct data','flag');
 
 
 
 
 
 
 
 
 
482
 
483
  // check for existing thumbnail
484
  if (file_exists($image->thumbPath))
@@ -512,7 +525,7 @@ class flagAdmin{
512
 
513
  // save the new thumbnail
514
  $thumb->save($image->thumbPath, $flag->options['thumbQuality']);
515
- flagAdmin::chmod ($image->thumbPath);
516
 
517
  //read the new sizes
518
  $new_size = @getimagesize ( $image->thumbPath );
@@ -527,7 +540,11 @@ class flagAdmin{
527
 
528
  if ( !empty($thumb->errmsg) )
529
  return $image->filename . ' (Error : '.$thumb->errmsg .')';
530
-
 
 
 
 
531
  // success
532
  return '1';
533
  }
@@ -541,7 +558,7 @@ class flagAdmin{
541
  * @param integer $height optional
542
  * @return string result code
543
  */
544
- static function resize_image($image, $width = 0, $height = 0) {
545
 
546
  global $flag;
547
 
@@ -552,7 +569,7 @@ class flagAdmin{
552
  $image = flagdb::find_image( $image );
553
 
554
  if ( !is_object($image) )
555
- return __('Object didn\'t contain correct data','flag');
556
 
557
  // before we start we import the meta data to database (required for uploads before V0.40)
558
  flagAdmin::maybe_import_meta( $image->pid );
@@ -580,6 +597,58 @@ class flagAdmin{
580
  return ' <strong>' . $image->filename . ' (Error : ' . $file->errmsg . ')</strong>';
581
  }
582
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
583
  return '1';
584
  }
585
 
@@ -592,7 +661,7 @@ class flagAdmin{
592
  * @param bool $name2alt
593
  * @return array $image_ids Id's which are sucessful added
594
  */
595
- function add_Images($galleryID, $imageslist, $name2alt = false) {
596
  global $wpdb;
597
 
598
  $alttext = '';
@@ -633,7 +702,7 @@ class flagAdmin{
633
  * @param array|int $imagesIds
634
  * @return bool
635
  */
636
- static function import_MetaData($imagesIds) {
637
 
638
  global $wpdb;
639
 
@@ -680,7 +749,7 @@ class flagAdmin{
680
  * @param array|int $imagesIds
681
  * @return bool
682
  */
683
- static function copy_MetaData($imagesIds) {
684
 
685
  global $wpdb;
686
 
@@ -728,7 +797,7 @@ class flagAdmin{
728
  * @param $id
729
  * @return array metadata
730
  */
731
- function get_MetaData($id) {
732
 
733
  require_once(FLAG_ABSPATH . 'lib/meta.php');
734
 
@@ -754,7 +823,7 @@ class flagAdmin{
754
  * @param int $id
755
  * @return mixed result
756
  */
757
- function maybe_import_meta( $id ) {
758
 
759
  require_once(FLAG_ABSPATH . 'lib/meta.php');
760
 
@@ -780,7 +849,7 @@ class flagAdmin{
780
  * @param mixed $p_header
781
  * @return bool
782
  */
783
- function getOnlyImages($p_event, $p_header) {
784
 
785
  $info = pathinfo($p_header['filename']);
786
  // check for extension
@@ -804,7 +873,7 @@ class flagAdmin{
804
  * @class flagAdmin
805
  * @return void
806
  */
807
- static function upload_images() {
808
 
809
  global $wpdb;
810
 
@@ -849,8 +918,8 @@ class flagAdmin{
849
  $filename = $filepart['basename'];
850
 
851
  // check for allowed extension and if it's an image file
852
- $ext = array('jpg', 'png', 'gif');
853
- if ( !in_array($filepart['extension'], $ext) || !@getimagesize($temp_file) ){
854
  flagGallery::show_error('<strong>' . $imagefiles['name'][$key] . ' </strong>' . __('is no valid image file!','flag'));
855
  continue;
856
  }
@@ -872,9 +941,11 @@ class flagAdmin{
872
 
873
  // save temp file to gallery
874
  if ( !@move_uploaded_file($temp_file, $dest_file) ){
875
- flagGallery::show_error(__('Error, the file could not moved to : ','flag') . $dest_file);
876
- flagAdmin::check_safemode( $gallery->abspath );
877
- continue;
 
 
878
  }
879
  if ( !flagAdmin::chmod($dest_file) ) {
880
  flagGallery::show_error(__('Error, the file permissions could not set','flag'));
@@ -914,7 +985,7 @@ class flagAdmin{
914
  */
915
  static function swfupload_image($galleryID = 0) {
916
 
917
- global $wpdb;
918
 
919
  if ($galleryID == 0) {
920
  //@unlink($temp_file);
@@ -937,8 +1008,10 @@ class flagAdmin{
937
 
938
  // check for allowed extension
939
  $ext = array('jpeg', 'jpg', 'png', 'gif');
940
- if (!in_array($filepart['extension'], $ext))
941
- return $filename . ' '. __('is no valid image file!','flag');
 
 
942
 
943
  // get the path to the gallery
944
  $gallerypath = $wpdb->get_var($wpdb->prepare("SELECT path FROM {$wpdb->flaggallery} WHERE gid = %d ", $galleryID));
@@ -960,9 +1033,11 @@ class flagAdmin{
960
 
961
  // save temp file to gallery
962
  if ( !@move_uploaded_file($temp_file, $dest_file) ){
963
- flagAdmin::check_safemode(WINABSPATH.$gallerypath);
964
- return __('Error, the file could not moved to : ','flag').$dest_file;
965
- }
 
 
966
 
967
  if ( !flagAdmin::chmod($dest_file) )
968
  return __('Error, the file permissions could not set','flag');
@@ -971,6 +1046,13 @@ class flagAdmin{
971
  $image_ids = flagAdmin::add_Images($galleryID, array($filename));
972
  $return = '';
973
  //create thumbnails
 
 
 
 
 
 
 
974
  foreach($image_ids as $picture){
975
  $return = flagAdmin::create_thumbnail($picture);
976
  }
@@ -1016,7 +1098,7 @@ class flagAdmin{
1016
  * @class flagAdmin
1017
  * @return bool $result
1018
  */
1019
- function check_quota() {
1020
 
1021
  if ( (IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck'))
1022
  if( $error = upload_is_user_over_quota( false ) ) {
@@ -1033,7 +1115,7 @@ class flagAdmin{
1033
  * @param string $filename
1034
  * @return bool $result
1035
  */
1036
- function chmod($filename = '') {
1037
 
1038
  $stat = @ stat(dirname($filename));
1039
  $perms = $stat['mode'] & 0007777;
@@ -1052,7 +1134,7 @@ class flagAdmin{
1052
  * @param string $foldername
1053
  * @return bool $result
1054
  */
1055
- static function check_safemode($foldername) {
1056
 
1057
  if ( SAFE_MODE ) {
1058
 
@@ -1077,7 +1159,7 @@ class flagAdmin{
1077
  * @param int $check_ID is the user_id
1078
  * @return bool $result
1079
  */
1080
- static function can_manage_this_gallery($check_ID) {
1081
 
1082
  global $user_ID, $wp_roles;
1083
 
@@ -1098,7 +1180,7 @@ class flagAdmin{
1098
  * @param int $dest_gid destination gallery
1099
  * @return void
1100
  */
1101
- static function move_images($pic_ids, $dest_gid) {
1102
 
1103
  $errors = '';
1104
  $count = 0;
@@ -1174,7 +1256,7 @@ class flagAdmin{
1174
  * @param int $dest_gid destination gallery
1175
  * @return void
1176
  */
1177
- static function copy_images($pic_ids, $dest_gid) {
1178
 
1179
  $errors = $messages = '';
1180
 
@@ -1267,7 +1349,7 @@ class flagAdmin{
1267
  * @param string $title name of the operation
1268
  * @return string the javascript output
1269
  */
1270
- static function do_ajax_operation( $operation, $image_array, $title = '' ) {
1271
 
1272
  if ( !is_array($image_array) || empty($image_array) )
1273
  return;
@@ -1305,7 +1387,7 @@ class flagAdmin{
1305
  * @param int $galleryID
1306
  * @return void
1307
  */
1308
- function set_gallery_preview( $galleryID ) {
1309
  global $wpdb;
1310
 
1311
  $galleryID = intval($galleryID);
@@ -1329,7 +1411,7 @@ class flagAdmin{
1329
  * @param int $galleryID
1330
  * @return array (JSON)
1331
  */
1332
- static function get_image_ids( $galleryID ) {
1333
 
1334
  if ( !function_exists('json_encode') )
1335
  return(-2);
@@ -1343,5 +1425,4 @@ class flagAdmin{
1343
  }
1344
 
1345
  } // END class flagAdmin
1346
-
1347
- ?>
5
  /**
6
  * flagAdmin - Class for admin operation
7
  */
8
+ if ( ! class_exists( 'flagAdmin' ) ) {
9
  class flagAdmin{
10
 
11
  /**
17
  * @param bool $output if the function should show an error messsage or not
18
  * @return bool|int
19
  */
20
+ public static function create_gallery($gallery, $defaultpath, $output = true) {
21
  global $wpdb, $user_ID;
22
 
23
  // get the current user ID
82
  $txt .= __('Unable to create directory ', 'flag').' <strong>' . $flagpath . '/thumbs !</strong>';
83
  }
84
 
85
+ // 4. Now create "webview" folder inside
86
+ if ( !is_dir(WINABSPATH . $flagpath . '/webview') ) {
87
+ if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/webview') )
88
+ $txt .= __('Unable to create directory ', 'flag').' <strong>' . $flagpath . '/webview !</strong>';
89
+ }
90
+
91
  if (SAFE_MODE) {
92
  $help = __('The server setting Safe-Mode is on !', 'flag');
93
  $help .= '<br />'.__('If you have problems, please create directory', 'flag').' <strong>' . $flagpath . '</strong> ';
120
 
121
  if ($result) {
122
  $message = __('Gallery \'%1$s\' successfully created.<br/>You can show this gallery with the tag %2$s.<br/>','flag');
123
+ $message = sprintf($message, esc_html(stripcslashes($gallerytitle)), '[flagallery gid=' . $gallery_id . ']');
124
  $message .= '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
125
  $message .= __('Edit gallery','flag');
126
  $message .= '</a>';
143
  * @param string $galleryfolder contains relative path
144
  * @return void
145
  */
146
+ public static function import_gallery($galleryfolder) {
147
 
148
  global $wpdb, $user_ID;
149
 
230
  * @param string $folder contains relative path
231
  * @return void
232
  */
233
+ public static function import_video($folder) {
234
 
235
 
236
  $created_msg = '';
272
  * @param string $folder contains relative path
273
  * @return void
274
  */
275
+ public static function import_mp3($folder) {
276
 
277
  $created_msg = '';
278
  // remove trailing slash at the end, if somebody use it
313
  * @param string $folder contains relative path
314
  * @return array
315
  */
316
+ public static function import_banner($folder) {
317
 
318
  $created_msg = '';
319
  // remove trailing slash at the end, if somebody use it
336
  }
337
 
338
  //Handle an individual file import.
339
+ public static function handle_import_file($file, $post_id = 0) {
340
  set_time_limit(120);
341
  $time = current_time('mysql');
342
  if ( $post = get_post($post_id) ) {
452
  * @param array $ext
453
  * @return array
454
  */
455
+ public static function scandir($dirname = '.', $ext = array()) {
456
  // thx to php.net :-)
457
  if(empty($ext))
458
  $ext = array('jpeg', 'jpg', 'png', 'gif');
474
  * @param object | int $image contain all information about the image or the id
475
  * @return string result code
476
  */
477
+ public static function create_thumbnail($image) {
478
 
479
  global $flag;
480
+
 
 
 
481
  if ( is_numeric($image) )
482
  $image = flagdb::find_image( $image );
483
 
484
+ if ( !is_object($image) )
485
  return __('Object didn\'t contain correct data','flag');
486
+
487
+ $dest_path = dirname($image->webimagePath);
488
+ if(!is_dir($dest_path)){
489
+ flagGallery::create_webview_folder(dirname($image->imagePath));
490
+ @chmod( $dest_path, 0755 );
491
+ }
492
+
493
+ if(! class_exists('flag_Thumbnail'))
494
+ require_once( flagGallery::graphic_library() );
495
 
496
  // check for existing thumbnail
497
  if (file_exists($image->thumbPath))
525
 
526
  // save the new thumbnail
527
  $thumb->save($image->thumbPath, $flag->options['thumbQuality']);
528
+ flagAdmin::chmod ($image->thumbPath);
529
 
530
  //read the new sizes
531
  $new_size = @getimagesize ( $image->thumbPath );
540
 
541
  if ( !empty($thumb->errmsg) )
542
  return $image->filename . ' (Error : '.$thumb->errmsg .')';
543
+
544
+ do_action('flag_thumbnail_created', $image);
545
+
546
+ flagAdmin::webview_image($image);
547
+
548
  // success
549
  return '1';
550
  }
558
  * @param integer $height optional
559
  * @return string result code
560
  */
561
+ public static function resize_image($image, $width = 0, $height = 0) {
562
 
563
  global $flag;
564
 
569
  $image = flagdb::find_image( $image );
570
 
571
  if ( !is_object($image) )
572
+ return __('Object didn\'t contain correct data','flag');
573
 
574
  // before we start we import the meta data to database (required for uploads before V0.40)
575
  flagAdmin::maybe_import_meta( $image->pid );
597
  return ' <strong>' . $image->filename . ' (Error : ' . $file->errmsg . ')</strong>';
598
  }
599
 
600
+ do_action('flag_image_resized', $image);
601
+
602
+ return '1';
603
+ }
604
+
605
+ /**
606
+ * flagAdmin::webview_image() - create a new image, based on the height /width
607
+ *
608
+ * @class flagAdmin
609
+ * @param object | int $image contain all information about the image or the id
610
+ * @return string result code
611
+ */
612
+ public static function webview_image($image) {
613
+
614
+ global $flag;
615
+
616
+ if ( is_numeric($image) )
617
+ $image = flagdb::find_image( $image );
618
+
619
+ if ( !is_object($image) )
620
+ return __('Object didn\'t contain correct data','flag');
621
+
622
+ $img_size = @getimagesize ( $image->imagePath );
623
+ $dest_path = dirname($image->webimagePath);
624
+ if(flagGallery::create_webview_folder(dirname($image->imagePath))){
625
+ if (! is_writable( $dest_path ) ) {
626
+ @chmod( $dest_path, 0755 );
627
+ }
628
+
629
+ if (file_exists($image->webimagePath)){
630
+ return '1';
631
+ }
632
+
633
+ $imgquality = $flag->options['imgQuality'];
634
+ $max_width = ($img_size[0] < 1200)? $img_size[0] : 1200;
635
+ $max_height = ($img_size[1] < 1200)? $img_size[1] : 1200;
636
+ if( function_exists('wp_get_image_editor') ) {
637
+ $editor = wp_get_image_editor( $image->imagePath );
638
+ $editor->set_quality( $imgquality );
639
+ $editor->resize( $max_width, $max_height, 0 );
640
+ $editor->save( $image->webimagePath );
641
+ if(@filesize($image->webimagePath) > @filesize($image->imagePath)) {
642
+ @copy($image->imagePath, $image->webimagePath);
643
+ }
644
+ $webviewsize = @getimagesize ( $image->webimagePath );
645
+ flagdb::update_image_meta($image->pid, array( 'webview' => $webviewsize) );
646
+
647
+ do_action('flag_image_optimized', $image);
648
+
649
+ }
650
+ }
651
+
652
  return '1';
653
  }
654
 
661
  * @param bool $name2alt
662
  * @return array $image_ids Id's which are sucessful added
663
  */
664
+ public static function add_Images($galleryID, $imageslist, $name2alt = false) {
665
  global $wpdb;
666
 
667
  $alttext = '';
702
  * @param array|int $imagesIds
703
  * @return bool
704
  */
705
+ public static function import_MetaData($imagesIds) {
706
 
707
  global $wpdb;
708
 
749
  * @param array|int $imagesIds
750
  * @return bool
751
  */
752
+ public static function copy_MetaData($imagesIds) {
753
 
754
  global $wpdb;
755
 
797
  * @param $id
798
  * @return array metadata
799
  */
800
+ public static function get_MetaData($id) {
801
 
802
  require_once(FLAG_ABSPATH . 'lib/meta.php');
803
 
823
  * @param int $id
824
  * @return mixed result
825
  */
826
+ public static function maybe_import_meta( $id ) {
827
 
828
  require_once(FLAG_ABSPATH . 'lib/meta.php');
829
 
849
  * @param mixed $p_header
850
  * @return bool
851
  */
852
+ public static function getOnlyImages($p_event, $p_header) {
853
 
854
  $info = pathinfo($p_header['filename']);
855
  // check for extension
873
  * @class flagAdmin
874
  * @return void
875
  */
876
+ public static function upload_images() {
877
 
878
  global $wpdb;
879
 
918
  $filename = $filepart['basename'];
919
 
920
  // check for allowed extension and if it's an image file
921
+ $ext = array('jpg', 'jpeg', 'png', 'gif');
922
+ if ( !in_array(strtolower($filepart['extension']), $ext) || !@getimagesize($temp_file) ){
923
  flagGallery::show_error('<strong>' . $imagefiles['name'][$key] . ' </strong>' . __('is no valid image file!','flag'));
924
  continue;
925
  }
941
 
942
  // save temp file to gallery
943
  if ( !@move_uploaded_file($temp_file, $dest_file) ){
944
+ if( !file_exists($dest_file)){
945
+ flagGallery::show_error(__('Error, the file could not moved to : ','flag') . $dest_file);
946
+ flagAdmin::check_safemode( $gallery->abspath );
947
+ continue;
948
+ }
949
  }
950
  if ( !flagAdmin::chmod($dest_file) ) {
951
  flagGallery::show_error(__('Error, the file permissions could not set','flag'));
985
  */
986
  static function swfupload_image($galleryID = 0) {
987
 
988
+ global $wpdb, $flag;
989
 
990
  if ($galleryID == 0) {
991
  //@unlink($temp_file);
1008
 
1009
  // check for allowed extension
1010
  $ext = array('jpeg', 'jpg', 'png', 'gif');
1011
+ if (!in_array(strtolower($filepart['extension']), $ext)){
1012
+ if(!@getimagesize($temp_file))
1013
+ return $filename . ' '. __('is no valid image file!','flag');
1014
+ }
1015
 
1016
  // get the path to the gallery
1017
  $gallerypath = $wpdb->get_var($wpdb->prepare("SELECT path FROM {$wpdb->flaggallery} WHERE gid = %d ", $galleryID));
1033
 
1034
  // save temp file to gallery
1035
  if ( !@move_uploaded_file($temp_file, $dest_file) ){
1036
+ if( !file_exists($dest_file)){
1037
+ flagAdmin::check_safemode(WINABSPATH.$gallerypath);
1038
+ return __('Error, the file could not moved to : ','flag').$dest_file;
1039
+ }
1040
+ }
1041
 
1042
  if ( !flagAdmin::chmod($dest_file) )
1043
  return __('Error, the file permissions could not set','flag');
1046
  $image_ids = flagAdmin::add_Images($galleryID, array($filename));
1047
  $return = '';
1048
  //create thumbnails
1049
+
1050
+ //save the thumb size values
1051
+ $flag->options['thumbWidth'] = intval($_POST['thumbw'])? intval($_POST['thumbw']) : 100;
1052
+ $flag->options['thumbHeight'] = intval($_POST['thumbh'])? intval($_POST['thumbh']) : 100;
1053
+ $flag->options['thumbFix'] = ('true' == $_POST['thumbf'])? 1 : 0;
1054
+ update_option('flag_options', $flag->options);
1055
+
1056
  foreach($image_ids as $picture){
1057
  $return = flagAdmin::create_thumbnail($picture);
1058
  }
1098
  * @class flagAdmin
1099
  * @return bool $result
1100
  */
1101
+ public static function check_quota() {
1102
 
1103
  if ( (IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck'))
1104
  if( $error = upload_is_user_over_quota( false ) ) {
1115
  * @param string $filename
1116
  * @return bool $result
1117
  */
1118
+ public static function chmod($filename = '') {
1119
 
1120
  $stat = @ stat(dirname($filename));
1121
  $perms = $stat['mode'] & 0007777;
1134
  * @param string $foldername
1135
  * @return bool $result
1136
  */
1137
+ public static function check_safemode($foldername) {
1138
 
1139
  if ( SAFE_MODE ) {
1140
 
1159
  * @param int $check_ID is the user_id
1160
  * @return bool $result
1161
  */
1162
+ public static function can_manage_this_gallery($check_ID) {
1163
 
1164
  global $user_ID, $wp_roles;
1165
 
1180
  * @param int $dest_gid destination gallery
1181
  * @return void
1182
  */
1183
+ public static function move_images($pic_ids, $dest_gid) {
1184
 
1185
  $errors = '';
1186
  $count = 0;
1256
  * @param int $dest_gid destination gallery
1257
  * @return void
1258
  */
1259
+ public static function copy_images($pic_ids, $dest_gid) {
1260
 
1261
  $errors = $messages = '';
1262
 
1349
  * @param string $title name of the operation
1350
  * @return string the javascript output
1351
  */
1352
+ public static function do_ajax_operation( $operation, $image_array, $title = '' ) {
1353
 
1354
  if ( !is_array($image_array) || empty($image_array) )
1355
  return;
1387
  * @param int $galleryID
1388
  * @return void
1389
  */
1390
+ public static function set_gallery_preview( $galleryID ) {
1391
  global $wpdb;
1392
 
1393
  $galleryID = intval($galleryID);
1411
  * @param int $galleryID
1412
  * @return array (JSON)
1413
  */
1414
+ public static function get_image_ids( $galleryID ) {
1415
 
1416
  if ( !function_exists('json_encode') )
1417
  return(-2);
1425
  }
1426
 
1427
  } // END class flagAdmin
1428
+ }
 
admin/get_skin.php CHANGED
@@ -138,5 +138,3 @@ function get_skins($skin_folder='', $type='') {
138
 
139
  return $flag_skins;
140
  }
141
-
142
- ?>
138
 
139
  return $flag_skins;
140
  }
 
 
admin/grab_meta.php CHANGED
@@ -37,4 +37,3 @@ if ($xmpdata) {
37
  $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
38
  }
39
  }
40
- ?>
37
  $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
38
  }
39
  }
 
admin/jgallery.php CHANGED
@@ -111,6 +111,12 @@ foreach ( $gID as $galID ) {
111
  $meta_data = maybe_unserialize($picture['meta_data']);
112
  $picture['width'] = $meta_data['width'];
113
  $picture['height'] = $meta_data['height'];
 
 
 
 
 
 
114
  unset($picture['meta_data']);
115
  $picture = array_map('stripslashes', $picture);
116
  $b['data'][] = $picture;
@@ -118,7 +124,7 @@ foreach ( $gID as $galID ) {
118
  $pid = intval($picture['pid']);
119
 
120
  if ($isCrawler){
121
- $xml['alt'] .= '<a style="display:block; overflow: hidden; height: 100px; width: 115px; margin-bottom: 10px; background-color: #eeeeee; background-position: 22px 44px; text-align: left;" class="i'. $j++ .' flag_pic_alt" href="'.$siteurl.'/'.$thegalleries['path'].'/'.$picture['filename'].'" id="flag_pic_'.$pid.'"><img style="float:left; margin-right: 10px; width: auto; height: auto; min-height:100px; min-width:115px;" title="'.esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))).'" alt="'.esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))).'" src="'.$siteurl.'/'.$thegalleries['path'].'/thumbs/thumbs_'.$picture['filename'].'" /><span style="display: block; overflow: hidden; text-decoration: none; color: #000; font-weight: normal;" class="flag_pic_desc" id="flag_desc_'.$pid.'"><strong>'.strip_tags(htmlspecialchars_decode($picture['alttext'])).'</strong><br />'.strip_tags(htmlspecialchars_decode($picture['description'])).'</span></a>';
122
  } else {
123
  if(!$disableViews){
124
  $views = (intval($picture['hitcounter']) < 10000) ? $picture['hitcounter'] : round($picture['hitcounter']/1000, 1).'k';
@@ -127,7 +133,7 @@ foreach ( $gID as $galID ) {
127
  } else {
128
  $views_panel = '';
129
  }
130
- $xml['alt'] .= '<a class="i'. $j++ .' flag_pic_alt" href="'.$siteurl.'/'.$thegalleries['path'].'/'.$picture['filename'].'" id="flag_pic_'.$pid.'" title="'.esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))).'">[img src='.$siteurl.'/'.$thegalleries['path'].'/thumbs/thumbs_'.$picture['filename'].']'.$views_panel.'<span class="flag_pic_desc" id="flag_desc_'.$pid.'"><strong>'.$picture['alttext'].'</strong><br /><span>'.$picture['description'].'</span></span></a>';
131
  }
132
  }
133
  $xml['alt'] .= '</div>';
@@ -137,4 +143,3 @@ foreach ( $gID as $galID ) {
137
  $xml['alt'] .= '</div>';
138
  $d = array('properties'=>$data) + $c + $musicData;
139
  $xml['json'] = json_encode($d);
140
- ?>
111
  $meta_data = maybe_unserialize($picture['meta_data']);
112
  $picture['width'] = $meta_data['width'];
113
  $picture['height'] = $meta_data['height'];
114
+ $picture['thumbnail'] = $meta_data['thumbnail']['width'].'x'.$meta_data['thumbnail']['height'];
115
+ $webview = '';
116
+ if(isset($meta_data['webview'])){
117
+ $picture['webview'] = $meta_data['webview'][0].'x'.$meta_data['webview'][1];
118
+ $webview = $flag_options['optimized_imgs']? '/webview' : '';
119
+ }
120
  unset($picture['meta_data']);
121
  $picture = array_map('stripslashes', $picture);
122
  $b['data'][] = $picture;
124
  $pid = intval($picture['pid']);
125
 
126
  if ($isCrawler){
127
+ $xml['alt'] .= '<a style="display:block; overflow: hidden; height: 100px; width: 115px; margin-bottom: 10px; background-color: #eeeeee; background-position: 22px 44px; text-align: left;" class="i'. $j++ .' flag_pic_alt" href="'.$siteurl.'/'.$thegalleries['path'].$webview.'/'.$picture['filename'].'" id="flag_pic_'.$pid.'"><img style="float:left; margin-right: 10px; width: auto; height: auto; min-height:100px; min-width:115px;" title="'.esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))).'" alt="'.esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))).'" src="'.$siteurl.'/'.$thegalleries['path'].'/thumbs/thumbs_'.$picture['filename'].'" /><span style="display: block; overflow: hidden; text-decoration: none; color: #000; font-weight: normal;" class="flag_pic_desc" id="flag_desc_'.$pid.'"><strong>'.strip_tags(htmlspecialchars_decode($picture['alttext'])).'</strong><br />'.strip_tags(htmlspecialchars_decode($picture['description'])).'</span></a>';
128
  } else {
129
  if(!$disableViews){
130
  $views = (intval($picture['hitcounter']) < 10000) ? $picture['hitcounter'] : round($picture['hitcounter']/1000, 1).'k';
133
  } else {
134
  $views_panel = '';
135
  }
136
+ $xml['alt'] .= '<a class="i'. $j++ .' flag_pic_alt" href="'.$siteurl.'/'.$thegalleries['path'].$webview.'/'.$picture['filename'].'" id="flag_pic_'.$pid.'" title="'.esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))).'">[img src='.$siteurl.'/'.$thegalleries['path'].'/thumbs/thumbs_'.$picture['filename'].']'.$views_panel.'<span class="flag_pic_desc" id="flag_desc_'.$pid.'"><strong>'.$picture['alttext'].'</strong><br /><span>'.$picture['description'].'</span></span></a>';
137
  }
138
  }
139
  $xml['alt'] .= '</div>';
143
  $xml['alt'] .= '</div>';
144
  $d = array('properties'=>$data) + $c + $musicData;
145
  $xml['json'] = json_encode($d);
 
admin/js/script.js CHANGED
@@ -57,7 +57,7 @@ function FlAGClass(ExtendVar, skin_id, pic_id, slideshow) {
57
  jQuery('.flashalbum').css('height','auto');
58
  jQuery('body#fullwindow').css('overflow','auto');
59
  jQuery('.flag_alternate').each(function(i){
60
- jQuery(this).show();
61
  var catMeta = jQuery('.flagCatMeta',this).hide().get();
62
  for(j=0; j<catMeta.length; j++) {
63
  var catName = jQuery(catMeta[j]).find('h4').text();
@@ -77,7 +77,7 @@ function FlAGClass(ExtendVar, skin_id, pic_id, slideshow) {
77
  if(!jQuery(this).hasClass('active')) {
78
  var catId = jQuery(this).attr('href');
79
  jQuery(this).addClass('active').siblings().removeClass('active');
80
- jQuery('.flag_alternate '+catId).show().siblings('.flagcategory').hide();
81
  alternate_flag_e(catId, ExtendVar);
82
  }
83
  return false;
@@ -96,7 +96,7 @@ function alternate_flag_e(t, ExtendVar){
96
  d = d.replace(/\]</g, '" /><');
97
  jQuery(this).addClass('loaded').html(d);
98
  }
99
- jQuery(this).show();
100
  if(ExtendVar == 'photoswipe') {
101
  var
102
  showDescr, longDescription, imgdescr, psImgCaption, curel,
57
  jQuery('.flashalbum').css('height','auto');
58
  jQuery('body#fullwindow').css('overflow','auto');
59
  jQuery('.flag_alternate').each(function(i){
60
+ jQuery(this).css({display: 'block'});
61
  var catMeta = jQuery('.flagCatMeta',this).hide().get();
62
  for(j=0; j<catMeta.length; j++) {
63
  var catName = jQuery(catMeta[j]).find('h4').text();
77
  if(!jQuery(this).hasClass('active')) {
78
  var catId = jQuery(this).attr('href');
79
  jQuery(this).addClass('active').siblings().removeClass('active');
80
+ jQuery('.flag_alternate '+catId).css({display: 'block'}).siblings('.flagcategory').hide();
81
  alternate_flag_e(catId, ExtendVar);
82
  }
83
  return false;
96
  d = d.replace(/\]</g, '" /><');
97
  jQuery(this).addClass('loaded').html(d);
98
  }
99
+ jQuery(this).css({display: 'block'});
100
  if(ExtendVar == 'photoswipe') {
101
  var
102
  showDescr, longDescription, imgdescr, psImgCaption, curel,
admin/manage-banner.php CHANGED
@@ -251,5 +251,3 @@ if ( $counter==0 )
251
  </div><!-- /#wrap -->
252
  <?php
253
  }
254
-
255
- ?>
251
  </div><!-- /#wrap -->
252
  <?php
253
  }
 
 
admin/manage-galleries.php CHANGED
@@ -126,6 +126,7 @@ function flag_manage_gallery_main() {
126
  <?php if ( function_exists('json_encode') ) : ?>
127
  <select name="bulkaction" id="bulkaction">
128
  <option value="no_action" ><?php _e("No action",'flag'); ?></option>
 
129
  <option value="new_thumbnail" ><?php _e("Create new thumbnails",'flag'); ?></option>
130
  <option value="resize_images" ><?php _e("Resize images",'flag'); ?></option>
131
  <option value="import_meta" ><?php _e("Import metadata",'flag'); ?></option>
@@ -376,4 +377,3 @@ if($gallerylist) {
376
 
377
  <?php
378
  }
379
- ?>
126
  <?php if ( function_exists('json_encode') ) : ?>
127
  <select name="bulkaction" id="bulkaction">
128
  <option value="no_action" ><?php _e("No action",'flag'); ?></option>
129
+ <option value="webview_images" ><?php _e("Create images optimized for web",'flag'); ?></option>
130
  <option value="new_thumbnail" ><?php _e("Create new thumbnails",'flag'); ?></option>
131
  <option value="resize_images" ><?php _e("Resize images",'flag'); ?></option>
132
  <option value="import_meta" ><?php _e("Import metadata",'flag'); ?></option>
377
 
378
  <?php
379
  }
 
admin/manage-images.php CHANGED
@@ -278,6 +278,7 @@ jQuery(document).ready( function() {
278
  <div class="alignleft actions">
279
  <select id="bulkaction" name="bulkaction" class="alignleft">
280
  <option value="no_action" ><?php _e("No action",'flag')?></option>
 
281
  <option value="new_thumbnail" ><?php _e("Create new thumbnails",'flag')?></option>
282
  <option value="resize_images" ><?php _e("Resize images",'flag')?></option>
283
  <option value="delete_images" ><?php _e("Delete images",'flag')?></option>
@@ -386,11 +387,19 @@ if($picturelist) {
386
  </a></strong>
387
  <br /><?php echo $date; ?>
388
  <?php if ( !empty($picture->meta_data['width']) ) {
389
- echo '<br />'.__('Size: ', 'flag').$picture->meta_data['width'].'x'.$picture->meta_data['height'].' '.__('pixel', 'flag');
390
  } else {
391
  $imgpath = WINABSPATH.$picture->path."/".$picture->filename;
392
  $img = @getimagesize($imgpath);
393
- if($img) echo '<br />'.__('Size: ', 'flag').$img[0].'x'.$img[1].' '.__('pixel', 'flag');
 
 
 
 
 
 
 
 
394
  } ?>
395
  <p>
396
  <?php
@@ -604,5 +613,3 @@ function flag_manage_gallery_columns() {
604
 
605
  return $gallery_columns;
606
  }
607
-
608
- ?>
278
  <div class="alignleft actions">
279
  <select id="bulkaction" name="bulkaction" class="alignleft">
280
  <option value="no_action" ><?php _e("No action",'flag')?></option>
281
+ <option value="webview_images" ><?php _e("Create images optimized for web",'flag'); ?></option>
282
  <option value="new_thumbnail" ><?php _e("Create new thumbnails",'flag')?></option>
283
  <option value="resize_images" ><?php _e("Resize images",'flag')?></option>
284
  <option value="delete_images" ><?php _e("Delete images",'flag')?></option>
387
  </a></strong>
388
  <br /><?php echo $date; ?>
389
  <?php if ( !empty($picture->meta_data['width']) ) {
390
+ echo '<br />'.__('Image size: ', 'flag').$picture->meta_data['width'].'x'.$picture->meta_data['height'];
391
  } else {
392
  $imgpath = WINABSPATH.$picture->path."/".$picture->filename;
393
  $img = @getimagesize($imgpath);
394
+ if($img) echo '<br />'.__('Image size: ', 'flag').$img[0].'x'.$img[1];
395
+ } ?>
396
+ <?php if ( !empty($picture->meta_data['thumbnail']) ) {
397
+ echo '<br />'.__('Thumbnail size: ', 'flag').$picture->meta_data['thumbnail']['width'].'x'.$picture->meta_data['thumbnail']['height'];
398
+ } ?>
399
+ <?php if ( !empty($picture->meta_data['webview']) ) {
400
+ echo '<br />'.__('Optimized size: ', 'flag').$picture->meta_data['webview'][0].'x'.$picture->meta_data['webview'][1];
401
+ } else {
402
+ echo '<br />'.__('Optimized size: ', 'flag').__('not optimized ', 'flag');
403
  } ?>
404
  <p>
405
  <?php
613
 
614
  return $gallery_columns;
615
  }
 
 
admin/manage-playlist.php CHANGED
@@ -262,5 +262,3 @@ if ( $counter==0 )
262
  </div><!-- /#wrap -->
263
  <?php
264
  }
265
-
266
- ?>
262
  </div><!-- /#wrap -->
263
  <?php
264
  }
 
 
admin/manage-sort.php CHANGED
@@ -150,4 +150,3 @@ if($picturelist) {
150
 
151
  <?php
152
  }
153
- ?>
150
 
151
  <?php
152
  }
 
admin/manage-video.php CHANGED
@@ -257,5 +257,3 @@ if ( $counter==0 )
257
  </div><!-- /#wrap -->
258
  <?php
259
  }
260
-
261
- ?>
257
  </div><!-- /#wrap -->
258
  <?php
259
  }
 
 
admin/manage.php CHANGED
@@ -75,11 +75,13 @@ class flagManageGallery {
75
  if (is_array($imagelist)) {
76
  foreach ($imagelist as $filename) {
77
  @unlink(WINABSPATH . $gallerypath . '/thumbs/thumbs_' . $filename);
 
78
  @unlink(WINABSPATH . $gallerypath .'/'. $filename);
79
  }
80
  }
81
  // delete folder
82
  @rmdir( WINABSPATH . $gallerypath . '/thumbs' );
 
83
  @rmdir( WINABSPATH . $gallerypath );
84
  }
85
  }
@@ -148,8 +150,9 @@ class flagManageGallery {
148
  if ($image) {
149
  //if ($flag->options['deleteImg']) {
150
  @unlink($image->imagePath);
151
- @unlink($image->thumbPath);
152
- //}
 
153
  $delete_pic = $wpdb->query("DELETE FROM $wpdb->flagpictures WHERE pid = '{$image->pid}'");
154
  }
155
  if($delete_pic)
@@ -201,6 +204,10 @@ class flagManageGallery {
201
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
202
  flagAdmin::do_ajax_operation( 'gallery_copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flag') );
203
  break;
 
 
 
 
204
  }
205
  }
206
 
@@ -227,7 +234,6 @@ class flagManageGallery {
227
  $flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
228
  $flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
229
  $flag->options['thumbFix'] = (bool) $_POST['thumbFix'];
230
- // What is in the case the user has no if cap 'FlAG Change options' ? Check feedback
231
  update_option('flag_options', $flag->options);
232
 
233
  $gallery_ids = explode(',', $_POST['TB_imagelist']);
@@ -258,8 +264,9 @@ class flagManageGallery {
258
  if ($image) {
259
  if ($flag->options['deleteImg']) {
260
  @unlink($image->imagePath);
261
- @unlink($image->thumbPath);
262
- }
 
263
  $delete_pic = flagdb::delete_image( $image->pid );
264
  }
265
  }
@@ -273,6 +280,9 @@ class flagManageGallery {
273
  case 'copy_meta':
274
  flagAdmin::do_ajax_operation( 'copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flag') );
275
  break;
 
 
 
276
  }
277
  }
278
 
@@ -463,4 +473,3 @@ class flagManageGallery {
463
  }
464
 
465
  }
466
- ?>
75
  if (is_array($imagelist)) {
76
  foreach ($imagelist as $filename) {
77
  @unlink(WINABSPATH . $gallerypath . '/thumbs/thumbs_' . $filename);
78
+ @unlink(WINABSPATH . $gallerypath . '/webview/' . $filename);
79
  @unlink(WINABSPATH . $gallerypath .'/'. $filename);
80
  }
81
  }
82
  // delete folder
83
  @rmdir( WINABSPATH . $gallerypath . '/thumbs' );
84
+ @rmdir( WINABSPATH . $gallerypath . '/webview' );
85
  @rmdir( WINABSPATH . $gallerypath );
86
  }
87
  }
150
  if ($image) {
151
  //if ($flag->options['deleteImg']) {
152
  @unlink($image->imagePath);
153
+ @unlink($image->webimagePath);
154
+ @unlink($image->thumbPath);
155
+ //}
156
  $delete_pic = $wpdb->query("DELETE FROM $wpdb->flagpictures WHERE pid = '{$image->pid}'");
157
  }
158
  if($delete_pic)
204
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
205
  flagAdmin::do_ajax_operation( 'gallery_copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flag') );
206
  break;
207
+ case 'webview_images':
208
+ // A prefix 'gallery_' will first fetch all ids from the selected galleries
209
+ flagAdmin::do_ajax_operation( 'gallery_webview_image' , $_POST['doaction'], __('Creating images optimized for web','flag') );
210
+ break;
211
  }
212
  }
213
 
234
  $flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
235
  $flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
236
  $flag->options['thumbFix'] = (bool) $_POST['thumbFix'];
 
237
  update_option('flag_options', $flag->options);
238
 
239
  $gallery_ids = explode(',', $_POST['TB_imagelist']);
264
  if ($image) {
265
  if ($flag->options['deleteImg']) {
266
  @unlink($image->imagePath);
267
+ @unlink($image->webimagePath);
268
+ @unlink($image->thumbPath);
269
+ }
270
  $delete_pic = flagdb::delete_image( $image->pid );
271
  }
272
  }
280
  case 'copy_meta':
281
  flagAdmin::do_ajax_operation( 'copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flag') );
282
  break;
283
+ case 'webview_images':
284
+ flagAdmin::do_ajax_operation( 'webview_image' , $_POST['doaction'], __('Creating images optimized for web','flag') );
285
+ break;
286
  }
287
  }
288
 
473
  }
474
 
475
  }
 
admin/media-upload.php CHANGED
@@ -231,4 +231,3 @@ function media_upload_flag_form() {
231
 
232
  <?php
233
  }
234
- ?>
231
 
232
  <?php
233
  }
 
admin/meta_box.php CHANGED
@@ -6,18 +6,15 @@ require_once (dirname(__FILE__) . '/playlist.functions.php');
6
  $i_skins = get_skins();
7
  $all_playlists = get_playlists();
8
  $flag_custom = get_post_custom($post->ID);
9
- $items_array = $flag_custom["mb_items_array"][0];
10
- $skinname = $flag_custom["mb_skinname"][0];
11
- $scode = $flag_custom["mb_scode"][0];
12
- $music = $flag_custom["mb_playlist"][0];
13
- $button_text = $flag_custom["mb_button"][0];
14
- $button_link = $flag_custom["mb_button_link"][0];
15
- if(!$music) $music = '';
16
- if(!$button_text) $button_text = '';
17
- if(!$button_link) $button_link = '';
18
- $bg_link = $flag_custom["mb_bg_link"][0];
19
- $bg_pos = $flag_custom["mb_bg_pos"][0];
20
- $bg_repeat = $flag_custom["mb_bg_repeat"][0];
21
  ?>
22
  <script type="text/javascript">/*<![CDATA[*/
23
  var i_arr = '<?php echo $items_array; ?>';
@@ -193,6 +190,3 @@ function short_code(galleries,skin,wmode,playlist) {
193
  </table>
194
  </form>
195
  </div>
196
- <?php
197
-
198
- ?>
6
  $i_skins = get_skins();
7
  $all_playlists = get_playlists();
8
  $flag_custom = get_post_custom($post->ID);
9
+ $items_array = isset($flag_custom["mb_items_array"][0])? $flag_custom["mb_items_array"][0] : '';
10
+ $skinname = isset($flag_custom["mb_skinname"][0])? $flag_custom["mb_skinname"][0] : '';
11
+ $scode = isset($flag_custom["mb_scode"][0])? $flag_custom["mb_scode"][0] : '';
12
+ $music = isset($flag_custom["mb_playlist"][0])? $flag_custom["mb_playlist"][0] : '';
13
+ $button_text = isset($flag_custom["mb_button"][0])? $flag_custom["mb_button"][0] : '';
14
+ $button_link = isset($flag_custom["mb_button_link"][0])? $flag_custom["mb_button_link"][0] : '';
15
+ $bg_link = isset($flag_custom["mb_bg_link"][0])? $flag_custom["mb_bg_link"][0] : '';
16
+ $bg_pos = isset($flag_custom["mb_bg_pos"][0])? $flag_custom["mb_bg_pos"][0] : '';
17
+ $bg_repeat = isset($flag_custom["mb_bg_repeat"][0])? $flag_custom["mb_bg_repeat"][0] : '';
 
 
 
18
  ?>
19
  <script type="text/javascript">/*<![CDATA[*/
20
  var i_arr = '<?php echo $items_array; ?>';
190
  </table>
191
  </form>
192
  </div>
 
 
 
admin/music-box.php CHANGED
@@ -527,4 +527,4 @@ if($musiclist) {
527
  </form>
528
  </div>
529
  <!-- /#new_playlist -->
530
- <?php } ?>
527
  </form>
528
  </div>
529
  <!-- /#new_playlist -->
530
+ <?php }
admin/overview.php CHANGED
@@ -461,4 +461,3 @@ function get_phpinfo() {
461
 
462
  return $phpinfo;
463
  }
464
- ?>
461
 
462
  return $phpinfo;
463
  }
 
admin/playlist-sort.php CHANGED
@@ -111,4 +111,3 @@ if(count($items_a)) {
111
 
112
  <?php
113
  }
114
- ?>
111
 
112
  <?php
113
  }
 
admin/playlist.functions.php CHANGED
@@ -157,5 +157,3 @@ function flag_playlist_delete($playlist) {
157
  }
158
  }
159
  }
160
-
161
- ?>
157
  }
158
  }
159
  }
 
 
admin/settings.php CHANGED
@@ -17,7 +17,10 @@ function flag_admin_options() {
17
  if (!empty($options)) {
18
  foreach ($options as $option) {
19
  $option = trim($option);
20
- $value = trim($_POST[$option]);
 
 
 
21
  $flag->options[$option] = $value;
22
  }
23
  if(isset($_POST['galleryPath'])) {
@@ -41,6 +44,8 @@ function flag_admin_options() {
41
  curl_setopt ($ch, CURLOPT_POST, 1);
42
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
43
  curl_setopt ($ch, CURLOPT_POSTFIELDS, array('access_key'=>$_POST['access_key'], 'access_url'=>$_POST['access_url'], 'license_key'=>$_POST['license_key']));
 
 
44
  $access_key_return = curl_exec ($ch);
45
  curl_close ($ch);
46
  } else {
@@ -160,7 +165,7 @@ jQuery(document).ready(function() {
160
  <div id="imageoptions" class="cptab">
161
  <form name="generaloptions" method="post">
162
  <?php wp_nonce_field('flag_settings'); ?>
163
- <input type="hidden" name="page_options" value="galleryPath,flashWidth,flashHeight,deleteImg,deepLinks,useMediaRSS,jAlterGal,jAlterGalScript,BarsBG,CatBGColor,CatBGColorOver,CatColor,CatColorOver,ThumbBG,ThumbLoaderColor,TitleColor,DescrColor,imgWidth,imgHeight,imgQuality,albSort,albSortDir,albPerPage,galSort,galSortDir,disableViews" />
164
  <h2><?php _e('Image Gallery Options','flag'); ?></h2>
165
  <h3><?php _e('General Options','flag'); ?></h3>
166
  <table class="form-table flag-options" style="width: auto; white-space: nowrap;">
@@ -194,13 +199,13 @@ jQuery(document).ready(function() {
194
  <h3><?php _e('Image settings','flag'); ?></h3>
195
  <table class="form-table flag-options" style="width: auto; white-space: nowrap;">
196
  <tr valign="top">
197
- <th scope="row" width="200"><label><?php _e('Resize Images','flag'); ?></label><br /><small>(Manage Gallery -> 'Resize Images' action)</small></th>
198
- <td><input type="text" size="5" name="imgWidth" value="<?php echo $flag_options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $flag_options['imgHeight']; ?>" />
199
- <span class="setting-description"><?php _e('Width x Height (in pixel). Flash Album Gallery will keep ratio size','flag'); ?></span></td>
200
  </tr>
201
  <tr valign="top">
202
  <th align="left"><?php _e('Image quality','flag'); ?></th>
203
- <td><input type="text" size="3" maxlength="3" name="imgQuality" value="<?php echo $flag_options['imgQuality']; ?>" /> %</td>
204
  </tr>
205
  </table>
206
 
@@ -560,5 +565,3 @@ function flag_set_capability($lowest_role, $capability){
560
  }
561
 
562
  }
563
-
564
- ?>
17
  if (!empty($options)) {
18
  foreach ($options as $option) {
19
  $option = trim($option);
20
+ if(isset($_POST[$option]))
21
+ $value = trim($_POST[$option]);
22
+ else
23
+ $value = false;
24
  $flag->options[$option] = $value;
25
  }
26
  if(isset($_POST['galleryPath'])) {
44
  curl_setopt ($ch, CURLOPT_POST, 1);
45
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
46
  curl_setopt ($ch, CURLOPT_POSTFIELDS, array('access_key'=>$_POST['access_key'], 'access_url'=>$_POST['access_url'], 'license_key'=>$_POST['license_key']));
47
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
48
+ curl_setopt($ch, CURLOPT_TIMEOUT, 10);
49
  $access_key_return = curl_exec ($ch);
50
  curl_close ($ch);
51
  } else {
165
  <div id="imageoptions" class="cptab">
166
  <form name="generaloptions" method="post">
167
  <?php wp_nonce_field('flag_settings'); ?>
168
+ <input type="hidden" name="page_options" value="galleryPath,flashWidth,flashHeight,deleteImg,deepLinks,useMediaRSS,optimized_imgs,jAlterGal,jAlterGalScript,BarsBG,CatBGColor,CatBGColorOver,CatColor,CatColorOver,ThumbBG,ThumbLoaderColor,TitleColor,DescrColor,imgQuality,albSort,albSortDir,albPerPage,galSort,galSortDir,disableViews" />
169
  <h2><?php _e('Image Gallery Options','flag'); ?></h2>
170
  <h3><?php _e('General Options','flag'); ?></h3>
171
  <table class="form-table flag-options" style="width: auto; white-space: nowrap;">
199
  <h3><?php _e('Image settings','flag'); ?></h3>
200
  <table class="form-table flag-options" style="width: auto; white-space: nowrap;">
201
  <tr valign="top">
202
+ <th scope="row" width="200"><label><?php _e('Use optimized images for mobile browsers','flag'); ?></label><br /><small>(Manage Gallery -> 'Optimize images for web' action)</small></th>
203
+ <td><input type="checkbox" name="optimized_imgs" value="1" <?php checked('1', $flag_options['optimized_imgs']); ?> />
204
+ <span class="setting-description"><?php _e('Optimized images loads faster, save traffic and make page more lightweight for browser','flag'); ?></span></td>
205
  </tr>
206
  <tr valign="top">
207
  <th align="left"><?php _e('Image quality','flag'); ?></th>
208
+ <td><input type="text" size="3" maxlength="3" name="imgQuality" value="<?php echo $flag_options['imgQuality']; ?>" /> % &nbsp;&nbsp;<span class="setting-description"><?php _e('Default: 85%','flag'); ?></span></td>
209
  </tr>
210
  </table>
211
 
565
  }
566
 
567
  }
 
 
admin/showmeta.php CHANGED
@@ -34,7 +34,7 @@ $xmpdata = $meta->get_XMP();
34
  <th scope="col"><?php _e('Value','flag'); ?></th>
35
  </tr>
36
  </thead>
37
- <?php
38
  foreach ($dbdata as $key => $value){
39
  if ( is_array($value) ) continue;
40
  $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
@@ -120,4 +120,4 @@ $xmpdata = $meta->get_XMP();
120
  ?>
121
  </table>
122
  </fieldset>
123
- <?php } ?>
34
  <th scope="col"><?php _e('Value','flag'); ?></th>
35
  </tr>
36
  </thead>
37
+ <?php $class = '';
38
  foreach ($dbdata as $key => $value){
39
  if ( is_array($value) ) continue;
40
  $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
120
  ?>
121
  </table>
122
  </fieldset>
123
+ <?php }
admin/skin_install.php CHANGED
@@ -139,5 +139,3 @@ function wp_install_skin_local_package($package, $feedback = '') {
139
  //Return the skin files name.
140
  return $skins_dir.$folder . '/';
141
  }
142
-
143
- ?>
139
  //Return the skin files name.
140
  return $skins_dir.$folder . '/';
141
  }
 
 
admin/skin_options.php CHANGED
@@ -1,13 +1,40 @@
1
  <?php
 
2
  require_once( dirname(dirname(__FILE__)) . '/flag-config.php');
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  // check for correct capability
5
  if ( !is_user_logged_in() )
6
  die('-1');
7
 
8
  // check for correct FlAG capability
9
- if ( !current_user_can('FlAG Change skin') )
10
- die('-1');
11
 
12
  $flashPost = file_get_contents("php://input");
13
  // parse properties_skin
@@ -57,9 +84,10 @@ function flag_skin_options() {
57
  if(!$fp) {
58
  echo '<p style="color:#ff0000;"><b>Error! The configuration file not be found. You need to reinstall this skin.</b></p>';
59
  } else {
60
- $cPanel = FLAG_URLPATH."lib/cpanel.swf";
61
- $constructor = FLAG_URLPATH."lib/";
62
- $swfObject = FLAG_URLPATH."admin/js/swfobject.js?ver=2.2";
 
63
  ?>
64
  <div id="skinOptions">
65
  <script type="text/javascript" src="<?php echo $swfObject ?>"></script>
@@ -77,7 +105,7 @@ function flag_skin_options() {
77
  menu : "false"
78
  };
79
  var attributes = {};
80
- swfobject.embedSWF("<?php echo $cPanel; ?>", "myContent", "600", "550", "9.0.0", "<?php echo FLAG_URLPATH; ?>skins/expressInstall.swf", flashvars, params, attributes);
81
  </script>
82
  <div id="myContent"><a href="http://www.adobe.com/go/getflash"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>
83
  <p>This page requires Flash Player version 10.1.52 or higher.</p>
@@ -87,5 +115,3 @@ function flag_skin_options() {
87
  }
88
  fclose($fp);
89
  }
90
-
91
- ?>
1
  <?php
2
+ define( 'SHORTINIT', true );
3
  require_once( dirname(dirname(__FILE__)) . '/flag-config.php');
4
 
5
+ if(!function_exists('sanitize_flagname')){
6
+ function sanitize_flagname( $filename ) {
7
+
8
+ //$filename = wp_strip_all_tags( $filename );
9
+ //$filename = remove_accents( $filename );
10
+ // Kill octets
11
+ $filename = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '', $filename );
12
+ $filename = preg_replace( '/&.+?;/', '', $filename ); // Kill entities
13
+ $filename = preg_replace( '|[^a-zA-Z0-9 _.\-]|i', '', $filename );
14
+ $filename = preg_replace('/[\s-]+/', '-', $filename);
15
+ $filename = trim($filename, '.-_ ');
16
+
17
+ return $filename;
18
+ }
19
+ }
20
+
21
+ if(!function_exists('get_currentuserinfo')){
22
+ require( ABSPATH . WPINC . '/formatting.php' );
23
+ require( ABSPATH . WPINC . '/capabilities.php' );
24
+ require( ABSPATH . WPINC . '/user.php' );
25
+ require( ABSPATH . WPINC . '/meta.php' );
26
+ require( ABSPATH . WPINC . '/pluggable.php' );
27
+ require( ABSPATH . WPINC . '/post.php' );
28
+ wp_cookie_constants( );
29
+ }
30
+
31
  // check for correct capability
32
  if ( !is_user_logged_in() )
33
  die('-1');
34
 
35
  // check for correct FlAG capability
36
+ if ( !current_user_can('FlAG Change skin') )
37
+ die('-1');
38
 
39
  $flashPost = file_get_contents("php://input");
40
  // parse properties_skin
84
  if(!$fp) {
85
  echo '<p style="color:#ff0000;"><b>Error! The configuration file not be found. You need to reinstall this skin.</b></p>';
86
  } else {
87
+ $flag_urlpath = dirname($flag_options['skinsDirURL']).'/flash-album-gallery/';
88
+ $cPanel = $flag_urlpath."lib/cpanel.swf";
89
+ $constructor = $flag_urlpath."lib/";
90
+ $swfObject = $flag_urlpath."admin/js/swfobject.js?ver=2.2";
91
  ?>
92
  <div id="skinOptions">
93
  <script type="text/javascript" src="<?php echo $swfObject ?>"></script>
105
  menu : "false"
106
  };
107
  var attributes = {};
108
+ swfobject.embedSWF("<?php echo $cPanel; ?>", "myContent", "600", "550", "9.0.0", "<?php echo $flag_urlpath; ?>skins/expressInstall.swf", flashvars, params, attributes);
109
  </script>
110
  <div id="myContent"><a href="http://www.adobe.com/go/getflash"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>
111
  <p>This page requires Flash Player version 10.1.52 or higher.</p>
115
  }
116
  fclose($fp);
117
  }
 
 
admin/skins.php CHANGED
@@ -38,7 +38,8 @@ if( isset($_POST['skinzipurl']) ) {
38
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
39
  curl_setopt($ch, CURLOPT_AUTOREFERER, true);
40
  curl_setopt($ch, CURLOPT_BINARYTRANSFER,true);
41
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
 
42
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
43
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
44
  curl_setopt($ch, CURLOPT_FILE, $fp);
@@ -170,6 +171,8 @@ if(!empty($flag_options['license_key'])){
170
  curl_setopt ($ch, CURLOPT_POST, 1);
171
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
172
  curl_setopt ($ch, CURLOPT_POSTFIELDS, array('check_status'=>$flag_options['license_key']));
 
 
173
  $status = curl_exec ($ch);
174
  curl_close ($ch);
175
  if($status === '0'){
@@ -365,6 +368,8 @@ $total_all_skins = count($all_skins);
365
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
366
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
367
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
 
 
368
  $skins_xml = @simplexml_load_string(curl_exec($ch));
369
  curl_close ($ch);
370
  }
@@ -513,4 +518,3 @@ $total_all_skins = count($all_skins);
513
 
514
 
515
  </div>
516
- <?php ?>
38
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
39
  curl_setopt($ch, CURLOPT_AUTOREFERER, true);
40
  curl_setopt($ch, CURLOPT_BINARYTRANSFER,true);
41
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
42
+ curl_setopt($ch, CURLOPT_TIMEOUT, 20);
43
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
44
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
45
  curl_setopt($ch, CURLOPT_FILE, $fp);
171
  curl_setopt ($ch, CURLOPT_POST, 1);
172
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
173
  curl_setopt ($ch, CURLOPT_POSTFIELDS, array('check_status'=>$flag_options['license_key']));
174
+ curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 3);
175
+ curl_setopt ($ch, CURLOPT_TIMEOUT, 10);
176
  $status = curl_exec ($ch);
177
  curl_close ($ch);
178
  if($status === '0'){
368
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
369
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
370
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
371
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
372
+ curl_setopt($ch, CURLOPT_TIMEOUT, 15);
373
  $skins_xml = @simplexml_load_string(curl_exec($ch));
374
  curl_close ($ch);
375
  }
518
 
519
 
520
  </div>
 
admin/tinymce/tinymce.php CHANGED
@@ -129,6 +129,3 @@ class add_flag_button {
129
 
130
  // Call it now
131
  $tinymce_button = new add_flag_button ();
132
-
133
-
134
- ?>
129
 
130
  // Call it now
131
  $tinymce_button = new add_flag_button ();
 
 
 
admin/tuning.php CHANGED
@@ -56,4 +56,3 @@ function flag_tune($show_error=true, $skins_reset=false) {
56
  }
57
  return true;
58
  }
59
- ?>
56
  }
57
  return true;
58
  }
 
admin/upgrade.php CHANGED
@@ -162,5 +162,3 @@ function flag_add_sql_column($table_name, $column_name, $create_ddl) {
162
  return false;
163
  }
164
 
165
-
166
- ?>
162
  return false;
163
  }
164
 
 
 
admin/upload.php CHANGED
@@ -46,5 +46,3 @@ include_once (FLAG_ABSPATH. 'admin/functions.php');
46
  $galleryID = (int) $_POST['galleryselect'];
47
 
48
  echo flagAdmin::swfupload_image($galleryID);
49
-
50
- ?>
46
  $galleryID = (int) $_POST['galleryselect'];
47
 
48
  echo flagAdmin::swfupload_image($galleryID);
 
 
admin/video-box.php CHANGED
@@ -449,4 +449,4 @@ if($videolist) {
449
  </form>
450
  </div>
451
  <!-- /#new_playlist -->
452
- <?php } ?>
449
  </form>
450
  </div>
451
  <!-- /#new_playlist -->
452
+ <?php }
admin/video-sort.php CHANGED
@@ -118,4 +118,3 @@ if(count($items_a)) {
118
 
119
  <?php
120
  }
121
- ?>
118
 
119
  <?php
120
  }
 
admin/video.functions.php CHANGED
@@ -156,5 +156,3 @@ function flag_v_playlist_delete($playlist) {
156
  }
157
  }
158
  }
159
-
160
- ?>
156
  }
157
  }
158
  }
 
 
admin/wpmu.php CHANGED
@@ -64,4 +64,3 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
64
 
65
  <?php
66
  }
67
- ?>
64
 
65
  <?php
66
  }
 
flag-config.php CHANGED
@@ -28,4 +28,3 @@ if ( !defined('WP_LOAD_PATH') ) {
28
 
29
  // let's load WordPress
30
  require_once( WP_LOAD_PATH . 'wp-load.php');
31
- ?>
28
 
29
  // let's load WordPress
30
  require_once( WP_LOAD_PATH . 'wp-load.php');
 
flag.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: GRAND Flash Album Gallery
4
  Plugin URI: http://codeasily.com/wordpress-plugins/flash-album-gallery/flag/
5
  Description: The Grand Flagallery plugin - provides a comprehensive interface for managing photos and images through a set of admin pages, and it displays photos in a way that makes your web site look very professional.
6
- Version: 3.20
7
  Author: Rattus
8
  Author URI: http://codeasily.com/
9
 
@@ -23,7 +23,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
23
  if (!class_exists('flagLoad')) {
24
  class flagLoad {
25
 
26
- var $version = '3.20';
27
  var $dbversion = '2.75';
28
  var $minium_WP = '3.0';
29
  var $minium_WPMU = '3.0';
@@ -46,24 +46,24 @@ class flagLoad {
46
  $this->define_constant();
47
  $this->define_tables();
48
  $this->load_dependencies();
49
-
50
  $this->plugin_name = plugin_basename(__FILE__);
51
 
52
  // Init options & tables during activation & deregister init option
53
  register_activation_hook( $this->plugin_name, array(&$this, 'activate') );
54
  add_action( 'init', array(&$this, 'wp_flag_tune_messages') );
55
- register_deactivation_hook( $this->plugin_name, array(&$this, 'deactivate') );
56
 
57
  // Register a uninstall hook to remove all tables & option automatic
58
  register_uninstall_hook( $this->plugin_name, array('flagLoader', 'uninstall') );
59
 
60
  // Start this plugin once all other plugins are fully loaded
61
  add_action( 'plugins_loaded', array(&$this, 'start_plugin') );
62
-
63
  // Add a message for PHP4 Users, can disable the update message later on
64
  if (version_compare(PHP_VERSION, '5.0.0', '<'))
65
  add_filter('transient_update_plugins', array(&$this, 'disable_upgrade'));
66
-
67
  //Add some message on the plugin page
68
  //add_action( 'after_plugin_row', array(&$this, 'flag_check_message_version') );
69
 
@@ -88,25 +88,25 @@ class flagLoad {
88
  add_filter('flag_gallery_name', 'sanitize_title');
89
 
90
  // Load the admin panel or the frontend functions
91
- if ( is_admin() ) {
92
-
93
  // Pass the init check or show a message
94
  if (get_option( "flag_init_check" ) != false )
95
  add_action( 'admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . get_option( "flag_init_check" ) . '</strong></p></div>\';') );
96
-
97
- } else {
98
-
99
  // Add MRSS to wp_head
100
  if ( $this->options['useMediaRSS'] )
101
  add_action('wp_head', array('flagMediaRss', 'add_mrss_alternate_link'));
102
-
103
  // Add the script and style files
104
  add_action('wp_print_scripts', array(&$this, 'load_scripts') );
105
 
106
  // Add a version number to the header
107
  add_action('wp_head', create_function('', 'echo "\n<!-- <meta name=\'Grand Flagallery\' content=\'' . $this->version . '\' /> -->\n";') );
108
 
109
- }
110
  }
111
 
112
  function wp_flag_tune_messages() {
@@ -118,6 +118,7 @@ class flagLoad {
118
  include_once (dirname (__FILE__) . '/admin/flag_install.php');
119
  // check for tables
120
  flag_capabilities();
 
121
  }
122
  // check for upgrade
123
  if( get_option( 'flag_db_version' ) < FLAG_DBVERSION ) {
@@ -129,50 +130,50 @@ class flagLoad {
129
  }
130
 
131
  function required_version() {
132
-
133
  global $wp_version, $wpmu_version;
134
-
135
  // Check for WPMU installation
136
  if (!defined ('IS_WPMU'))
137
  define('IS_WPMU', version_compare($wpmu_version, $this->minium_WPMU, '>=') );
138
 
139
  // Check for WP version installation
140
  $wp_ok = version_compare($wp_version, $this->minium_WP, '>=');
141
-
142
  if ( ($wp_ok == FALSE) and (IS_WPMU == FALSE) ) {
143
  add_action('admin_notices', create_function('', 'global $flag; printf (\'<div id="message" class="error"><p><strong>\' . __(\'Sorry,GRAND Flash Album Gallery works only under WordPress %s or higher\', "flag" ) . \'</strong></p></div>\', $flag->minium_WP );'));
144
  return false;
145
  }
146
  return true;
147
-
148
  }
149
-
150
  function check_memory_limit() {
151
-
152
  $memory_limit = (int) substr( ini_get('memory_limit'), 0, -1);
153
  //This works only with enough memory, 8MB is silly, wordpress requires already 7.9999
154
  if ( ($memory_limit != 0) && ($memory_limit < 12 ) ) {
155
  add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . __('Sorry, GRAND Flash Album Gallery works only with a Memory Limit of 16 MB higher', 'flag') . '</strong></p></div>\';'));
156
  return false;
157
  }
158
-
159
  return true;
160
-
161
  }
162
-
163
- function define_tables() {
164
  global $wpdb;
165
-
166
- // add database pointer
167
  $wpdb->flagpictures = $wpdb->prefix . 'flag_pictures';
168
  $wpdb->flaggallery = $wpdb->prefix . 'flag_gallery';
169
  $wpdb->flagcomments = $wpdb->prefix . 'flag_comments';
170
  $wpdb->flagalbum = $wpdb->prefix . 'flag_album';
171
-
172
  }
173
-
174
  function define_constant() {
175
-
176
  define('FLAGVERSION', $this->version);
177
  // Minimum required database version
178
  define('FLAG_DBVERSION', $this->dbversion);
@@ -181,13 +182,13 @@ class flagLoad {
181
  if ( !defined('WINABSPATH') ) {
182
  define('WINABSPATH', str_replace("\\", "/", ABSPATH) );
183
  }
184
-
185
  // define URL
186
  define('FLAGFOLDER', plugin_basename( dirname(__FILE__)) );
187
-
188
  define('FLAG_ABSPATH', str_replace("\\","/", WP_PLUGIN_DIR . '/' . plugin_basename( dirname(__FILE__) ) . '/' ));
189
  define('FLAG_URLPATH', WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) . '/' );
190
-
191
  // get value for safe mode
192
  if ( !defined('SAFE_MODE') ) {
193
  if ( (gettype( ini_get('safe_mode') ) == 'string') ) {
@@ -197,13 +198,13 @@ class flagLoad {
197
  } else
198
  define( 'SAFE_MODE', ini_get('safe_mode') );
199
  }
200
-
201
  }
202
-
203
  function load_dependencies() {
204
  global $flagdb;
205
-
206
- // Load global libraries
207
  require_once (dirname (__FILE__) . '/lib/core.php');
208
  require_once (dirname (__FILE__) . '/lib/flag-db.php');
209
  require_once (dirname (__FILE__) . '/lib/image.php');
@@ -223,25 +224,25 @@ class flagLoad {
223
  include_once (dirname (__FILE__) . '/admin/tinymce/tinymce.php');
224
 
225
  // Load backend libraries
226
- if ( is_admin() ) {
227
  require_once (dirname (__FILE__) . '/admin/admin.php');
228
  require_once (dirname (__FILE__) . '/admin/media-upload.php');
229
  $this->flagAdminPanel = new flagAdminPanel();
230
-
231
- // Load frontend libraries
232
  } else {
233
  require_once (dirname (__FILE__) . '/lib/swfobject.php');
234
  require_once (dirname (__FILE__) . '/lib/shortcodes.php');
235
- }
236
  }
237
  }
238
-
239
  function load_textdomain() {
240
-
241
  load_plugin_textdomain('flag', false, dirname( plugin_basename(__FILE__) ) . '/lang');
242
 
243
  }
244
-
245
  function load_scripts() {
246
 
247
  wp_enqueue_script('jquery');
@@ -254,8 +255,6 @@ class flagLoad {
254
  wp_register_script('swfaddress', plugins_url('/flash-album-gallery/admin/js/swfaddress.js'), array(), '2.4');
255
  wp_enqueue_script('swfaddress');
256
  }
257
- wp_register_style('fancybox', plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.css') );
258
- wp_register_script('fancybox', plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.pack.js'), array(), '1.3.4', true );
259
 
260
  }
261
 
@@ -272,18 +271,18 @@ class flagLoad {
272
 
273
  function activate() {
274
  //Since version 0.40 it's tested only with PHP5.2, currently we keep PHP4 support a while
275
- //if (version_compare(PHP_VERSION, '5.2.0', '<')) {
276
  // deactivate_plugins(plugin_basename(__FILE__)); // Deactivate ourself
277
- // wp_die("Sorry, but you can't run this plugin, it requires PHP 5.2 or higher.");
278
- // return;
279
- //}
280
  include_once (dirname (__FILE__) . '/admin/flag_install.php');
281
  // check for tables
282
  flag_install();
283
  $this->flag_fullwindow_page_init();
284
  flush_rewrite_rules();
285
  }
286
-
287
  function deactivate() {
288
  // remove & reset the init check option
289
  delete_option( 'flag_init_check' );
@@ -297,15 +296,15 @@ class flagLoad {
297
  function disable_upgrade($option){
298
 
299
  $this_plugin = plugin_basename(__FILE__);
300
-
301
- // PHP5.2 is required for FlAG V0.40
302
  if ( version_compare($option->response[ $this_plugin ]->new_version, '0.40', '>=') )
303
  return $option;
304
 
305
  if( isset($option->response[ $this_plugin ]) ){
306
  //TODO:Clear its download link, not now but maybe later
307
  //$option->response[ $this_plugin ]->package = '';
308
-
309
  //Add a notice message
310
  if ($this->add_PHP5_notice == false){
311
  add_action( "in_plugin_update_message-$this->plugin_name", create_function('', 'echo \'<br /><span style="color:red">Please update to PHP5.2 as soon as possible, the plugin is not tested under PHP4 anymore</span>\';') );
@@ -314,7 +313,7 @@ class flagLoad {
314
  }
315
  return $option;
316
  }
317
-
318
  // PLUGIN MESSAGE ON PLUGINS PAGE
319
  function flag_check_message_version($file)
320
  {
@@ -330,7 +329,7 @@ class flagLoad {
330
  if($message)
331
  {
332
  preg_match( '|flag040:(.*)$|mi', $message, $theMessage );
333
-
334
  $columns = substr($wp_version, 0, 3) == "2.8" ? 3 : 5;
335
 
336
  if ( !empty( $theMessage ) )
@@ -509,4 +508,3 @@ if(!function_exists('sanitize_flagname')){
509
  return $filename;
510
  }
511
  }
512
- ?>
3
  Plugin Name: GRAND Flash Album Gallery
4
  Plugin URI: http://codeasily.com/wordpress-plugins/flash-album-gallery/flag/
5
  Description: The Grand Flagallery plugin - provides a comprehensive interface for managing photos and images through a set of admin pages, and it displays photos in a way that makes your web site look very professional.
6
+ Version: 4.00
7
  Author: Rattus
8
  Author URI: http://codeasily.com/
9
 
23
  if (!class_exists('flagLoad')) {
24
  class flagLoad {
25
 
26
+ var $version = '4.00';
27
  var $dbversion = '2.75';
28
  var $minium_WP = '3.0';
29
  var $minium_WPMU = '3.0';
46
  $this->define_constant();
47
  $this->define_tables();
48
  $this->load_dependencies();
49
+
50
  $this->plugin_name = plugin_basename(__FILE__);
51
 
52
  // Init options & tables during activation & deregister init option
53
  register_activation_hook( $this->plugin_name, array(&$this, 'activate') );
54
  add_action( 'init', array(&$this, 'wp_flag_tune_messages') );
55
+ register_deactivation_hook( $this->plugin_name, array(&$this, 'deactivate') );
56
 
57
  // Register a uninstall hook to remove all tables & option automatic
58
  register_uninstall_hook( $this->plugin_name, array('flagLoader', 'uninstall') );
59
 
60
  // Start this plugin once all other plugins are fully loaded
61
  add_action( 'plugins_loaded', array(&$this, 'start_plugin') );
62
+
63
  // Add a message for PHP4 Users, can disable the update message later on
64
  if (version_compare(PHP_VERSION, '5.0.0', '<'))
65
  add_filter('transient_update_plugins', array(&$this, 'disable_upgrade'));
66
+
67
  //Add some message on the plugin page
68
  //add_action( 'after_plugin_row', array(&$this, 'flag_check_message_version') );
69
 
88
  add_filter('flag_gallery_name', 'sanitize_title');
89
 
90
  // Load the admin panel or the frontend functions
91
+ if ( is_admin() ) {
92
+
93
  // Pass the init check or show a message
94
  if (get_option( "flag_init_check" ) != false )
95
  add_action( 'admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . get_option( "flag_init_check" ) . '</strong></p></div>\';') );
96
+
97
+ } else {
98
+
99
  // Add MRSS to wp_head
100
  if ( $this->options['useMediaRSS'] )
101
  add_action('wp_head', array('flagMediaRss', 'add_mrss_alternate_link'));
102
+
103
  // Add the script and style files
104
  add_action('wp_print_scripts', array(&$this, 'load_scripts') );
105
 
106
  // Add a version number to the header
107
  add_action('wp_head', create_function('', 'echo "\n<!-- <meta name=\'Grand Flagallery\' content=\'' . $this->version . '\' /> -->\n";') );
108
 
109
+ }
110
  }
111
 
112
  function wp_flag_tune_messages() {
118
  include_once (dirname (__FILE__) . '/admin/flag_install.php');
119
  // check for tables
120
  flag_capabilities();
121
+ update_option("flagVersion", FLAGVERSION);
122
  }
123
  // check for upgrade
124
  if( get_option( 'flag_db_version' ) < FLAG_DBVERSION ) {
130
  }
131
 
132
  function required_version() {
133
+
134
  global $wp_version, $wpmu_version;
135
+
136
  // Check for WPMU installation
137
  if (!defined ('IS_WPMU'))
138
  define('IS_WPMU', version_compare($wpmu_version, $this->minium_WPMU, '>=') );
139
 
140
  // Check for WP version installation
141
  $wp_ok = version_compare($wp_version, $this->minium_WP, '>=');
142
+
143
  if ( ($wp_ok == FALSE) and (IS_WPMU == FALSE) ) {
144
  add_action('admin_notices', create_function('', 'global $flag; printf (\'<div id="message" class="error"><p><strong>\' . __(\'Sorry,GRAND Flash Album Gallery works only under WordPress %s or higher\', "flag" ) . \'</strong></p></div>\', $flag->minium_WP );'));
145
  return false;
146
  }
147
  return true;
148
+
149
  }
150
+
151
  function check_memory_limit() {
152
+
153
  $memory_limit = (int) substr( ini_get('memory_limit'), 0, -1);
154
  //This works only with enough memory, 8MB is silly, wordpress requires already 7.9999
155
  if ( ($memory_limit != 0) && ($memory_limit < 12 ) ) {
156
  add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . __('Sorry, GRAND Flash Album Gallery works only with a Memory Limit of 16 MB higher', 'flag') . '</strong></p></div>\';'));
157
  return false;
158
  }
159
+
160
  return true;
161
+
162
  }
163
+
164
+ function define_tables() {
165
  global $wpdb;
166
+
167
+ // add database pointer
168
  $wpdb->flagpictures = $wpdb->prefix . 'flag_pictures';
169
  $wpdb->flaggallery = $wpdb->prefix . 'flag_gallery';
170
  $wpdb->flagcomments = $wpdb->prefix . 'flag_comments';
171
  $wpdb->flagalbum = $wpdb->prefix . 'flag_album';
172
+
173
  }
174
+
175
  function define_constant() {
176
+
177
  define('FLAGVERSION', $this->version);
178
  // Minimum required database version
179
  define('FLAG_DBVERSION', $this->dbversion);
182
  if ( !defined('WINABSPATH') ) {
183
  define('WINABSPATH', str_replace("\\", "/", ABSPATH) );
184
  }
185
+
186
  // define URL
187
  define('FLAGFOLDER', plugin_basename( dirname(__FILE__)) );
188
+
189
  define('FLAG_ABSPATH', str_replace("\\","/", WP_PLUGIN_DIR . '/' . plugin_basename( dirname(__FILE__) ) . '/' ));
190
  define('FLAG_URLPATH', WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) . '/' );
191
+
192
  // get value for safe mode
193
  if ( !defined('SAFE_MODE') ) {
194
  if ( (gettype( ini_get('safe_mode') ) == 'string') ) {
198
  } else
199
  define( 'SAFE_MODE', ini_get('safe_mode') );
200
  }
201
+
202
  }
203
+
204
  function load_dependencies() {
205
  global $flagdb;
206
+
207
+ // Load global libraries
208
  require_once (dirname (__FILE__) . '/lib/core.php');
209
  require_once (dirname (__FILE__) . '/lib/flag-db.php');
210
  require_once (dirname (__FILE__) . '/lib/image.php');
224
  include_once (dirname (__FILE__) . '/admin/tinymce/tinymce.php');
225
 
226
  // Load backend libraries
227
+ if ( is_admin() ) {
228
  require_once (dirname (__FILE__) . '/admin/admin.php');
229
  require_once (dirname (__FILE__) . '/admin/media-upload.php');
230
  $this->flagAdminPanel = new flagAdminPanel();
231
+
232
+ // Load frontend libraries
233
  } else {
234
  require_once (dirname (__FILE__) . '/lib/swfobject.php');
235
  require_once (dirname (__FILE__) . '/lib/shortcodes.php');
236
+ }
237
  }
238
  }
239
+
240
  function load_textdomain() {
241
+
242
  load_plugin_textdomain('flag', false, dirname( plugin_basename(__FILE__) ) . '/lang');
243
 
244
  }
245
+
246
  function load_scripts() {
247
 
248
  wp_enqueue_script('jquery');
255
  wp_register_script('swfaddress', plugins_url('/flash-album-gallery/admin/js/swfaddress.js'), array(), '2.4');
256
  wp_enqueue_script('swfaddress');
257
  }
 
 
258
 
259
  }
260
 
271
 
272
  function activate() {
273
  //Since version 0.40 it's tested only with PHP5.2, currently we keep PHP4 support a while
274
+ //if (version_compare(PHP_VERSION, '5.2.0', '<')) {
275
  // deactivate_plugins(plugin_basename(__FILE__)); // Deactivate ourself
276
+ // wp_die("Sorry, but you can't run this plugin, it requires PHP 5.2 or higher.");
277
+ // return;
278
+ //}
279
  include_once (dirname (__FILE__) . '/admin/flag_install.php');
280
  // check for tables
281
  flag_install();
282
  $this->flag_fullwindow_page_init();
283
  flush_rewrite_rules();
284
  }
285
+
286
  function deactivate() {
287
  // remove & reset the init check option
288
  delete_option( 'flag_init_check' );
296
  function disable_upgrade($option){
297
 
298
  $this_plugin = plugin_basename(__FILE__);
299
+
300
+ // PHP5.2 is required for FlAG V0.40
301
  if ( version_compare($option->response[ $this_plugin ]->new_version, '0.40', '>=') )
302
  return $option;
303
 
304
  if( isset($option->response[ $this_plugin ]) ){
305
  //TODO:Clear its download link, not now but maybe later
306
  //$option->response[ $this_plugin ]->package = '';
307
+
308
  //Add a notice message
309
  if ($this->add_PHP5_notice == false){
310
  add_action( "in_plugin_update_message-$this->plugin_name", create_function('', 'echo \'<br /><span style="color:red">Please update to PHP5.2 as soon as possible, the plugin is not tested under PHP4 anymore</span>\';') );
313
  }
314
  return $option;
315
  }
316
+
317
  // PLUGIN MESSAGE ON PLUGINS PAGE
318
  function flag_check_message_version($file)
319
  {
329
  if($message)
330
  {
331
  preg_match( '|flag040:(.*)$|mi', $message, $theMessage );
332
+
333
  $columns = substr($wp_version, 0, 3) == "2.8" ? 3 : 5;
334
 
335
  if ( !empty( $theMessage ) )
508
  return $filename;
509
  }
510
  }
 
flagshow.php CHANGED
@@ -34,4 +34,3 @@ $thumb->show();
34
  $thumb->destruct();
35
 
36
  exit;
37
- ?>
34
  $thumb->destruct();
35
 
36
  exit;
 
lib/app.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  // include the flag function
3
  @ require_once (dirname(dirname(__FILE__)). '/flag-config.php');
4
 
@@ -7,7 +10,7 @@ if(isset($_REQUEST['account'])){
7
  global $wpdb, $flagdb;
8
  $account = json_decode(stripslashes($_REQUEST['account']));
9
  $flag_options = get_option ('flag_options');
10
- if($account->access_key != $flag_options['access_key']){ die('{"status":"key_error"}'); }
11
 
12
  $current_plugins = get_option('active_plugins', array());
13
  if (!in_array('flash-album-gallery/flag.php', (array) $current_plugins)) {
@@ -26,10 +29,12 @@ if(isset($_REQUEST['account'])){
26
  $image = $flagdb->find_image( $pid );
27
  if ($image) {
28
  @unlink($image->imagePath);
 
29
  @unlink($image->thumbPath);
30
  $wpdb->query("DELETE FROM $wpdb->flagpictures WHERE pid = '{$image->pid}'");
31
  }
32
  }
 
33
  if(isset($_GET['account']) && isset($GLOBALS[ 'HTTP_RAW_POST_DATA' ])){
34
  $path = $wpdb->get_var("SELECT path FROM $wpdb->flaggallery WHERE gid = $gid");
35
  $file = ABSPATH . trailingslashit($path) . str_replace(array(' ',':'), array('_',''), current_time('mysql')) . '.jpg';
@@ -39,10 +44,10 @@ if(isset($_REQUEST['account'])){
39
  if ( $out ) {
40
  if(@fwrite( $out, $GLOBALS[ 'HTTP_RAW_POST_DATA' ] )){
41
 
42
- $alttext = isset($_GET['alttext'])? $wpdb->escape(flagallery_utf8_urldecode($_GET['alttext'])) : '';
43
- $description = isset($_GET['description'])? $wpdb->escape(flagallery_utf8_urldecode($_GET['description'])) : '';
44
  $exclude = intval($account->exclude);
45
- $location = $wpdb->escape($account->location);
46
 
47
  $wpdb->query( "INSERT INTO `{$wpdb->flagpictures}` (`galleryid`, `filename`, `alttext`, `description`, `exclude`, `location`) VALUES ('$gid', '$filename', '$alttext', '$description', '$exclude', '$location')" );
48
 
@@ -58,9 +63,7 @@ if(isset($_REQUEST['account'])){
58
  do_action('flag_added_new_image', $image);
59
 
60
  $thumb = flagAdmin::create_thumbnail($pic_id);
61
- if($thumb == '1') {
62
- do_action('flag_thumbnail_created', $picture);
63
- } else {
64
  fclose( $out );
65
  die('{"status":"thumb_error: '.$thumb.'"}');
66
  }
@@ -75,9 +78,59 @@ if(isset($_REQUEST['account'])){
75
  die('{"status":"fopen_error"}');
76
  }
77
  }
78
- $r['data'] = $wpdb->get_results("SELECT pid, galleryid, filename, description, alttext, link, UNIX_TIMESTAMP(imagedate) AS imagedate, UNIX_TIMESTAMP(modified) AS modified, sortorder, exclude, location, hitcounter, total_value, total_votes FROM $wpdb->flagpictures WHERE galleryid = '{$gid}' ORDER BY pid DESC");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  $r['data'] = stripslashes_deep($r['data']);
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  echo json_encode($r);
82
  die();
83
  } elseif(isset($account->updated_item)){
@@ -87,9 +140,22 @@ if(isset($_REQUEST['account'])){
87
  if ($image) {
88
  $flagdb->update_picture($args);
89
  $gid = intval($args['galleryid']);
90
- $r['data'] = $wpdb->get_results("SELECT pid, galleryid, filename, description, alttext, link, UNIX_TIMESTAMP(imagedate) AS imagedate, UNIX_TIMESTAMP(modified) AS modified, sortorder, exclude, location, hitcounter, total_value, total_votes FROM $wpdb->flagpictures WHERE galleryid = '{$gid}' ORDER BY pid DESC");
91
  $r['data'] = stripslashes_deep($r['data']);
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  echo json_encode($r);
94
  die();
95
  }
@@ -128,11 +194,19 @@ if(isset($_REQUEST['account'])){
128
  $gid = (int) $gallery['gid'];
129
  $gallery['title'] = htmlspecialchars_decode($gallery['title'], ENT_QUOTES);
130
  $gallery['galdesc'] = htmlspecialchars_decode($gallery['galdesc'], ENT_QUOTES);
131
- $thepictures = $wpdb->get_var("SELECT filename FROM $wpdb->flagpictures WHERE galleryid = '{$gid}' ORDER BY pid DESC");
132
- $r['data'][] = $gallery + array( 'thumbnail' => $thepictures );
 
 
 
 
 
 
 
133
  }
134
  }
135
  $r['data'] = stripslashes_deep($r['data']);
 
136
 
137
  echo json_encode($r);
138
  die();
1
  <?php
2
+ //ini_set( 'display_errors', '1' );
3
+ //ini_set( 'error_reporting', E_ALL );
4
+
5
  // include the flag function
6
  @ require_once (dirname(dirname(__FILE__)). '/flag-config.php');
7
 
10
  global $wpdb, $flagdb;
11
  $account = json_decode(stripslashes($_REQUEST['account']));
12
  $flag_options = get_option ('flag_options');
13
+ if(empty($flag_options['access_key']) || $account->access_key != $flag_options['access_key']){ die('{"status":"key_error"}'); }
14
 
15
  $current_plugins = get_option('active_plugins', array());
16
  if (!in_array('flash-album-gallery/flag.php', (array) $current_plugins)) {
29
  $image = $flagdb->find_image( $pid );
30
  if ($image) {
31
  @unlink($image->imagePath);
32
+ @unlink($image->webimagePath);
33
  @unlink($image->thumbPath);
34
  $wpdb->query("DELETE FROM $wpdb->flagpictures WHERE pid = '{$image->pid}'");
35
  }
36
  }
37
+ // old app
38
  if(isset($_GET['account']) && isset($GLOBALS[ 'HTTP_RAW_POST_DATA' ])){
39
  $path = $wpdb->get_var("SELECT path FROM $wpdb->flaggallery WHERE gid = $gid");
40
  $file = ABSPATH . trailingslashit($path) . str_replace(array(' ',':'), array('_',''), current_time('mysql')) . '.jpg';
44
  if ( $out ) {
45
  if(@fwrite( $out, $GLOBALS[ 'HTTP_RAW_POST_DATA' ] )){
46
 
47
+ $alttext = isset($_GET['alttext'])? esc_sql(flagallery_utf8_urldecode($_GET['alttext'])) : '';
48
+ $description = isset($_GET['description'])? esc_sql(flagallery_utf8_urldecode($_GET['description'])) : '';
49
  $exclude = intval($account->exclude);
50
+ $location = esc_sql($account->location);
51
 
52
  $wpdb->query( "INSERT INTO `{$wpdb->flagpictures}` (`galleryid`, `filename`, `alttext`, `description`, `exclude`, `location`) VALUES ('$gid', '$filename', '$alttext', '$description', '$exclude', '$location')" );
53
 
63
  do_action('flag_added_new_image', $image);
64
 
65
  $thumb = flagAdmin::create_thumbnail($pic_id);
66
+ if($thumb != '1') {
 
 
67
  fclose( $out );
68
  die('{"status":"thumb_error: '.$thumb.'"}');
69
  }
78
  die('{"status":"fopen_error"}');
79
  }
80
  }
81
+ // new app
82
+ if(isset($_POST['account']) && isset($_FILES['userfile']['name'])){
83
+ $path = $wpdb->get_var("SELECT path FROM $wpdb->flaggallery WHERE gid = $gid");
84
+ $file = ABSPATH . trailingslashit($path) . basename( $_FILES['userfile']['name']);
85
+ $filename = basename( $_FILES['userfile']['name']);
86
+ // Open temp file
87
+ if ( @move_uploaded_file($_FILES['userfile']['tmp_name'], $file ) ) {
88
+
89
+ $alttext = esc_sql($account->alttext);
90
+ $description = esc_sql($account->description);
91
+ $exclude = intval($account->exclude);
92
+ $location = esc_sql($account->location);
93
+
94
+ $wpdb->query( "INSERT INTO `{$wpdb->flagpictures}` (`galleryid`, `filename`, `alttext`, `description`, `exclude`, `location`) VALUES ('$gid', '$filename', '$alttext', '$description', '$exclude', '$location')" );
95
+
96
+ // and give me the new id
97
+ $pic_id = (int) $wpdb->insert_id;
98
+
99
+ @ require_once (dirname(dirname(__FILE__)). '/admin/functions.php');
100
+ // add the metadata
101
+ flagAdmin::import_MetaData($pic_id);
102
+
103
+ // action hook for post process after the image is added to the database
104
+ $image = array( 'id' => $pic_id, 'filename' => $filename, 'galleryID' => $gid);
105
+ do_action('flag_added_new_image', $image);
106
+
107
+ $thumb = flagAdmin::create_thumbnail($pic_id);
108
+ if($thumb != '1') {
109
+ fclose( $out );
110
+ die('{"status":"thumb_error: '.$thumb.'"}');
111
+ }
112
+
113
+ } else {
114
+ @unlink($_FILES['userfile']['tmp_name']);
115
+ die('{"status":"fwrite_error"}');
116
+ }
117
+ }
118
+ $r['data'] = $wpdb->get_results("SELECT pid, galleryid, filename, description, alttext, link, UNIX_TIMESTAMP(imagedate) AS imagedate, UNIX_TIMESTAMP(modified) AS modified, sortorder, exclude, location, hitcounter, total_value, total_votes, meta_data FROM $wpdb->flagpictures WHERE galleryid = '{$gid}' ORDER BY pid DESC");
119
  $r['data'] = stripslashes_deep($r['data']);
120
 
121
+ $i = 0;
122
+ foreach($r['data'] as $image_data){
123
+ $meta = maybe_unserialize($image_data->meta_data);
124
+ if(isset($meta['webview']) && !empty($meta['webview'])){
125
+ $r['data'][$i]->webviewfilename = '/webview/'. $image_data->filename;
126
+ } else {
127
+ $r['data'][$i]->webviewfilename = '';
128
+ }
129
+ $r['data'][$i]->thumbfilename = '/thumbs/thumbs_'. $image_data->filename;
130
+ unset($r['data'][$i]->meta_data);
131
+ $i++;
132
+ }
133
+
134
  echo json_encode($r);
135
  die();
136
  } elseif(isset($account->updated_item)){
140
  if ($image) {
141
  $flagdb->update_picture($args);
142
  $gid = intval($args['galleryid']);
143
+ $r['data'] = $wpdb->get_results("SELECT pid, galleryid, filename, description, alttext, link, UNIX_TIMESTAMP(imagedate) AS imagedate, UNIX_TIMESTAMP(modified) AS modified, sortorder, exclude, location, hitcounter, total_value, total_votes, meta_data FROM $wpdb->flagpictures WHERE galleryid = '{$gid}' ORDER BY pid DESC");
144
  $r['data'] = stripslashes_deep($r['data']);
145
 
146
+ $i = 0;
147
+ foreach($r['data'] as $image_data){
148
+ $meta = maybe_unserialize($image_data->meta_data);
149
+ if(isset($meta['webview']) && !empty($meta['webview'])){
150
+ $r['data'][$i]->webviewfilename = '/webview/'. $image_data->filename;
151
+ } else {
152
+ $r['data'][$i]->webviewfilename = '';
153
+ }
154
+ $r['data'][$i]->thumbfilename = '/thumbs/thumbs_'. $image_data->filename;
155
+ unset($r['data'][$i]->meta_data);
156
+ $i++;
157
+ }
158
+
159
  echo json_encode($r);
160
  die();
161
  }
194
  $gid = (int) $gallery['gid'];
195
  $gallery['title'] = htmlspecialchars_decode($gallery['title'], ENT_QUOTES);
196
  $gallery['galdesc'] = htmlspecialchars_decode($gallery['galdesc'], ENT_QUOTES);
197
+ $wp_site_url = explode('//', site_url(), 2);
198
+ $wp_site_url = explode('/', $wp_site_url[1], 2);
199
+ $wp_folder = (isset($wp_site_url[1]) && !empty($wp_site_url[1]))? trailingslashit($wp_site_url[1]) : '';
200
+
201
+ $gallery['path'] = $wp_folder . $gallery['path'];
202
+ $preview = $wpdb->get_var("SELECT filename FROM {$wpdb->flagpictures} WHERE galleryid = '{$gid}' ORDER BY pid DESC");
203
+ $picturesCounter = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->flagpictures} WHERE galleryid = '{$gid}'");
204
+ $picturesCounter = intval($picturesCounter);
205
+ $r['data'][] = $gallery + array( 'thumbnail' => $preview, 'thumbfilename' => '/thumbs/thumbs_'.$preview, 'counter' => $picturesCounter );
206
  }
207
  }
208
  $r['data'] = stripslashes_deep($r['data']);
209
+ $r['flag_version'] = get_option('flagVersion');
210
 
211
  echo json_encode($r);
212
  die();
lib/class.swfobject.php CHANGED
@@ -133,4 +133,3 @@ class flag_swfobject {
133
 
134
  }
135
  endif;
136
- ?>
133
 
134
  }
135
  endif;
 
lib/constructor.php CHANGED
@@ -35,5 +35,3 @@ if(isset($arr['properties_skin']) && !empty($arr['properties_skin'])) {
35
  } else {
36
  echo '0';
37
  }
38
-
39
- ?>
35
  } else {
36
  echo '0';
37
  }
 
 
lib/core.php CHANGED
@@ -72,13 +72,13 @@ class flagGallery {
72
  }
73
 
74
  /**
75
- * flagGallery::get_thumbnail_folder()
76
  *
77
  * @param mixed $gallerypath
78
  * @param bool $include_Abspath
79
  * @return string $foldername
80
  */
81
- static function create_thumbnail_folder($gallerypath, $include_Abspath = TRUE) {
82
  if (!$include_Abspath) {
83
  $gallerypath = WINABSPATH . $gallerypath;
84
  }
@@ -87,15 +87,54 @@ class flagGallery {
87
  return FALSE;
88
  }
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  if (is_dir($gallerypath . '/thumbs/')) {
91
  return '/thumbs/';
92
  }
93
-
94
  if (is_admin()) {
95
  if (!is_dir($gallerypath . '/thumbs/')) {
96
  if ( !wp_mkdir_p($gallerypath . '/thumbs/') ) {
97
  if (SAFE_MODE) {
98
- flagAdmin::check_safemode($gallerypath . '/thumbs/');
99
  } else {
100
  flagGallery::show_error(__('Unable to create directory ', 'flag') . $gallerypath . '/thumbs !');
101
  }
@@ -104,9 +143,9 @@ class flagGallery {
104
  return '/thumbs/';
105
  }
106
  }
107
-
108
  return FALSE;
109
-
110
  }
111
 
112
  /**
@@ -227,9 +266,12 @@ class flagGallery {
227
  $filepart['filename'] = substr($filepart['basename'],0 ,strlen($filepart['basename']) - (strlen($filepart['extension']) + 1) );
228
 
229
  $filepart['filename'] = sanitize_title_with_dashes( $filepart['filename'] );
230
-
 
 
 
231
  //extension jpeg will not be recognized by the slideshow, so we rename it
232
- $filepart['extension'] = ($filepart['extension'] == 'jpeg') ? 'jpg' : $filepart['extension'];
233
 
234
  //combine the new file name
235
  $filepart['basename'] = $filepart['filename'] . '.' . $filepart['extension'];
@@ -357,5 +399,3 @@ class flagGallery {
357
  }
358
 
359
  }
360
-
361
- ?>
72
  }
73
 
74
  /**
75
+ * flagGallery::create_webview_folder()
76
  *
77
  * @param mixed $gallerypath
78
  * @param bool $include_Abspath
79
  * @return string $foldername
80
  */
81
+ static function create_webview_folder($gallerypath, $include_Abspath = TRUE) {
82
  if (!$include_Abspath) {
83
  $gallerypath = WINABSPATH . $gallerypath;
84
  }
87
  return FALSE;
88
  }
89
 
90
+ if (is_dir($gallerypath . '/webview/')) {
91
+ return '/webview/';
92
+ }
93
+
94
+ if (is_admin()) {
95
+ if (!is_dir($gallerypath . '/webview/')) {
96
+ if ( !wp_mkdir_p($gallerypath . '/webview/') ) {
97
+ if (SAFE_MODE) {
98
+ flagAdmin::check_safemode($gallerypath . '/webview/');
99
+ } else {
100
+ flagGallery::show_error(__('Unable to create directory ', 'flag') . $gallerypath . '/webview !');
101
+ }
102
+ return FALSE;
103
+ }
104
+
105
+ return '/webview/';
106
+ }
107
+ }
108
+
109
+ return FALSE;
110
+
111
+ }
112
+
113
+ /**
114
+ * flagGallery::get_thumbnail_folder()
115
+ *
116
+ * @param mixed $gallerypath
117
+ * @param bool $include_Abspath
118
+ * @return string $foldername
119
+ */
120
+ static function create_thumbnail_folder($gallerypath, $include_Abspath = TRUE) {
121
+ if (!$include_Abspath) {
122
+ $gallerypath = WINABSPATH . $gallerypath;
123
+ }
124
+
125
+ if (!file_exists($gallerypath)) {
126
+ return FALSE;
127
+ }
128
+
129
  if (is_dir($gallerypath . '/thumbs/')) {
130
  return '/thumbs/';
131
  }
132
+
133
  if (is_admin()) {
134
  if (!is_dir($gallerypath . '/thumbs/')) {
135
  if ( !wp_mkdir_p($gallerypath . '/thumbs/') ) {
136
  if (SAFE_MODE) {
137
+ flagAdmin::check_safemode($gallerypath . '/thumbs/');
138
  } else {
139
  flagGallery::show_error(__('Unable to create directory ', 'flag') . $gallerypath . '/thumbs !');
140
  }
143
  return '/thumbs/';
144
  }
145
  }
146
+
147
  return FALSE;
148
+
149
  }
150
 
151
  /**
266
  $filepart['filename'] = substr($filepart['basename'],0 ,strlen($filepart['basename']) - (strlen($filepart['extension']) + 1) );
267
 
268
  $filepart['filename'] = sanitize_title_with_dashes( $filepart['filename'] );
269
+
270
+ if ( empty($filepart['filename']) )
271
+ $filepart['filename'] = str_replace(array(' ',':'), array('_',''), current_time('mysql'));
272
+
273
  //extension jpeg will not be recognized by the slideshow, so we rename it
274
+ $filepart['extension'] = (empty($filepart['extension']) || $filepart['extension'] == 'jpeg') ? 'jpg' : strtolower($filepart['extension']);
275
 
276
  //combine the new file name
277
  $filepart['basename'] = $filepart['filename'] . '.' . $filepart['extension'];
399
  }
400
 
401
  }
 
 
lib/flag-db.php CHANGED
@@ -158,7 +158,7 @@ class flagdb {
158
  function get_album($id) {
159
  /** @var $wpdb wpdb */
160
  global $wpdb;
161
- $id = $wpdb->escape($id);
162
  $albums = $wpdb->get_var( "SELECT categories FROM $wpdb->flagalbum WHERE id = '{$id}'" );
163
  return $albums;
164
  }
@@ -363,7 +363,7 @@ class flagdb {
363
  // create the sql parameter "name = value"
364
  foreach ($update as $key => $value)
365
  if ($value)
366
- $sql[] = $key . " = '" . $wpdb->escape($value) . "'";
367
 
368
  // create the final string
369
  $sql = implode(', ', $sql);
@@ -617,7 +617,7 @@ class flagdb {
617
  $searchand = ' AND ';
618
  }
619
 
620
- $term = $wpdb->escape($request);
621
  if (count($search_terms) > 1 && $search_terms[0] != $request )
622
  $search .= " OR (tt.description LIKE '{$n}{$term}{$n}') OR (tt.alttext LIKE '{$n}{$term}{$n}') OR (tt.filename LIKE '{$n}{$term}{$n}')";
623
 
@@ -657,7 +657,7 @@ class flagdb {
657
  // If a search pattern is specified, load the posts that match
658
  if ( !empty($filename) ) {
659
  // added slashes screw with quote grouping when done early, so done later
660
- $term = $wpdb->escape($filename);
661
 
662
  if ( is_numeric($galleryID) ) {
663
  $id = (int) $galleryID;
@@ -708,9 +708,9 @@ class flagdb {
708
  global $wpdb;
709
 
710
  $pid =intval($args['pid']);
711
- $alttext = $wpdb->escape($args['alttext']);
712
- $desc = $wpdb->escape($args['description']);
713
- $link = $wpdb->escape($args['link']);
714
  $sortorder = intval($args['sortorder']);
715
  $exclude = intval($args['exclude']);
716
 
@@ -730,4 +730,3 @@ if ( ! isset($GLOBALS['flagdb']) ) {
730
  unset($GLOBALS['flagdb']);
731
  $GLOBALS['flagdb'] = new flagdb();
732
  }
733
- ?>
158
  function get_album($id) {
159
  /** @var $wpdb wpdb */
160
  global $wpdb;
161
+ $id = esc_sql($id);
162
  $albums = $wpdb->get_var( "SELECT categories FROM $wpdb->flagalbum WHERE id = '{$id}'" );
163
  return $albums;
164
  }
363
  // create the sql parameter "name = value"
364
  foreach ($update as $key => $value)
365
  if ($value)
366
+ $sql[] = $key . " = '" . esc_sql($value) . "'";
367
 
368
  // create the final string
369
  $sql = implode(', ', $sql);
617
  $searchand = ' AND ';
618
  }
619
 
620
+ $term = esc_sql($request);
621
  if (count($search_terms) > 1 && $search_terms[0] != $request )
622
  $search .= " OR (tt.description LIKE '{$n}{$term}{$n}') OR (tt.alttext LIKE '{$n}{$term}{$n}') OR (tt.filename LIKE '{$n}{$term}{$n}')";
623
 
657
  // If a search pattern is specified, load the posts that match
658
  if ( !empty($filename) ) {
659
  // added slashes screw with quote grouping when done early, so done later
660
+ $term = esc_sql($filename);
661
 
662
  if ( is_numeric($galleryID) ) {
663
  $id = (int) $galleryID;
708
  global $wpdb;
709
 
710
  $pid =intval($args['pid']);
711
+ $alttext = esc_sql($args['alttext']);
712
+ $desc = esc_sql($args['description']);
713
+ $link = esc_sql($args['link']);
714
  $sortorder = intval($args['sortorder']);
715
  $exclude = intval($args['exclude']);
716
 
730
  unset($GLOBALS['flagdb']);
731
  $GLOBALS['flagdb'] = new flagdb();
732
  }
 
lib/flv.php CHANGED
@@ -27,4 +27,3 @@ if(isset($_GET['vID'])) {
27
  } else {
28
  echo 'no such file ID';
29
  }
30
- ?>
27
  } else {
28
  echo 'no such file ID';
29
  }
 
lib/gallery.php CHANGED
@@ -85,5 +85,3 @@ foreach ( $gID as $galleryID ) {
85
  }
86
  }
87
  echo "</gallery>\n";
88
-
89
- ?>
85
  }
86
  }
87
  echo "</gallery>\n";
 
 
lib/gd.thumbnail.inc.php CHANGED
@@ -759,4 +759,3 @@ class flag_Thumbnail {
759
  return true;
760
  }
761
  }
762
- ?>
759
  return true;
760
  }
761
  }
 
lib/hitcounter.php CHANGED
@@ -76,4 +76,3 @@ function flag_update_counter($upd) {
76
  }
77
 
78
  }
79
- ?>
76
  }
77
 
78
  }
 
lib/image.php CHANGED
@@ -12,6 +12,7 @@ class flagImage{
12
  var $imageURL = ''; // URL Path to the image
13
  var $thumbURL = ''; // URL Path to the thumbnail
14
  var $imagePath = ''; // Server Path to the image
 
15
  var $thumbPath = ''; // Server Path to the thumbnail
16
  var $href = ''; // A href link code
17
 
@@ -61,6 +62,7 @@ class flagImage{
61
  $this->imageURL = get_option ('siteurl') . '/' . $this->path . '/' . $this->filename;
62
  $this->thumbURL = get_option ('siteurl') . '/' . $this->path . '/thumbs/thumbs_' . $this->filename;
63
  $this->imagePath = WINABSPATH.$this->path . '/' . $this->filename;
 
64
  $this->thumbPath = WINABSPATH.$this->path . '/thumbs/thumbs_' . $this->filename;
65
  $this->meta_data = unserialize($this->meta_data);
66
 
@@ -86,4 +88,3 @@ class flagImage{
86
 
87
  }
88
  endif;
89
- ?>
12
  var $imageURL = ''; // URL Path to the image
13
  var $thumbURL = ''; // URL Path to the thumbnail
14
  var $imagePath = ''; // Server Path to the image
15
+ var $webimagePath = ''; // Server Path to the image
16
  var $thumbPath = ''; // Server Path to the thumbnail
17
  var $href = ''; // A href link code
18
 
62
  $this->imageURL = get_option ('siteurl') . '/' . $this->path . '/' . $this->filename;
63
  $this->thumbURL = get_option ('siteurl') . '/' . $this->path . '/thumbs/thumbs_' . $this->filename;
64
  $this->imagePath = WINABSPATH.$this->path . '/' . $this->filename;
65
+ $this->webimagePath = WINABSPATH.$this->path . '/webview/' . $this->filename;
66
  $this->thumbPath = WINABSPATH.$this->path . '/thumbs/thumbs_' . $this->filename;
67
  $this->meta_data = unserialize($this->meta_data);
68
 
88
 
89
  }
90
  endif;
 
lib/media-rss.php CHANGED
@@ -190,5 +190,3 @@ class flagMediaRss {
190
  }
191
 
192
  }
193
-
194
- ?>
190
  }
191
 
192
  }
 
 
lib/meta.php CHANGED
@@ -105,57 +105,65 @@ class flagMeta {
105
  $meta= array();
106
 
107
  // taken from WP core
108
- $exif = $this->exif_data['EXIF'];
109
- if (!empty($exif['FNumber']))
110
- $meta['aperture'] = 'F ' . round( $this->exif_frac2dec( $exif['FNumber'] ), 2 );
111
- if (!empty($exif['Model']))
112
- $meta['camera'] = trim( $exif['Model'] );
113
- if (!empty($exif['DateTimeDigitized']))
114
- $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeDigitized']));
115
- if (!empty($exif['FocalLength']))
116
- $meta['focal_length'] = $this->exif_frac2dec( $exif['FocalLength'] ) . __(' mm','flag');
117
- if (!empty($exif['ISOSpeedRatings']))
118
- $meta['iso'] = $exif['ISOSpeedRatings'];
119
- if (!empty($exif['ExposureTime'])) {
120
- $meta['shutter_speed'] = $this->exif_frac2dec ($exif['ExposureTime']);
121
- $meta['shutter_speed'] =($meta['shutter_speed'] > 0.0 and $meta['shutter_speed'] < 1.0) ? ( '1/' . round( 1 / $meta['shutter_speed'], -1) ) : ($meta['shutter_speed']);
122
- $meta['shutter_speed'] .= __(' sec','flag');
123
- }
124
- //Bit 0 indicates the flash firing status
125
- if (!empty($exif['Flash']))
126
- $meta['flash'] = ( $exif['Flash'] & 1 ) ? __('Fired', 'flag') : __('Not fired',' flag');
127
-
 
 
128
  // additional information
129
- $exif = $this->exif_data['IFD0'];
130
- if (!empty($exif['Model']))
131
- $meta['camera'] = $exif['Model'];
132
- if (!empty($exif['Make']))
133
- $meta['make'] = $exif['Make'];
134
- if (!empty($exif['ImageDescription']))
135
- $meta['title'] = utf8_encode($exif['ImageDescription']);
136
- if (!empty($exif['Orientation']))
137
- $meta['Orientation'] = $exif['Orientation'];
138
-
139
- // this is done by Windows
140
- $exif = $this->exif_data['WINXP'];
141
 
142
- if (!empty($exif['Title']) && empty($meta['title']))
143
- $meta['title'] = utf8_encode($exif['Title']);
144
- if (!empty($exif['Author']))
145
- $meta['author'] = utf8_encode($exif['Author']);
146
- if (!empty($exif['Keywords']))
147
- $meta['tags'] = utf8_encode($exif['Keywords']);
148
- if (!empty($exif['Subject']))
149
- $meta['subject'] = utf8_encode($exif['Subject']);
150
- if (!empty($exif['Comments']))
151
- $meta['caption'] = utf8_encode($exif['Comments']);
 
 
 
 
152
 
153
  $this->exif_array = $meta;
154
  }
155
 
156
  // return one element if requested
157
- if ($object)
 
 
158
  return $this->exif_array[$object];
 
159
 
160
  return $this->exif_array;
161
 
@@ -214,14 +222,17 @@ class flagMeta {
214
  // var_dump($this->iptc_data);
215
  $meta = array();
216
  foreach ($iptcTags as $key => $value) {
217
- if ($this->iptc_data[$key])
218
  $meta[$value] = trim(utf8_encode(implode(", ", $this->iptc_data[$key])));
219
  }
220
  $this->iptc_array = $meta;
221
  }
222
  // return one element if requested
223
- if ($object)
 
 
224
  return $this->iptc_array[$object];
 
225
  return $this->iptc_array;
226
  }
227
 
@@ -311,7 +322,8 @@ class flagMeta {
311
  } // foreach
312
 
313
  // cut off the useless tags
314
- $xmlarray = $xmlarray['x:xmpmeta']['rdf:RDF']['rdf:Description'];
 
315
 
316
  // --------- Some values from the XMP format--------- //
317
  $xmpTags = array (
@@ -330,7 +342,7 @@ class flagMeta {
330
 
331
  foreach ($xmpTags as $key => $value) {
332
  // if the kex exist
333
- if ($xmlarray[$key]) {
334
  switch ($key) {
335
  case 'xap:CreateDate' :
336
  case 'xap:ModifyDate' :
@@ -343,8 +355,11 @@ class flagMeta {
343
  }
344
  }
345
  // return one element if requested
346
- if ($object)
 
 
347
  return $this->xmp_array[$object];
 
348
  return $this->xmp_array;
349
  }
350
 
@@ -422,7 +437,7 @@ class flagMeta {
422
  'flash' => __('Flash','flag')
423
  );
424
 
425
- if ($tagnames[$key]) $key = $tagnames[$key];
426
 
427
  return($key);
428
  }
@@ -430,7 +445,7 @@ class flagMeta {
430
  function get_date_time() {
431
  // get exif - data
432
  if ($this->exif_data) {
433
- $date_time = $this->exif_data['EXIF']['DateTimeDigitized'];
434
  // if we didn't get the correct exif value we take filetime
435
  if ($date_time == null)
436
  $date_time = $this->exif_data['FILE']['FileDateTime'];
@@ -487,4 +502,3 @@ class flagMeta {
487
  }
488
 
489
  }
490
- ?>
105
  $meta= array();
106
 
107
  // taken from WP core
108
+ if(isset($this->exif_data['EXIF'])){
109
+ $exif = $this->exif_data['EXIF'];
110
+ if (!empty($exif['FNumber']))
111
+ $meta['aperture'] = 'F ' . round( $this->exif_frac2dec( $exif['FNumber'] ), 2 );
112
+ if (!empty($exif['Model']))
113
+ $meta['camera'] = trim( $exif['Model'] );
114
+ if (!empty($exif['DateTimeDigitized']))
115
+ $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeDigitized']));
116
+ if (!empty($exif['FocalLength']))
117
+ $meta['focal_length'] = $this->exif_frac2dec( $exif['FocalLength'] ) . __(' mm','flag');
118
+ if (!empty($exif['ISOSpeedRatings']))
119
+ $meta['iso'] = $exif['ISOSpeedRatings'];
120
+ if (!empty($exif['ExposureTime'])) {
121
+ $meta['shutter_speed'] = $this->exif_frac2dec ($exif['ExposureTime']);
122
+ $meta['shutter_speed'] =($meta['shutter_speed'] > 0.0 and $meta['shutter_speed'] < 1.0) ? ( '1/' . round( 1 / $meta['shutter_speed'], -1) ) : ($meta['shutter_speed']);
123
+ $meta['shutter_speed'] .= __(' sec','flag');
124
+ }
125
+ //Bit 0 indicates the flash firing status
126
+ if (!empty($exif['Flash']))
127
+ $meta['flash'] = ( $exif['Flash'] & 1 ) ? __('Fired', 'flag') : __('Not fired',' flag');
128
+ }
129
+
130
  // additional information
131
+ if(isset($this->exif_data['IFD0'])){
132
+ $exif = $this->exif_data['IFD0'];
133
+ if (!empty($exif['Model']))
134
+ $meta['camera'] = $exif['Model'];
135
+ if (!empty($exif['Make']))
136
+ $meta['make'] = $exif['Make'];
137
+ if (!empty($exif['ImageDescription']))
138
+ $meta['title'] = utf8_encode($exif['ImageDescription']);
139
+ if (!empty($exif['Orientation']))
140
+ $meta['Orientation'] = $exif['Orientation'];
141
+ }
 
142
 
143
+ // this is done by Windows
144
+ if(isset($this->exif_data['WINXP'])){
145
+ $exif = $this->exif_data['WINXP'];
146
+ if (!empty($exif['Title']) && empty($meta['title']))
147
+ $meta['title'] = utf8_encode($exif['Title']);
148
+ if (!empty($exif['Author']))
149
+ $meta['author'] = utf8_encode($exif['Author']);
150
+ if (!empty($exif['Keywords']))
151
+ $meta['tags'] = utf8_encode($exif['Keywords']);
152
+ if (!empty($exif['Subject']))
153
+ $meta['subject'] = utf8_encode($exif['Subject']);
154
+ if (!empty($exif['Comments']))
155
+ $meta['caption'] = utf8_encode($exif['Comments']);
156
+ }
157
 
158
  $this->exif_array = $meta;
159
  }
160
 
161
  // return one element if requested
162
+ if ($object){
163
+ if(!isset($this->exif_array[$object]))
164
+ $this->exif_array[$object] = '';
165
  return $this->exif_array[$object];
166
+ }
167
 
168
  return $this->exif_array;
169
 
222
  // var_dump($this->iptc_data);
223
  $meta = array();
224
  foreach ($iptcTags as $key => $value) {
225
+ if (isset($this->iptc_data[$key]))
226
  $meta[$value] = trim(utf8_encode(implode(", ", $this->iptc_data[$key])));
227
  }
228
  $this->iptc_array = $meta;
229
  }
230
  // return one element if requested
231
+ if ($object){
232
+ if(!isset($this->iptc_array[$object]))
233
+ $this->iptc_array[$object] = '';
234
  return $this->iptc_array[$object];
235
+ }
236
  return $this->iptc_array;
237
  }
238
 
322
  } // foreach
323
 
324
  // cut off the useless tags
325
+ if(isset($xmlarray['x:xmpmeta']))
326
+ $xmlarray = $xmlarray['x:xmpmeta']['rdf:RDF']['rdf:Description'];
327
 
328
  // --------- Some values from the XMP format--------- //
329
  $xmpTags = array (
342
 
343
  foreach ($xmpTags as $key => $value) {
344
  // if the kex exist
345
+ if (isset($xmlarray[$key]) && $xmlarray[$key]) {
346
  switch ($key) {
347
  case 'xap:CreateDate' :
348
  case 'xap:ModifyDate' :
355
  }
356
  }
357
  // return one element if requested
358
+ if ($object){
359
+ if(!isset($this->xmp_array[$object]))
360
+ $this->xmp_array[$object] = '';
361
  return $this->xmp_array[$object];
362
+ }
363
  return $this->xmp_array;
364
  }
365
 
437
  'flash' => __('Flash','flag')
438
  );
439
 
440
+ if (isset($tagnames[$key])) $key = $tagnames[$key];
441
 
442
  return($key);
443
  }
445
  function get_date_time() {
446
  // get exif - data
447
  if ($this->exif_data) {
448
+ $date_time = isset($this->exif_data['EXIF']['DateTimeDigitized'])? $this->exif_data['EXIF']['DateTimeDigitized'] : null;
449
  // if we didn't get the correct exif value we take filetime
450
  if ($date_time == null)
451
  $date_time = $this->exif_data['FILE']['FileDateTime'];
502
  }
503
 
504
  }
 
lib/shortcodes.php CHANGED
@@ -133,11 +133,13 @@ class FlAG_shortcodes {
133
  wp_print_scripts('flagscroll');
134
  }
135
  if ( $this->flag_fancybox ) {
 
 
136
  wp_print_styles('fancybox');
137
  wp_print_scripts('fancybox');
138
  }
139
  if ( $this->flag_add_script ) {
140
- wp_register_script('flagscript', plugins_url('/admin/js/script.js', dirname(__FILE__)), array('jquery'), '1.0', true );
141
  wp_print_scripts('flagscript');
142
  wp_register_style('flagallery', plugins_url('/admin/css/flagallery.css', dirname(__FILE__)) );
143
  wp_print_styles('flagallery');
@@ -281,5 +283,3 @@ class FlAG_shortcodes {
281
 
282
  // let's use it
283
  $flagShortcodes = new FlAG_Shortcodes;
284
-
285
- ?>
133
  wp_print_scripts('flagscroll');
134
  }
135
  if ( $this->flag_fancybox ) {
136
+ wp_register_style('fancybox', plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.css') );
137
+ wp_register_script('fancybox', plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.pack.js'), array(), '1.3.4', true );
138
  wp_print_styles('fancybox');
139
  wp_print_scripts('fancybox');
140
  }
141
  if ( $this->flag_add_script ) {
142
+ wp_register_script('flagscript', plugins_url('/admin/js/script.js', dirname(__FILE__)), array('jquery'), '1.1', true );
143
  wp_print_scripts('flagscript');
144
  wp_register_style('flagallery', plugins_url('/admin/css/flagallery.css', dirname(__FILE__)) );
145
  wp_print_styles('flagallery');
283
 
284
  // let's use it
285
  $flagShortcodes = new FlAG_Shortcodes;
 
 
lib/swfobject.php CHANGED
@@ -502,5 +502,3 @@ function get_include_contents($filename, $galleryID, $skin, $skinID, $width, $he
502
  }
503
  return false;
504
  }
505
-
506
- ?>
502
  }
503
  return false;
504
  }
 
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Rattus
3
  Donate link: http://photogallerycreator.com/grand-flagallery/
4
  Tags: admin, flash, fullscreen gallery, gallery, image, images, image gallery, mp3, music, page, photo, slider, plugin, slideshow, video, widget, iphone gallery, best gallery, portfolio, banner rotator
5
  Requires at least: 3.0
6
- Tested up to: 3.6.2
7
  Stable tag: trunk
8
 
9
  Photo Gallery, Video Gallery, Music Album & Banner Rotator plugin with powerfull admin to manage your media content
@@ -47,12 +47,20 @@ Now you can see "Views" of each photo in the gallery and visitors can "Like" ima
47
  * Demo [Gallery Widgets](http://photogallerycreator.com/widgets-for-wordpress/)
48
  * Demo [Facebook Gallery Integration](http://www.facebook.com/#!/PhotoGalleryCreator?sk=app_206659789371708)
49
 
50
- New plugin:
51
- > Try our **new plugin** called [Gmedia Gallery](http://wordpress.org/extend/plugins/grand-media/). Help me make it best gallery plugin: test it and write suggestions how I can improve it in feature versions.
52
-
53
 
54
  == Changelog ==
55
 
 
 
 
 
 
 
 
 
 
 
 
56
  = v3.20 - 15.10.2013 =
57
  * Fix alternative gallery
58
  * Added Gallery sorting on Manage Galleries page
3
  Donate link: http://photogallerycreator.com/grand-flagallery/
4
  Tags: admin, flash, fullscreen gallery, gallery, image, images, image gallery, mp3, music, page, photo, slider, plugin, slideshow, video, widget, iphone gallery, best gallery, portfolio, banner rotator
5
  Requires at least: 3.0
6
+ Tested up to: 3.8.1
7
  Stable tag: trunk
8
 
9
  Photo Gallery, Video Gallery, Music Album & Banner Rotator plugin with powerfull admin to manage your media content
47
  * Demo [Gallery Widgets](http://photogallerycreator.com/widgets-for-wordpress/)
48
  * Demo [Facebook Gallery Integration](http://www.facebook.com/#!/PhotoGalleryCreator?sk=app_206659789371708)
49
 
 
 
 
50
 
51
  == Changelog ==
52
 
53
+ = v4.00 - 17.01.2014 =
54
+ * added ability to set thumb size while upload
55
+ * added optimized image size for mobile devices
56
+ * added ability to turn off optimized images for mobile devices
57
+ * fixed strict warnings
58
+ * added hooks when creating thumbs or resizing images
59
+ * fixed alternative gallery for firefox based browsers
60
+ * added action for creating optimized images on Manage Galleries page and on Edit Gallery page
61
+ * show sizes for thumbnails and optimized images
62
+ * small fixes and improvements
63
+
64
  = v3.20 - 15.10.2013 =
65
  * Fix alternative gallery
66
  * Added Gallery sorting on Manage Galleries page
widgets/widgets.php CHANGED
@@ -706,6 +706,3 @@ function flagMusicWidget($xml, $w = '100%', $h = '200', $skin = 'music_default')
706
  echo flagMusicWidget::render_music($xml, $w, $h, $skin);
707
 
708
  }
709
-
710
-
711
- ?>
706
  echo flagMusicWidget::render_music($xml, $w, $h, $skin);
707
 
708
  }
 
 
 
xml/media-rss.php CHANGED
@@ -91,4 +91,3 @@ if ($mode=='last_pictures') {
91
  header("content-type:text/xml;charset=utf-8");
92
  echo "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n";
93
  echo $rss;
94
- ?>
91
  header("content-type:text/xml;charset=utf-8");
92
  echo "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n";
93
  echo $rss;