Plugin Directory

Changeset 203320


Ignore:
Timestamp:
02/08/2010 07:34:46 PM (16 years ago)
Author:
timhodson
Message:

Added: post_excerpt template tag; ready for version 0.9.5

Location:
blog-in-blog/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • blog-in-blog/trunk/bib_post_template.tpl

    r202589 r203320  
    1 <!--fragment of html for post template blog-in-blog Version: 0.9.4 -->
     1<!--fragment of html for post template blog-in-blog Version: 0.9.5 -->
    22<div class="post">
    33<!-- Post Headline -->     
  • blog-in-blog/trunk/blog-in-blog.php

    r202589 r203320  
    55Plugin URI: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/
    66Description: Create a blog within a blog using a category. This plugin basically shows posts in a category on a page using shortcodes.
    7 Version: 0.9.4
     7Version: 0.9.5
    88Author: Tim Hodson
    99Author URI: http://timhodson.com
     
    119119
    120120        $data['post_content'] = apply_filters('the_content', $post->post_content);
     121       
     122        $data['post_excerpt'] = apply_filters('the_excerpt', bib_process_excerpt($post) );
     123       
    121124        $data['post_permalink'] = apply_filters('the_permalink', get_permalink($post));
    122125        $data['post_comments'] = bib_process_comments($post->comment_status, $post->comment_count, $data['post_permalink']);
     
    184187    // get template string from options
    185188    if( file_exists( $blog_in_blog_opts['bib_post_template'] ) ) {
     189       
    186190        $template = file_get_contents( $blog_in_blog_opts['bib_post_template'] );
     191       
     192        // post id
    187193        $template = str_replace("%post_id%", $data['post_id'], $template);
    188194       
     195        // dates
    189196        $template = str_replace("%post_date%", $data['post_date'], $template);
    190197        $template = str_replace("%post_time%", $data['post_time'], $template);
     
    197204        $template = str_replace("%post_yr%", $data['post_yr'], $template);
    198205        $template = str_replace("%post_title%", $data['post_title'], $template);
    199 
     206       
     207        // author
    200208        $template = str_replace("%post_author%", $data['post_author'], $template);
    201209        $template = str_replace("%post_author_avatar%", $data['post_author_avatar'], $template);
    202 
     210       
     211        // content
    203212        $template = str_replace("%post_content%", $data['post_content'], $template);
     213        $template = str_replace("%post_excerpt%", $data['post_excerpt'] , $template);
     214       
     215        // post meta
    204216        $template = str_replace("%post_permalink%", $data['post_permalink'], $template);
    205217        $template = str_replace("%post_categories%", $data['post_categories'], $template);
     
    302314
    303315}
     316
     317function bib_process_excerpt($post) {
     318   
     319    //var_dump($post);
     320    $output = $post->post_excerpt;
     321   
     322    if ( post_password_required($post) ) {
     323        $output = __('There is no excerpt because this is a protected post.');
     324        return $output;
     325    }
     326   
     327    return apply_filters('get_the_excerpt', $output);   
     328}
     329
    304330
    305331/**
  • blog-in-blog/trunk/options.php

    r202589 r203320  
    7575
    7676function blog_in_blog_menu() {
    77     add_menu_page('Blog-in-Blog Options', 'Blog-in-Blog', 8, __FILE__ , 'blog_in_blog_options', 'favicon.ico');
     77    add_options_page('Blog-in-Blog Options', 'Blog-in-Blog', 8, __FILE__ , 'blog_in_blog_options', 'favicon.ico');
    7878    add_action( 'admin_init', 'register_bib_settings' );
    7979}
  • blog-in-blog/trunk/readme.txt

    r202589 r203320  
    55Requires at least: 2.7.1
    66Tested up to: 2.9
    7 Stable tag: 0.9.4
     7Stable tag: 0.9.5
    88
    99Create a blog within a blog using a category. This plugin basically shows posts in a category on a page using shortcodes.
     
    5858* `%post_categories%` - The categories that the post belongs to.
    5959* `%post_content%` - The content of the post.
     60* `%post_excerpt%` - The excerpt of the post (if defined) Note blog-in-blog will also recognise the `<!--more-->` tag in your content.
    6061* `%post_comments%` - A comments link.
    6162* `%post_date%` - The date of the post as defined by the format string in the admin page.
     
    7071
    7172== Changelog ==
     73
     74= 0.9.5 =
     75* Added: `%post_excerpt%' tag (will only show anything if you actualy have an excerpt). blog-in-blog already recognises the `<!--more-->` quicktag.
     76
     77= 0.9.4 =
     78* Updated: Admin page now uses the Wordpress Settings API.
    7279
    7380= 0.9.3 =
Note: See TracChangeset for help on using the changeset viewer.