Plugin Directory

Changeset 669235


Ignore:
Timestamp:
02/17/2013 12:03:48 PM (13 years ago)
Author:
faleddo
Message:

update for 1.1

Location:
ultimate-wp-filter/trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • ultimate-wp-filter/trunk/filter.php

    r667505 r669235  
    11<?php
    2 /*
    3 Plugin Name: Ultimate WP Filter
    4 Plugin URI: http://faleddo.x10.bz
    5 Description: A lighweight filtering plugin. Just activate and it will censor explicit words automatically by replace them with asterik(*) characters.
    6 Version: 1.0
    7 Author: Laurensius Faleddo
    8 Author URI: http://faleddo.x10.bz
    9 Text Domain: ultimate-wp-filter
    10 Licence: GPL2
    11 */
    12     add_action( 'admin_menu', 'uwpf_options' );
     2   
     3    function uwpf_clean() {
    134
    14     function uwpf_options() {
    15         add_options_page('Ultimate WP Filter Configs', 'Ultimate WP Filter', 'manage_options', __FILE__, 'build_page');
     5        if( is_admin() ) return;
     6
     7        $tmp = get_option('uwpf_options');
     8
     9        if (isset($tmp['rdo_group_filtering'])) {
     10            if($tmp['rdo_group_filtering']=='off'){ return; }}     
     11           
     12        if (isset($tmp['chk_comment_author'])) {
     13            if($tmp['chk_comment_author']=='1'){ add_filter('get_comment_author', 'CleanWords'); }}     
     14           
     15        if (isset($tmp['chk_comment_text'])) {
     16            if($tmp['chk_comment_text']=='1'){ add_filter('comment_text', 'CleanWords'); }}
     17           
     18        if (isset($tmp['chk_post_content'])) {
     19            if($tmp['chk_post_content']=='1'){ add_filter('the_content', 'CleanWords'); }}
     20           
     21        if (isset($tmp['chk_post_tags'])) {
     22            if($tmp['chk_post_tags']=='1'){ add_filter('term_links-post_tag', 'CleanWords'); }}     
     23           
     24        if (isset($tmp['chk_post_title'])) {
     25            if($tmp['chk_post_title']=='1'){ add_filter('the_title', 'CleanWords'); }}
     26
     27        if (isset($tmp['chk_tag_cloud'])) {
     28            if($tmp['chk_tag_cloud']=='1'){ add_filter('wp_tag_cloud', 'CleanWords'); }}
     29
     30        if (isset($tmp['chk_bbpress'])) {
     31            if($tmp['chk_bbpress']=='1'){
     32                if (class_exists('bbPress')) {
     33                    add_filter('bbp_get_topic_content', 'CleanWords');
     34                    add_filter('bbp_get_reply_content', 'CleanWords');
     35                }
     36            }
     37        }
    1638    }
    1739   
    18     function build_page() {
    19         $options = get_option( 'uwpf_option' );
    20         $customkeywords = isset( $options['custom_keywords'] ) ? $options['custom_keywords'] : '';
    21     ?>
    22     <div class="wrap">
    23         <div class="icon32" id="icon-options-general"><br></div>
    24         <h2>Ultimate WP Filter</h2>
    25         <p></p>
     40    function CleanWords($teks) {
     41        $tmp = get_option('uwpf_options');
    2642       
    27        
    28         <form method="post" action="options.php">
    29             <table class="form-table">
    30                 <th scope="row">
    31                         Custom Keywords:
    32                         <br/>
    33                         <span class="description">
    34                             Include custom keywords to be filtered. Separate them with a comma(,).
    35                         </span>
    36                     </th>
    37                     <td>
    38                         <textarea name="uwpf_option[custom_keywords]" rows="10" cols=100%><?php echo esc_textarea( $customkeywords ); ?></textarea>
    39                     </td>
    40                 </tr>
    41             </table>
    42            
    43             <p class="submit">
    44                 <input type="submit" class="button-primary" value="Save Changes" />
    45             </p>
    46         </form>
    47     </div>
    48     <?php   
    49 }
    50     function CleanWords($teks) {
    51                
    52         $indonesian_word = "asu,bajingan,bangsat,jancuk,kontol,lonte,ndasmu,";
    53         $english_word = "bitch,asshole,fuck,motherfucker,wtf,what the fuck,whatthefuck";
    54         $words = "$indonesian_word, $english_word";
     43        $custom = $tmp['custom_keywords'];
     44        $english_word = "asshole,bitch,fuck,motherfucker,what the fuck,whatthefuck,wtf,";
     45        $indonesian_word = "asu,bajingan,banci,bangsat,bego,bejad,bejat,bencong,bolot,brengsek,budek,geblek,gembel,goblok,idiot,jablay,jancuk,kampungan,kamseupay,keparat,kontol,kunyuk,lonte,maho,ndasmu,ngehe,pecun,perek,sarap,sinting,sompret,tai,tolol,udik";
     46        $words = "$custom, $indonesian_word, $english_word";
    5547        $words = explode(",", $words);
    5648           
     
    7567    }
    7668
    77     add_filter('comment_text', 'CleanWords');
    78     add_filter('get_comment_author', 'CleanWords');
    79     add_filter('term_links-post_tag', 'CleanWords');
    80     add_filter('the_title', 'CleanWords');
    81     add_filter('the_content', 'CleanWords');
    82     add_filter('wp_tag_cloud', 'CleanWords');
    83 
    84     if (class_exists('bbPress')) {
    85         add_filter('bbp_get_topic_content', 'CleanWords');
    86         add_filter('bbp_get_reply_content', 'CleanWords');
    87     }
    8869?>
  • ultimate-wp-filter/trunk/index.php

    r667505 r669235  
    1 hell-o-world
     1<center><h1>hell-o-world</h1><center>
  • ultimate-wp-filter/trunk/readme.txt

    r667505 r669235  
    55Requires at least: 2.9
    66Tested up to: 3.5.1
    7 Stable tag: 1.0.0
     7Stable tag: 1.1.0
     8License: GPLv2 or later
    89
    9 A lighweight filtering plugin. Just activate and it will censor explicit words automatically by replace them with asterik(*) characters.
     10A lighweight filtering plugin that will censor explicit words automatically by replacing them with asterik(*) characters.
    1011
    1112== Description ==
    1213
    13 Ultimate WP Filter is a small and simple Wordpress filtering plugin that will censor explicit words words in comments, posts content, posts title, tag clouds and in bbPress automatically by replace them with asterik(*) characters. Its totally free without any feature or time limitation. This first release version contains 14 words only. Please contribute to make this plugin cleans websites better by submitting more explicit words to faleddo@ymail.com.
     14Ultimate WP Filter is a small and simple Wordpress filtering plugin that will censor explicit words words in comments, posts content, posts title, tags, tag clouds and in bbPress automatically by replacing them with asterik(*) characters. Its totally free without any feature or time limitation. This version contains a few words only. Please contribute to make this plugin cleans websites better by submitting more explicit words and bug reports to faleddo@ymail.com.
    1415
    1516= Features =
    1617
    17181. Censor explicit words in English and Indonesian language
     192. Set custom words to be filtered
    1820
    1921== Installation ==
     
    3941* First release
    4042
     43= 1.1 =
     44* Ability to set custom keywords
     45* Added admin menu to configure Ultimate WP Filter plugin
     46* Added 41 keywords
     47
    4148== Upgrade Notice ==
    4249* None - The plugin does have version control and will perform any structural upgrades automatically.
Note: See TracChangeset for help on using the changeset viewer.