Image Photo Gallery Final Tiles Grid - Version 3.3.34

Version Description

  • [Fix] Fixed lightbox skipping images bug
Download this release

Release Info

Developer GreenTreeLabs
Plugin Icon 128x128 Image Photo Gallery Final Tiles Grid
Version 3.3.34
Comparing to
See all releases

Code changes from version 3.3.32 to 3.3.34

FinalTilesGalleryLite.php CHANGED
@@ -5,15 +5,17 @@
5
  * Plugin URI: https://www.final-tiles-gallery.com
6
  * Description: Wordpress Plugin for creating responsive image galleries. By: GreenTreeLabs
7
  * Author: Green Tree Labs
8
- * Version: 3.3.32
9
  * Author URI: https://www.greentreelabs.net
10
  *
11
  * @fs_premium_only /lightbox-pro/
12
  *
13
  */
14
- define( "FTGVERSION", "3.3.32" );
15
  /*
16
  Changelog:
 
 
17
  3.3.30
18
  Fix: fixed wrong image order when using Masonry layout
19
  3.3.29
5
  * Plugin URI: https://www.final-tiles-gallery.com
6
  * Description: Wordpress Plugin for creating responsive image galleries. By: GreenTreeLabs
7
  * Author: Green Tree Labs
8
+ * Version: 3.3.34
9
  * Author URI: https://www.greentreelabs.net
10
  *
11
  * @fs_premium_only /lightbox-pro/
12
  *
13
  */
