Changeset 475552
- Timestamp:
- 12/14/2011 07:17:48 PM (14 years ago)
- Location:
- get-post-list-with-thumbnails
- Files:
-
- 9 added
- 10 edited
-
branches/ajaxgplwt.php (modified) (1 diff)
-
branches/get_post_list_with_thumbs.php (modified) (19 diffs)
-
branches/readme.txt (modified) (5 diffs)
-
branches/screenshot-1.jpg (modified) (previous)
-
branches/screenshot-2.jpg (modified) (previous)
-
tags/8.0.4 (added)
-
tags/8.0.4/ajaxgplwt.php (added)
-
tags/8.0.4/ajaxhandlergplwt.js (added)
-
tags/8.0.4/get_post_list_with_thumbs.php (added)
-
tags/8.0.4/readme.txt (added)
-
tags/8.0.4/screenshot-1.jpg (added)
-
tags/8.0.4/screenshot-2.jpg (added)
-
tags/8.0.4/screenshot-3.jpg (added)
-
tags/8.0.4/screenshot-4.jpg (added)
-
trunk/ajaxgplwt.php (modified) (1 diff)
-
trunk/get_post_list_with_thumbs.php (modified) (19 diffs)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/screenshot-1.jpg (modified) (previous)
-
trunk/screenshot-2.jpg (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
get-post-list-with-thumbnails/branches/ajaxgplwt.php
r450778 r475552 38 38 $pgnm=$arrv[24]; 39 39 //echo $pgnm; 40 $pgmx=$arrv[25]; 41 $gp lwtdiv=$arrv[26];40 $pgmx=$arrv[25]; 41 $gptb =$arrv[26]; 42 42 $ech =$arrv[27]; 43 $gplwtdiv=$arrv[28]; 43 44 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); 45 46 46 47 //} -
get-post-list-with-thumbnails/branches/get_post_list_with_thumbs.php
r451098 r475552 4 4 Plugin URI: http://www.wpworking.com/ 5 5 Description: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.46 Version: 9.0.0 7 7 Author: Alvaro Neto 8 8 Author URI: http://wpworking.com/ … … 74 74 'pgnm' => 1, 75 75 'pgmx' => '', 76 'ech' => false 76 'gptb' => false, 77 'ech' => false 77 78 ), $atts)); 78 79 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); 80 81 echo $gplwtres; 81 82 $gplwt_string = ob_get_contents(); … … 115 116 } 116 117 // 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){118 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='',$gptb=false,$pgnm='',$pgmx='',$ech=true,$gplwtdiv=''){ 118 119 //echo "testando"; 119 120 //error_reporting(E_ALL); 120 121 //ini_set('display_errors', '1'); 121 $ptype = gtpartrat($ptype,'post'); 122 $gplwtdiv = gtpartrat($gplwtdiv,''); 122 $ptype = gtpartrat($ptype,'post'); 123 123 $dexcp = gtpartrat($dexcp,false); 124 124 $orient = gtpartrat($orient,'v'); … … 152 152 $pgnm = gtpartrat($pgnm,1); 153 153 $pgmx = gtpartrat($pgmx,''); 154 $ech = gtpartrat($ech,true); 154 $gptb = gtpartrat($gptb,false); 155 $ech = gtpartrat($ech,true); 156 $gplwtdiv = gtpartrat($gplwtdiv,''); 155 157 /* 156 158 $gplwtdiv … … 310 312 endif; 311 313 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 312 321 // here we start to build the return html code 313 322 if($pgnm==1 && $pgin > 0): … … 325 334 $parflw_p .= $postnr.",".$linn.",".$divwid.",".$tbwid.",".$tbhig.",".$cp.","; 326 335 $parflw_p .= $cs.",".$lwt.",".$tte.",".$sptb.",".$tgtb.",".$ordm.","; 327 $parflw_p .= $ordf.",".$metk.",".$mett.",".$pgin.",".$pgplnm.",".$pgmx.",".$gp lwtdiv.",".$ech;336 $parflw_p .= $ordf.",".$metk.",".$mett.",".$pgin.",".$pgplnm.",".$pgmx.",".$gptb.",".$ech.",".$gplwtdiv; 328 337 //echo "teste".$pgplnm; 329 338 $prevflg = true; … … 337 346 $parflw_n .= $postnr.",".$linn.",".$divwid.",".$tbwid.",".$tbhig.",".$cp.","; 338 347 $parflw_n .= $cs.",".$lwt.",".$tte.",".$sptb.",".$tgtb.",".$ordm.","; 339 $parflw_n .= $ordf.",".$metk.",".$mett.",".$pgin.",".($pgnm+1).",".$pgmx.",".$gp lwtdiv.",".$ech;348 $parflw_n .= $ordf.",".$metk.",".$mett.",".$pgin.",".($pgnm+1).",".$pgmx.",".$gptb.",".$ech.",".$gplwtdiv; 340 349 341 350 $nextflg = true; … … 497 506 'mett' => '', 498 507 499 'pgin' => '' 508 'pgin' => '', 509 'gptb' => '' 500 510 ); 501 511 } … … 506 516 echo $after_widget; 507 517 //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']); 509 519 } 510 520 function getPostListThumbs_control() … … 540 550 'mett' => '', 541 551 542 'pgin' => '' 552 'pgin' => '', 553 'gptb' => '' 543 554 ); 544 555 } … … 572 583 $options['mett'] = $_POST['getPostListThumbs-WidgetMetT']; 573 584 $options['pgin'] = $_POST['getPostListThumbs-WidgetPgin']; 585 $options['gptb'] = $_POST['getPostListThumbs-WidgetGptb']; 574 586 575 587 update_option("widget_getPostListThumbs", $options); … … 648 660 else{ 649 661 $schk = ""; 662 } 663 // 664 if($options['gptb']){ 665 $gptbchk = "checked"; 666 } 667 else{ 668 $gptbchk = ""; 650 669 } 651 670 // … … 706 725 <label for="getPostListThumbs-WidgetSptb">Suppress Thumbnails: </label><br /> 707 726 <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?> /> 708 730 <br /><br /> 709 731 <label for="getPostListThumbs-WidgetImgo">Display only images(write post or page in the field bellow): </label><br /> … … 841 863 'mett' => '', 842 864 843 'pgin' => '' 865 'pgin' => '', 866 'gptb' => '' 844 867 ); 845 868 } … … 850 873 echo $after_widget;*/ 851 874 //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']); 853 876 } 854 877 function update( $new_instance, $old_instance ) { … … 881 904 $instance['mett'] = $new_instance['mett']; 882 905 $instance['pgin'] = $new_instance['pgin']; 906 $instance['gptb'] = htmlspecialchars($new_instance['gptb']); 883 907 884 908 return $instance; … … 913 937 'mett'=>'n', 914 938 915 'pgin'=>'' 939 'pgin'=>'', 940 'gptb' => false 916 941 ); 917 942 $instance = wp_parse_args( (array) $instance, $defaults ); … … 989 1014 else{ 990 1015 $schk = ""; 1016 } 1017 // 1018 if($instance['gptb']){ 1019 $gptbchk = "checked"; 1020 } 1021 else{ 1022 $gptbchk = ""; 991 1023 } 992 1024 // … … 1048 1080 <label for="<?php echo $this->get_field_id( 'sptb' ); ?>">Suppress Thumbnails: </label><br /> 1049 1081 <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?> /> 1050 1085 <br /><br /> 1051 1086 <label for="<?php echo $this->get_field_id( 'imgo' ); ?>">Display only images: </label><br /> -
get-post-list-with-thumbnails/branches/readme.txt
r451097 r475552 4 4 Tags: list, posts list, list post, thumbnails 5 5 Requires at least: 3.1.3 6 Tested up to: 3. 1.37 Stable tag: 8.0.46 Tested up to: 3.2.1 7 Stable tag: 9.0.0 8 8 9 9 == Description == 10 10 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.11 Description: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. 12 12 13 13 You 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/ … … 40 40 /* if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Get Post List With Thumbnails')) : endif; */ 41 41 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" ]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" gptb="false"] 43 43 44 Important: if you want to add featured image instead of the first image, add add_theme_support( 'post-thumbnails' ); to your functions.php file 44 45 45 46 == Frequently Asked Questions == … … 92 93 Post Type: ptype="post" // default='post' 'post' or 'page' 93 94 Display Excerpt: dexcp="false" // true, false default 'false' 95 Get featured image(instead of first image): gptb="false" // true, false default 'false' 94 96 95 97 == Upgrade Notice == 98 9.0.0 New option, choose featured image(instead of first image) 96 99 8.0.4 Adjustment for the beta pagination feature 97 100 8.0.3 Bug Fixed on number of posts … … 112 115 Configure as widget or shortcode 113 116 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"] 115 118 116 119 Parameters … … 140 143 Post Type: ptype="post" // default='post' 'post' or 'page' 141 144 Display Excerpt: dexcp="false" // true, false default 'false' 145 Get featured image(instead of first image): gptb="false" // true, false default 'false' 142 146 143 147 If you have any questions, please let me know [email protected] -
get-post-list-with-thumbnails/trunk/ajaxgplwt.php
r450778 r475552 38 38 $pgnm=$arrv[24]; 39 39 //echo $pgnm; 40 $pgmx=$arrv[25]; 41 $gp lwtdiv=$arrv[26];40 $pgmx=$arrv[25]; 41 $gptb =$arrv[26]; 42 42 $ech =$arrv[27]; 43 $gplwtdiv=$arrv[28]; 43 44 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); 45 46 46 47 //} -
get-post-list-with-thumbnails/trunk/get_post_list_with_thumbs.php
r451098 r475552 4 4 Plugin URI: http://www.wpworking.com/ 5 5 Description: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.46 Version: 9.0.0 7 7 Author: Alvaro Neto 8 8 Author URI: http://wpworking.com/ … … 74 74 'pgnm' => 1, 75 75 'pgmx' => '', 76 'ech' => false 76 'gptb' => false, 77 'ech' => false 77 78 ), $atts)); 78 79 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); 80 81 echo $gplwtres; 81 82 $gplwt_string = ob_get_contents(); … … 115 116 } 116 117 // 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){118 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='',$gptb=false,$pgnm='',$pgmx='',$ech=true,$gplwtdiv=''){ 118 119 //echo "testando"; 119 120 //error_reporting(E_ALL); 120 121 //ini_set('display_errors', '1'); 121 $ptype = gtpartrat($ptype,'post'); 122 $gplwtdiv = gtpartrat($gplwtdiv,''); 122 $ptype = gtpartrat($ptype,'post'); 123 123 $dexcp = gtpartrat($dexcp,false); 124 124 $orient = gtpartrat($orient,'v'); … … 152 152 $pgnm = gtpartrat($pgnm,1); 153 153 $pgmx = gtpartrat($pgmx,''); 154 $ech = gtpartrat($ech,true); 154 $gptb = gtpartrat($gptb,false); 155 $ech = gtpartrat($ech,true); 156 $gplwtdiv = gtpartrat($gplwtdiv,''); 155 157 /* 156 158 $gplwtdiv … … 310 312 endif; 311 313 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 312 321 // here we start to build the return html code 313 322 if($pgnm==1 && $pgin > 0): … … 325 334 $parflw_p .= $postnr.",".$linn.",".$divwid.",".$tbwid.",".$tbhig.",".$cp.","; 326 335 $parflw_p .= $cs.",".$lwt.",".$tte.",".$sptb.",".$tgtb.",".$ordm.","; 327 $parflw_p .= $ordf.",".$metk.",".$mett.",".$pgin.",".$pgplnm.",".$pgmx.",".$gp lwtdiv.",".$ech;336 $parflw_p .= $ordf.",".$metk.",".$mett.",".$pgin.",".$pgplnm.",".$pgmx.",".$gptb.",".$ech.",".$gplwtdiv; 328 337 //echo "teste".$pgplnm; 329 338 $prevflg = true; … … 337 346 $parflw_n .= $postnr.",".$linn.",".$divwid.",".$tbwid.",".$tbhig.",".$cp.","; 338 347 $parflw_n .= $cs.",".$lwt.",".$tte.",".$sptb.",".$tgtb.",".$ordm.","; 339 $parflw_n .= $ordf.",".$metk.",".$mett.",".$pgin.",".($pgnm+1).",".$pgmx.",".$gp lwtdiv.",".$ech;348 $parflw_n .= $ordf.",".$metk.",".$mett.",".$pgin.",".($pgnm+1).",".$pgmx.",".$gptb.",".$ech.",".$gplwtdiv; 340 349 341 350 $nextflg = true; … … 497 506 'mett' => '', 498 507 499 'pgin' => '' 508 'pgin' => '', 509 'gptb' => '' 500 510 ); 501 511 } … … 506 516 echo $after_widget; 507 517 //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']); 509 519 } 510 520 function getPostListThumbs_control() … … 540 550 'mett' => '', 541 551 542 'pgin' => '' 552 'pgin' => '', 553 'gptb' => '' 543 554 ); 544 555 } … … 572 583 $options['mett'] = $_POST['getPostListThumbs-WidgetMetT']; 573 584 $options['pgin'] = $_POST['getPostListThumbs-WidgetPgin']; 585 $options['gptb'] = $_POST['getPostListThumbs-WidgetGptb']; 574 586 575 587 update_option("widget_getPostListThumbs", $options); … … 648 660 else{ 649 661 $schk = ""; 662 } 663 // 664 if($options['gptb']){ 665 $gptbchk = "checked"; 666 } 667 else{ 668 $gptbchk = ""; 650 669 } 651 670 // … … 706 725 <label for="getPostListThumbs-WidgetSptb">Suppress Thumbnails: </label><br /> 707 726 <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?> /> 708 730 <br /><br /> 709 731 <label for="getPostListThumbs-WidgetImgo">Display only images(write post or page in the field bellow): </label><br /> … … 841 863 'mett' => '', 842 864 843 'pgin' => '' 865 'pgin' => '', 866 'gptb' => '' 844 867 ); 845 868 } … … 850 873 echo $after_widget;*/ 851 874 //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']); 853 876 } 854 877 function update( $new_instance, $old_instance ) { … … 881 904 $instance['mett'] = $new_instance['mett']; 882 905 $instance['pgin'] = $new_instance['pgin']; 906 $instance['gptb'] = htmlspecialchars($new_instance['gptb']); 883 907 884 908 return $instance; … … 913 937 'mett'=>'n', 914 938 915 'pgin'=>'' 939 'pgin'=>'', 940 'gptb' => false 916 941 ); 917 942 $instance = wp_parse_args( (array) $instance, $defaults ); … … 989 1014 else{ 990 1015 $schk = ""; 1016 } 1017 // 1018 if($instance['gptb']){ 1019 $gptbchk = "checked"; 1020 } 1021 else{ 1022 $gptbchk = ""; 991 1023 } 992 1024 // … … 1048 1080 <label for="<?php echo $this->get_field_id( 'sptb' ); ?>">Suppress Thumbnails: </label><br /> 1049 1081 <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?> /> 1050 1085 <br /><br /> 1051 1086 <label for="<?php echo $this->get_field_id( 'imgo' ); ?>">Display only images: </label><br /> -
get-post-list-with-thumbnails/trunk/readme.txt
r451097 r475552 4 4 Tags: list, posts list, list post, thumbnails 5 5 Requires at least: 3.1.3 6 Tested up to: 3. 1.37 Stable tag: 8.0.46 Tested up to: 3.2.1 7 Stable tag: 9.0.0 8 8 9 9 == Description == 10 10 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.11 Description: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. 12 12 13 13 You 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/ … … 40 40 /* if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Get Post List With Thumbnails')) : endif; */ 41 41 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" ]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" gptb="false"] 43 43 44 Important: if you want to add featured image instead of the first image, add add_theme_support( 'post-thumbnails' ); to your functions.php file 44 45 45 46 == Frequently Asked Questions == … … 92 93 Post Type: ptype="post" // default='post' 'post' or 'page' 93 94 Display Excerpt: dexcp="false" // true, false default 'false' 95 Get featured image(instead of first image): gptb="false" // true, false default 'false' 94 96 95 97 == Upgrade Notice == 98 9.0.0 New option, choose featured image(instead of first image) 96 99 8.0.4 Adjustment for the beta pagination feature 97 100 8.0.3 Bug Fixed on number of posts … … 112 115 Configure as widget or shortcode 113 116 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"] 115 118 116 119 Parameters … … 140 143 Post Type: ptype="post" // default='post' 'post' or 'page' 141 144 Display Excerpt: dexcp="false" // true, false default 'false' 145 Get featured image(instead of first image): gptb="false" // true, false default 'false' 142 146 143 147 If you have any questions, please let me know [email protected]
Note: See TracChangeset
for help on using the changeset viewer.