Advertisement

This is about Me?

Do not read this

    Thanks To

    Related sites

    Community

    Syndication

    You can grab our news as an Atom feed.


    WordPress Search Filter Plugins

    [27-Mar-2010]

    May be you just wondering how to filter the WordPress search result by category. It's possible by adding some function to your wordpress, but if you don't familiar with PHP, I just write a plugin for you called WP Search Filter.

    This plugin is simply add a dropdown categories next to the search form. If one of the category is selected, then it will only search on that category.

    Actually it's also possible to filter the search result by custom field , but I will do it later :D

    Installation
    Just install the plugin and activate. Make sure your search form is called from:

    <?php
    get_search_form
    ();
    <
    p>?>

    Demo:
    Please see the live demo at the top right of this website.

    Incoming search terms:


    WP Dropdown Posts Plugins

    [1-Mar-2010]

    Sometime you want to display WordPress Posts list in a dropdown style just like WordPress Page does. Unfortunately this feature is not available in WordPress. But dont' worry guys, I have created a plugin for this purpose. WP Dropdown Posts will shows posts list in dropdown and if you click on an item, you will be redirected to that post. Read the rest of this entry »

    Incoming search terms:


    WP Editarea WordPress Plugin

    [11-Feb-2010]

    WordPress used to embed Codepress syntax highlighting at Version 2.8 and immediately disabled it at Version 2.8.1 due to browser incompatibilities. However I found another free Javascript code editor called Editarea which has more features than Codepress . Now you can simply integrate Editarea functionality to your WordPress by using WP Editarea Plugins.

    WP Editarea
    Contributors: takien
    Requires at least: 2.9
    Tested up to: 2.9.1
    Stable tag: 0.1

    Description

    WP Editarea turns your Oldschool textarea code editor in WordPress Dashboard (plugin/theme editor) into a fancy realtime highlighted code editor using Editarea.

    Plugin Feature

    * Automatically detect syntax language
    * Live preview in plugin option page
    * Better than codepress (for me)
    * Easy integration, no file to edit
    * Easy to use configuration page

    Editarea Feature
    * Multi language interface
    * Bracket matching highlight
    * Support many syntax
    * Line numbers
    * Search/replace with regex
    * More at Editarea homepage.

    Browser Compatibility
    * IE 6 & 7 & 8, Firefox 1.5 & 2 & 3, Safari 3.x & 4, Opera 9, 9.5, 9.6 and Chrome 1 & 2[2]

    Installation

    The installation process.

    1. Upload `wp-editarea` folder to the `/wp-content/plugins/` directory. Make sure directory structures are not changed. Or Directly upload from your Plugin management page.
    2. Activate the plugin through the 'Plugins' menu in WordPress
    3. Go to Settings menu and set options you need.

    Screenshots

    1. Setting page and live preview.

    wordpress editarea, wordpress syntax highlight

    WP Editarea setting page.


    2. Your new theme editor :D
     editarea, wordpress code editor, wordpress syntax highlight

    WordPress Editarea

    Incoming search terms:


    Word Replacer WordPress Plugin

    [1-Feb-2010]

    Word Replacer is a WordPress plugin will enable you to replace a specific word in your content then replace it with replacement given. Contents that can be replaced are posts, pages, or comments. It's identical with the Word Censors in SMF Forum Software.

    Readme:

    === Word Replacer ===
    Contributors: takien
    Donate link: Donate
    Tags: replacer, post, comment, page, replace, censor, bbcode, filter
    Requires at least: 2.9
    Tested up to: 2.9.1
    Stable tag: 0.1

    Replace word in post, page, or comment.

    == Description ==

    Word Replacer is a WordPress plugins to replace any desired text/word with your choice. You can filter which content to be replaced, eg. only in page, comment, or post. With very userfriendly administration page you can manage list of word eaasily. It's also can be used to censor any bad/vulgar words in your comment your your guest posting. It's simple but useful.

    Feature:

    * Userfriendly administration page.
    * Define yourself what word to replace in where. (e.g. a word shoud be replaced in comment but not in post etc)
    * Uses it's own database table, if you wish you can directly update/add/delete/import through your MySQL admin.

    == Installation ==

    The installation process.

    1. Upload zipped plugin file to the `/wp-content/plugins/` directory. Or Directly upload from your Plugin management page.
    2. Activate the plugin through the 'Plugins' menu in WordPress
    3. Go to Settings menu and you will see Word Replacer sub menu. Yeah, there are your playground.

    == Frequently Asked Questions ==

    == Support RegeX ==

    No, at this time.

    == Screenshots ==

    Word replacer

    Administration page where you can add/remove your word.


    Administration page where you can add/remove your word.

    == Changelog ==

    = 0.1 =
    * First release

    The code:

    Code

    Word Replacer Source Code

    <?php
    /*
    Plugin Name: Word Replacer
    Plugin URI: http://wordpress.org/#
    Description: Replace word in post, page, or comment
    Author: Takien
    Version: 0.1
    Author URI: http://takien.com/
    */

    /*  Copyright 2010 takien.com

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

        For a copy of the GNU General Public License, write to the Free Software
        Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    */

    global $wpdb;
    global 
    $word_replacer;

    $word_replacer = Array(
                    
    'name'             => 'Word Replacer',
                    
    'version'         => '0.1',
                    
    'table_name'    => $wpdb->prefix "word_replacer",
                    
    'base_name'        => 'wordreplacer'
    );

    function 
    _specialchar($string) {
        return 
    htmlspecialchars(stripcslashes($string));
    }

    if(isset(
    $_POST['submit'])) {

        
    $id                $_POST['id'];
        
    $original         $_POST['original'];
        
    $replacement     $_POST['replacer'];
        
    $in_posts         $_POST['in_posts'];
        
    $in_comments    $_POST['in_comments'];
        
    $in_pages        $_POST['in_pages'];

    $numfield count($original);

        for (
    $i 1$i < = $numfield$i++) {
        if(!empty(
    $original[$i]) && empty($id[$i])) {
        
    $wpdb->query$wpdb->prepare"
            INSERT INTO "
    .$word_replacer['table_name']."
            (original, replacement, in_posts, in_comments, in_pages)
            VALUES (%s, %s, %s, %s, %s)"
    ,
            array(
    $wpdb->escape($original[$i]), $wpdb->escape($replacement[$i]),$wpdb->escape($in_posts[$i]),$wpdb->escape($in_comments[$i]),$wpdb->escape($in_pages[$i]))));
            
    $message =  '
    <div id="message" class="updated fade">

    <strong>Word Inserted.</strong>
    </div>

    '
    ;
        }
        elseif(empty(
    $original[$i]) && !empty($id[$i])) {
            
    $wpdb->query("
            DELETE FROM "
    .$word_replacer['table_name']." WHERE id = '".$id[$i]."'");
            
    $message =  '
    <div id="message" class="updated fade">

    <strong>Word Deleted.</strong>
    </div>

    '
    ;
        }
        elseif(!empty(
    $original[$i]) && !empty($id[$i])) {
            
    $wpdb->update($word_replacer['table_name'],
            array(
    'original'     => $wpdb->escape($original[$i]),
            
    'replacement'         => $wpdb->escape($replacement[$i]),
            
    'in_posts'            => $wpdb->escape($in_posts[$i]),
            
    'in_comments'        => $wpdb->escape($in_comments[$i]),
            
    'in_pages'            => $wpdb->escape($in_pages[$i])
            ),
            array( 
    'id' => $id[$i] ), array( '%s''%s''%s''%s''%s'), array( '%d' ) );
            
    $message =  '
    <div id="message" class="updated fade">

    <strong>Word Updated.</strong>
    </div>

    '
    ;
        }
        }
    }

    function 
    word_replacer_install () {
        global 
    $wpdb;
        global 
    $word_replacer;

       if(
    $wpdb->get_var('show tables like "'.$word_replacer['table_name'].'"') != $word_replacer['table_name']) {

          
    $sql "CREATE TABLE " $word_replacer['table_name'] . " (
          id mediumint(9) NOT NULL AUTO_INCREMENT,
          original VARCHAR(200) NOT NULL,
          replacement VARCHAR(200) NOT NULL,
          in_posts VARCHAR(5) NOT NULL,
          in_comments VARCHAR(5) NOT NULL,
          in_pages VARCHAR(5) NOT NULL,
          UNIQUE KEY id (id)
        );"
    ;

          require_once(
    ABSPATH 'wp-admin/includes/upgrade.php');
          
    dbDelta($sql);

          
    $badword         "badword";
          
    $properword     "goodword";

          
    $insert "INSERT INTO " $word_replacer['table_name'] .
                
    " (original, replacement, in_posts, in_comments, in_pages) " .
                
    "VALUES ('" $wpdb->escape($badword) . "','" $wpdb->escape($properword) . "','yes','yes','yes')";

          
    $results $wpdb->query$insert );

          
    add_option("word_replacer_ver"$word_replacer['version']);
       }
    }

    register_activation_hook(__FILE__,'word_replacer_install');

    function 
    word_replacer_db() {
        global 
    $wpdb;
        global 
    $word_replacer;
        return 
    $wpdb->get_results("SELECT * FROM ".$word_replacer['table_name']." ORDER BY id"ARRAY_A);
    }

    // for content 

    function word_replacer_postpage($content) {
    $i 1;
    foreach(
    word_replacer_db() as $wrdb) {
    $i++;
        
    $original[$i]         = stripslashes($wrdb['original']);
        
    $replacement[$i]     = stripslashes($wrdb['replacement']);
        
    $in_posts[$i]         = stripslashes($wrdb['in_posts']);
        
    $in_comments[$i]     = stripslashes($wrdb['in_comments']);
        
    $in_pages[$i]         = stripslashes($wrdb['in_pages']);

        if(
    is_page() && ($in_pages[$i] == 'yes')) {
            
    $content str_replace($original[$i],$replacement[$i],$content);
        }
        elseif(!
    is_page() && ($in_posts[$i] == 'yes')) {
            
    $content str_replace($original[$i],$replacement[$i],$content);
        }

    }
    return 
    $content;
    }

    // for comment
    function word_replacer_comment($content) {
    $i 1;
    foreach(
    word_replacer_db() as $wrdb) {
    $i++;
        
    $original[$i]         = stripslashes($wrdb['original']);
        
    $replacement[$i]     = stripslashes($wrdb['replacement']);
        
    $in_posts[$i]         = stripslashes($wrdb['in_posts']);
        
    $in_comments[$i]     = stripslashes($wrdb['in_comments']);
        
    $in_pages[$i]         = stripslashes($wrdb['in_pages']);

        if(
    $in_comments[$i]    == 'yes') {
        
    $content str_replace($original[$i],$replacement[$i],$content);
        }
        }
    return 
    $content;
    }

    add_filter('comment_text','word_replacer_comment');
    add_filter('the_content','word_replacer_postpage');
    add_action('admin_menu''word_replacer_add_page');

    function 
    word_replacer_add_page() {
        global 
    $word_replacer;
        
    add_options_page($word_replacer ['name'], $word_replacer ['name'], 'administrator''wordreplacer''word_replacer_page');
    }

    function 
    word_replacer_page() {
        global 
    $wpdb$word_replacer$message;

        echo 
    '
    <div class="wrap">
    <h2>'
    .$word_replacer ['name'].'</h2>

    '
    ;
        echo 
    $message;
    ?>

    <script language="Javascript" type="text/javascript">
    <!--
    function addField(area,field,limit) {
        if(!document.getElementById) return;
        var field_area = document.getElementById(area);
        var all_inputs = field_area.getElementsByTagName("input");
        var last_item = all_inputs.length - 1;
        var last = all_inputs[last_item].id;
        var count = Number(last.split("_")[1]) + 1;

        if(count > limit && limit > 0) return;

        field_area.innerHTML += "
    <tr>
    <td>
    <input type='hidden' name='id[]' value='' />
    <input style='width:100%' name='original[]' type='text' /></td>
    <td> => </td>
    <td>
    <input style='width:100%' name='replacer[]' type='text' /></td>
    <td>
    <input value='yes' name='in_posts[]' type='checkbox' /></td>
    <td>
    <input value='yes' name='in_comments[]' type='checkbox' /></td>
    <td>
    <input value='yes' name='in_pages[]' type='checkbox' /></td>
    </tr>

    ";

    }
    //-->
    </script>

    <?php
    $action_url 
    $_SERVER[PHP_SELF] . '?page=' $word_replacer['base_name'];

    ?>

    Put the word to be replaced on the left, and what to change it to on the right.
    <form method="post" action="<?php echo $action_url;?>">
    <table class="widefat fixed" width="650" align="center" id="word-replacer-list" width="100%">
    <thead>
    <?php wp_nonce_field('update-options'); ?>
    <tr>
    <th>Original</th>
    <th width="20"> </th>
    <th>Replacement</th>
    <th width="80">Posts</th>
    <th width="80">Comments</th>
    <th width="80">Pages</th>
    </tr>
    </thead>

    <?php
    $i 
    = -1;

    foreach(
    word_replacer_db() as $wrdb) { $i++ ?>
    <?php $alternate 
    = (empty($alternate) ? 'class="alternate"' '');?>
    <tr <?php echo $alternate;?>>
    <td>
    <input type="hidden" name="id[]" value="<?php echo $wrdb['id']; ?/>" />
    <input style="
    width:100%" type="text" name="original[<?php echo $i;?/>]" id="original_<?php echo $i;?>" value="<?php echo _specialchar($wrdb['original']) ?>" /></td>
    <td> => </td>
    <td>
    <input style="width:100%" type="text" name="replacer[<?php echo $i;?/>]" value="<?php echo _specialchar($wrdb['replacement']) ?>" /></td>
    <td>
    <input value="yes" name="in_posts[<?php echo $i;?/>]" <?php echo (($wrdb['in_posts'] == 'yes') ? 'checked="checked"' : ''); ?> type="checkbox" /></td>
    <td>
    <input value="
    yes" name="in_comments[<?php echo $i;?/>]" <?php echo (($wrdb['in_comments'] == 'yes') ? 'checked="checked"' : ''); ?> type="checkbox" /></td>
    <td>
    <input value="
    yes" name="in_pages[<?php echo $i;?/>]" <?php echo (($wrdb['in_pages'] == 'yes') ? 'checked="checked"' : ''); ?> type="checkbox" /></td>
    </tr>

    <?php } ?>
    </table>
    <input type="
    button" value="Add More Fields" style="cursor:pointer" onclick="addField('word-replacer-list','original_',0);" />
    <input type="
    hidden" name="action" value="update" />
    <input name="
    submit" class="button-primary" type="submit" value="<?php _e('Add/Update Words') ?/>" />
    </form>

    Instruction:


    1. To <b>Add New Word</b> click Add More Fields  add your word, replacement and filter, then hit Add/Update Words.
    2. To <b>Update</b> a word, just replace/retype in it's place an hit Add/Update Words.
    3. To <b>Delete</b> a word, leave blank/clear word in "
    original" field and hit Add/Update Words.
    </div>

    <?php
    }
    ?>

    <p>?>


    Feature Wishlist

    Here are  some feature wish lists for Word Replacer Plugin based on user comments:

    • Replace the title
    • Replace Case-insensitive

    Uploaded to WordPress.org

    This Word Replacer Plugin just approved and uploaded to WordPress Plugins Directory
    Please see it in action, here.. http://wordpress.org/extend/plugins/word-replacer/ :D

    Note: This post was posted by WP Sub Post Plugin

    Incoming search terms:


    WordPress Plugin WP Sub Post

    [28-Jan-2010]

    WP Sub Post is a wordpress plugin that allow you to make your wordpress post has a parent or child post.

    Notes:

    • Child post is a real post that has a parent.
    • Child post only displayed on it's parent post page or when parent page is displayed.
    • Child post can not be viewed individually.
    • Child post has all possibility like a normal post, such as attachment, custom fields etc.

    Features:

    • Add/edit parent post directly from your post area.
    • No need to edit theme file.

    Limitations:

    • No setting page
    • I don't know about it's compatibility.

    Bugs:

    • Not compatible with my syntax highlight plugin :D

    Screenshot

    Plugin page:

    WP sub post

    New/Edit post page:

    Wp sub post

    View Single Post:

    Wp sub post

    RSS:

    Wp sub post


    Code:

    Here is the code of this plugins...  Hahaha.. little bit messy

    WP Sub Post

    WP Sub Post

    <?php</p>
    /*
    Plugin Name: WP Sub Post
    Plugin URI: http://wordpress.org/#
    Description: You can make a post is a child of another post.
    Author: Takien
    Version: 0.1 Alpha
    Author URI: http://takien.com
    */

    ////////////////////////////

    class Walker_PostDropdown extends Walker {

        var 
    $tree_type 'post';

        var 
    $db_fields = array ('parent' => 'post_parent''id' => 'ID');

        function 
    start_el(&$output$page$depth$args) {
            
    $pad str_repeat(' '$depth 3);

            
    $output .= "\tID\"";
            if ( 
    $page->ID == $args['selected'] )
                
    $output .= ' selected="selected"';
            
    $output .= '>';
            
    $title esc_html($page->post_title);
            
    $output .= "$pad$title";
            
    $output .= "\n";
        }
    }
    /////////////
    function &wp_get_posts($args '') {
        global 
    $wpdb;

        
    $defaults = array(
            
    'child_of' => 0'sort_order' => 'ASC',
            
    'sort_column' => 'post_title''hierarchical' => 1,
            
    'exclude' => '''include' => '',
            
    'meta_key' => '''meta_value' => '',
            
    'authors' => '''parent' => -1'exclude_tree' => '',
            
    'number' => '''offset' => 0
        
    );

        
    $r wp_parse_args$args$defaults );
        
    extract$rEXTR_SKIP );
        
    $number = (int) $number;
        
    $offset = (int) $offset;

        
    $cache = array();
        
    $key md5serializecompact(array_keys($defaults)) ) );
        if ( 
    $cache wp_cache_get'wp_get_posts''posts' ) ) {
            if ( 
    is_array($cache) && isset( $cache$key ] ) ) {
                
    $pages apply_filters('wp_get_posts'$cache$key ], $r );
                return 
    $pages;
            }
        }

        if ( !
    is_array($cache) )
            
    $cache = array();

        
    $inclusions '';
        if ( !empty(
    $include) ) {
            
    $child_of 0//ignore child_of, parent, exclude, meta_key, and meta_value params if using include
            
    $parent = -1;
            
    $exclude '';
            
    $meta_key '';
            
    $meta_value '';
            
    $hierarchical false;
            
    $incpages preg_split('/[\s,]+/',$include);
            if ( 
    count($incpages) ) {
                foreach ( 
    $incpages as $incpage ) {
                    if (empty(
    $inclusions))
                        
    $inclusions $wpdb->prepare(' AND ( ID = %d '$incpage);
                    else
                        
    $inclusions .= $wpdb->prepare(' OR ID = %d '$incpage);
                }
            }
        }
        if (!empty(
    $inclusions))
            
    $inclusions .= ')';

        
    $exclusions '';
        if ( !empty(
    $exclude) ) {
            
    $expages preg_split('/[\s,]+/',$exclude);
            if ( 
    count($expages) ) {
                foreach ( 
    $expages as $expage ) {
                    if (empty(
    $exclusions))
                        
    $exclusions $wpdb->prepare(' AND ( ID <> %d '$expage);
                    else
                        
    $exclusions .= $wpdb->prepare(' AND ID <> %d '$expage);
                }
            }
        }
        if (!empty(
    $exclusions))
            
    $exclusions .= ')';

        
    $author_query '';
        if (!empty(
    $authors)) {
            
    $post_authors preg_split('/[\s,]+/',$authors);

            if ( 
    count($post_authors) ) {
                foreach ( 
    $post_authors as $post_author ) {
                    
    //Do we have an author id or an author login?
                    
    if ( == intval($post_author) ) {
                        
    $post_author get_userdatabylogin($post_author);
                        if ( empty(
    $post_author) )
                            continue;
                        if ( empty(
    $post_author->ID) )
                            continue;
                        
    $post_author $post_author->ID;
                    }

                    if ( 
    '' == $author_query )
                        
    $author_query $wpdb->prepare(' post_author = %d '$post_author);
                    else
                        
    $author_query .= $wpdb->prepare(' OR post_author = %d '$post_author);
                }
                if ( 
    '' != $author_query )
                    
    $author_query " AND ($author_query)";
            }
        }

        
    $join '';
        
    $where "$exclusions $inclusions ";
        if ( ! empty( 
    $meta_key ) || ! empty( $meta_value ) ) {
            
    $join " LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )";

            
    // meta_key and meta_value might be slashed
            
    $meta_key stripslashes($meta_key);
            
    $meta_value stripslashes($meta_value);
            if ( ! empty( 
    $meta_key ) )
                
    $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_key = %s"$meta_key);
            if ( ! empty( 
    $meta_value ) )
                
    $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_value = %s"$meta_value);

        }

        if ( 
    $parent >= )
            
    $where .= $wpdb->prepare(' AND post_parent = %d '$parent);

        
    $query "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'post' AND post_status = 'publish') $where ";
        
    $query .= $author_query;
        
    $query .= " ORDER BY " $sort_column " " $sort_order ;

        if ( !empty(
    $number) )
            
    $query .= ' LIMIT ' $offset ',' $number;

        
    $pages $wpdb->get_results($query);

        if ( empty(
    $pages) ) {
            
    $pages apply_filters('wp_get_posts', array(), $r);
            return 
    $pages;
        }

        
    // Sanitize before caching so it'll only get done once
        
    $num_pages count($pages);
        for (
    $i 0$i $num_pages$i++) {
            
    $pages[$i] = sanitize_post($pages[$i], 'raw');
        }

        
    // Update cache.
        
    update_page_cache($pages);

        if ( 
    $child_of || $hierarchical )
            
    $pages = & get_page_children($child_of$pages);

        if ( !empty(
    $exclude_tree) ) {
            
    $exclude = (int) $exclude_tree;
            
    $children get_page_children($exclude$pages);
            
    $excludes = array();
            foreach ( 
    $children as $child )
                
    $excludes[] = $child->ID;
            
    $excludes[] = $exclude;
            
    $num_pages count($pages);
            for ( 
    $i 0$i $num_pages$i++ ) {
                if ( 
    in_array($pages[$i]->ID$excludes) )
                    unset(
    $pages[$i]);
            }
        }

        
    $cache$key ] = $pages;
        
    wp_cache_set'wp_get_posts'$cache'posts' );

        
    $pages apply_filters('wp_get_posts'$pages$r);

        return 
    $pages;
    }
    //////////////

    function walk_post_dropdown_tree() {
        
    $args func_get_args();
        if ( empty(
    $args[2]['walker']) ) // the user's options are the third parameter
            
    $walker = new Walker_PostDropdown;
        else
            
    $walker $args[2]['walker'];

        return 
    call_user_func_array(array(&$walker'walk'), $args);
    }

    function 
    wp_dropdown_posts($args '') {
        
    $defaults = array(
            
    'depth' => 0'child_of' => 0,
            
    'selected' => 0'echo' => 1,
            
    'name' => 'page_id''show_option_none' => '''show_option_no_change' => '',
            
    'option_none_value' => ''
        
    );

        
    $r wp_parse_args$args$defaults );
        
    extract$rEXTR_SKIP );

        
    $pages wp_get_posts($r);
        
    $output '';
        
    $name esc_attr($name);

        if ( ! empty(
    $pages) ) {
            
    $output "
    <select id=""$name\"" 
    name="\"$name\"">
    <
    option value="\"-1\"">$show_option_no_change</option>
    <
    option value="\""">$show_option_none</option>

    \n"
    ;
        }

        
    $output apply_filters('wp_dropdown_pages'$output);

        if ( 
    $echo )
            echo 
    $output;

        return 
    $output;
    }
    /////////////////////////////

    /* Use the admin_menu action to define the custom boxes */
    add_action('admin_menu''myplugin_add_custom_box');

    /* Use the save_post action to do something with the data entered */
    add_action('save_post''myplugin_save_postdata');

    /* Adds a custom section to the "advanced" Post and Page edit screens */
    function myplugin_add_custom_box() {

      if( 
    function_exists'add_meta_box' )) {
        
    add_meta_box'myplugin_sectionid'__'WP Sub Posts''myplugin_textdomain' ), 'myplugin_inner_custom_box''post''side','high' );
        
    //add_meta_box( $id,                  $title,                                      $callback,                  $page, $context, $priority );
        
    add_meta_box'myplugin_sectionid'__'WP Sub Posts''myplugin_textdomain' ), 'myplugin_inner_custom_box''page''advanced' );
       } else {
        
    add_action('dbx_post_advanced''myplugin_old_custom_box' );
        
    add_action('dbx_page_advanced''myplugin_old_custom_box' );
      }
    }

    function 
    myplugin_inner_custom_box() {
    echo 
    '
    <style type="text/css">
    select#parent_id, select#parent_id option {
        width:250px;
    }
    </style>

    '
    ;

    echo 
    '
    <input id="myplugin_noncename" name="myplugin_noncename" type="hidden" value="' 
    .
        
    wp_create_nonceplugin_basename(__FILE__) ) . '" />';  ?>
    <h5><?php _e('Parent'?></h5>

    <label for="post_parent">Please select the parent of this post</label>

    <?php 

    $currentid 
    $_GET['post'];
    wp_dropdown_posts(array('exclude_tree'             => $currentid,
                                
    'selected'             => $post->post_parent,
                                
    'name'                 => 'parent_id',
                                
    'show_option_none'     => __('Main Post (no parent)'),
                                
    'sort_column'        => 'menu_order, post_title'));
     }

    /* Prints the edit form for pre-WordPress 2.5 post/page */
    function myplugin_old_custom_box() {

      echo 
    '
    <div class="dbx-b-ox-wrapper">' 
    "\n";
      echo 
    '
    <fieldset id="myplugin_fieldsetid" class="dbx-box">' 
    "\n";
      echo 
    '
    <div class="dbx-h-andle-wrapper">
    <h3 class="dbx-handle">' 
    .
            
    __'WP Sub Posts''myplugin_textdomain' ) . "</h3>
    </div>

    "
    ;   

      echo 
    '
    <div class="dbx-c-ontent-wrapper">
    <div class="dbx-content">'
    ;

      
    // output editing form

      
    myplugin_inner_custom_box();

      
    // end wrapper

      
    echo "</div>
    </div>
    </fieldset>
    </div>

    \n"
    ;
    }

    /* When the post is saved, saves our custom data */
    function myplugin_save_postdata$post_id ) {

      
    // verify this came from the our screen and with proper authorization,
      // because save_post can be triggered at other times

      
    if ( !wp_verify_nonce$_POST['myplugin_noncename'], plugin_basename(__FILE__) )) {
        return 
    $post_id;
      }

      
    // verify if this is an auto save routine. If it is our form has not been submitted, so we dont want
      // to do anything
      
    if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
        return 
    $post_id;

      
    // Check permissions
      
    if ( 'page' == $_POST['post_type'] ) {
        if ( !
    current_user_can'edit_page'$post_id ) )
          return 
    $post_id;
      } else {
        if ( !
    current_user_can'edit_post'$post_id ) )
          return 
    $post_id;
      }

      
    // OK, we're authenticated: we need to find and save the data

      
    $mydata $_POST['parent_id'];

       return 
    $mydata;
    }

    add_filter('posts_where','where_no_parent');
    add_filter ('the_content','subpost_template'1);

    function 
    subpost_template($content) {

        if(
    is_singular) {
        
    remove_filter('posts_where','where_no_parent');
        }
        echo 
    $content;

        
    $idnya get_the_ID();
        
    $child = new WP_Query("post_type=post&post_parent=".$idnya."");

        while(
    $child->have_posts()) : $child->the_post();
        echo 
    '
    <blockquote>

    '
    ;
        echo 
    '
    <h3>'
    ;
        
    the_title();

        echo 
    '</h3>

    '
    ;
        
    $childid =  get_the_ID();
        
    the_content();

        
    edit_post_link('Edit','','',$childid);
        echo 
    '</blockquote>

    '
    ;

        endwhile;
        
    wp_reset_query();
    }

    function 
    where_no_parent($where) {
        global 
    $wpdb;
         
    $where .= " AND post_parent  = 0";
         return 
    $where;
    }
    ?>

    ?>
    Revision by polvocdo

    subpost_template()

    subpost_template()

    <?php


        
    if(is_singular()) {
            
    remove_filter('posts_where','where_no_parent');
        }

        
    $parentID get_the_ID();
           
    $childposts get_posts(array(
                                    
    'post_type' => 'post',
                                    
    'numberposts' => -1,
                                    
    'post_status' => 'publish',
                                    
    'post_parent' => $parentID
                                    
    ));
          
    $subcontent "";
        foreach(
    $childposts as $childpost){
            
    $subcontent .= "
    <blockquote>

    "
    ;
            
    $subcontent .= "
    <h3>"
    .$childpost->post_title."</h3>

    "
    ;
            
    $subcontent .= $childpost->post_content;
            
    $subcontent .= '

    <a rel="nofollow" href="'
    .get_edit_post_link($childpost->ID).'">Edit</a>

    '
    ;
            
    $subcontent .= "</blockquote>

    "
    ;
        }

        
    $content .= $subcontent;

        return 
    $content;
    }

    <
    p>?>

    WP Dropdown Post

    wp_dropdown_posts()

    <?php</p>
    $currentid $_GET['post'];
    wp_dropdown_posts(array('exclude_tree'             => $currentid,
                                
    'selected'             => $post->post_parent,
                                
    'name'                 => 'parent_id',
                                
    'show_option_none'     => __('Main Post (no parent)'),
                                
    'sort_column'        => 'menu_order, post_title'));

    <
    p>?>
    Download

    You can download alpha version of this plugin here http://cektkp.com/wpsubpost
    If it not working please Click here

    Warning

    This plugin is Alpha version, use it for testing purpose only. Any problem caused by this plugin is not my responsibility.

    Demo:

    See below:

    Code Update WP Sub Post

    There are some changes to the WP Sub Post:

    • Fixed/Added, now child post can be viewed as a single post, with link to the Parent Post instead of displaying blank post with 'Post not found' title.
    • Added, CSS class and id to the blockquote of the child post. It would be useful to make a link like http://example.com/parentpost.html#childpostXXX. while XXX is your child post ID.

    Two functions that are changed subpost_template() and where_no_parent()

    WP Sub Post

    <?php
    function subpost_template($content) {
    global 
    $post;

    $parentID get_the_ID();
           
    $childposts get_posts(array(
                                    
    'post_type' => 'post',
                                    
    'numberposts' => -1,
                                    
    'post_status' => 'publish',
                                    
    'post_parent' => $parentID
                                    
    ));
          
    $subcontent "";
        foreach(
    $childposts as $childpost){
            
    $subcontent .= "
    <blockquote class=\"sub_post\" id=\"subpost_"
    .$childpost->ID."\">";
            
    $subcontent .= "
    <h3>"
    .$childpost->post_title."</h3>

    "
    ;
            
    $subcontent .= $childpost->post_content;
            
    $subcontent .= '
    <p class="postmetadata"><small>This sub post was added on: '
    .date('l, dS F, Y',strtotime($childpost->post_date)).' <a href="'.get_edit_post_link($childpost->ID).'" rel="nofollow">Edit</a></small>

    '
    ;
            
    $subcontent .= "</blockquote>

    "
    ;
        }

            if(
    $post->post_parent !== 0) {

            
    $parent_info '
    <blockquote>This post is a child post of <strong>'
    .get_the_title($post->post_parent).'</strong>. To view the parent post, please <a href="'.get_permalink($post->post_parent).'">click here.</a></blockquote>

    '
    ;
            
    $content $parent_info.$content;
            }

        
    $content .= $subcontent;
        return 
    $content;
    }

    function 
    where_no_parent($where) {
        global 
    $wpdb;
        if(!
    is_single()) {
         
    $where .= " AND post_parent  = 0";
        }
        else {
        
    $where .= " AND post_type = 'post'";
        }
        return 
    $where;
    }

    <
    p>?>

    Finally you can see the demo here

    Yesterday, I was failed to add a demo directly in this site because of incompatibility with smart tags (all smart tags are not working when WP Sub Post is activated).

    The problem comes from my old stupid function subpost_template():D

    Thanks and sorry to polvocdo :) , actually your revision is the answer.
    Ha ha I'm forget to replace mine with your revision  :hammer: ....


    This is a child post

    This is an individual post (http://takien.com/536/this-is-a-child-post.php) that attached to the another post ( http://takien.com/550/wordpress-plugin-wp-sub-post.php)

    image on the child post

    Child post could be useful when you want to add an additional information to the main post,  news analysis, or update. Instead of editing the main post, you can now simply Add New post and mark it as child post.

    Child post also has it's own functionality, can handle attachment, displaying image. etc.

    But you can't see this post in the post editing page (wp-admin/edit.php) because of filter  in the plugin to prevent child post to be displayed individually in the main page, post listing, feed, etc.  Hahaha.. don't worry, I will fix it soon.

    Incoming search terms:


    All In One SEO Pack, A Smart and Stupid Plugin

    [15-Jul-2009]

    What a smart plugin that can optimize basic SEO of our WordPress blog while no many another plugin can do that out there. This plugin also has good statistics with 2,380,049 times downloaded.

    But, I say it's stupid, because that small plugin never complete from development, lol. The plugin author always doing small changes on this plugin and releases update everyday.

    I don't even want to know what he changed. The most important thing is it always displaying annoying announcement on wordpress dashboard everytime I upgrade. Yes, its important because we have to manually re-enable that plugin after upgrade, otherwise it won't work. wakakakkakakaka...

    Incoming search terms:


    WordPress Spry Menu Plugins

    [1-Jul-2009]

    Hi, this is my first plugin I write. WP Spry Menu that automatically creating Spry Drop Down Menu for wordpress category include configuration page with configurable "Home" link. This plugin using Spry (Copyright (c) 2006. Adobe Systems Incorporated) javascript library from www.adobe.com. The Spry library is FREE and redistributable with some condition (see license on the js file).

    Feature:
    * Displaying WordPress Category in dropdown css menu.
    * No template arguments are needed to configure menu behavior, all settings are place on the Admin.
    * Live preview as soon as you change the settings. No need to refresh your homepage to see changes.
    * Configurable direction, your menu should appears horizontal, vertical drop left, or vertical drop right.
    * Changeable Home text link, you can leave it blank for no home link.
    * Depth setting, how many child you want to display.
    * Exclue setting, you can select which category should not appears on the menu.
    * Order setting, order by name or ID.
    * Hide/Hide emtpy category. By default WordPress won't display an empty category, now you can configure.
    * Child of setting, only display menu from selected parent category.

    How to install?

    The installation is very easy.

    1. Upload `wp-spry-menu` folder to the `/wp-content/plugins/` directory. Make sure wp-spry-menu contains all included files.
    2. Activate the plugin through the 'Plugins' menu in WordPress
    3. Place `< ?php if ( function_exists('wp_spry_menu') ) wp_spry_menu();?>` in your templates
    4. Configure from WP Spry Menu options in your WordPress Admin.

    Note: Since WordPress 2.7.1 you can easy upload zipped plugin from admin.

    Frequently Asked Questions

    Is it support to display page menu?
    Currently not, may be in the next release.

    Can I edit my own css from the settings page?
    I'm sorry you can't, wait for the next release :)

    Screenshots

    1. Setting page and Vertical Drop Right preview.
    screenshot-1

    2. Setting page and Vertical Drop Left preview.
    screenshot-2

    3. Setting page and Horizontal preview.
    screenshot-3

    Changelog

    July 01, 2009 version 1.0.1
    * Add Child of as dropdown select.
    * Live preview from plugin setting page.
    * Code improvement

    June, 2009 version 1.0.0

    * Add admin settings
    * No need to add template argument, all go to setting area.
    * Add Vertical Drop Left and Vertical Drop Right

    January, 2009 version 0.0.1

    * Only display Horizontal style
    * First release

    Download

    Download from WordPress.org

    Question and feedback are welcome :)

    Post updated: August 13, 2009

    Next Release's Features:
    1. Added menu for page
    2. Added ability to select theme for menu
    3. Added ability to change the category title ("View all posts filed under ...")
    4. User friendly help, using tooltips.
    5. Cleaner output.
    6. Fixed some IE problems :)

    Still in my head:
    1. Add menu for blogroll.
    2. Add ability to edit CSS directly.
    3. Add ability to create custom menu.

    Incoming search terms:


    News Archive