14
+ define( "FTGVERSION", "3.3.34" );
15
  /*
16
  Changelog:
17
+ 3.3.34
18
+ Fix: fixed lightbox skipping images bug
19
  3.3.30
20
  Fix: fixed wrong image order when using Masonry layout
21
  3.3.29
admin/include/fields.php CHANGED
@@ -418,7 +418,7 @@ $this->addField( "Links & Lightbox", "lightbox", array(
418
  "excludeFrom" => array(),
419
  ) );
420
  $this->addField( "Links & Lightbox", "mobileLightbox", array(
421
- "name" => "Lightbox & Links",
422
  "type" => "select",
423
  "description" => "Define here what happens when user click on the images. Lightboxes with video support: EverlightBox, LightGallery, Magnific popup, Colorbox (require embed URL)); PrettyPhoto, FancyBox (require embed URL)",
424
  "values" => array(
418
  "excludeFrom" => array(),
419
  ) );
420
  $this->addField( "Links & Lightbox", "mobileLightbox", array(
421
+ "name" => "Lightbox & Links (mobile)",
422
  "type" => "select",
423
  "description" => "Define here what happens when user click on the images. Lightboxes with video support: EverlightBox, LightGallery, Magnific popup, Colorbox (require embed URL)); PrettyPhoto, FancyBox (require embed URL)",
424
  "values" => array(
admin/scripts/final-tiles-gallery-admin.js CHANGED
@@ -514,7 +514,7 @@ var FTG = function($) {
514
  $('#video-panel-action').val('edit');
515
 
516
  var filters = "";
517
- if($(".gallery-filters [name=ftg_filters]").val())
518
  filters = $(".gallery-filters [name=ftg_filters]").val().split('|');
519
  $(".video-filters", $panel).empty();
520
  for (var i = 0; i < filters.length; i++) {
514
  $('#video-panel-action').val('edit');
515
 
516
  var filters = "";
517
+ if($(".gallery-filters [name=ftg_filters]").length)
518
  filters = $(".gallery-filters [name=ftg_filters]").val().split('|');
519
  $(".video-filters", $panel).empty();
520
  for (var i = 0; i < filters.length; i++) {
lib/gallery-class.php CHANGED
@@ -23,7 +23,9 @@ if ( !class_exists( "FinalTilesGallery" ) ) {
23
  $this->gallery->{$prop} = $v;
24
  }
25
  }
26
- $this->gallery->source = "images";
 
 
27
  switch ( $this->gallery->source ) {
28
  default:
29
  case "images":
@@ -231,14 +233,7 @@ if ( !class_exists( "FinalTilesGallery" ) ) {
231
 
232
  public static function getFilters( $filters )
233
  {
234
- if ( empty($filters) || !ftg_fs()->is_plan_or_trial__premium_only( 'ultimate' ) ) {
235
- return "";
236
- }
237
- $css = array();
238
- foreach ( explode( "|", $filters ) as $f ) {
239
- $css[] = "ftg-set-" . FinalTilesGallery::slugify( $f );
240
- }
241
- return implode( " ", $css );
242
  }
243
 
244
  private function hasSocial()
@@ -308,7 +303,7 @@ if ( !class_exists( "FinalTilesGallery" ) ) {
308
  }
309
  //style
310
  $bgCaption = $this->toRGB( $gallery->captionBackgroundColor );
311
- $html = "<!-- Final Tiles Grid Gallery for WordPress v" . FTGVERSION . " -->\n\n";
312
  $html .= stripslashes( $this->gallery->beforeGalleryText );
313
  $captionVertical = null;
314
  $captionHorizontal = null;
@@ -382,9 +377,6 @@ if ( !class_exists( "FinalTilesGallery" ) ) {
382
  if ( $gallery->loadedEasing == "elastic-out" ) {
383
  $loadedEasing = "cubic-bezier(.26,1.9,.4,.67)";
384
  }
385
- $html .= "#ftg-{$this->id}{$rid} .tile.ftg-preload { transform: scaleY(" . $gallery->loadedScaleY / 100 . ") scaleX(" . $gallery->loadedScaleX / 100 . ") translate(" . $gallery->loadedHSlide . 'px,' . $gallery->loadedVSlide . "px) rotateX(" . $gallery->loadedRotateX . "deg) rotateY(" . $gallery->loadedRotateY . "deg); }\n";
386
- $html .= "#ftg-{$this->id}{$rid} .tile.ftg-preload { transition: all {$loadedEasing} " . $gallery->loadedDuration / 1000 . "s, opacity linear " . $gallery->loadedDuration / 1000 . "s; }\n";
387
- $html .= "#ftg-{$this->id}{$rid} .tile img.item { transition-duration: " . $gallery->hoverDuration / 1000 . "s; }\n";
388
 
389
  if ( $gallery->hoverZoom != 100 || $gallery->hoverRotation != 0 ) {
390
  $html .= "#ftg-{$this->id}{$rid} .tile:hover img {\n";
@@ -419,7 +411,7 @@ if ( !class_exists( "FinalTilesGallery" ) ) {
419
  }
420
  $captionBehavior = ( wp_is_mobile() ? $gallery->captionMobileBehavior : $gallery->captionBehavior );
421
  $hover = ( $captionBehavior == "never" ? "" : "ftg-hover-enabled" );
422
- if ( $captionBehavior != "none" && !ftg_fs()->is_plan_or_trial__premium_only( 'ultimate' ) ) {
423
  $captionBehavior = "none";
424
  }
425
  $socialClasses = "";
@@ -428,22 +420,8 @@ if ( !class_exists( "FinalTilesGallery" ) ) {
428
  }
429
  $html .= "<a name='{$this->id}'></a>";
430
  $html .= "<div class='final-tiles-gallery {$socialClasses} {$hover} " . (( $gallery->captionFrame == 'T' ? "caption-frame" : "" )) . " caption-{$captionBehavior} caption-{$gallery->captionVerticalAlignment} caption-{$gallery->captionHorizontalAlignment}' id='ftg-{$this->id}{$rid}' style='width:{$gallery->width}'>\n";
431
-
432
  if ( strlen( $gallery->filters ) ) {
433
- if(ftg_fs()->can_use_premium_code())
434
- {
435
- $filters = explode( "|", $gallery->filters );
436
- $filter_url = ( $gallery->filterClick == 'F' ? '#ftg-set-ftgall' : '?ftg-set=all#' . $this->id );
437
- $html .= "<div class='ftg-filters'>\n";
438
- $html .= "\t<a data-filter='all' href='{$filter_url}' class='selected'>{$gallery->allFilterLabel}</a>\n";
439
- foreach ( $filters as $filter ) {
440
- $filter_url = ( $gallery->filterClick == 'F' ? '#ftg-set-' . FinalTilesGallery::slugify( $filter ) : '?ftg-set=' . FinalTilesGallery::slugify( $filter ) . '#' . $this->id );
441
- $html .= "\t<a data-filter='" . $this->slugify( $filter ) . "' href='{$filter_url}'>{$filter}</a>\n";
442
- }
443
- $html .= "</div>\n";
444
- }
445
  }
446
-
447
  $html .= "<div class='ftg-items'>\n";
448
  if ( $gallery->loadMethod == "sequential" ) {
449
  $html .= "\t<div class='loading-bar'><i></i></div>\n";
@@ -519,11 +497,11 @@ if ( !class_exists( "FinalTilesGallery" ) ) {
519
  }
520
 
521
  $html .= "\t(function () {\n";
522
- /*if(wp_is_mobile())
523
- {
524
- $html .= "\t\tjQuery('#ftg-$this->id$rid .tile').on('touchstart', function (e) {\n";
525
- $html .= "\t\t\tjQuery(this).addClass('hover');\n";
526
- $html .= "\t\t});\n";
527
  }*/
