web/wp-content/plugins/posts-of-current-category/posts-of-current-category.php
branchwordpress
changeset 123 561aa6d282f6
parent 109 03b0d1493584
equal deleted inserted replaced
112:fb7cd02b9848 123:561aa6d282f6
     4 Plugin URI: http://anupraj.com.np/home/wp-plugins/display-posts-of-current-category-widget/
     4 Plugin URI: http://anupraj.com.np/home/wp-plugins/display-posts-of-current-category-widget/
     5 Description: Lists (Show/Display title) Posts of Current Category and Order Posts by author,content,date,ID, .. etc  Sort ASC/DESC. Go to Appearance>Widgets and Drag "Posts of Current Category" widget to your Sidebar.
     5 Description: Lists (Show/Display title) Posts of Current Category and Order Posts by author,content,date,ID, .. etc  Sort ASC/DESC. Go to Appearance>Widgets and Drag "Posts of Current Category" widget to your Sidebar.
     6 Version: 0.1
     6 Version: 0.1
     7 Author: Anup Raj
     7 Author: Anup Raj
     8 Author URI: http://anupraj.com.np/home/
     8 Author URI: http://anupraj.com.np/home/
       
     9 // modified by sam 21/01/2010
     9 */
    10 */
    10 
    11 
    11 class posts_cur_cat extends WP_Widget {
    12 class posts_cur_cat extends WP_Widget {
    12 	function posts_cur_cat() {
    13 	function posts_cur_cat() {
    13 		$widget_ops = array('description' => __('Display Posts of current category and order it.', 'posts-of-cur-cat') );
    14 		$widget_ops = array('description' => __('Display Posts of current category and order it.', 'posts-of-cur-cat') );
   145 	
   146 	
   146 	$query = "&category=$curCategoryID&showposts=$limit&orderby=$OrderBy&order=$AscDesc";
   147 	$query = "&category=$curCategoryID&showposts=$limit&orderby=$OrderBy&order=$AscDesc";
   147 	$posts = get_posts($query); //get posts
   148 	$posts = get_posts($query); //get posts
   148 	$postlist = '';	
   149 	$postlist = '';	
   149     foreach ($posts as $post) {
   150     foreach ($posts as $post) {
   150 		$post_title = htmlspecialchars(stripslashes($post->post_title));
   151 		$post_title_s = htmlspecialchars(stripslashes(cache_cutter($post->post_title)));
   151 		$postlist .= '<li><a href="' . get_permalink($post->ID) . '" title="'. $post_title .'" >' . $post_title . '</a> </li>';
   152 		$post_title_l = htmlspecialchars(stripslashes(text_cutter($post->post_title,200)));
       
   153 		// modif here (cache_cutter(); ) 				
       
   154 		$postlist .= '<li><a href="' . get_permalink($post->ID) . '" title="'.  $post_title_s .'" >' . $post_title_l . ' </a> </li>';
   152     }
   155     }
   153 	
   156 	
   154 	echo '<ul class="advanced-recent-posts">';		
   157 	echo '<ul class="advanced-recent-posts">';		
   155 		echo $postlist;
   158 		echo $postlist;
   156 	echo '</ul>';
   159 	echo '</ul>';
   157  }
   160  }
       
   161 
   158 ?>
   162 ?>