Plugin Directory

Changeset 351820


Ignore:
Timestamp:
02/26/2011 02:56:36 PM (15 years ago)
Author:
timhodson
Message:
  • Added: Category hiding under Wordpress 3.1 is slightly different, both methods returned for backwards compatability.
  • Fixed: POST_ID showing unecessarily. Don't you love debug code!
  • Fixed: Markdown clashes with wpautop() tags now correct.
  • Fixed: We now look in whichever folder your uploads is set to.
Location:
blog-in-blog
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • blog-in-blog/tags/1.0.4/bib_post_template.tpl

    r289540 r351820  
    1 <!-- fragment of html for post template blog-in-blog Version: %bib_version% -->
     1<!-- fragment of html for post template. This file will be deprecated... -->
     2<!-- blog-in-blog Version: %bib_version% -->
    23<div class="post">
    34<!-- Post Headline -->     
  • blog-in-blog/tags/1.0.4/blog-in-blog.php

    r348059 r351820  
    44Plugin URI: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/
    55Description: Create a blog within a blog using a category. This plugin basically shows posts in a category on a page using shortcodes.
    6 Version: 1.0.3
     6Version: 1.0.4
    77Author: Tim Hodson
    88Author URI: http://timhodson.com
     
    3131*/
    3232
    33 
    3433if ( ! defined( 'BIB_VERSION' ) )
    35     define( 'BIB_VERSION', '1.0.3' );
     34    define( 'BIB_VERSION', '1.0.4' );
    3635
    3736// Pre-2.6 compatibility
     
    4544    define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
    4645
     46
     47if (!defined('BIB_WP_UPLOADS_DIR')){
     48    $uploads = wp_upload_dir();
     49    define ('BIB_WP_UPLOADS_DIR', $uploads['basedir']);
     50}
    4751
    4852include_once( WP_PLUGIN_DIR."/blog-in-blog/options.php" );
     
    7882    $blog_in_blog_opts['host_page'] = $wp_query->post->ID;
    7983
    80     //echo "POST_ID=".$blog_in_blog_opts['host_page'] ;
    81    
    8284    if(strstr($thumbnail_size,'x'))
    8385    {
     
    765767
    766768/*
    767 * Hide the category chosen to be the blog
     769* Hide the category(ies) chosen to be the blog
    768770*/
    769 function bib_hide_category($notused) {
     771function bib_hide_category($unused) {
    770772    global $wp_query;
    771    
    772773    $c = '';
    773    
    774774    $cat = get_option('bib_hide_category');
    775775
    776     if ( is_home() ) {
    777         //var_dump($cat);
    778 
    779         // if option to show latest is used
    780         //
     776    if ( is_home()) {
    781777        // else just hide the categories
    782778        if (is_array($cat)) {
    783 
    784779            foreach ($cat as $v) {
    785 
    786780                if($v != "NONE") {
    787781                    $c .= '-' . $v . ',';
    788782                }
    789 
    790             }
    791             $wp_query->query_vars['cat'] = $c;
    792         }
    793 
    794 
    795     }
    796 
    797 }
    798 
    799 add_action('pre_get_posts', 'bib_hide_category');
     783            }
     784            $c = trim($c, ',');
     785            //$wp_query->query_vars['cat'] = $c;
     786            $wp_query->set('cat',$c);
     787            $wp_query->set('category__not_in',  array_values($cat));
     788        }
     789      //return $query ;
     790    }
     791
     792}
     793
     794add_filter('pre_get_posts', 'bib_hide_category');
    800795
    801796
     
    815810
    816811                $query->set('cat', $c);
     812                $query->set('category__not_in',  array_values($cat));
    817813            }
    818814        }
     
    823819add_filter('pre_get_posts','bib_hide_category_feed');
    824820
     821
     822//add_action('all', create_function('', 'var_dump( current_filter() ) ; '));
     823//add_action('shutdown', create_function('', ' global $wpdb; if(isset($wpdb)) var_dump( $wpdb->queries ); '));
     824
     825
    825826?>
  • blog-in-blog/tags/1.0.4/options.php

    r347736 r351820  
    4141//  bib_set_option_default('bib_single',  1);
    4242
    43         if( ! get_option('bib_html') && file_exists(WP_CONTENT_DIR."/uploads/".get_option('bib_post_template'))){
     43        if( ! get_option('bib_html') && file_exists( BIB_WP_UPLOADS_DIR."/".get_option('bib_post_template'))){
    4444            //echo "uploads dir for template";
    45             bib_set_option_default('bib_html', file_get_contents(WP_CONTENT_DIR."/uploads/".get_option('bib_post_template')) );
     45            bib_set_option_default('bib_html', file_get_contents(BIB_WP_UPLOADS_DIR."/".get_option('bib_post_template')) );
    4646        }  elseif ( ! get_option('bib_html') && file_exists(WP_PLUGIN_DIR."/blog-in-blog/".get_option('bib_post_template'))) {
    4747            //echo "plugin dir for template";
     
    231231
    232232    if (is_array($categories)) {
    233 
    234233        foreach ($categories as $cat) {
    235 
    236234            if (in_array($cat->cat_ID, $catselected)) {
    237235                $select .= '<option value="' . $cat->cat_ID . '" selected="selected" >';
    238                 $select .= $cat->cat_name . ' (category_id:' . $cat->cat_ID;
     236                $select .= $cat->cat_name . ' (category_id=' . $cat->cat_ID;
    239237                $select .= ', ' . $cat->category_count . ' posts)';
    240238                $select .= '</option>';
     
    242240            } else {
    243241                $select .= '<option value="' . $cat->cat_ID . '">';
    244                 $select .= $cat->cat_name . ' (category_id:' . $cat->cat_ID;
     242                $select .= $cat->cat_name . ' (category_id=' . $cat->cat_ID;
    245243                $select .= ', ' . $cat->category_count . ' posts)';
    246244                $select .= '</option>';
    247245            }
    248 
    249246        }
    250247    }
     
    429426function bib_get_help() {
    430427    $rt = file_get_contents( WP_PLUGIN_DIR.'/blog-in-blog/readme.txt' );
    431     $rc = parsePluginReadme($rt, true);
     428    $rc = pm_parsePluginReadme($rt, true);
    432429    foreach ($rc['sections'] as $section){
    433430        echo $section;
    434431    }
     432    echo "<p>Help ends!</p>";
    435433}
    436434
     
    443441                // apply click functions to nav tabs.
    444442                jQuery(".nav-tab").click(function(){
    445                     console.log("nav-tab toggle others off") ;
    446443                    jQuery("a.nav-tab.nav-tab-active").toggleClass("nav-tab-active") ;
    447                     console.log("nav-tab toggle this on") ;
    448444                    jQuery(this).toggleClass("nav-tab-active") ;
    449445                });
    450446
    451447                // take clickevent off donate div!
    452                 console.log(jQuery("div.nav-tab").unbind("click") );
     448                jQuery("div.nav-tab").unbind("click");
    453449
    454450                // first time through hide everything but category section
  • blog-in-blog/tags/1.0.4/plugin-meta/markdown.php

    r347736 r351820  
    4141
    4242# Change to false to remove Markdown from posts and/or comments.
    43 @define( 'MARKDOWN_WP_POSTS',      true );
    44 @define( 'MARKDOWN_WP_COMMENTS',   true );
     43@define( 'MARKDOWN_WP_POSTS',      false );
     44@define( 'MARKDOWN_WP_COMMENTS',   false );
    4545
    4646
  • blog-in-blog/tags/1.0.4/plugin-meta/plugin-meta.php

    r347736 r351820  
    11<?php
    22
    3 include 'markdown.php'; //Used to convert readme.txt contents to HTML.
    4 
    5 /**
     3include 'markdown.php'; //Used to convert readme.txt contents to HTML.
     4
     5/**
     6 * Tim Hodson: renamed functions to avoid collisions.
     7 *
    68 * Extract plugin headers and readme.txt data from a plugin's ZIP archive.
    79 *
     
    2123 * @return array Associative array containing 'headers', 'readme' and 'pluginFile'. Returns FALSE if the input file is not a valid ZIP archive or doesn't contain a WP plugin.
    2224 */
    23 function analysePluginPackage($packageFilename, $applyMarkdown = false){
     25function pm_analysePluginPackage($packageFilename, $applyMarkdown = false){
    2426    if ( !file_exists($packageFilename) || !is_readable($packageFilename) ){
    2527        return false;
     
    4345        if ( empty($readme) && (strtolower(basename($fileName)) == 'readme.txt') ){
    4446            //Try to parse the readme
    45             $readme = parsePluginReadme($zip->getFromIndex($fileIndex), $applyMarkdown);
     47            $readme = pm_parsePluginReadme($zip->getFromIndex($fileIndex), $applyMarkdown);
    4648            continue; //Skip the rest of the checks.
    4749        }
     
    6466            //Try to read the header. WP only scans the first 8kiB, so we do the same.
    6567            $fileContents = substr($zip->getFromIndex($fileIndex), 0, 8*1024);
    66             $header = getPluginHeader($fileContents);
     68            $header = pm_getPluginHeader($fileContents);
    6769            if ( !empty($header) ){
    6870                $pluginFile = $fileName;
     
    7779    }
    7880}
     81
     82
    7983
    8084/**
     
    102106 * @return array Associative array, or NULL if the input doesn't look like a valid readme.txt file. See above for a list of fields.
    103107 */
    104 function parsePluginReadme($readmeTxtContents, $applyMarkdown = false){
     108function pm_parsePluginReadme($readmeTxtContents, $applyMarkdown = false){
    105109    $readmeTxtContents = trim($readmeTxtContents, " \t\n\r");
    106110    $readme = array(
     
    188192    //Apply Markdown to sections
    189193    if ( $applyMarkdown ){
    190         $sections = array_map('applyMarkdown', $sections);
     194        $sections = array_map('pm_applyMarkdown', $sections);
    191195    }
    192196   
     
    219223 * @return array Associative array 
    220224 */
    221 function getPluginPackageMeta($packageInfo){
     225function pm_getPluginPackageMeta($packageInfo){
    222226    if ( is_string($packageInfo) && file_exists($packageInfo) ){
    223         $packageInfo = analysePluginPackage($packageInfo, true);
     227        $packageInfo = pm_analysePluginPackage($packageInfo, true);
    224228    }
    225229   
     
    279283 * @return string
    280284 */
    281 function applyMarkdown($text){
     285function pm_applyMarkdown($text){
    282286    //The WP standard for readme files uses some custom markup, like "= H4 headers ="
    283287    $text = preg_replace('@^\s*=\s*(.+?)\s*=\s*$@m', "<h4>$1</h4>\n", $text);
     
    340344 * @return array|null See above for description.
    341345 */
    342 function getPluginHeader( $file_data ) {
     346function pm_getPluginHeader( $file_data ) {
    343347
    344348    $default_headers = array(
     
    356360    );
    357361
    358     $plugin_data = _get_file_data( $file_data, $default_headers );
     362    $plugin_data = pm_get_file_data( $file_data, $default_headers );
    359363
    360364    // Site Wide Only is the old header for Network
     
    390394 * @param array $all_headers The list of headers to search for in the file.
    391395 */
    392 function _get_file_data( $file_data, $all_headers ) {
     396function pm_get_file_data( $file_data, $all_headers ) {
    393397    foreach ( $all_headers as $field => $regex ) {
    394398        preg_match( '/' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field});
    395399        if ( !empty( ${$field} ) )
    396             ${$field} = __cleanup_header_comment( ${$field}[1] );
     400            ${$field} = pm_cleanup_header_comment( ${$field}[1] );
    397401        else
    398402            ${$field} = '';
     
    413417 * @return string
    414418 */
    415 function __cleanup_header_comment($str) {
     419function pm_cleanup_header_comment($str) {
    416420    return trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $str));
    417421}
  • blog-in-blog/tags/1.0.4/readme.txt

    r347784 r351820  
    44Tags: categories, blog, hide, cms
    55Requires at least: 2.7.1
    6 Tested up to: 3.0.5
    7 Stable tag: 1.0.3
     6Tested up to: 3.1
     7Stable tag: 1.0.4
    88
    99Create multiple blogs within a blog using a category. This plugin shows posts from a category on any page you like using shortcodes.
     
    4646= Tips =
    47471. The category list in the blog-in-blog admin page ONLY shows categories with posts.  You need to create some content first!
    48 1. You can specify the name of the template file in the shortcode (applies to that shortcode instance only). We always look in `wp-content/uploads/` for your template file first (your template will be safe under uploads/) before looking in `wp-content/plugins/blog-in-blog` (your template will probably be lost when the plugin is upgraded).
     481. You can specify the name of the template file in the shortcode (applies to that shortcode instance only). We always look in `wp-content/uploads/` (or wherever you have set your uploads folder) for your template file first before looking in `wp-content/plugins/blog-in-blog` (your template will probably be lost when the plugin is upgraded).
    4949
    5050== Frequently Asked Questions ==
     
    5858
    5959As a minimum you need the following shortcode:
    60 
    6160`[blog_in_blog category_id=_yourchosencategoryid_]`
    6261
    6362or to save you typing `[blog_in_blog]` every time...
    64 
    6563`[bib category_id=_yourchosencategoryid_]`
    6664
    67 
    68 
    69 `_yourchosencategoryid_` must be a number.
     65The value used for `_yourchosencategoryid_` must be a number.
    7066
    7167*Additional shortcode paramaters:*
     
    8480    - Default is always newest (DESC) first.
    8581* `template=<your filename>` Specify a template filename. We look in the following locations in the order shown:
    86     1. Uploads directory: `WP_CONTENT_DIR/uploads/<your filename>`
     82    1. Uploads directory: `WP_CONTENT_DIR/uploads/<your filename>` (or whever your uploads directory is)
    8783    1. Plugin directiry: `WP_CONTENT_DIR/plugins/blog-in-blog/<your filename>`
    8884* `post_id=<a post id>` If specified only show a single post. All other parameters are ignored.
     
    128124* French `fr_FR` - Stef Walter
    129125
     126The .pot file was extensively rewritten as of version 1.0.3. You may wish to send me your new translations?
     127
    130128== Changelog ==
     129
     130= 1.0.4 =
     131
     132* Added: Category hiding under Wordpress 3.1 is slightly different, both methods returned for backwards compatability.
     133* Fixed: POST_ID showing unecessarily. Don't you love debug code!
     134* Fixed: Markdown clashes with wpautop() `<br>` tags now correct.
     135* Fixed: We now look in whichever folder your uploads is set to.
    131136
    132137= 1.0.3 =
  • blog-in-blog/trunk/bib_post_template.tpl

    r289540 r351820  
    1 <!-- fragment of html for post template blog-in-blog Version: %bib_version% -->
     1<!-- fragment of html for post template. This file will be deprecated... -->
     2<!-- blog-in-blog Version: %bib_version% -->
    23<div class="post">
    34<!-- Post Headline -->     
  • blog-in-blog/trunk/blog-in-blog.php

    r348059 r351820  
    44Plugin URI: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/
    55Description: Create a blog within a blog using a category. This plugin basically shows posts in a category on a page using shortcodes.
    6 Version: 1.0.3
     6Version: 1.0.4
    77Author: Tim Hodson
    88Author URI: http://timhodson.com
     
    3131*/
    3232
    33 
    3433if ( ! defined( 'BIB_VERSION' ) )
    35     define( 'BIB_VERSION', '1.0.3' );
     34    define( 'BIB_VERSION', '1.0.4' );
    3635
    3736// Pre-2.6 compatibility
     
    4544    define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
    4645
     46
     47if (!defined('BIB_WP_UPLOADS_DIR')){
     48    $uploads = wp_upload_dir();
     49    define ('BIB_WP_UPLOADS_DIR', $uploads['basedir']);
     50}
    4751
    4852include_once( WP_PLUGIN_DIR."/blog-in-blog/options.php" );
     
    7882    $blog_in_blog_opts['host_page'] = $wp_query->post->ID;
    7983
    80     //echo "POST_ID=".$blog_in_blog_opts['host_page'] ;
    81    
    8284    if(strstr($thumbnail_size,'x'))
    8385    {
     
    765767
    766768/*
    767 * Hide the category chosen to be the blog
     769* Hide the category(ies) chosen to be the blog
    768770*/
    769 function bib_hide_category($notused) {
     771function bib_hide_category($unused) {
    770772    global $wp_query;
    771    
    772773    $c = '';
    773    
    774774    $cat = get_option('bib_hide_category');
    775775
    776     if ( is_home() ) {
    777         //var_dump($cat);
    778 
    779         // if option to show latest is used
    780         //
     776    if ( is_home()) {
    781777        // else just hide the categories
    782778        if (is_array($cat)) {
    783 
    784779            foreach ($cat as $v) {
    785 
    786780                if($v != "NONE") {
    787781                    $c .= '-' . $v . ',';
    788782                }
    789 
    790             }
    791             $wp_query->query_vars['cat'] = $c;
    792         }
    793 
    794 
    795     }
    796 
    797 }
    798 
    799 add_action('pre_get_posts', 'bib_hide_category');
     783            }
     784            $c = trim($c, ',');
     785            //$wp_query->query_vars['cat'] = $c;
     786            $wp_query->set('cat',$c);
     787            $wp_query->set('category__not_in',  array_values($cat));
     788        }
     789      //return $query ;
     790    }
     791
     792}
     793
     794add_filter('pre_get_posts', 'bib_hide_category');
    800795
    801796
     
    815810
    816811                $query->set('cat', $c);
     812                $query->set('category__not_in',  array_values($cat));
    817813            }
    818814        }
     
    823819add_filter('pre_get_posts','bib_hide_category_feed');
    824820
     821
     822//add_action('all', create_function('', 'var_dump( current_filter() ) ; '));
     823//add_action('shutdown', create_function('', ' global $wpdb; if(isset($wpdb)) var_dump( $wpdb->queries ); '));
     824
     825
    825826?>
  • blog-in-blog/trunk/options.php

    r347736 r351820  
    4141//  bib_set_option_default('bib_single',  1);
    4242
    43         if( ! get_option('bib_html') && file_exists(WP_CONTENT_DIR."/uploads/".get_option('bib_post_template'))){
     43        if( ! get_option('bib_html') && file_exists( BIB_WP_UPLOADS_DIR."/".get_option('bib_post_template'))){
    4444            //echo "uploads dir for template";
    45             bib_set_option_default('bib_html', file_get_contents(WP_CONTENT_DIR."/uploads/".get_option('bib_post_template')) );
     45            bib_set_option_default('bib_html', file_get_contents(BIB_WP_UPLOADS_DIR."/".get_option('bib_post_template')) );
    4646        }  elseif ( ! get_option('bib_html') && file_exists(WP_PLUGIN_DIR."/blog-in-blog/".get_option('bib_post_template'))) {
    4747            //echo "plugin dir for template";
     
    231231
    232232    if (is_array($categories)) {
    233 
    234233        foreach ($categories as $cat) {
    235 
    236234            if (in_array($cat->cat_ID, $catselected)) {
    237235                $select .= '<option value="' . $cat->cat_ID . '" selected="selected" >';
    238                 $select .= $cat->cat_name . ' (category_id:' . $cat->cat_ID;
     236                $select .= $cat->cat_name . ' (category_id=' . $cat->cat_ID;
    239237                $select .= ', ' . $cat->category_count . ' posts)';
    240238                $select .= '</option>';
     
    242240            } else {
    243241                $select .= '<option value="' . $cat->cat_ID . '">';
    244                 $select .= $cat->cat_name . ' (category_id:' . $cat->cat_ID;
     242                $select .= $cat->cat_name . ' (category_id=' . $cat->cat_ID;
    245243                $select .= ', ' . $cat->category_count . ' posts)';
    246244                $select .= '</option>';
    247245            }
    248 
    249246        }
    250247    }
     
    429426function bib_get_help() {
    430427    $rt = file_get_contents( WP_PLUGIN_DIR.'/blog-in-blog/readme.txt' );
    431     $rc = parsePluginReadme($rt, true);
     428    $rc = pm_parsePluginReadme($rt, true);
    432429    foreach ($rc['sections'] as $section){
    433430        echo $section;
    434431    }
     432    echo "<p>Help ends!</p>";
    435433}
    436434
     
    443441                // apply click functions to nav tabs.
    444442                jQuery(".nav-tab").click(function(){
    445                     console.log("nav-tab toggle others off") ;
    446443                    jQuery("a.nav-tab.nav-tab-active").toggleClass("nav-tab-active") ;
    447                     console.log("nav-tab toggle this on") ;
    448444                    jQuery(this).toggleClass("nav-tab-active") ;
    449445                });
    450446
    451447                // take clickevent off donate div!
    452                 console.log(jQuery("div.nav-tab").unbind("click") );
     448                jQuery("div.nav-tab").unbind("click");
    453449
    454450                // first time through hide everything but category section
  • blog-in-blog/trunk/plugin-meta/markdown.php

    r347736 r351820  
    4141
    4242# Change to false to remove Markdown from posts and/or comments.
    43 @define( 'MARKDOWN_WP_POSTS',      true );
    44 @define( 'MARKDOWN_WP_COMMENTS',   true );
     43@define( 'MARKDOWN_WP_POSTS',      false );
     44@define( 'MARKDOWN_WP_COMMENTS',   false );
    4545
    4646
  • blog-in-blog/trunk/plugin-meta/plugin-meta.php

    r347736 r351820  
    11<?php
    22
    3 include 'markdown.php'; //Used to convert readme.txt contents to HTML.
    4 
    5 /**
     3include 'markdown.php'; //Used to convert readme.txt contents to HTML.
     4
     5/**
     6 * Tim Hodson: renamed functions to avoid collisions.
     7 *
    68 * Extract plugin headers and readme.txt data from a plugin's ZIP archive.
    79 *
     
    2123 * @return array Associative array containing 'headers', 'readme' and 'pluginFile'. Returns FALSE if the input file is not a valid ZIP archive or doesn't contain a WP plugin.
    2224 */
    23 function analysePluginPackage($packageFilename, $applyMarkdown = false){
     25function pm_analysePluginPackage($packageFilename, $applyMarkdown = false){
    2426    if ( !file_exists($packageFilename) || !is_readable($packageFilename) ){
    2527        return false;
     
    4345        if ( empty($readme) && (strtolower(basename($fileName)) == 'readme.txt') ){
    4446            //Try to parse the readme
    45             $readme = parsePluginReadme($zip->getFromIndex($fileIndex), $applyMarkdown);
     47            $readme = pm_parsePluginReadme($zip->getFromIndex($fileIndex), $applyMarkdown);
    4648            continue; //Skip the rest of the checks.
    4749        }
     
    6466            //Try to read the header. WP only scans the first 8kiB, so we do the same.
    6567            $fileContents = substr($zip->getFromIndex($fileIndex), 0, 8*1024);
    66             $header = getPluginHeader($fileContents);
     68            $header = pm_getPluginHeader($fileContents);
    6769            if ( !empty($header) ){
    6870                $pluginFile = $fileName;
     
    7779    }
    7880}
     81
     82
    7983
    8084/**
     
    102106 * @return array Associative array, or NULL if the input doesn't look like a valid readme.txt file. See above for a list of fields.
    103107 */
    104 function parsePluginReadme($readmeTxtContents, $applyMarkdown = false){
     108function pm_parsePluginReadme($readmeTxtContents, $applyMarkdown = false){
    105109    $readmeTxtContents = trim($readmeTxtContents, " \t\n\r");
    106110    $readme = array(
     
    188192    //Apply Markdown to sections
    189193    if ( $applyMarkdown ){
    190         $sections = array_map('applyMarkdown', $sections);
     194        $sections = array_map('pm_applyMarkdown', $sections);
    191195    }
    192196   
     
    219223 * @return array Associative array 
    220224 */
    221 function getPluginPackageMeta($packageInfo){
     225function pm_getPluginPackageMeta($packageInfo){
    222226    if ( is_string($packageInfo) && file_exists($packageInfo) ){
    223         $packageInfo = analysePluginPackage($packageInfo, true);
     227        $packageInfo = pm_analysePluginPackage($packageInfo, true);
    224228    }
    225229   
     
    279283 * @return string
    280284 */
    281 function applyMarkdown($text){
     285function pm_applyMarkdown($text){
    282286    //The WP standard for readme files uses some custom markup, like "= H4 headers ="
    283287    $text = preg_replace('@^\s*=\s*(.+?)\s*=\s*$@m', "<h4>$1</h4>\n", $text);
     
    340344 * @return array|null See above for description.
    341345 */
    342 function getPluginHeader( $file_data ) {
     346function pm_getPluginHeader( $file_data ) {
    343347
    344348    $default_headers = array(
     
    356360    );
    357361
    358     $plugin_data = _get_file_data( $file_data, $default_headers );
     362    $plugin_data = pm_get_file_data( $file_data, $default_headers );
    359363
    360364    // Site Wide Only is the old header for Network
     
    390394 * @param array $all_headers The list of headers to search for in the file.
    391395 */
    392 function _get_file_data( $file_data, $all_headers ) {
     396function pm_get_file_data( $file_data, $all_headers ) {
    393397    foreach ( $all_headers as $field => $regex ) {
    394398        preg_match( '/' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field});
    395399        if ( !empty( ${$field} ) )
    396             ${$field} = __cleanup_header_comment( ${$field}[1] );
     400            ${$field} = pm_cleanup_header_comment( ${$field}[1] );
    397401        else
    398402            ${$field} = '';
     
    413417 * @return string
    414418 */
    415 function __cleanup_header_comment($str) {
     419function pm_cleanup_header_comment($str) {
    416420    return trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $str));
    417421}
  • blog-in-blog/trunk/readme.txt

    r347784 r351820  
    44Tags: categories, blog, hide, cms
    55Requires at least: 2.7.1
    6 Tested up to: 3.0.5
    7 Stable tag: 1.0.3
     6Tested up to: 3.1
     7Stable tag: 1.0.4
    88
    99Create multiple blogs within a blog using a category. This plugin shows posts from a category on any page you like using shortcodes.
     
    4646= Tips =
    47471. The category list in the blog-in-blog admin page ONLY shows categories with posts.  You need to create some content first!
    48 1. You can specify the name of the template file in the shortcode (applies to that shortcode instance only). We always look in `wp-content/uploads/` for your template file first (your template will be safe under uploads/) before looking in `wp-content/plugins/blog-in-blog` (your template will probably be lost when the plugin is upgraded).
     481. You can specify the name of the template file in the shortcode (applies to that shortcode instance only). We always look in `wp-content/uploads/` (or wherever you have set your uploads folder) for your template file first before looking in `wp-content/plugins/blog-in-blog` (your template will probably be lost when the plugin is upgraded).
    4949
    5050== Frequently Asked Questions ==
     
    5858
    5959As a minimum you need the following shortcode:
    60 
    6160`[blog_in_blog category_id=_yourchosencategoryid_]`
    6261
    6362or to save you typing `[blog_in_blog]` every time...
    64 
    6563`[bib category_id=_yourchosencategoryid_]`
    6664
    67 
    68 
    69 `_yourchosencategoryid_` must be a number.
     65The value used for `_yourchosencategoryid_` must be a number.
    7066
    7167*Additional shortcode paramaters:*
     
    8480    - Default is always newest (DESC) first.
    8581* `template=<your filename>` Specify a template filename. We look in the following locations in the order shown:
    86     1. Uploads directory: `WP_CONTENT_DIR/uploads/<your filename>`
     82    1. Uploads directory: `WP_CONTENT_DIR/uploads/<your filename>` (or whever your uploads directory is)
    8783    1. Plugin directiry: `WP_CONTENT_DIR/plugins/blog-in-blog/<your filename>`
    8884* `post_id=<a post id>` If specified only show a single post. All other parameters are ignored.
     
    128124* French `fr_FR` - Stef Walter
    129125
     126The .pot file was extensively rewritten as of version 1.0.3. You may wish to send me your new translations?
     127
    130128== Changelog ==
     129
     130= 1.0.4 =
     131
     132* Added: Category hiding under Wordpress 3.1 is slightly different, both methods returned for backwards compatability.
     133* Fixed: POST_ID showing unecessarily. Don't you love debug code!
     134* Fixed: Markdown clashes with wpautop() `<br>` tags now correct.
     135* Fixed: We now look in whichever folder your uploads is set to.
    131136
    132137= 1.0.3 =
Note: See TracChangeset for help on using the changeset viewer.