Plugin Directory

Changeset 475552


Ignore:
Timestamp:
12/14/2011 07:17:48 PM (14 years ago)
Author:
alvaron
Message:
 
Location:
get-post-list-with-thumbnails
Files:
9 added
10 edited

Legend:

Unmodified
Added
Removed
  • get-post-list-with-thumbnails/branches/ajaxgplwt.php

    r450778 r475552  
    3838                $pgnm=$arrv[24];
    3939                //echo $pgnm;
    40                 $pgmx=$arrv[25];
    41                 $gplwtdiv=$arrv[26];
     40                $pgmx=$arrv[25];               
     41                $gptb =$arrv[26];
    4242                $ech =$arrv[27];   
     43                $gplwtdiv=$arrv[28];
    4344
    44                 getPostListThumbs($ptype,$dexcp,$orient,$imgo,$ttgo,$dtgo,$dtfrm,$categ,$postnr,$linn,$divwid,$tbwid,$tbhig,$cp,$cs,$lwt,$tte,$sptb,$tgtb,$ordm,$ordf,$metk,$mett,$pgin,$pgnm,$pgmx,$gplwtdiv,$ech);
     45                getPostListThumbs($ptype,$dexcp,$orient,$imgo,$ttgo,$dtgo,$dtfrm,$categ,$postnr,$linn,$divwid,$tbwid,$tbhig,$cp,$cs,$lwt,$tte,$sptb,$tgtb,$ordm,$ordf,$metk,$mett,$pgin,$gptb,$pgnm,$pgmx,$ech,$gplwtdiv);
    4546
    4647            //}
  • get-post-list-with-thumbnails/branches/get_post_list_with_thumbs.php

    r451098 r475552  
    44Plugin URI: http://www.wpworking.com/
    55Description:Displays a post list and custom size thumbnails(for the post 1st attached image), linked to each post permalink. Use as multiples widget or shortcode.
    6 Version: 8.0.4
     6Version: 9.0.0
    77Author: Alvaro Neto
    88Author URI: http://wpworking.com/
     
    7474        'pgnm' => 1,
    7575        'pgmx' => '',
    76         'ech' => false
     76        'gptb' => false,
     77        'ech' => false     
    7778    ), $atts));
    7879    ob_start();         
    79     $gplwtres=getPostListThumbs($ptype,$dexcp,$orient,$imgo,$ttgo,$dtgo,$dtfrm,$categ,$postnr,$linn,$divwid,$tbwid,$tbhig,$cp,$cs,$lwt,$tte,$sptb,$tgtb,$ordm,$ordf,$metk,$mett,$pgin,$pgnm,$pgmx,$ech);
     80    $gplwtres=getPostListThumbs($ptype,$dexcp,$orient,$imgo,$ttgo,$dtgo,$dtfrm,$categ,$postnr,$linn,$divwid,$tbwid,$tbhig,$cp,$cs,$lwt,$tte,$sptb,$tgtb,$ordm,$ordf,$metk,$mett,$pgin,$gptb,$pgnm,$pgmx,$ech);
    8081    echo $gplwtres;
    8182    $gplwt_string = ob_get_contents();
     
    115116}
    116117// display a list of posts with custom size thumbnails, using the post first image
    117 function getPostListThumbs($ptype='post',$dexcp=false,$orient='v',$imgo=false,$ttgo=false,$dtgo=false,$dtfrm=1,$categ='',$postnr=20,$linn=3,$divwid=300,$tbwid=40,$tbhig=40,$cp=4,$cs=4,$lwt=1,$tte='',$sptb=false,$tgtb=false,$ordm='',$ordf='ID',$metk='',$mett='n',$pgin='',$pgnm='',$pgmx='',$gplwtdiv='',$ech=true){   
     118function getPostListThumbs($ptype='post',$dexcp=false,$orient='v',$imgo=false,$ttgo=false,$dtgo=false,$dtfrm=1,$categ='',$postnr=20,$linn=3,$divwid=300,$tbwid=40,$tbhig=40,$cp=4,$cs=4,$lwt=1,$tte='',$sptb=false,$tgtb=false,$ordm='',$ordf='ID',$metk='',$mett='n',$pgin='',$gptb=false,$pgnm='',$pgmx='',$ech=true,$gplwtdiv=''){   
    118119    //echo "testando";
    119120    //error_reporting(E_ALL);
    120121    //ini_set('display_errors', '1');
    121     $ptype = gtpartrat($ptype,'post');
    122     $gplwtdiv = gtpartrat($gplwtdiv,'');
     122    $ptype = gtpartrat($ptype,'post'); 
    123123    $dexcp = gtpartrat($dexcp,false);
    124124    $orient = gtpartrat($orient,'v');
     
    152152    $pgnm = gtpartrat($pgnm,1);
    153153    $pgmx = gtpartrat($pgmx,'');
    154     $ech = gtpartrat($ech,true);
     154    $gptb = gtpartrat($gptb,false);
     155    $ech = gtpartrat($ech,true);   
     156    $gplwtdiv = gtpartrat($gplwtdiv,'');
    155157    /*
    156158    $gplwtdiv
     
    310312                    endif;
    311313                   
     314                    if($gptb):
     315                        $thumbgplwt = wp_get_attachment_image_src ( get_post_thumbnail_id ( get_the_ID() ), 'thumbnail' ) ;
     316                        if($thumbgplwt[0]!=""):
     317                            $imgsrc = "<img src=".$thumbgplwt[0]." width=".$tbwid." height=".$tbhig." alt=".get_the_title().">";
     318                        endif;
     319                    endif;
     320                   
    312321                    // here we start to build the return html code
    313322                    if($pgnm==1 && $pgin > 0):                     
     
    325334                            $parflw_p .= $postnr.",".$linn.",".$divwid.",".$tbwid.",".$tbhig.",".$cp.",";
    326335                            $parflw_p .= $cs.",".$lwt.",".$tte.",".$sptb.",".$tgtb.",".$ordm.",";
    327                             $parflw_p .= $ordf.",".$metk.",".$mett.",".$pgin.",".$pgplnm.",".$pgmx.",".$gplwtdiv.",".$ech;
     336                            $parflw_p .= $ordf.",".$metk.",".$mett.",".$pgin.",".$pgplnm.",".$pgmx.",".$gptb.",".$ech.",".$gplwtdiv;
    328337                            //echo "teste".$pgplnm;
    329338                            $prevflg = true;
     
    337346                            $parflw_n .= $postnr.",".$linn.",".$divwid.",".$tbwid.",".$tbhig.",".$cp.",";
    338347                            $parflw_n .= $cs.",".$lwt.",".$tte.",".$sptb.",".$tgtb.",".$ordm.",";
    339                             $parflw_n .= $ordf.",".$metk.",".$mett.",".$pgin.",".($pgnm+1).",".$pgmx.",".$gplwtdiv.",".$ech;
     348                            $parflw_n .= $ordf.",".$metk.",".$mett.",".$pgin.",".($pgnm+1).",".$pgmx.",".$gptb.",".$ech.",".$gplwtdiv;
    340349                           
    341350                            $nextflg = true;                           
     
    497506          'mett' => '',
    498507         
    499           'pgin' => ''
     508          'pgin' => '',
     509          'gptb' => ''
    500510          );
    501511  }
     
    506516  echo $after_widget;
    507517  //Our Widget Content
    508     getPostListThumbs($options['ptype'],$options['dexcp'],$options['orient'],$options['imgo'],$options['ttgo'],$options['dtgo'],$options['dtfrm'],$options['categ'],$options['postnr'],$options['linn'],$options['divwid'],$options['tbwid'],$options['tbhig'],$options['cp'],$options['cs'],$options['lwt'],$options['tte'],$options['sptb'],$options['tgtb'],$options['metk'],$options['mett'],$options['pgin']);
     518    getPostListThumbs($options['ptype'],$options['dexcp'],$options['orient'],$options['imgo'],$options['ttgo'],$options['dtgo'],$options['dtfrm'],$options['categ'],$options['postnr'],$options['linn'],$options['divwid'],$options['tbwid'],$options['tbhig'],$options['cp'],$options['cs'],$options['lwt'],$options['tte'],$options['sptb'],$options['tgtb'],$options['metk'],$options['mett'],$options['pgin'],$options['gptb']);
    509519}
    510520function getPostListThumbs_control()
     
    540550          'mett' => '',
    541551         
    542           'pgin' => ''
     552          'pgin' => '',
     553          'gptb' => ''
    543554          );
    544555  }
     
    572583    $options['mett'] = $_POST['getPostListThumbs-WidgetMetT'];
    573584    $options['pgin'] = $_POST['getPostListThumbs-WidgetPgin'];
     585    $options['gptb'] = $_POST['getPostListThumbs-WidgetGptb'];
    574586   
    575587    update_option("widget_getPostListThumbs", $options);
     
    648660        else{
    649661            $schk = "";
     662        }
     663        //
     664        if($options['gptb']){
     665            $gptbchk = "checked";
     666        }
     667        else{
     668            $gptbchk = "";
    650669        }
    651670        //
     
    706725    <label for="getPostListThumbs-WidgetSptb">Suppress Thumbnails: </label><br />
    707726    <input type="checkbox" id="getPostListThumbs-WidgetSptb" name="getPostListThumbs-WidgetSptb"  <?=$schk?> />
     727    <br /><br />
     728    <label for="getPostListThumbs-WidgetGptb">Get featured image(instead of first image): </label><br />
     729    <input type="checkbox" id="getPostListThumbs-WidgetGptb" name="getPostListThumbs-WidgetGptb"  <?=$gptbchk?> />
    708730    <br /><br />
    709731    <label for="getPostListThumbs-WidgetImgo">Display only images(write post or page in the field bellow): </label><br />
     
    841863            'mett' => '',
    842864           
    843             'pgin' => ''
     865            'pgin' => '',
     866            'gptb' => ''
    844867             );
    845868        }
     
    850873          echo $after_widget;*/
    851874          //Our Widget Content
    852             getPostListThumbs($instance['ptype'],$instance['dexcp'],$instance['orient'],$instance['imgo'],$instance['ttgo'],$instance['dtgo'],$instance['dtfrm'],$instance['categ'],$instance['postnr'],$instance['linn'],$instance['divwid'],$instance['tbwid'],$instance['tbhig'],$instance['cp'],$instance['cs'],$instance['lwt'],$instance['tte'],$instance['sptb'],$instance['tgtb'],$instance['ordm'],$instance['ordf'],$instance['metk'],$instance['mett'],$instance['pgin']);
     875            getPostListThumbs($instance['ptype'],$instance['dexcp'],$instance['orient'],$instance['imgo'],$instance['ttgo'],$instance['dtgo'],$instance['dtfrm'],$instance['categ'],$instance['postnr'],$instance['linn'],$instance['divwid'],$instance['tbwid'],$instance['tbhig'],$instance['cp'],$instance['cs'],$instance['lwt'],$instance['tte'],$instance['sptb'],$instance['tgtb'],$instance['ordm'],$instance['ordf'],$instance['metk'],$instance['mett'],$instance['pgin'],$instance['gptb']);
    853876    }
    854877    function update( $new_instance, $old_instance ) {
     
    881904        $instance['mett'] = $new_instance['mett'];
    882905        $instance['pgin'] = $new_instance['pgin'];
     906        $instance['gptb'] = htmlspecialchars($new_instance['gptb']);
    883907       
    884908        return $instance;
     
    913937        'mett'=>'n',
    914938       
    915         'pgin'=>''
     939        'pgin'=>'',
     940        'gptb' => false
    916941        );
    917942        $instance = wp_parse_args( (array) $instance, $defaults );
     
    9891014                else{
    9901015                    $schk = "";
     1016                }
     1017                //
     1018                if($instance['gptb']){
     1019                    $gptbchk = "checked";
     1020                }
     1021                else{
     1022                    $gptbchk = "";
    9911023                }
    9921024                //
     
    10481080            <label for="<?php echo $this->get_field_id( 'sptb' ); ?>">Suppress Thumbnails: </label><br />
    10491081            <input type="checkbox" id="<?php echo $this->get_field_id( 'sptb' ); ?>" name="<?php echo $this->get_field_name( 'sptb' ); ?>"  <?=$schk?> />
     1082            <br /><br />
     1083            <label for="<?php echo $this->get_field_id( 'gptb' ); ?>">Get featured image(instead of first image): </label><br />
     1084            <input type="checkbox" id="<?php echo $this->get_field_id( 'gptb' ); ?>" name="<?php echo $this->get_field_name( 'gptb' ); ?>"  <?=$gptbchk?> />
    10501085            <br /><br />
    10511086            <label for="<?php echo $this->get_field_id( 'imgo' ); ?>">Display only images: </label><br />
  • get-post-list-with-thumbnails/branches/readme.txt

    r451097 r475552  
    44Tags: list, posts list, list post, thumbnails
    55Requires at least: 3.1.3
    6 Tested up to: 3.1.3
    7 Stable tag: 8.0.4
     6Tested up to: 3.2.1
     7Stable tag: 9.0.0
    88
    99== Description ==
    1010
    11 Description:Displays a list with posts and custom size thumbnails(for the post first attached image), linked to each post permalink. You can configure it as multiple widgets or short code.
     11Description:Displays a list with posts and custom size thumbnails(for the first attached or featured image), linked to each post permalink. You can configure it as multiple widgets or short code.
    1212
    1313You can choose(parameters are not required, see screen shot 2) list orientation, display only images, display the post date, date format, display the post title, category, the number of posts, number of registers per line(for horizontal orientation), the table width, the thumbnails dimensions, the table cellpadding and cellspacing and the columns layout. See it working on http://www.wpworking.com/posts-list/
     
    4040/* if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Get Post List With Thumbnails')) : endif; */
    4141
    42 you can use short code: [gplt orient="h" imgo="false" ttgo="true" dtgo="true" dtfrm="1" categ="" postnr="100" linn="3" divwid="300" tbwid="90" tbhig="90" cp="4" cs="4" lwt="2" tte="" sptb="false" tgtb="false" ordm="DESC" ordf="ID" metk="" mett="" pgin="" ptype="post" dexcp="false"]
     42you can use short code: [gplt orient="h" imgo="false" ttgo="true" dtgo="true" dtfrm="1" categ="" postnr="100" linn="3" divwid="300" tbwid="90" tbhig="90" cp="4" cs="4" lwt="2" tte="" sptb="false" tgtb="false" ordm="DESC" ordf="ID" metk="" mett="" pgin="" ptype="post" dexcp="false" gptb="false"]
    4343
     44Important: if you want to add featured image instead of the first image, add add_theme_support( 'post-thumbnails' ); to your functions.php file
    4445
    4546== Frequently Asked Questions ==
     
    9293Post Type: ptype="post" // default='post' 'post' or 'page'
    9394Display Excerpt: dexcp="false" // true, false default 'false'
     95Get featured image(instead of first image): gptb="false" // true, false default 'false'
    9496
    9597== Upgrade Notice ==
     989.0.0 New option, choose featured image(instead of first image)
    96998.0.4 Adjustment for the beta pagination feature
    971008.0.3 Bug Fixed on number of posts
     
    112115Configure as widget or shortcode
    113116
    114 [gplt orient="h" imgo="false" ttgo="true" dtgo="true" dtfrm="1" categ="" postnr="100" linn="3" divwid="300" tbwid="90" tbhig="90" cp="4" cs="4" lwt="2" tte="" sptb="false" tgtb="false" ordm="DESC" ordf="ID" metk="" mett="" pgin="" ptype="post" dexcp="false"]
     117[gplt orient="h" imgo="false" ttgo="true" dtgo="true" dtfrm="1" categ="" postnr="100" linn="3" divwid="300" tbwid="90" tbhig="90" cp="4" cs="4" lwt="2" tte="" sptb="false" tgtb="false" ordm="DESC" ordf="ID" metk="" mett="" pgin="" ptype="post" dexcp="false" gptb="false"]
    115118
    116119Parameters
     
    140143Post Type: ptype="post" // default='post' 'post' or 'page'
    141144Display Excerpt: dexcp="false" // true, false default 'false'
     145Get featured image(instead of first image): gptb="false" // true, false default 'false'
    142146
    143147If you have any questions, please let me know  [email protected]
  • get-post-list-with-thumbnails/trunk/ajaxgplwt.php

    r450778 r475552  
    3838                $pgnm=$arrv[24];
    3939                //echo $pgnm;
    40                 $pgmx=$arrv[25];
    41                 $gplwtdiv=$arrv[26];
     40                $pgmx=$arrv[25];               
     41                $gptb =$arrv[26];
    4242                $ech =$arrv[27];   
     43                $gplwtdiv=$arrv[28];
    4344
    44                 getPostListThumbs($ptype,$dexcp,$orient,$imgo,$ttgo,$dtgo,$dtfrm,$categ,$postnr,$linn,$divwid,$tbwid,$tbhig,$cp,$cs,$lwt,$tte,$sptb,$tgtb,$ordm,$ordf,$metk,$mett,$pgin,$pgnm,$pgmx,$gplwtdiv,$ech);
     45                getPostListThumbs($ptype,$dexcp,$orient,$imgo,$ttgo,$dtgo,$dtfrm,$categ,$postnr,$linn,$divwid,$tbwid,$tbhig,$cp,$cs,$lwt,$tte,$sptb,$tgtb,$ordm,$ordf,$metk,$mett,$pgin,$gptb,$pgnm,$pgmx,$ech,$gplwtdiv);
    4546
    4647            //}
  • get-post-list-with-thumbnails/trunk/get_post_list_with_thumbs.php

    r451098 r475552  
    44Plugin URI: http://www.wpworking.com/
    55Description:Displays a post list and custom size thumbnails(for the post 1st attached image), linked to each post permalink. Use as multiples widget or shortcode.
    6 Version: 8.0.4
     6Version: 9.0.0
    77Author: Alvaro Neto
    88Author URI: http://wpworking.com/
     
    7474        'pgnm' => 1,
    7575        'pgmx' => '',
    76         'ech' => false
     76        'gptb' => false,
     77        'ech' => false     
    7778    ), $atts));
    7879    ob_start();         
    79     $gplwtres=getPostListThumbs($ptype,$dexcp,$orient,$imgo,$ttgo,$dtgo,$dtfrm,$categ,$postnr,$linn,$divwid,$tbwid,$tbhig,$cp,$cs,$lwt,$tte,$sptb,$tgtb,$ordm,$ordf,$metk,$mett,$pgin,$pgnm,$pgmx,$ech);
     80    $gplwtres=getPostListThumbs($ptype,$dexcp,$orient,$imgo,$ttgo,$dtgo,$dtfrm,$categ,$postnr,$linn,$divwid,$tbwid,$tbhig,$cp,$cs,$lwt,$tte,$sptb,$tgtb,$ordm,$ordf,$metk,$mett,$pgin,$gptb,$pgnm,$pgmx,$ech);
    8081    echo $gplwtres;
    8182    $gplwt_string = ob_get_contents();
     
    115116}
    116117// display a list of posts with custom size thumbnails, using the post first image
    117 function getPostListThumbs($ptype='post',$dexcp=false,$orient='v',$imgo=false,$ttgo=false,$dtgo=false,$dtfrm=1,$categ='',$postnr=20,$linn=3,$divwid=300,$tbwid=40,$tbhig=40,$cp=4,$cs=4,$lwt=1,$tte='',$sptb=false,$tgtb=false,$ordm='',$ordf='ID',$metk='',$mett='n',$pgin='',$pgnm='',$pgmx='',$gplwtdiv='',$ech=true){   
     118function getPostListThumbs($ptype='post',$dexcp=false,$orient='v',$imgo=false,$ttgo=false,$dtgo=false,$dtfrm=1,$categ='',$postnr=20,$linn=3,$divwid=300,$tbwid=40,$tbhig=40,$cp=4,$cs=4,$lwt=1,$tte='',$sptb=false,$tgtb=false,$ordm='',$ordf='ID',$metk='',$mett='n',$pgin='',$gptb=false,$pgnm='',$pgmx='',$ech=true,$gplwtdiv=''){   
    118119    //echo "testando";
    119120    //error_reporting(E_ALL);
    120121    //ini_set('display_errors', '1');
    121     $ptype = gtpartrat($ptype,'post');
    122     $gplwtdiv = gtpartrat($gplwtdiv,'');
     122    $ptype = gtpartrat($ptype,'post'); 
    123123    $dexcp = gtpartrat($dexcp,false);
    124124    $orient = gtpartrat($orient,'v');
     
    152152    $pgnm = gtpartrat($pgnm,1);
    153153    $pgmx = gtpartrat($pgmx,'');
    154     $ech = gtpartrat($ech,true);
     154    $gptb = gtpartrat($gptb,false);
     155    $ech = gtpartrat($ech,true);   
     156    $gplwtdiv = gtpartrat($gplwtdiv,'');
    155157    /*
    156158    $gplwtdiv
     
    310312                    endif;
    311313                   
     314                    if($gptb):
     315                        $thumbgplwt = wp_get_attachment_image_src ( get_post_thumbnail_id ( get_the_ID() ), 'thumbnail' ) ;
     316                        if($thumbgplwt[0]!=""):
     317                            $imgsrc = "<img src=".$thumbgplwt[0]." width=".$tbwid." height=".$tbhig." alt=".get_the_title().">";
     318                        endif;
     319                    endif;
     320                   
    312321                    // here we start to build the return html code
    313322                    if($pgnm==1 && $pgin > 0):                     
     
    325334                            $parflw_p .= $postnr.",".$linn.",".$divwid.",".$tbwid.",".$tbhig.",".$cp.",";
    326335                            $parflw_p .= $cs.",".$lwt.",".$tte.",".$sptb.",".$tgtb.",".$ordm.",";
    327                             $parflw_p .= $ordf.",".$metk.",".$mett.",".$pgin.",".$pgplnm.",".$pgmx.",".$gplwtdiv.",".$ech;
     336                            $parflw_p .= $ordf.",".$metk.",".$mett.",".$pgin.",".$pgplnm.",".$pgmx.",".$gptb.",".$ech.",".$gplwtdiv;
    328337                            //echo "teste".$pgplnm;
    329338                            $prevflg = true;
     
    337346                            $parflw_n .= $postnr.",".$linn.",".$divwid.",".$tbwid.",".$tbhig.",".$cp.",";
    338347                            $parflw_n .= $cs.",".$lwt.",".$tte.",".$sptb.",".$tgtb.",".$ordm.",";
    339                             $parflw_n .= $ordf.",".$metk.",".$mett.",".$pgin.",".($pgnm+1).",".$pgmx.",".$gplwtdiv.",".$ech;
     348                            $parflw_n .= $ordf.",".$metk.",".$mett.",".$pgin.",".($pgnm+1).",".$pgmx.",".$gptb.",".$ech.",".$gplwtdiv;
    340349                           
    341350                            $nextflg = true;                           
     
    497506          'mett' => '',
    498507         
    499           'pgin' => ''
     508          'pgin' => '',
     509          'gptb' => ''
    500510          );
    501511  }
     
    506516  echo $after_widget;
    507517  //Our Widget Content
    508     getPostListThumbs($options['ptype'],$options['dexcp'],$options['orient'],$options['imgo'],$options['ttgo'],$options['dtgo'],$options['dtfrm'],$options['categ'],$options['postnr'],$options['linn'],$options['divwid'],$options['tbwid'],$options['tbhig'],$options['cp'],$options['cs'],$options['lwt'],$options['tte'],$options['sptb'],$options['tgtb'],$options['metk'],$options['mett'],$options['pgin']);
     518    getPostListThumbs($options['ptype'],$options['dexcp'],$options['orient'],$options['imgo'],$options['ttgo'],$options['dtgo'],$options['dtfrm'],$options['categ'],$options['postnr'],$options['linn'],$options['divwid'],$options['tbwid'],$options['tbhig'],$options['cp'],$options['cs'],$options['lwt'],$options['tte'],$options['sptb'],$options['tgtb'],$options['metk'],$options['mett'],$options['pgin'],$options['gptb']);
    509519}
    510520function getPostListThumbs_control()
     
    540550          'mett' => '',
    541551         
    542           'pgin' => ''
     552          'pgin' => '',
     553          'gptb' => ''
    543554          );
    544555  }
     
    572583    $options['mett'] = $_POST['getPostListThumbs-WidgetMetT'];
    573584    $options['pgin'] = $_POST['getPostListThumbs-WidgetPgin'];
     585    $options['gptb'] = $_POST['getPostListThumbs-WidgetGptb'];
    574586   
    575587    update_option("widget_getPostListThumbs", $options);
     
    648660        else{
    649661            $schk = "";
     662        }
     663        //
     664        if($options['gptb']){
     665            $gptbchk = "checked";
     666        }
     667        else{
     668            $gptbchk = "";
    650669        }
    651670        //
     
    706725    <label for="getPostListThumbs-WidgetSptb">Suppress Thumbnails: </label><br />
    707726    <input type="checkbox" id="getPostListThumbs-WidgetSptb" name="getPostListThumbs-WidgetSptb"  <?=$schk?> />
     727    <br /><br />
     728    <label for="getPostListThumbs-WidgetGptb">Get featured image(instead of first image): </label><br />
     729    <input type="checkbox" id="getPostListThumbs-WidgetGptb" name="getPostListThumbs-WidgetGptb"  <?=$gptbchk?> />
    708730    <br /><br />
    709731    <label for="getPostListThumbs-WidgetImgo">Display only images(write post or page in the field bellow): </label><br />
     
    841863            'mett' => '',
    842864           
    843             'pgin' => ''
     865            'pgin' => '',
     866            'gptb' => ''
    844867             );
    845868        }
     
    850873          echo $after_widget;*/
    851874          //Our Widget Content
    852             getPostListThumbs($instance['ptype'],$instance['dexcp'],$instance['orient'],$instance['imgo'],$instance['ttgo'],$instance['dtgo'],$instance['dtfrm'],$instance['categ'],$instance['postnr'],$instance['linn'],$instance['divwid'],$instance['tbwid'],$instance['tbhig'],$instance['cp'],$instance['cs'],$instance['lwt'],$instance['tte'],$instance['sptb'],$instance['tgtb'],$instance['ordm'],$instance['ordf'],$instance['metk'],$instance['mett'],$instance['pgin']);
     875            getPostListThumbs($instance['ptype'],$instance['dexcp'],$instance['orient'],$instance['imgo'],$instance['ttgo'],$instance['dtgo'],$instance['dtfrm'],$instance['categ'],$instance['postnr'],$instance['linn'],$instance['divwid'],$instance['tbwid'],$instance['tbhig'],$instance['cp'],$instance['cs'],$instance['lwt'],$instance['tte'],$instance['sptb'],$instance['tgtb'],$instance['ordm'],$instance['ordf'],$instance['metk'],$instance['mett'],$instance['pgin'],$instance['gptb']);
    853876    }
    854877    function update( $new_instance, $old_instance ) {
     
    881904        $instance['mett'] = $new_instance['mett'];
    882905        $instance['pgin'] = $new_instance['pgin'];
     906        $instance['gptb'] = htmlspecialchars($new_instance['gptb']);
    883907       
    884908        return $instance;
     
    913937        'mett'=>'n',
    914938       
    915         'pgin'=>''
     939        'pgin'=>'',
     940        'gptb' => false
    916941        );
    917942        $instance = wp_parse_args( (array) $instance, $defaults );
     
    9891014                else{
    9901015                    $schk = "";
     1016                }
     1017                //
     1018                if($instance['gptb']){
     1019                    $gptbchk = "checked";
     1020                }
     1021                else{
     1022                    $gptbchk = "";
    9911023                }
    9921024                //
     
    10481080            <label for="<?php echo $this->get_field_id( 'sptb' ); ?>">Suppress Thumbnails: </label><br />
    10491081            <input type="checkbox" id="<?php echo $this->get_field_id( 'sptb' ); ?>" name="<?php echo $this->get_field_name( 'sptb' ); ?>"  <?=$schk?> />
     1082            <br /><br />
     1083            <label for="<?php echo $this->get_field_id( 'gptb' ); ?>">Get featured image(instead of first image): </label><br />
     1084            <input type="checkbox" id="<?php echo $this->get_field_id( 'gptb' ); ?>" name="<?php echo $this->get_field_name( 'gptb' ); ?>"  <?=$gptbchk?> />
    10501085            <br /><br />
    10511086            <label for="<?php echo $this->get_field_id( 'imgo' ); ?>">Display only images: </label><br />
  • get-post-list-with-thumbnails/trunk/readme.txt

    r451097 r475552  
    44Tags: list, posts list, list post, thumbnails
    55Requires at least: 3.1.3
    6 Tested up to: 3.1.3
    7 Stable tag: 8.0.4
     6Tested up to: 3.2.1
     7Stable tag: 9.0.0
    88
    99== Description ==
    1010
    11 Description:Displays a list with posts and custom size thumbnails(for the post first attached image), linked to each post permalink. You can configure it as multiple widgets or short code.
     11Description:Displays a list with posts and custom size thumbnails(for the first attached or featured image), linked to each post permalink. You can configure it as multiple widgets or short code.
    1212
    1313You can choose(parameters are not required, see screen shot 2) list orientation, display only images, display the post date, date format, display the post title, category, the number of posts, number of registers per line(for horizontal orientation), the table width, the thumbnails dimensions, the table cellpadding and cellspacing and the columns layout. See it working on http://www.wpworking.com/posts-list/
     
    4040/* if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Get Post List With Thumbnails')) : endif; */
    4141
    42 you can use short code: [gplt orient="h" imgo="false" ttgo="true" dtgo="true" dtfrm="1" categ="" postnr="100" linn="3" divwid="300" tbwid="90" tbhig="90" cp="4" cs="4" lwt="2" tte="" sptb="false" tgtb="false" ordm="DESC" ordf="ID" metk="" mett="" pgin="" ptype="post" dexcp="false"]
     42you can use short code: [gplt orient="h" imgo="false" ttgo="true" dtgo="true" dtfrm="1" categ="" postnr="100" linn="3" divwid="300" tbwid="90" tbhig="90" cp="4" cs="4" lwt="2" tte="" sptb="false" tgtb="false" ordm="DESC" ordf="ID" metk="" mett="" pgin="" ptype="post" dexcp="false" gptb="false"]
    4343
     44Important: if you want to add featured image instead of the first image, add add_theme_support( 'post-thumbnails' ); to your functions.php file
    4445
    4546== Frequently Asked Questions ==
     
    9293Post Type: ptype="post" // default='post' 'post' or 'page'
    9394Display Excerpt: dexcp="false" // true, false default 'false'
     95Get featured image(instead of first image): gptb="false" // true, false default 'false'
    9496
    9597== Upgrade Notice ==
     989.0.0 New option, choose featured image(instead of first image)
    96998.0.4 Adjustment for the beta pagination feature
    971008.0.3 Bug Fixed on number of posts
     
    112115Configure as widget or shortcode
    113116
    114 [gplt orient="h" imgo="false" ttgo="true" dtgo="true" dtfrm="1" categ="" postnr="100" linn="3" divwid="300" tbwid="90" tbhig="90" cp="4" cs="4" lwt="2" tte="" sptb="false" tgtb="false" ordm="DESC" ordf="ID" metk="" mett="" pgin="" ptype="post" dexcp="false"]
     117[gplt orient="h" imgo="false" ttgo="true" dtgo="true" dtfrm="1" categ="" postnr="100" linn="3" divwid="300" tbwid="90" tbhig="90" cp="4" cs="4" lwt="2" tte="" sptb="false" tgtb="false" ordm="DESC" ordf="ID" metk="" mett="" pgin="" ptype="post" dexcp="false" gptb="false"]
    115118
    116119Parameters
     
    140143Post Type: ptype="post" // default='post' 'post' or 'page'
    141144Display Excerpt: dexcp="false" // true, false default 'false'
     145Get featured image(instead of first image): gptb="false" // true, false default 'false'
    142146
    143147If you have any questions, please let me know  [email protected]
Note: See TracChangeset for help on using the changeset viewer.