Plugin Directory

Changeset 1064596


Ignore:
Timestamp:
01/10/2015 12:33:18 PM (11 years ago)
Author:
bortpress
Message:

0.4.0.3b

Continued fix for wptexturize and page_size errors

Location:
masonry-post-gallery
Files:
15 added
2 edited

Legend:

Unmodified
Added
Removed
  • masonry-post-gallery/trunk/masonry-post-gallery.php

    r1064345 r1064596  
    22/**
    33 * @package Cactus Masonry
    4  * @version 0.4.0.2b
     4 * @version 0.4.0.3b
    55 */
    66/*
     
    88 * Plugin URI: http://cactuscomputers.com.au/masonry
    99 * Description: A highly customizable masonry styled gallery of post thumbnails.  Please refer to the <a href="http://cactuscomputers.com.au/masonry">plugin Home Page</a> for detailed instructions.
    10  * Version: 0.4.0.2b
     10 * Version: 0.4.0.3b
    1111 * Author: N. E - Cactus Computers
    1212 * Author URI: http://www.cactuscomputers.com.au/masonry
     
    123123            'post_category'             =>  "",
    124124            'post_order'                =>  "DESC",
    125             'post_orderby'              =>  "post_date",
    126             'gallery_align'             =>  "center",
    127             'image_background_color'    =>  "#ffffff",
    128             'hover_color'               =>  "#ffffff",
    129             'hover_intensity'           =>  "0.5",
    130             'upscale_narrow_images'     => 0,
    131             'upscale_short_images'      => 0,
    132             'max_upscale_quality'       => "large",
    133             'noscript_width'            => "auto",
    134             'noscript_height'           => "auto",
    135             'noscript_max_width'        => "none",
    136             'noscript_max_height'       => "none",
    137             'upscale_max_width'         => "none",
    138             'upscale_max_height'        => "none",
    139             'link_location'             => "post",
    140             'show_lightbox'             => false,
    141             'browse_with_lightbox'      => false,
    142             'show_lightbox_title'       => false,
    143             'soft_gutter'               => 0,
    144             'infinite_scroll'           => true,
    145             'posts_per_page'            => 30,
    146             'show_loader'               => true,
    147             'search_start'              => 0,
    148             'page_size'                 => 1000,
    149             'test_mode'                 => false,
    150             'default_image_id'          => false,
    151             'show_posts'                => true,
    152             'show_pages'                => false,
    153             'require_javascript'        => false,
    154             'javascript_error_message'  => 'Please enable JavaScript to properly view this page.',
    155             'infinite_scroll_buffer'    => 400,
    156             'display_post_titles'       => false,
    157             'display_post_excerpts'     => false,
    158             'custom_post_types'         => "",
    159             'load_js'                   => true,
    160             'force_auto_width'          => false,
    161             'crop_images'               => false,
    162             'ajax_mode'                 => false,
    163             'link_custom_class'         => ''
     125            'post_orderby'              =>  "post_date",
     126            'gallery_align'             =>  "center",
     127            'image_background_color'    =>  "#ffffff",
     128            'hover_color'               =>  "#ffffff",
     129            'hover_intensity'           =>  "0.5",
     130            'upscale_narrow_images'     =>  0,
     131            'upscale_short_images'      =>  0,
     132            'max_upscale_quality'       =>  "large",
     133            'noscript_width'            =>  "auto",
     134            'noscript_height'           =>  "auto",
     135            'noscript_max_width'        =>  "none",
     136            'noscript_max_height'       =>  "none",
     137            'upscale_max_width'         =>  "none",
     138            'upscale_max_height'        =>  "none",
     139            'link_location'             =>  "post",
     140            'show_lightbox'             =>  false,
     141            'browse_with_lightbox'      =>  false,
     142            'show_lightbox_title'       =>  false,
     143            'soft_gutter'               =>  0,
     144            'infinite_scroll'           =>  true,
     145            'posts_per_page'            =>  30,
     146            'show_loader'               =>  true,
     147            'search_start'              =>  0,
     148            'page_size'                 =>  1000,
     149            'test_mode'                 =>  false,
     150            'default_image_id'          =>  false,
     151            'show_posts'                =>  true,
     152            'show_pages'                =>  false,
     153            'require_javascript'        =>  false,
     154            'javascript_error_message'  =>  'Please enable JavaScript to properly view this page.',
     155            'infinite_scroll_buffer'    =>  400,
     156            'display_post_titles'       =>  false,
     157            'display_post_excerpts'     =>  false,
     158            'custom_post_types'         =>  "",
     159            'load_js'                   =>  true,
     160            'force_auto_width'          =>  false,
     161            'crop_images'               =>  false,
     162            'ajax_mode'                 =>  false,
     163            'link_custom_class'         =>  ''
    164164            ), $atts);
    165165       
     
    228228            if(has_post_thumbnail($post->ID) || !(self::$a['default_image_id'] === false))
    229229            {   
    230                 if($post_count >= self::$a['search_start'] && $post_count < self::$a['page_size']) $script_text .= self::render_post();
    231                 $post_count++;
     230                if(self::$post_count >= self::$a['search_start'] && self::$post_count < self::$a['search_start']+self::$a['page_size']) $script_text .= self::render_post();
     231                self::$post_count++;
    232232            }   
    233233        }
     
    313313        $link_class = "masonry_brick_a";
    314314        if(self::$a['link_custom_class'] != '') $link_class .= " " . self::$a['link_custom_class'];
    315         $link_class = "class=\"{$link_class}\"";
    316         $lightbox_text = " data-lightbox=\"";
    317         if(self::$a['browse_with_lightbox'] === true) $lightbox_text .= "thispage\"";
    318         else $lightbox_text .= $post->ID . "\"";
    319         if(self::$a['show_lightbox_title'] === true) $lightbox_text .= " data-title=\"" . $tit . "\"";
     315        $lightbox_text = " data-lightbox='";
     316        if(self::$a['browse_with_lightbox'] === true)
     317        {
     318            $lightbox_text .= "thispage'";
     319            $data_lightbox = "thispage";
     320        }
     321        else
     322        {
     323            $lightbox_text .= $post->ID . "'";
     324            $data_lightbox = $post->ID;
     325        }
     326        if(self::$a['show_lightbox_title'] === true) $lightbox_text .= " data-title='" . $tit . "'";
    320327        //Set where each image links and handle any interference with the show_lightbox parameter
    321328        if(has_post_thumbnail())
     
    382389                self::$a['show_lightbox'] = false;
    383390        }
    384         if(!(self::$a['show_lightbox'] === true)) $lightbox_text = "";
     391        if(!(self::$a['show_lightbox'] === true))
     392        {
     393            $lightbox_text = "";
     394            $data_lightbox = "";
     395        }
    385396        //Sort out databox
    386397        if($show_databox)
    387398        {
    388             $data_text = "<div class=\"cactus_masonry_databox\">";
    389             if(self::$a['display_post_titles'] && strlen($tit) > 0) $data_text .= "<div class=\"cm_title\">{$tit}</div>";
    390             if(self::$a['display_post_excerpts'] && strlen($excerpt) > 0) $data_text .= "<div class=\"cm_exerpt\">{$excerpt}</div>";
     399            $data_text = "<div class='cactus_masonry_databox'>";
     400            if(self::$a['display_post_titles'] && strlen($tit) > 0) $data_text .= "<div class='cm_title'>{$tit}</div>";
     401            if(self::$a['display_post_excerpts'] && strlen($excerpt) > 0) $data_text .= "<div class='cm_exerpt'>{$excerpt}</div>";
    391402            $data_text .= "</div>";
    392403        }
     
    435446            //Write the JavaScript
    436447            //Start with the innerHTML of the masonry_brick DIVs
    437             $output .= "                s = '<{$link_type} {$lightbox_text} {$link_class} style=\"display: block;\" href=\"{$lnk}\"><img class=\"masonry_brick_img size-thumbnail\" src=\"{$thumbnail[0]}\" alt=\"{$tit}\" style=\"";
     448            $output .= "                s = \"<img class='masonry_brick_img size-thumbnail' src='{$thumbnail[0]}' alt='{$tit}' style='";
    438449            if(!($thumbnail[5] && strpos(self::$a['upscale_max_width'], '%') !== false) && (self::$a['width'] != 'auto')) $output .= "width: 100%; ";
    439450            $output .= "height: " . self::$a['height'] . "; ";     
    440451            $output .= "max-height: " . self::$a['max_height'] . "; ";
    441452            if(self::$a['crop_images']) $output .= "visibility: hidden; ";
    442             $output .= "\"/>";
    443             if(self::$a['crop_images']) $output .= "<div class=\"cactus_masonry_cropped\" style=\"background-image: url({$thumbnail[0]});\"></div>";
     453            $output .= "'/>";
     454            if(self::$a['crop_images']) $output .= "<div class='cactus_masonry_cropped' style='background-image: url({$thumbnail[0]});'></div>";
    444455            //Add the databox containing the title and excerpt
    445456            if($show_databox) $output .= $data_text;
    446             $output .= "</{$link_type}>';";
    447457            //Create DOM Element for masonry_brick DIV
     458            $output .= "\";
     459                lk = document.createElement('{$link_type}');
     460                lk.className = '{$link_class}';
     461                lk.style.display = 'block';
     462                lk.href = \"{$lnk}\";";
     463            if($data_lightbox != "")
     464                $output .= "
     465                lk.setAttribute('data-lightbox', '{$data_lightbox}');";
     466            if(self::$a['show_lightbox_title'] === true)
     467                $output .= "
     468                lk.setAttribute('data-title', \"{$tit}\");";
    448469            $output .= "
     470                lk.innerHTML = s;
    449471                el = document.createElement('div');
    450                 el.innerHTML = s;
    451472                el.className = 'masonry_brick';
    452473                el.style.opacity = '0';
    453474                el.style.display = 'inline-block';
    454                 el.style.height = '" . $norm_height . "';\n";
     475                el.style.height = '" . $norm_height . "';
     476                el.appendChild(lk);\n";
    455477            //Set width
    456478            if($thumbnail[5] && strpos(self::$a['upscale_max_width'], '%') !== false) $output .= "          el.style.width = 'auto';\n";
     
    467489                self::$noscript_text .= "       
    468490                    <div class='masonry_brick' style='height: " . self::$a['noscript_height'] . "; width: " . self::$a['noscript_width'] . ";   max-height: " . self::$a['noscript_max_height'] . "; max-width: " . self::$a['noscript_max_width'] . ";'>
    469                         <{$link_type} {$link_class} style='display: block; height: 100%; width: 100%' href='{$lnk}'>
     491                        <{$link_type} class='{$link_class}' style='display: block; height: 100%; width: 100%' href='{$lnk}'>
    470492                            <img class='masonry_brick_img' style='display: block; height: 100%; width: 100%' src='{$thumbnail[0]}' alt='{$tit}'/>
    471493                        </{$link_type}>
  • masonry-post-gallery/trunk/readme.txt

    r1064345 r1064596  
    55Requires at least: 3.9.1
    66Tested up to: 4.1
    7 Stable tag: 0.4.0.2b
     7Stable tag: 0.4.0.3b
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6363
    6464== Changelog ==
     65
     66= 0.4.0.3b =
     67* Further fixes for the wptexturize bug which should no longer interfere with other plugins
     68* Fixed an error with the page_size parameter
    6569
    6670= 0.4.0.2b =
     
    262266== Upgrade Notice ==
    263267
     268= 0.4.0.3b =
     269WARNING: The 0.4 updates change the #masonry_post_gallery to div.masonry_post_gallery which could affect your custom CSS.  Fixed a major bug caused by an interaction with wptexturize.
     270
    264271= 0.4.0.2b =
    265272WARNING: The 0.4 updates change the #masonry_post_gallery to div.masonry_post_gallery which could affect your custom CSS.  Fixed a major bug caused by an interaction with wptexturize.
Note: See TracChangeset for help on using the changeset viewer.