diff -r 2f6f6f7551ca -r 32102edaa81b web/wp-content/plugins/posts-of-current-category/posts-of-current-category.php --- a/web/wp-content/plugins/posts-of-current-category/posts-of-current-category.php Thu Sep 16 15:45:36 2010 +0000 +++ b/web/wp-content/plugins/posts-of-current-category/posts-of-current-category.php Mon Nov 19 18:26:13 2012 +0100 @@ -1,12 +1,11 @@ Widgets and Drag "Posts of Current Category" widget to your Sidebar. -Version: 0.1 +Version: 0.4 Author: Anup Raj -Author URI: http://anupraj.com.np/home/ -// modified by sam 21/01/2010 +Author URI: http://anupraj.com.np/ */ class posts_cur_cat extends WP_Widget { @@ -18,7 +17,6 @@ function widget($args, $instance) { extract($args, EXTR_SKIP); - echo $before_widget; $title = empty($instance['title']) ? __('', 'posts-of-cur-cat') : apply_filters('widget_title', $instance['title']); $parameters = array( @@ -29,12 +27,47 @@ 'OrderBy' => esc_attr($instance['OrderBy']) ); + echo $before_title; + echo ''; + echo $title; + }else{ + if($post->post_parent) { + $parent_title = get_the_title($post->post_parent); + echo $parent_title; + echo '">'; + echo $parent_title; + } else { + wp_title(''); + echo '">'; + wp_title(''); + } + } + echo ''; + echo $after_title; - //print recent posts - post_of_curCat($parameters); + echo $before_widget; + if (is_page()){ + /* + if($post->post_parent){ + $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&sort_column=menu_order"); + }else{ + $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&sort_column=menu_order"); + } + if ($children && !$s) { + //echo ''; + } + */ + } + if(is_category()){//print recent posts + post_of_curCat($parameters); + } echo $after_widget; } //end of widget @@ -74,7 +107,8 @@ ?>

@@ -148,15 +182,12 @@ $posts = get_posts($query); //get posts $postlist = ''; foreach ($posts as $post) { - $post_title_s = htmlspecialchars(stripslashes(cache_cutter($post->post_title))); - $post_title_l = htmlspecialchars(stripslashes(text_cutter($post->post_title,200))); - // modif here (cache_cutter(); ) - $postlist .= '

  • ' . $post_title_l . '
  • '; + $post_title = htmlspecialchars(stripslashes($post->post_title)); + $postlist .= '
  • ' . $post_title . '
  • '; } - echo '