Changeset 1953


Ignore:
Timestamp:
06/10/10 12:02:59 (3 years ago)
Author:
shibuya246
Message:

[Extensions] Added admin settings page, exclusion words for tags for showing on post,lists page

Location:
branches/1.4/content/plugins/tags
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/1.4/content/plugins/tags/languages/tags_language.php

    r1720 r1953  
    1111 
    1212/* RSS */ 
    13 $lang['post_rss_tagged'] = "Stories tagged";  
     13$lang['post_rss_tagged'] = "Stories tagged"; 
     14 
     15 
     16$lang['tags_settings_header'] = "Tags Settings"; 
     17$lang['tags_setting_exclude_words'] = "Tag words to exclude (separate by comma)"; 
     18$lang['tags_setting_exclude_active'] = "Exclusion words active"; 
    1419?> 
  • branches/1.4/content/plugins/tags/readme.txt

    r1717 r1953  
    1313Changelog 
    1414--------- 
     15v.1.8 2010/06/10 - Alan - Added admin settings page, exclusion tag words for list and post page 
    1516v.1.7 2010/05/22 - Nick - Fix for home page title tags and moved Tag RSS from SB Base into this plugin 
    1617v.1.6 2010/04/14 - Nick - Top stories page name changed from "index" to "popular" 
  • branches/1.4/content/plugins/tags/tags.php

    r1834 r1953  
    33 * name: Tags 
    44 * description: Show tags, filter tags and RSS for tags 
    5  * version: 1.7 
     5 * version: 1.8 
    66 * folder: tags 
    77 * class: Tags 
    88 * type: tags 
    9  * hooks: theme_index_top, header_include, header_include_raw, header_meta, show_post_extra_fields, show_post_extras, bookmarking_functions_preparelist, breadcrumbs, post_rss_feed 
     9 * hooks: theme_index_top, header_include, header_include_raw, header_meta, show_post_extra_fields, show_post_extras, bookmarking_functions_preparelist, breadcrumbs, post_rss_feed, admin_plugin_settings, admin_sidebar_plugin_settings 
    1010 * author: Nick Ramsay 
    1111 * authorurl: http://hotarucms.org/member.php?1-Nick 
     
    147147         
    148148        $tags = explode(',', $h->post->tags); 
    149          
     149 
     150        $tags_settings = $h->getSerializedSettings('tags'); 
     151         
     152        if ($tags_settings['tags_setting_exclude_active'] && $tags_settings['tags_setting_exclude_words'])  { 
     153            $exclude_tags = explode(',', $tags_settings['tags_setting_exclude_words']);      
     154            array_walk($exclude_tags, array($this,'trim_value'));            
     155            if ($exclude_tags) { 
     156                $tags = array_diff( $tags, $exclude_tags ); 
     157            } 
     158        } 
     159 
    150160        // lots of nice issets for php 5.3 compatibility 
    151161        if (isset($vars[0]) && isset($vars[1]) && ($vars[0] == "tags") && ($vars[1] == "raw")) { 
     
    169179            echo "<div class='clear'>&nbsp;</div>\n"; 
    170180        } 
    171     } 
     181 
     182    } 
     183 
     184 
     185     
     186    //required for above array_walk method 
     187    public function trim_value(&$value) 
     188    {  
     189        $value = trim($value); 
     190    } 
     191 
     192 
    172193     
    173194     
Note: See TracChangeset for help on using the changeset viewer.