WordPress.org

Plugin Directory

Changeset 202021


Ignore:
Timestamp:
02/05/10 00:10:51 (4 years ago)
Author:
djzone
Message:

Pages handling and new Pages Widget

Location:
advanced-category-excluder/trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • advanced-category-excluder/trunk/CHANGES.txt

    r201713 r202021  
    112010. 02. 03. - DjZoNe 
    221.5-alpha: 
    3     - added "Categories Widget support"  
     3    - added "Categories Widget support" 
     4    - added "Pages Widget support"        
    45 
    562009. 05. 12. - DjZoNe 
  • advanced-category-excluder/trunk/README.txt

    r117485 r202021  
    1717This is great, for **SEO** reasons, for content separation, for grouping information, and handle them as real sub pages. 
    1818 
    19 **[Download now!](http://downloads.wordpress.org/plugin/advanced-category-excluder.1.4.2.zip)** 
     19**[Download now!](http://downloads.wordpress.org/plugin/advanced-category-excluder.1.4.3.zip)** 
    2020 
    2121[Support](http://ace.dev.rain.hu/) | 
  • advanced-category-excluder/trunk/advanced-category-excluder.php

    r201713 r202021  
    3232 remove_filter('posts_where', 'ace_where'); 
    3333 remove_filter('posts_distinct', 'ace_distinct'); 
    34  remove_filter('get_bookmarks', 'ace_get_bookmarks'); 
     34 remove_filter('wp_list_bookmarks', 'ace_get_bookmarks'); 
    3535 remove_filter('getarchives_where','ace_getarchives_where'); 
    3636 //remove_filter('getarchives_join','ace_getarchives_join'); 
     
    5757} 
    5858 
    59 function ace_get_bookmarks($bookmarks) 
     59function ace_list_bookmarks($bookmarks) 
    6060{ 
    6161    $filter = ace_get_section(); 
     
    8585function ace_list_pages_excludes($excludes) 
    8686{ 
     87    global $wp_query; 
     88 
     89    if($wp_query->is_page_widget) return $excludes; 
     90 
    8791      $filter = ace_get_section(); 
    8892    $posts_to_exclude = get_option("ace_page_sections_".$filter); 
    8993     
    90     return explode(",",$posts_to_exclude); 
     94    return explode(",",$posts_to_exclude); 
    9195} 
    9296 
     
    245249            add_submenu_page('advanced-category-excluder/main.php', __('Links', 'ace'), __('Links', 'ace'), 'manage_options', 'advanced-category-excluder/pages/links.php'); 
    246250            add_submenu_page('advanced-category-excluder/main.php', __('Link categories', 'ace'), __('Link categories', 'ace'), 'manage_options', 'advanced-category-excluder/pages/link_categories.php'); 
    247       add_submenu_page('advanced-category-excluder/main.php', __('Widget - Categories', 'ace'), __('Widget - Categories', 'ace'), 'manage_options', 'advanced-category-excluder/pages/cat_widget.php');                  
     251      add_submenu_page('advanced-category-excluder/main.php', __('Widget - Categories', 'ace'), __('Widget - Categories', 'ace'), 'manage_options', 'advanced-category-excluder/pages/cat_widget.php'); 
     252      add_submenu_page('advanced-category-excluder/main.php', __('Widget - Pages', 'ace'), __('Widget - Pages', 'ace'), 'manage_options', 'advanced-category-excluder/pages/page_widget.php');                       
    248253            add_submenu_page('advanced-category-excluder/main.php', __('Tags', 'ace'), __('Tags', 'ace'), 'manage_options', 'advanced-category-excluder/pages/tags.php'); 
    249254            add_submenu_page('advanced-category-excluder/main.php', __('Plugins homepage', 'ace'), __('Plugin homepage', 'ace'), 'manage_options', 'advanced-category-excluder/pages/home.php'); 
     
    415420} 
    416421 
     422/** 
     423 * Since 1.5 
     424 */  
    417425function ace_categories_dropdown_args($args) 
    418426{ 
     
    422430  $args['exclude']=$cats_to_exclude; 
    423431   
     432  return $args; 
     433} 
     434 
     435/** 
     436 * We only hook to this to remove, the value in wp_query 
     437 * we set at ace_pages_args   
     438 */  
     439function ace_list_pages($args) 
     440{ 
     441  global $wp_query; 
     442 
     443  unset($wp_query->is_page_widget); 
     444   
     445  return $args; 
     446} 
     447 
     448function ace_pages_args($args) 
     449{ 
     450  global $wp_query; 
     451  // 
     452  // work around, to skipp double excluding 
     453  //   
     454  $wp_query->is_page_widget=1; 
     455   
     456  $filter = ace_get_section();       
     457  $cats_to_exclude = get_option("ace_pagewidget_".$filter); 
     458    
     459  $args['exclude']=$cats_to_exclude; 
     460     
    424461  return $args; 
    425462} 
     
    477514add_filter('getarchives_where','ace_getarchives_where'); 
    478515//add_filter('getarchives_join','ace_getarchives_join'); 
     516 
    479517add_filter('wp_list_pages_excludes','ace_list_pages_excludes'); 
    480 add_filter('get_bookmarks','ace_get_bookmarks'); 
     518//add_filter('wp_list_bookmarks','ace_list_bookmarks'); 
    481519 
    482520add_action('admin_menu', 'ace_adminmenu'); 
     
    489527add_action('widget_categories_dropdown_args', 'ace_categories_dropdown_args'); 
    490528add_action('widget_categories_args', 'ace_categories_dropdown_args'); 
     529add_action('widget_pages_args', 'ace_pages_args'); 
     530add_filter('wp_list_pages','ace_list_pages'); 
     531add_action('widget_links_args', 'ace_links_args'); 
     532 
    491533 
    492534add_action('activate_advanced-category-excluder/advanced-category-excluder.php', 'ace_install'); 
  • advanced-category-excluder/trunk/pages/link_categories.php

    r114747 r202021  
    22    global $wpdb, $ace_targets; 
    33 
    4     unset($ace_targets['is_feed']); 
    5     unset($ace_targets['is_comment_feed']); 
    6     unset($ace_targets['norobots']); 
     4    $targets = $ace_targets; 
     5    unset($targets['norobots']); 
     6    unset($targets['is_comment_feed']); 
     7    unset($targets['is_feed']); 
    78     
    89    if ($_POST['submit']) 
     
    1112      if (!empty($_POST['categories'])) 
    1213      {   
    13         if (is_array($ace_targets)) 
     14        if (is_array($targets)) 
    1415        { 
    1516         
    16           foreach ($ace_targets as $key=>$val) 
     17          foreach ($targets as $key=>$val) 
    1718          { 
    1819                $data = $_POST['categories_'.$key]; 
     
    3940    if ($_POST['empty']) 
    4041    { 
    41         foreach ($ace_targets as $key=>$val) 
     42        foreach ($targets as $key=>$val) 
    4243        { 
    4344            update_option("ace_linkcategory_sections_".$key,""); 
     
    5859      <div class="inside"> 
    5960        <ul> 
    60          <li><?php echo sprintf(__("Here are %s different sections on the site. You can define section by section which link categories would you like to hide.","ace"), count($ace_targets)); ?></li> 
     61         <li><?php echo sprintf(__("Here are %s different sections on the site. You can define section by section which link categories would you like to hide.","ace"), count($targets)); ?></li> 
    6162        </ul> 
    6263      </div> 
     
    6667        <div class="inside">                       
    6768     <?php  
    68       foreach ($ace_targets as $key=>$val): 
     69      foreach ($targets as $key=>$val): 
    6970      $_cats = explode(",",get_option("ace_linkcategory_sections_".$key)); 
    7071     ?> 
  • advanced-category-excluder/trunk/pages/links.php

    r114747 r202021  
    22    global $wpdb, $ace_targets; 
    33 
    4     unset($ace_targets['is_feed']); 
    5     unset($ace_targets['is_comment_feed']); 
    6     unset($ace_targets['norobots']);     
     4    $targets = $ace_targets; 
     5    unset($targets['norobots']); 
     6    unset($targets['is_comment_feed']); 
     7    unset($targets['is_feed']);  
    78     
    89    if ($_POST['submit']) 
     
    1112      if (!empty($_POST['categories'])) 
    1213      {   
    13         if (is_array($ace_targets)) 
     14        if (is_array($targets)) 
    1415        { 
    1516         
    16           foreach ($ace_targets as $key=>$val) 
     17          foreach ($targets as $key=>$val) 
    1718          { 
    1819                $data = $_POST['categories_'.$key]; 
     
    3940    if ($_POST['empty']) 
    4041    { 
    41         foreach ($ace_targets as $key=>$val) 
     42        foreach ($targets as $key=>$val) 
    4243        { 
    4344            update_option("ace_link_sections_".$key,""); 
     
    5960      <div class="inside"> 
    6061        <ul> 
    61          <li><?php echo sprintf(__("Here are %s different sections on the site. You can define section by section which links would you like to hide.","ace"), count($ace_targets)); ?></li> 
     62         <li><?php echo sprintf(__("Here are %s different sections on the site. You can define section by section which links would you like to hide.","ace"), count($targets)); ?></li> 
    6263        </ul> 
    6364      </div> 
     
    6768        <div class="inside">                       
    6869     <?php  
    69       foreach ($ace_targets as $key=>$val): 
     70      foreach ($targets as $key=>$val): 
    7071      $_cats = explode(",",get_option("ace_link_sections_".$key)); 
    7172     ?> 
  • advanced-category-excluder/trunk/pages/page_sections.php

    r96759 r202021  
    1919                    foreach ($data as $k=>$v) 
    2020                    { 
    21                 $s.=trim($v); if ($c != $k) $s.=","; 
    22                         } 
     21                          $s.=trim($v); if ($c != $k) $s.=","; 
     22                    } 
    2323                    update_option("ace_page_categories_".$key,$s); 
    2424                } 
  • advanced-category-excluder/trunk/pages/pages.php

    r114747 r202021  
    22    global $wpdb, $ace_targets; 
    33 
    4     unset($ace_targets['is_feed']); 
    5     unset($ace_targets['is_comment_feed']); 
     4    $targets = $ace_targets; 
     5    unset($targets['is_comment_feed']); 
     6    unset($targets['is_feed']); 
    67     
    78    if ($_POST['submit']) 
     
    1011        if (!empty($_POST['categories'])) 
    1112        {   
    12             if (is_array($ace_targets)) 
     13            if (is_array($targets)) 
    1314            { 
    1415             
    15               foreach ($ace_targets as $key=>$val) 
     16              foreach ($targets as $key=>$val) 
    1617              { 
    1718                    $data = $_POST['categories_'.$key]; 
     
    3839    if ($_POST['empty']) 
    3940    { 
    40         foreach ($ace_targets as $key=>$val) 
     41        foreach ($targets as $key=>$val) 
    4142        { 
    4243            update_option("ace_page_sections_".$key,""); 
     
    5859      <div class="inside"> 
    5960        <ul> 
    60          <li><?php echo sprintf(__("Here are %s different sections on the site. You can define section by section which categories would you like to hide.","ace"), count($ace_targets)); ?></li> 
     61         <li><?php echo sprintf(__("Here are %s different sections on the site. You can define section by section which categories would you like to hide.","ace"), count($targets)); ?></li> 
    6162        </ul> 
    6263      </div> 
     
    6667        <div class="inside">                       
    6768     <?php  
    68       foreach ($ace_targets as $key=>$val): 
     69      foreach ($targets as $key=>$val): 
    6970      $_cats = explode(",",get_option("ace_page_sections_".$key)); 
    7071     ?> 
Note: See TracChangeset for help on using the changeset viewer.