Plugin Directory

Changeset 3366678


Ignore:
Timestamp:
09/23/2025 04:25:11 PM (6 months ago)
Author:
galaxyweblinks
Message:

Fixed plugin console error and update version

Location:
gallery-with-thumbnail-slider
Files:
41 added
5 edited

Legend:

Unmodified
Added
Removed
  • gallery-with-thumbnail-slider/trunk/function.php

    r3361887 r3366678  
    3737        }
    3838     
    39         if(!empty($getimag)){
     39        if(!empty($getimag) && is_array($getimag)){
    4040            ob_start();
    4141               
     
    6767                    $thumbsize = 'thumbnail';
    6868                }
     69
     70                $getverticalgal = get_post_meta($postid, '_gwtsvertical_gal', true);
     71
     72                    $slide_item = get_option('gwts_gwl_gallery_numberof_items');
     73                    if(!empty($slide_item)){
     74                        $slide_item = $slide_item;
     75                    }
     76                    else{
     77                        $slide_item = 1;
     78                    }
     79
     80                    $itemscls = "";
     81                    if($slide_item == 1 && !$getverticalgal){
     82                        $itemscls = "item-single";
     83                    }
    6984            ?>
    7085
     
    7287          <div class="clearfix" <?php if(!empty($smaxwidth)){ ?>style="max-width:<?php echo esc_html($smaxwidth, 'gallery-with-thumbnail-slider'); ?>px;"<?php } ?>>
    7388
    74             <ul id="gwts-gwl-img-gallery<?php echo esc_html($postid, 'gallery-with-thumbnail-slider'); ?>" class="gwts-gwl-slidergal list-unstyled cS-hidden" data-litebx="<?php if(!empty($lboxswitchr)){ echo esc_attr($lboxswitchr); }else{ echo "false"; }?>">
     89            <ul id="gwts-gwl-img-gallery<?php echo esc_html($postid, 'gallery-with-thumbnail-slider'); ?>" class="gwts-gwl-slidergal list-unstyled cS-hidden <?php echo $itemscls; ?>">
    7590                    <?php
    7691                    $scaption = get_option('gwts_gwl_enable_caption');
     
    112127
    113128            ?>
    114             <style type="text/css">
    115                 .lSSlideOuter .lSSlideWrapper ul li img{
    116                     width: 100%;
    117                     <?php if($slide_item == 1 && !$getverticalgal){ ?>
    118                     height: 400px;
    119                     min-height: 300px;
    120                     max-height: 500px;
    121                     object-fit: cover;
    122                     object-position: center;
    123                     <?php } ?>
    124                 }
    125                 .lightSlider li.lslide p {
    126                  position: absolute;
    127                  bottom: 0;color: #fff;
    128                  padding: 10px;
    129                  background: rgb(0 0 0 / 39%);
    130                  width: 100%;
    131                  text-align: center;
    132                  font-size:20px;
    133                 }
    134                 .lightSlider li.lslide {
    135                    position: relative;
    136                 }
    137             </style>
     129           
    138130
    139131            <?php if(null !== $simagezoom && !empty($simagezoom)){ ?>
     
    270262                <script>
    271263                    jQuery(document).ready(function() {
     264                        // Ensure lightGallery is available on jQuery
     265                        if (typeof lightGallery !== 'undefined' && !jQuery.fn.lightGallery) {
     266                            jQuery.fn.lightGallery = lightGallery;
     267                        }
    272268                        var setting_download = '<?php echo esc_attr($lboxdownload); ?>';
    273269            var count  = 0
     
    323319                    var lithbox = jQuery('#gwts-gwl-img-gallery<?php echo esc_attr($postid, 'gallery-with-thumbnail-slider'); ?>').attr("data-litebx");
    324320                    if(lithbox=='true'){
    325                         obj.lightGallery({
    326                             download: setting_download,
    327                             selector: '#gwts-gwl-img-gallery<?php echo esc_attr($postid, 'gallery-with-thumbnail-slider'); ?> .lslide'
    328                         });
     321                        var galleryElement = jQuery('#gwts-gwl-img-gallery<?php echo esc_attr($postid, 'gallery-with-thumbnail-slider'); ?>');
     322                        var galleryItems = galleryElement.find('.lslide');
     323                        if(galleryElement.length > 0 && galleryItems.length > 0 && typeof lightGallery !== 'undefined'){
     324                            galleryElement.lightGallery({
     325                                download: setting_download,
     326                                selector: '#gwts-gwl-img-gallery<?php echo esc_attr($postid, 'gallery-with-thumbnail-slider'); ?> li'
     327                            });
     328                        }
    329329                    }           
    330330                }
     
    357357                <script>
    358358                jQuery(document).ready(function() {
     359                    // Ensure lightGallery is available on jQuery
     360                    if (typeof lightGallery !== 'undefined' && !jQuery.fn.lightGallery) {
     361                        jQuery.fn.lightGallery = lightGallery;
     362                    }
    359363                    var setting_download = '<?php echo esc_attr($lboxdownload, ); ?>';
    360364                jQuery('#gwts-gwl-img-gallery<?php echo esc_attr($postid); ?>').lightSlider({
     
    409413                            var lithbox = jQuery('#gwts-gwl-img-gallery<?php echo esc_attr($postid, 'gallery-with-thumbnail-slider'); ?>').attr("data-litebx");
    410414                            if(lithbox=='true'){
    411                                 el.lightGallery({
    412                                     download: setting_download,
    413                                     selector: '#gwts-gwl-img-gallery<?php echo esc_attr($postid, 'gallery-with-thumbnail-slider'); ?> .lslide'
    414                                 });
     415                                var galleryElement = jQuery('#gwts-gwl-img-gallery<?php echo esc_attr($postid, 'gallery-with-thumbnail-slider'); ?>');
     416                                var galleryItems = galleryElement.find('.lslide');
     417                                if(galleryElement.length > 0 && galleryItems.length > 0 && typeof lightGallery !== 'undefined'){
     418                                    galleryElement.lightGallery({
     419                                        download: setting_download,
     420                                        selector: '#gwts-gwl-img-gallery<?php echo esc_attr($postid, 'gallery-with-thumbnail-slider'); ?> li'
     421                                    });
     422                                }
    415423                            }   
    416424                        } 
  • gallery-with-thumbnail-slider/trunk/gwts-gallery.php

    r3361887 r3366678  
    55* Author: Galaxy Weblinks
    66* Author URI: http://galaxyweblinks.com
    7 * Version: 7.5
     7* Version: 7.6
    88* Tested up to: 6.8
    99* Text Domain: gallery-with-thumbnail-slider
     
    393393function gwts_gwl_frontend_enqueue_script()
    394394{
    395     if ( is_page() ) {
    396         $script_version = gmdate('Ymd');
    397        
    398         wp_enqueue_style('gwts-gwl-lightslider-css', GWTS_GWL_PLUGINURL . 'includes/css/lightslider.css', array(), $script_version);
    399         wp_enqueue_style('gwts-gwl-style-css', GWTS_GWL_PLUGINURL . 'includes/css/gwts-style.css', array(), $script_version);
    400         wp_enqueue_style('gwts-gwl-lightgal-css', GWTS_GWL_PLUGINURL . 'includes/css/lightgallery.css', array(), $script_version);
    401 
    402         wp_enqueue_script('gwts-gwl-lightslider', GWTS_GWL_PLUGINURL . 'includes/js/lightslider.js', array('jquery'), $script_version, true);
    403         wp_enqueue_script('gwts-gwl-cdngal', GWTS_GWL_PLUGINURL . 'includes/js/picturefill.min.js', array('jquery'), $script_version, true);
    404         wp_enqueue_script('gwts-gwl-lightgallry', GWTS_GWL_PLUGINURL . 'includes/js/lightgallery-all.min.js', array('jquery'), $script_version, true);
    405         wp_enqueue_script('gwts-gwl-mousewheel', GWTS_GWL_PLUGINURL . 'includes/js/jquery.mousewheel.min.js', array('jquery'), $script_version, true);
    406         wp_enqueue_script('gwts-gwl-zoom.min', GWTS_GWL_PLUGINURL . 'includes/js/gwts.zoom.min.js', array('jquery'), $script_version, true);
    407     }
     395    $script_version = gmdate('Ymd');
     396   
     397    wp_enqueue_style('gwts-gwl-lightslider-css', GWTS_GWL_PLUGINURL . 'includes/css/lightslider.css', array(), $script_version);
     398    wp_enqueue_style('gwts-gwl-style-css', GWTS_GWL_PLUGINURL . 'includes/css/gwts-style.css', array(), $script_version);
     399    wp_enqueue_style('gwts-gwl-lightgal-css', GWTS_GWL_PLUGINURL . 'includes/css/lightgallery.css', array(), $script_version);
     400
     401    wp_enqueue_script('gwts-gwl-lightslider', GWTS_GWL_PLUGINURL . 'includes/js/lightslider.js', array('jquery'), $script_version, true);
     402    wp_enqueue_script('gwts-gwl-cdngal', GWTS_GWL_PLUGINURL . 'includes/js/picturefill.min.js', array('jquery'), $script_version, true);
     403    wp_enqueue_script('gwts-gwl-mousewheel', GWTS_GWL_PLUGINURL . 'includes/js/jquery.mousewheel.min.js', array('jquery'), $script_version, true);
     404    wp_enqueue_script('gwts-gwl-lightgallry', GWTS_GWL_PLUGINURL . 'includes/js/lightgallery-all.min.js', array('jquery', 'gwts-gwl-mousewheel'), $script_version, true);
     405   
     406
     407    wp_enqueue_script('gwts-gwl-zoom.min', GWTS_GWL_PLUGINURL . 'includes/js/gwts.zoom.min.js', array('jquery'), $script_version, true);
     408   
    408409}
    409410add_action('wp_enqueue_scripts', 'gwts_gwl_frontend_enqueue_script');
  • gallery-with-thumbnail-slider/trunk/gwts-slider.php

    r3361887 r3366678  
    3636                $getdescription = get_post_meta($postid, '_gwts_gallery_desc', true);
    3737
    38                 if(!empty($getimag)){
     38                if(!empty($getimag) && is_array($getimag)){
    3939                    ob_start();
    4040                    if(!empty($getttl) || !empty($getdescription)) {?>
     
    6262                        $thumbsize = 'thumbnail';
    6363                    }
     64
     65                    $getverticalgal = get_post_meta($postid, '_gwtsvertical_gal', true);
     66
     67                    $slide_item = get_option('gwts_gwl_gallery_numberof_items');
     68                    if(!empty($slide_item)){
     69                        $slide_item = $slide_item;
     70                    }
     71                    else{
     72                        $slide_item = 1;
     73                    }
     74
     75                    $itemscls = "";
     76                    if($slide_item == 1 && !$getverticalgal){
     77                        $itemscls = "item-single";
     78                    }
     79
    6480                    ?>
    6581                    <div class="item gwts-gwl-prev-gallery-items" style="<?php if(!empty($sliderbgcolor)){ ?>background-color:<?php echo esc_attr($sliderbgcolor, 'gallery-with-thumbnail-slider'); ?>;<?php } ?>padding: <?php echo esc_attr($sliderPadding); ?>;">
     
    6783                           
    6884                        <?php $lboxswitchr = get_option('gwts_gwl_lightbx_switcher'); ?>
    69                     <ul id="gwts-gwl-img-gallery" class="gwts-gwl-slidergal list-unstyled cS-hidden" data-litebx="<?php if(!empty($lboxswitchr)){echo esc_attr($lboxswitchr);}else{echo "false";}?>">
     85                    <ul id="gwts-gwl-img-gallery" class="gwts-gwl-slidergal list-unstyled cS-hidden <?php echo $itemscls; ?>">
    7086                           
    7187                            <?php
     
    207223                            <script>
    208224                            jQuery(document).ready(function() {
     225                                // Ensure lightGallery is available on jQuery
     226                                if (typeof lightGallery !== 'undefined' && !jQuery.fn.lightGallery) {
     227                                    jQuery.fn.lightGallery = lightGallery;
     228                                }
    209229                                var setting_download = '<?php echo esc_attr($lboxdownload); ?>';
    210230                var count  = 0
     
    258278                                           
    259279                                            if(lithbox=='true'){
    260                                                 obj.lightGallery({
    261                                                     download: setting_download,
    262                                     selector: '#gwts-gwl-img-gallery .lslide'
    263                                     });
     280                                                var galleryElement = jQuery('#gwts-gwl-img-gallery');
     281                                                var galleryItems = galleryElement.find('.lslide');
     282                                                if(galleryElement.length > 0 && galleryItems.length > 0 && typeof lightGallery !== 'undefined'){
     283                                                    galleryElement.lightGallery({
     284                                                        download: setting_download,
     285                                                            selector: '#gwts-gwl-img-gallery li'
     286                                                        });
     287                                                }
    264288                                            }           
    265289                    }
     
    272296
    273297                        <script>
    274                         jQuery(document).ready(function() {
     298                        jQuery(document).ready(function() {
     299                            // Ensure lightGallery is available on jQuery
     300                            if (typeof lightGallery !== 'undefined' && !jQuery.fn.lightGallery) {
     301                                jQuery.fn.lightGallery = lightGallery;
     302                            }
    275303                            var setting_download = '<?php echo esc_attr($lboxdownload); ?>';                   
    276304                    jQuery('#gwts-gwl-img-gallery').lightSlider({                       
     
    310338                       
    311339                                    if(lithbox=='true'){
    312                                         el.lightGallery({
    313                                             download: setting_download,
    314                               selector: '.gwts-gwl-slidergal .lslide'
    315                             });
     340                                        var galleryElement = jQuery('#gwts-gwl-img-gallery');
     341                                        var galleryItems = galleryElement.find('.lslide');
     342                                        if(galleryElement.length > 0 && galleryItems.length > 0 && typeof lightGallery !== 'undefined'){
     343                                        galleryElement.lightGallery({
     344                                            download: setting_download,
     345                                      selector: '.gwts-gwl-slidergal li'
     346                                    });
     347                                        }
    316348                                    }
    317349                  },
  • gallery-with-thumbnail-slider/trunk/includes/css/gwts-style.css

    r3361887 r3366678  
    181181    width: 100%;
    182182}
     183
     184
     185.lSSlideOuter .lSSlideWrapper ul li img{
     186    width: 100%;
     187   
     188
     189   
     190}
     191
     192.lSSlideOuter .lSSlideWrapper ul.item-single li img{
     193    aspect-ratio: 1 / 1;    /* square maintain karega */
     194    object-fit: contain;    /* image cut nahi hogi */
     195    object-position: center;
     196    max-height: 600px;       
     197}
     198
     199.lightSlider li.lslide p {
     200    position: absolute;
     201    bottom: 0;color: #fff;
     202    padding: 10px;
     203    background: rgb(0 0 0 / 39%);
     204    width: 100%;
     205    text-align: center;
     206    font-size:20px;
     207}
     208.lightSlider li.lslide {
     209    position: relative;
     210}
  • gallery-with-thumbnail-slider/trunk/readme.txt

    r3361887 r3366678  
    77Tested up to: 6.8
    88Requires PHP: 7.4
    9 Stable tag: 7.5
     9Stable tag: 7.6
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9595== Changelog ==
    9696
     97= 7.6 =
     98– Fixed console error
     99
    97100= 7.5 =
    98101– Upgrade JS Library
     
    172175== Upgrade Notice ==
    173176
     177= 7.6 =
     178– Fixed console error
     179
    174180= 7.5 =
    175181– Upgrade JS Library
Note: See TracChangeset for help on using the changeset viewer.