Plugin Directory

Changeset 551516


Ignore:
Timestamp:
05/31/2012 06:50:47 PM (14 years ago)
Author:
leethompson
Message:

Undoing last commit to apply to trunk

Location:
lazy-content-slider/tags/2.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lazy-content-slider/tags/2.1/lzcs.php

    r551510 r551516  
    55Description: This is a content slider that shows 5 slides from a "Featured Category"                                                                                               
    66Author: Lee Thompson                                                                                                                                                               
    7 Version: 2.2
     7Version: 2.1
    88Author URI: http://mysqlhow2.com                                                                                                                                                   
    99                                                                                                                                                                                   
     
    9090}
    9191
    92 function getDisplayPosts($limit = 4)
    93 {
     92function drawslider() {
     93    global $post;
     94    echo "<div id=\"featured\" >";
     95    echo "<ul class=\"ui-tabs-nav\">";
    9496    $posts = get_option('lzcs_cat');
    9597    $args = array('category' => $posts );
    9698    $recent_posts = wp_get_recent_posts( $args );
    97 
    98     $output = array();
    99     foreach ($recent_posts as $post) {
    100         setup_postdata($post);
    101         if (has_post_thumbnail($post['ID'])) {
    102             $output[] = $post;
    103         }
    104 
    105         if (count($output) > $limit) break;
    106     }
    107 
    108     return $output;
    109 }
    110 
    111 function drawslider() {
    112     global $post;
    113     $recent_posts = getDisplayPosts();
    114 
    115     if (count($recent_posts) == 0) {
    116         return;
    117     }
    118 
    119     echo "<div id=\"featured\" >";
    120     echo "<ul class=\"ui-tabs-nav\">";
    121 
     99   
     100    $limit = 4;
     101    $displayedPosts = 0;
     102   
    122103    foreach( $recent_posts as $recent ){
    123104        setup_postdata($recent);
    124105        $postid = $recent["ID"];
    125 
     106        if (!has_post_thumbnail($postid)) {
     107                continue;
     108        }
     109       
     110        if (++$displayedPosts > $limit) break;
     111       
    126112        $thumbnail =  get_the_post_thumbnail( $postid, array(50, 50) );
    127113       
     
    138124    echo '</ul>';   // Closing the div.ui-tabs-nav
    139125   
    140 
     126    $displayedPosts = 0;
     127           
    141128    foreach( $recent_posts as $recent ){
    142129        $postid = $recent["ID"];
     
    145132        $postexcerpt = string_limit_words($postexcerpt,15);
    146133
     134        if (!has_post_thumbnail($postid)) {
     135                continue;
     136        }
     137       
     138        if (++$displayedPosts > $limit) break;
     139       
    147140        $largeimage = get_the_post_thumbnail( $postid, array(400, 250));
    148141?>                     
  • lazy-content-slider/tags/2.1/readme.txt

    r551510 r551516  
    55Requires at least: 2.9.2
    66Tested up to: 3.3.2
    7 Stable tag: 2.2
     7Stable tag: 2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5151
    5252== Frequently Asked Questions ==
    53 Just want to give shout out to Tim Garrison [http://www.skudd.com/] who helped with my looping and
     53Just want to give shout out to Tim Garrison who helped with my looping and
    5454webdeveloperplus with the great tutorial on the slider using jquery.
    5555
     
    7171= 2.1 =
    7272Added Excerpt to div.info
    73 = 2.2 =
    74 Refactored to not show the div if no thumbnail-enabled posts are found -
    75 tgarrison
    7673
    7774
     
    9289= 2.1 =
    9390Added Excerpt to div.info
    94 = 2.2 =
    95 Refactored to not show the div if no thumbnail-enabled posts are found -
    96 tgarrison
    97 
Note: See TracChangeset for help on using the changeset viewer.