Plugin Directory

Changeset 1194206


Ignore:
Timestamp:
07/07/2015 03:46:34 PM (11 years ago)
Author:
eugenyh
Message:

Version 0.6.12 released

Location:
advanced-recent-posts/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • advanced-recent-posts/trunk/backend/lptw-recent-posts-backend.php

    r1191281 r1194206  
    9696            </tr>
    9797            <tr id="columns_and_width">
    98                 <th scope="row">Columns and width:</th>
     98                <th scope="row">Columns and dimensions:</th>
    9999                <td>
    100100                    <div class="lptw-sb-row">
     
    120120                    <div class="lptw-sb-row">
    121121                        <label for="sb_height"><input type="number" class="small-text layout-basic-hide layout-grid-show layout-thumbnail-hide layout-dropcap-hide" value="400" id="sb_height" min="1" step="1" name="sb_height" disabled="disabled">
    122                         The fixed height of the cell in pixels, only for Responsive Grid. If not set - all cells have auto height.</label>
     122                        The fixed height of the Post in pixels, only for Responsive Grid. If value = 0, height of all Featured set to auto height.</label>
     123                    </div>
     124                    <div class="lptw-sb-row">
     125                        <label for="sb_featured_height"><input type="number" class="small-text layout-basic-hide layout-grid-show layout-thumbnail-hide layout-dropcap-hide" value="400" id="sb_featured_height" min="1" step="1" name="sb_featured_height" disabled="disabled">
     126                        The fixed height of the <b><u>Featured</u></b> Post in pixels, only for Responsive Grid. If value = 0, height of all <b><u>Featured</u></b> Posts set to 400 px.</label>
     127                    </div>
     128                    <div class="lptw-sb-row">
     129                        <label for="sb_min_height"><input type="number" class="small-text layout-basic-hide layout-grid-show layout-thumbnail-hide layout-dropcap-hide" value="0" id="sb_min_height" min="0" step="1" name="sb_min_height" disabled="disabled">
     130                        The minimal height of all Posts in pixels, only for Responsive Grid. If value = 0, minimal height is not limited.</label>
    123131                    </div>
    124132                </td>
     
    265273            </tr>
    266274            <tr>
     275                <th scope="row">Post Excerpt:</th>
     276                <td>
     277                    <fieldset id="post_excerpt" class="layout-basic-hide layout-grid-show layout-thumbnail-hide layout-dropcap-hide" disabled="disabled">
     278                        <p>
     279                            <label for="excerpt_show"><input type="checkbox" checked="checked" value="0" id="excerpt_show" name="excerpt_show" >
     280                            Show the Post Excerpt.</label>
     281                        </p>
     282                        <p>
     283                            <label for="excerpt_lenght"><input type="number" class="small-text" value="35" id="excerpt_lenght" min="1" step="1" name="excerpt_lenght">
     284                            Post Excerpt lenght in words.</label>
     285                        </p>
     286                        <p>
     287                            <label for="ignore_more_tag"><input type="checkbox" value="0" id="ignore_more_tag" name="ignore_more_tag" >
     288                            Ignore &lt;!-- more --&gt; tag.</label>
     289                        </p>
     290                    </fieldset>
     291                    <p class="description">Only for Responsive Grid layout yet.</p>
     292                </td>
     293            </tr>
     294            <tr>
    267295                <th scope="row">Show date and time:</th>
    268296                <td>
  • advanced-recent-posts/trunk/backend/lptw-recent-posts-shortcode-builder.js

    r1191281 r1194206  
    109109
    110110    var sb_height = $("#sb_height").val();
     111    if ( sb_height < 1 ) { sb_height = ''; }
     112   
     113    var sb_featured_height = $("#sb_featured_height").val();   
     114    if ( sb_featured_height < 1 ) { sb_featured_height = ''; }   
     115
     116    var sb_min_height = $("#sb_min_height").val();   
    111117
    112118    var sb_columns = $('#sb_columns').val();
     
    134140    var sb_dropcap_background_color = $("#dropcap-background-color").val();
    135141    var sb_dropcap_text_color = $("#dropcap-text-color").val();
    136 
     142   
     143    /* --- Excerpt Section start --- */
     144    if ($("#excerpt_show").is(":checked") == true) {
     145      var sb_excerpt_show = "true";
     146    } else {
     147      var sb_excerpt_show = "false";
     148    }
     149   
     150    var sb_excerpt_lenght = $("#excerpt_lenght").val();
     151   
     152    if ($("#ignore_more_tag").is(":checked") == true) {
     153      var sb_ignore_more_tag = "true";
     154    } else {
     155      var sb_ignore_more_tag = "false";
     156    }   
     157    /* --- End --- */
     158 
    137159    if ($("#show_date_before_title").is(":checked") == true) {
    138160      var sb_show_date_before_title = "true";
     
    167189    if (sb_layout == 'basic') {
    168190      sb_height = '';
     191      sb_featured_height = '';     
     192      sb_min_height = '';     
     193      sb_excerpt_show = '';
     194      sb_excerpt_lenght = '';
     195      sb_ignore_more_tag = '';
    169196    }
    170197
     
    175202      sb_color_scheme = '';
    176203      sb_height = '';
     204      sb_featured_height = '';           
     205      sb_min_height = '';           
     206      sb_excerpt_show = '';
     207      sb_excerpt_lenght = '';
     208      sb_ignore_more_tag = '';
    177209    }
    178210
     
    189221      sb_show_date_before_title = '';
    190222      sb_height = '';
     223      sb_featured_height = '';           
     224      sb_min_height = '';           
     225      sb_excerpt_show = '';
     226      sb_excerpt_lenght = '';
     227      sb_ignore_more_tag = '';     
    191228    }
    192229
     
    229266      shortcode += ' height="' + sb_height + '"';
    230267    }
     268    if (sb_featured_height != '') {
     269      shortcode += ' featured_height="' + sb_featured_height + '"';
     270    }
     271    if (sb_min_height != '') {
     272      shortcode += ' min_height="' + sb_min_height + '"';
     273    }
    231274    if (sb_space_hor != '') {
    232275      shortcode += ' space_hor="' + sb_space_hor + '"';
     
    264307    if (sb_dropcap_text_color != '') {
    265308      shortcode += ' text_color="' + sb_dropcap_text_color + '"';
     309    }
     310    if (sb_excerpt_show != '') {
     311      shortcode += ' excerpt_show="' + sb_excerpt_show + '"';
     312    }
     313    if (sb_excerpt_lenght != '') {
     314      shortcode += ' excerpt_lenght="' + sb_excerpt_lenght + '"';
     315    }
     316    if (sb_ignore_more_tag != '') {
     317      shortcode += ' ignore_more_tag="' + sb_ignore_more_tag + '"';
    266318    }
    267319    if (sb_show_date_before_title != '') {
  • advanced-recent-posts/trunk/lptw-recent-posts.css

    r1191281 r1194206  
    1 /* version 0.6.11 */
     1/* version 0.6.12 */
    22/*--------------------------------------------------------------
    33>>> TABLE OF CONTENTS:
     
    412412 * -------------------------- GRID LAYOUT -------------------------- */
    413413
    414  #grid-container {
     414 .lptw-container {
    415415    overflow: hidden;
    416416 }
     417
     418.grid-layout .overlay {
     419  display: none;
     420}
    417421
    418422.lptw-post-grid-img {
     
    445449}
    446450.lptw-grid-element {
    447   min-height: 400px;
     451  /*min-height: 400px;*/
    448452  overflow: hidden;
    449453  box-sizing: border-box;
  • advanced-recent-posts/trunk/lptw-recent-posts.php

    r1191281 r1194206  
    55Description: Plugin that shows the recent posts with thumbnails in the widget and in other parts of the your blog or theme with shortcodes.
    66Tags: widget, posts, plugin, recent, recent posts, latest, latest posts, shortcode, thumbnail, thumbnails, categories, content, featured image, Taxonomy, custom post type, custom
    7 Version: 0.6.11
     7Version: 0.6.12
    88Author: Eugene Holin
    99Author URI: http://lp-tricks.com/
     
    2727
    2828/* trim excerpt to custom size */
    29 function lptw_custom_excerpt ($limit) {
    30       $excerpt = explode(' ', get_the_excerpt(), $limit);
    31       if (count($excerpt)>=$limit) {
     29function lptw_custom_excerpt ($limit, $ignore_more_tag) {
     30    global $more;
     31    if ($ignore_more_tag == 'true') { $more = 1; }
     32    else { $more = 0; }
     33    $excerpt = explode(' ', get_the_excerpt(), $limit);
     34    if (count($excerpt)>=$limit) {
    3235        array_pop($excerpt);
    3336        $excerpt = implode(" ",$excerpt).'...';
    34       } else {
     37    } else {
    3538        $excerpt = implode(" ",$excerpt);
    36       }
    37       $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
    38       return $excerpt;
    3939    }
     40    $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
     41    return $excerpt;
     42}
    4043
    4144register_activation_hook( __FILE__, 'lptw_recent_posts_activate' );
     
    950953}
    951954
    952 
    953955/**
    954956-------------------------------------- Shortcode --------------------------------------
     
    973975        'columns'                   => '1',
    974976        'height'                    => '',
     977        'featured_height'           => '400',
     978        'min_height'                => '400',
    975979        'width'                     => '300',
    976980        'date_format'               => 'd.m.Y',
     
    989993        'tags_id'                   => '',
    990994        'tags_exclude'              => 'false',
    991         'override_colors'           => 'false'
     995        'override_colors'           => 'false',
     996        'excerpt_show'              => 'true',
     997        'excerpt_lenght'            => '35',
     998        'ignore_more_tag'           => 'false'
    992999    ), $atts );
    9931000
     
    10631070            break;
    10641071            case 'grid-medium':
    1065                 $content .= '<div id="grid-container">';
     1072                $rand_grid = rand(11111, 99999);
     1073                $content .= '<div class="lptw-container" id="lptw-grid-'.$rand_grid.'">';
    10661074            break;
    10671075        }
    10681076        while( $lptw_shortcode_query->have_posts() ) {
    10691077            $lptw_shortcode_query->the_post();
     1078            /*
     1079            echo '<pre>';
     1080            echo $lptw_shortcode_query->post->ID;
     1081            echo $lptw_shortcode_query->post->post_excerpt;
     1082            echo '</pre>';
     1083            */
    10701084
    10711085            $element_style_args = Array();
     
    11811195            </article>';
    11821196
    1183             /* recent posts with thumbnail and featured posts */
     1197            /* Responsive Grid - recent posts with thumbnail and featured posts */
    11841198            } elseif ($a['layout'] == 'grid-medium' ) {
     1199                $featured_height = $a['featured_height'] . 'px';
    11851200                if ($a['fluid_images'] == 'true') {
    11861201                    $base_width = (100 / $a['columns']) - 1;
     
    11931208
    11941209                if ( $a['height'] > 0 ) { $element_style_args[] = 'height: '.$a['height'].'px;'; }
     1210                if ( $a['excerpt_show'] == 'false' ) { $element_style_args[] = 'padding-bottom: 0.5rem;'; }
     1211                if ( $a['min_height'] > 0 ) { $element_style_args[] = 'min-height: '.$a['min_height'].'px;'; }
    11951212
    11961213                if ( $a['override_colors'] == 'true' ) {
     
    12041221
    12051222                    $element_style_args[] = 'width: ' . $featured_width . ';';
     1223                    $element_style_args[] = 'min-height: ' . $featured_height . ';';
    12061224                    $element_style_args[] = 'background: url('.$url_grid.') center center no-repeat;';
    12071225                    $element_style_args[] = 'background-size: cover;';
     
    12441262                    $content .= '</div>
    12451263                        </header>';
    1246                     if ( has_excerpt( $post_id ) ) {
    1247                         $my_excerpt = get_the_excerpt();
    1248                         $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'" '.$user_text_color.'>' . $my_excerpt . '</content>';
    1249                     } else {
    1250                         $my_excerpt = lptw_custom_excerpt(35);
    1251                         $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'" '.$user_text_color.'>' . $my_excerpt . '</content>';
     1264                    if ($a['excerpt_show'] == 'true') {
     1265                        $manual_excerpt = $lptw_shortcode_query->post->post_excerpt;
     1266                        if ( !empty($manual_excerpt) ) {
     1267                            $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'" '.$user_text_color.'>' . $manual_excerpt . '</content>';
     1268                        } else {
     1269                            $my_excerpt = lptw_custom_excerpt($a['excerpt_lenght'], $a['ignore_more_tag']);
     1270                            $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'" '.$user_text_color.'>' . $my_excerpt . '</content>';
     1271                        }
    12521272                    }
    12531273                    $content .= '</article>';
     
    12601280        if ($a['layout'] == 'grid-medium') {
    12611281            $content .= '<script>
    1262                             jQuery(document).ready(function($) {
    1263                               var $container = $("#grid-container");
     1282                            jQuery(window).on("load", function() {
     1283                              var $ = jQuery;
     1284                              $(".overlay").css("display", "block");
     1285                              var $container = $("#lptw-grid-'.$rand_grid.'");
    12641286                              var fluid_images = '.$a['fluid_images'].';
    12651287                              var countedColumnWidth;
  • advanced-recent-posts/trunk/readme.txt

    r1191281 r1194206  
    8080== Changelog ==
    8181
     82= 0.6.12 =
     83* Added the Post Excerpt settings: now you can show or hide an Excerpt of all Posts in the Responsive Grid, also you can set the Post Excerpt lenght and use or ignore &lt;!-- more --&gt; tag.
     84* Added new settings of Post height in the Responsive Grid:
     85  * Height of a Featured Post
     86  * The minimal height of all Posts
     87* Fixed issue with incorect height of elements of the Responsive Grid in Chrome and Safari
     88* Fixed issue with incorrect work of two or more shortcodes on the page
     89
    8290= 0.6.11 =
    8391* Added text color setting for Basic Layout
Note: See TracChangeset for help on using the changeset viewer.