Changeset 606324
- Timestamp:
- 10/01/2012 01:06:54 AM (13 years ago)
- Location:
- wordpress-posts-timeline/trunk
- Files:
-
- 3 edited
-
inc/timeline_options.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
wordpress-posts-timeline.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-posts-timeline/trunk/inc/timeline_options.php
r579979 r606324 2 2 /* CURRENT OPTIONS: 3 3 4 plugin version 1.6 4 plugin version 1.6.1 5 5 6 6 timeline_post_category - select post category from current category dropdown … … 35 35 $date_formats = array( 36 36 'March 10, 2012' => 'F j, Y', 37 '03.10.2012' => 'm. d.y',37 '03.10.2012' => 'm.j.y', 38 38 '2012' => 'Y', 39 'March, 2012' => 'F, Y' 39 'March, 2012' => 'F, Y', 40 '20 March, 2012' => 'j F, Y' 40 41 ); 41 42 … … 84 85 'input_type' => 'text' 85 86 ), 87 'show_titles' => array ( 88 'name' => 'timeline_show_titles', 89 'default' => 'no', 90 'desc' => 'Do you want to show the post title?', 91 'input_type' => 'dropdown', 92 'data' => array( //manual dropdown options 93 'yes' => 'yes', 94 'no' => 'no') 95 ), 86 96 'date_format' => array ( 87 97 'name' => 'timeline_date_format' , … … 94 104 'name' => 'timeline_text_length' , 95 105 'default' => 10, 96 'desc' => 'How many words do you want to show for each post? ',106 'desc' => 'How many words do you want to show for each post? (Use "-1" for full length)', 97 107 'input_type' => 'text', 98 108 ), -
wordpress-posts-timeline/trunk/readme.txt
r579979 r606324 1 1 === WordPress Posts Timeline === 2 2 Contributors: hobbsh 3 Donate Link: http://www. hackbits.com/3 Donate Link: http://www.wyliehobbs.com/ 4 4 Tags: posts timeline, css timeline, vertical timeline, timeline 5 5 Requires at least: 3.1 6 6 Tested up to: 3.4.1 7 Stable tag: 1.6 7 Stable tag: 1.6.1 8 8 License: GPLv2 9 9 -
wordpress-posts-timeline/trunk/wordpress-posts-timeline.php
r579979 r606324 5 5 Description: Outputs WordPress posts in a vertical timeline 6 6 Author: Wylie Hobbs 7 Version: 1.6 8 Author URI: http:/ hackbits.com/demos/wordpress-posts-timeline7 Version: 1.6.1 8 Author URI: http://wyliehobbs.com/demos/wordpress-posts-timeline 9 9 Text Domain: wordpress-posts-timeline 10 10 Domain Path: /lang 11 11 */ 12 12 13 /* Copyright 2012 Wylie Hobbs (email : w ylie@hackbits.com)13 /* Copyright 2012 Wylie Hobbs (email : workwith@wyliehobbs.com) 14 14 15 15 This program is free software; you can redistribute it and/or modify … … 28 28 29 29 define('WPTIMELINE_UNIQUE', 'wptimeline'); 30 define('WPTIMELINE_VERSION', 1.6 );30 define('WPTIMELINE_VERSION', 1.61); 31 31 32 32 … … 67 67 68 68 $posts = get_posts( $post_args ); 69 echo'<div id="timeline">';70 echo'<ul>';69 $out .= '<div id="timeline">'; 70 $out .= '<ul>'; 71 71 foreach ( $posts as $post ) : setup_postdata($post); 72 72 73 echo'<li><div>';73 $out .= '<li><div>'; 74 74 if( get_option('timeline_post_link') == 'yes'){ 75 echo '<a href="' . get_permalink($post->ID) . '" title="'.$post->title.'">'; 76 echo '<h3 class="timeline-date">'; 77 echo get_the_time(get_option('timeline_date_format'), $post->ID); 78 echo '</h3></a>'; 75 $out .= '<a href="' . get_permalink($post->ID) . '" title="'.$post->title.'">'; 76 $out .= '<h3 class="timeline-date">'; 77 $out .= get_the_time(get_option('timeline_date_format'), $post->ID); 78 if( get_option('timeline_show_titles') == 'yes'){ 79 $out .= " ".get_the_title($post->ID)." "; 80 } 81 $out .= '</h3></a>'; 79 82 } 80 83 else{ 81 echo '<h3 class="timeline-date">'; 82 echo get_the_time(get_option('timeline_date_format'), $post->ID); 83 echo '</h3>'; 84 $out .= '<h3 class="timeline-date">'; 85 $out .= get_the_time(get_option('timeline_date_format'), $post->ID); 86 if( get_option('timeline_show_titles') == 'yes'){ 87 $out .= " ".get_the_title($post->ID)." "; 88 } 89 $out .= '</h3>'; 84 90 } 85 91 if ( get_option('timeline_include_images') == 'yes' ){ 86 92 if ( featured_image() == true && has_post_thumbnail( $post->ID ) ){ 87 echo'<span class="timeline-image">' . get_the_post_thumbnail( $post->ID, 'timeline-thumb' ) . '</span>';93 $out .= '<span class="timeline-image">' . get_the_post_thumbnail( $post->ID, 'timeline-thumb' ) . '</span>'; 88 94 } 89 95 } 90 echo'<span class="timeline-text">'.timeline_text(get_option('timeline_text_length')).'</span>';91 echo'</div></li>';96 $out .= '<span class="timeline-text">'.timeline_text(get_option('timeline_text_length')).'</span>'; 97 $out .= '</div></li>'; 92 98 93 99 endforeach; 94 100 95 echo'</ul>';96 echo'</div> <!-- #timeline -->';101 $out .= '</ul>'; 102 $out .= '</div> <!-- #timeline -->'; 97 103 wp_reset_postdata(); 104 return $out; 98 105 } 99 106 … … 102 109 $str = get_the_content('', true, ''); 103 110 $str = strip_tags($str); 104 if(stripos($str," ") ){111 if(stripos($str," ") && $limit>=0){ 105 112 $ex_str = explode(" ",$str); 106 113 if(count($ex_str)>$limit){ 107 114 for($i=0;$i<$limit;$i++){ 108 $str_s.=$ex_str[$i]." ";115 $str_s.=$ex_str[$i]." "; 109 116 } 110 return $str_s; 117 $str_s.="..."; 118 return $str_s; 111 119 }else{ 112 return $str;120 return $str; 113 121 } 114 122 }else{
Note: See TracChangeset
for help on using the changeset viewer.