528
  $html .= "\t\tvar rel = '';\n";
529
  $html .= "\t\tjQuery('#ftg-{$this->id}{$rid} .ftg-lightbox').click(function (e) {\n";
@@ -606,7 +584,7 @@ if ( !class_exists( "FinalTilesGallery" ) ) {
606
  if ( $gallery->filterClick == "T" && ($current_filter != 'all' && $current_filter != null && !in_array( $current_filter, $img_filters )) ) {
607
  continue;
608
  }
609
- if ( $mage->type == 'video' && !ftg_fs()->is_plan_or_trial__premium_only( 'ultimate' ) ) {
610
  continue;
611
  }
612
  $title = ( in_array( $gallery->lightbox, array(
@@ -623,7 +601,7 @@ if ( !class_exists( "FinalTilesGallery" ) ) {
623
  $rel = $gallery->rel;
624
  }
625
 
626
- if ( isset( $image->group ) ) {
627
  $rel = ( $lightbox == "prettyphoto" ? "prettyPhoto[{$image->group}]" : $image->group );
628
  $groups[$image->group] = 1;
629
  } else {
@@ -838,118 +816,6 @@ if ( !class_exists( "FinalTilesGallery" ) ) {
838
 
839
  public function getPosts()
840
  {
841
- $noPaging = true;
842
- $postsPerPage = 0;
843
- $page = 1;
844
-
845
- if ( $this->gallery->ajaxLoading == "T" ) {
846
- $noPaging = false;
847
- $postsPerPage = $this->gallery->tilesPerPage;
848
- $page = ( isset( $_POST['page'] ) ? intval( $_POST['page'] ) : 1 );
849
- } else {
850
- $noPaging = $this->gallery->max_posts == 0;
851
-
852
- if ( !$noPaging ) {
853
- $postsPerPage = $this->gallery->max_posts;
854
- $page = 1;
855
- }
856
-
857
- }
858
-
859
- $args = array(
860
- 'order' => 'DESC',
861
- 'orderby' => 'date',
862
- 'post_status' => array( 'publish' ),
863
- 'meta_query' => '_thumbnail_id',
864
- 'ignore_sticky_posts' => 1,
865
- 'nopaging' => $noPaging,
866
- 'posts_per_page' => $postsPerPage,
867
- 'paged' => $page,
868
- 'meta_query' => array( array(
869
- 'key' => '_thumbnail_id',
870
- ) ),
871
- );
872
- if ( $this->gallery->post_types ) {
873
- $args['post_type'] = explode( ",", $this->gallery->post_types );
874
- }
875
- if ( isset( $this->gallery->post_categories ) && !empty($this->gallery->post_categories) ) {
876
- $args['category__in'] = $this->gallery->post_categories;
877
- }
878
- $relation = "OR";
879
- if ( isset( $this->gallery->taxonomyOperator ) ) {
880
- $relation = $this->gallery->taxonomyOperator;
881
- }
882
- $args['tax_query'] = array(
883
- "relation" => $relation,
884
- );
885
- if ( isset( $this->gallery->post_taxonomies ) ) {
886
- foreach ( explode( ",", $this->gallery->post_taxonomies ) as $taxonomy_raw ) {
887
- $t = explode( "|", $taxonomy_raw );
888
- $args['tax_query'][] = array( array(
889
- 'taxonomy' => $t[0],
890
- 'field' => 'term_id',
891
- 'terms' => $t[1],
892
- ) );
893
- }
894
- }
895
- $posts = get_posts( $args );
896
- $imageResults = array();
897
- foreach ( $posts as &$post ) {
898
- $post_thumbnail_id = get_post_thumbnail_id( $post->ID );
899
-
900
- if ( $post_thumbnail_id ) {
901
- $item = new stdClass();
902
- $item->attID = $post_thumbnail_id;
903
- $item->imageId = $post_thumbnail_id;
904
- $item->imagePath = get_post_meta( $post->ID, 'ftg_image_url', true );
905
- $item->filters = get_post_meta( $post->ID, 'ftg_filters', true );
906
- switch ( $this->gallery->recentPostsCaption ) {
907
- case "title":
908
- $item->description = $post->post_title;
909
- break;
910
- case "excerpt":
911
- $item->description = $post->post_excerpt;
912
- break;
913
- case "auto-excerpt":
914
- $item->description = $this->auto_excerpt( $post, $this->gallery->recentPostsCaptionAutoExcerptLength, "..." );
915
- break;
916
- case "custom":
917
- $fields = explode( "\n", $this->gallery->captionCustomFields );
918
- $item->description = "";
919
- $line = 0;
920
- foreach ( $fields as $field ) {
921
- $field = trim( $field );
922
- //if(! empty($field))
923
- $r = preg_match_all( "/\\{(\\w)+\\}/", $field, $m );
924
- if ( $r ) {
925
- foreach ( $m[0] as $meta ) {
926
- $code = str_replace( array( "{", "}" ), "", $meta );
927
- $val = get_post_meta( $post->ID, $code, true );
928
- $field = str_replace( $meta, $val, $field );
929
- }
930
- }
931
- if ( empty($field) ) {
932
- $field = "&nbsp;";
933
- }
934
- $css_class = str_replace( array( "{", "}" ), "", implode( '-', $m[0] ) );
935
- $item->description .= "<span class='ftg-meta ftg-meta-" . $css_class . "'>" . $field . "</span>";
936
- }
937
- break;
938
- }
939
-
940
- if ( empty($item->imagePath) ) {
941
- $attr = wp_get_attachment_image_src( $post_thumbnail_id, $this->gallery->defaultPostImageSize );
942
- $item->imagePath = $attr[0];
943
- }
944
-
945
- if ( $this->gallery->lightbox == 'post' ) {
946
- $item->link = get_permalink( $post->ID );
947
- }
948
- $this->images[] = $item;
949
- // unset($post, $post_thumbnail_id);
950
- }
951
-
952
- }
953
  }
954
 
955
  public function getImages()
23
  $this->gallery->{$prop} = $v;
24
  }
25
  }
26
+ if ( !ftg_fs()->is_plan( 'ultimate' ) ) {
27
+ $this->gallery->source = "images";
28
+ }
29
  switch ( $this->gallery->source ) {
30
  default:
31
  case "images":
233
 
234
  public static function getFilters( $filters )
235
  {
236
+ return "";
 
 
 
 
 
 
 
237
  }
238
 
239
  private function hasSocial()
303
  }
304
  //style
305
  $bgCaption = $this->toRGB( $gallery->captionBackgroundColor );
306
+ $html = "<!-- Final Tiles Grid Gallery for WordPress v" . FTGVERSION . " " . FTG_PLAN . " -->\n\n";
307
  $html .= stripslashes( $this->gallery->beforeGalleryText );
308
  $captionVertical = null;
309
  $captionHorizontal = null;
377
  if ( $gallery->loadedEasing == "elastic-out" ) {
378
  $loadedEasing = "cubic-bezier(.26,1.9,.4,.67)";
379
  }
 
 
 
380
 
381
  if ( $gallery->hoverZoom != 100 || $gallery->hoverRotation != 0 ) {
382
  $html .= "#ftg-{$this->id}{$rid} .tile:hover img {\n";
411
  }
412
  $captionBehavior = ( wp_is_mobile() ? $gallery->captionMobileBehavior : $gallery->captionBehavior );
413
  $hover = ( $captionBehavior == "never" ? "" : "ftg-hover-enabled" );
414
+ if ( $captionBehavior != "none" && !ftg_fs()->is_plan_or_trial( 'ultimate' ) ) {
415
  $captionBehavior = "none";
416
  }
417
  $socialClasses = "";
420
  }
421
  $html .= "<a name='{$this->id}'></a>";
422
  $html .= "<div class='final-tiles-gallery {$socialClasses} {$hover} " . (( $gallery->captionFrame == 'T' ? "caption-frame" : "" )) . " caption-{$captionBehavior} caption-{$gallery->captionVerticalAlignment} caption-{$gallery->captionHorizontalAlignment}' id='ftg-{$this->id}{$rid}' style='width:{$gallery->width}'>\n";
 
423
  if ( strlen( $gallery->filters ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
424
  }
 
425
  $html .= "<div class='ftg-items'>\n";
426
  if ( $gallery->loadMethod == "sequential" ) {
427
  $html .= "\t<div class='loading-bar'><i></i></div>\n";
497
  }
498
 
499
  $html .= "\t(function () {\n";
500
+ /*if(wp_is_mobile())
501
+ {
502
+ $html .= "\t\tjQuery('#ftg-$this->id$rid .tile').on('touchstart', function (e) {\n";
503
+ $html .= "\t\t\tjQuery(this).addClass('hover');\n";
504
+ $html .= "\t\t});\n";
505
  }*/
506
  $html .= "\t\tvar rel = '';\n";
507
  $html .= "\t\tjQuery('#ftg-{$this->id}{$rid} .ftg-lightbox').click(function (e) {\n";
584
  if ( $gallery->filterClick == "T" && ($current_filter != 'all' && $current_filter != null && !in_array( $current_filter, $img_filters )) ) {
585
  continue;
586
  }
587
+ if ( $image->type == 'video' && !ftg_fs()->is_plan_or_trial__premium_only( 'ultimate' ) ) {
588
  continue;
589
  }
590
  $title = ( in_array( $gallery->lightbox, array(
601
  $rel = $gallery->rel;
602
  }
603
 
604
+ if ( isset( $image->group ) && !empty($image->group) ) {
605
  $rel = ( $lightbox == "prettyphoto" ? "prettyPhoto[{$image->group}]" : $image->group );
606
  $groups[$image->group] = 1;
607
  } else {
816
 
817
  public function getPosts()
818
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
819
  }
820
 
821
  public function getImages()
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: GreenTreeLabs
3
  Donate link: http://greentreelabs.net/blog/donate/
4
  Tags: gallery, grid gallery, best gallery plugin, free gallery, gallery plugin, gallery grid plugin, masonry, photo gallery, image gallery, social gallery, portfolio gallery, lightbox, justified gallery
5
  Requires at least: 3.8.2
6
- Tested up to: 4.9.1
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -133,10 +133,10 @@ Currently galleries made with Envira, FooGallery, Instagram, NextGen, JetPack, M
133
  5. Image management
134
  6. 52 pages documentation
135
 
136
- == Changelog ==
137
-
138
- = 3.3.32 =
139
- * [Enhancement] Add trial plans
140
 
141
  = 3.3.30 =
142
  * [Fix] Fixed wrong image order when using Masonry layout
@@ -262,6 +262,9 @@ Currently galleries made with Envira, FooGallery, Instagram, NextGen, JetPack, M
262
 
263
  == Upgrade Notice ==
264
 
 
 
 
265
  = 3.3.24
266
  * [Fix] Fixed missing captions on mobile
267
  * [Fix] Fixed skipped images when using columns layout
3
  Donate link: http://greentreelabs.net/blog/donate/
4
  Tags: gallery, grid gallery, best gallery plugin, free gallery, gallery plugin, gallery grid plugin, masonry, photo gallery, image gallery, social gallery, portfolio gallery, lightbox, justified gallery
5
  Requires at least: 3.8.2
6
+ Tested up to: 4.8
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
133
  5. Image management
134
  6. 52 pages documentation
135
 
136
+ == Changelog ==
137
+
138
+ = 3.3.34 =
139
+ * [Fix] Fixed lightbox skipping images bug
140
 
141
  = 3.3.30 =
142
  * [Fix] Fixed wrong image order when using Masonry layout
262
 
263
  == Upgrade Notice ==
264
 
265
+ = 3.3.34 =
266
+ * [Fix] Fixed lightbox skipping images bug
267
+
268
  = 3.3.24
269
  * [Fix] Fixed missing captions on mobile
270
  * [Fix] Fixed skipped images when using columns layout