Changeset 351820
- Timestamp:
- 02/26/2011 02:56:36 PM (15 years ago)
- Location:
- blog-in-blog
- Files:
-
- 12 edited
- 1 copied
-
tags/1.0.4 (copied) (copied from blog-in-blog/trunk)
-
tags/1.0.4/bib_post_template.tpl (modified) (1 diff)
-
tags/1.0.4/blog-in-blog.php (modified) (7 diffs)
-
tags/1.0.4/options.php (modified) (5 diffs)
-
tags/1.0.4/plugin-meta/markdown.php (modified) (1 diff)
-
tags/1.0.4/plugin-meta/plugin-meta.php (modified) (13 diffs)
-
tags/1.0.4/readme.txt (modified) (5 diffs)
-
trunk/bib_post_template.tpl (modified) (1 diff)
-
trunk/blog-in-blog.php (modified) (7 diffs)
-
trunk/options.php (modified) (5 diffs)
-
trunk/plugin-meta/markdown.php (modified) (1 diff)
-
trunk/plugin-meta/plugin-meta.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (5 diffs)
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% --> 2 3 <div class="post"> 3 4 <!-- Post Headline --> -
blog-in-blog/tags/1.0.4/blog-in-blog.php
r348059 r351820 4 4 Plugin URI: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/ 5 5 Description: 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. 36 Version: 1.0.4 7 7 Author: Tim Hodson 8 8 Author URI: http://timhodson.com … … 31 31 */ 32 32 33 34 33 if ( ! defined( 'BIB_VERSION' ) ) 35 define( 'BIB_VERSION', '1.0. 3' );34 define( 'BIB_VERSION', '1.0.4' ); 36 35 37 36 // Pre-2.6 compatibility … … 45 44 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); 46 45 46 47 if (!defined('BIB_WP_UPLOADS_DIR')){ 48 $uploads = wp_upload_dir(); 49 define ('BIB_WP_UPLOADS_DIR', $uploads['basedir']); 50 } 47 51 48 52 include_once( WP_PLUGIN_DIR."/blog-in-blog/options.php" ); … … 78 82 $blog_in_blog_opts['host_page'] = $wp_query->post->ID; 79 83 80 //echo "POST_ID=".$blog_in_blog_opts['host_page'] ;81 82 84 if(strstr($thumbnail_size,'x')) 83 85 { … … 765 767 766 768 /* 767 * Hide the category chosen to be the blog769 * Hide the category(ies) chosen to be the blog 768 770 */ 769 function bib_hide_category($ notused) {771 function bib_hide_category($unused) { 770 772 global $wp_query; 771 772 773 $c = ''; 773 774 774 $cat = get_option('bib_hide_category'); 775 775 776 if ( is_home() ) { 777 //var_dump($cat); 778 779 // if option to show latest is used 780 // 776 if ( is_home()) { 781 777 // else just hide the categories 782 778 if (is_array($cat)) { 783 784 779 foreach ($cat as $v) { 785 786 780 if($v != "NONE") { 787 781 $c .= '-' . $v . ','; 788 782 } 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 794 add_filter('pre_get_posts', 'bib_hide_category'); 800 795 801 796 … … 815 810 816 811 $query->set('cat', $c); 812 $query->set('category__not_in', array_values($cat)); 817 813 } 818 814 } … … 823 819 add_filter('pre_get_posts','bib_hide_category_feed'); 824 820 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 825 826 ?> -
blog-in-blog/tags/1.0.4/options.php
r347736 r351820 41 41 // bib_set_option_default('bib_single', 1); 42 42 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'))){ 44 44 //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')) ); 46 46 } elseif ( ! get_option('bib_html') && file_exists(WP_PLUGIN_DIR."/blog-in-blog/".get_option('bib_post_template'))) { 47 47 //echo "plugin dir for template"; … … 231 231 232 232 if (is_array($categories)) { 233 234 233 foreach ($categories as $cat) { 235 236 234 if (in_array($cat->cat_ID, $catselected)) { 237 235 $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; 239 237 $select .= ', ' . $cat->category_count . ' posts)'; 240 238 $select .= '</option>'; … … 242 240 } else { 243 241 $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; 245 243 $select .= ', ' . $cat->category_count . ' posts)'; 246 244 $select .= '</option>'; 247 245 } 248 249 246 } 250 247 } … … 429 426 function bib_get_help() { 430 427 $rt = file_get_contents( WP_PLUGIN_DIR.'/blog-in-blog/readme.txt' ); 431 $rc = p arsePluginReadme($rt, true);428 $rc = pm_parsePluginReadme($rt, true); 432 429 foreach ($rc['sections'] as $section){ 433 430 echo $section; 434 431 } 432 echo "<p>Help ends!</p>"; 435 433 } 436 434 … … 443 441 // apply click functions to nav tabs. 444 442 jQuery(".nav-tab").click(function(){ 445 console.log("nav-tab toggle others off") ;446 443 jQuery("a.nav-tab.nav-tab-active").toggleClass("nav-tab-active") ; 447 console.log("nav-tab toggle this on") ;448 444 jQuery(this).toggleClass("nav-tab-active") ; 449 445 }); 450 446 451 447 // take clickevent off donate div! 452 console.log(jQuery("div.nav-tab").unbind("click"));448 jQuery("div.nav-tab").unbind("click"); 453 449 454 450 // first time through hide everything but category section -
blog-in-blog/tags/1.0.4/plugin-meta/markdown.php
r347736 r351820 41 41 42 42 # 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 ); 45 45 46 46 -
blog-in-blog/tags/1.0.4/plugin-meta/plugin-meta.php
r347736 r351820 1 1 <?php 2 2 3 include 'markdown.php'; //Used to convert readme.txt contents to HTML. 4 5 /** 3 include 'markdown.php'; //Used to convert readme.txt contents to HTML. 4 5 /** 6 * Tim Hodson: renamed functions to avoid collisions. 7 * 6 8 * Extract plugin headers and readme.txt data from a plugin's ZIP archive. 7 9 * … … 21 23 * @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. 22 24 */ 23 function analysePluginPackage($packageFilename, $applyMarkdown = false){25 function pm_analysePluginPackage($packageFilename, $applyMarkdown = false){ 24 26 if ( !file_exists($packageFilename) || !is_readable($packageFilename) ){ 25 27 return false; … … 43 45 if ( empty($readme) && (strtolower(basename($fileName)) == 'readme.txt') ){ 44 46 //Try to parse the readme 45 $readme = p arsePluginReadme($zip->getFromIndex($fileIndex), $applyMarkdown);47 $readme = pm_parsePluginReadme($zip->getFromIndex($fileIndex), $applyMarkdown); 46 48 continue; //Skip the rest of the checks. 47 49 } … … 64 66 //Try to read the header. WP only scans the first 8kiB, so we do the same. 65 67 $fileContents = substr($zip->getFromIndex($fileIndex), 0, 8*1024); 66 $header = getPluginHeader($fileContents);68 $header = pm_getPluginHeader($fileContents); 67 69 if ( !empty($header) ){ 68 70 $pluginFile = $fileName; … … 77 79 } 78 80 } 81 82 79 83 80 84 /** … … 102 106 * @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. 103 107 */ 104 function p arsePluginReadme($readmeTxtContents, $applyMarkdown = false){108 function pm_parsePluginReadme($readmeTxtContents, $applyMarkdown = false){ 105 109 $readmeTxtContents = trim($readmeTxtContents, " \t\n\r"); 106 110 $readme = array( … … 188 192 //Apply Markdown to sections 189 193 if ( $applyMarkdown ){ 190 $sections = array_map(' applyMarkdown', $sections);194 $sections = array_map('pm_applyMarkdown', $sections); 191 195 } 192 196 … … 219 223 * @return array Associative array 220 224 */ 221 function getPluginPackageMeta($packageInfo){225 function pm_getPluginPackageMeta($packageInfo){ 222 226 if ( is_string($packageInfo) && file_exists($packageInfo) ){ 223 $packageInfo = analysePluginPackage($packageInfo, true);227 $packageInfo = pm_analysePluginPackage($packageInfo, true); 224 228 } 225 229 … … 279 283 * @return string 280 284 */ 281 function applyMarkdown($text){285 function pm_applyMarkdown($text){ 282 286 //The WP standard for readme files uses some custom markup, like "= H4 headers =" 283 287 $text = preg_replace('@^\s*=\s*(.+?)\s*=\s*$@m', "<h4>$1</h4>\n", $text); … … 340 344 * @return array|null See above for description. 341 345 */ 342 function getPluginHeader( $file_data ) {346 function pm_getPluginHeader( $file_data ) { 343 347 344 348 $default_headers = array( … … 356 360 ); 357 361 358 $plugin_data = _get_file_data( $file_data, $default_headers );362 $plugin_data = pm_get_file_data( $file_data, $default_headers ); 359 363 360 364 // Site Wide Only is the old header for Network … … 390 394 * @param array $all_headers The list of headers to search for in the file. 391 395 */ 392 function _get_file_data( $file_data, $all_headers ) {396 function pm_get_file_data( $file_data, $all_headers ) { 393 397 foreach ( $all_headers as $field => $regex ) { 394 398 preg_match( '/' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field}); 395 399 if ( !empty( ${$field} ) ) 396 ${$field} = __cleanup_header_comment( ${$field}[1] );400 ${$field} = pm_cleanup_header_comment( ${$field}[1] ); 397 401 else 398 402 ${$field} = ''; … … 413 417 * @return string 414 418 */ 415 function __cleanup_header_comment($str) {419 function pm_cleanup_header_comment($str) { 416 420 return trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $str)); 417 421 } -
blog-in-blog/tags/1.0.4/readme.txt
r347784 r351820 4 4 Tags: categories, blog, hide, cms 5 5 Requires at least: 2.7.1 6 Tested up to: 3. 0.57 Stable tag: 1.0. 36 Tested up to: 3.1 7 Stable tag: 1.0.4 8 8 9 9 Create multiple blogs within a blog using a category. This plugin shows posts from a category on any page you like using shortcodes. … … 46 46 = Tips = 47 47 1. 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).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/` (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). 49 49 50 50 == Frequently Asked Questions == … … 58 58 59 59 As a minimum you need the following shortcode: 60 61 60 `[blog_in_blog category_id=_yourchosencategoryid_]` 62 61 63 62 or to save you typing `[blog_in_blog]` every time... 64 65 63 `[bib category_id=_yourchosencategoryid_]` 66 64 67 68 69 `_yourchosencategoryid_` must be a number. 65 The value used for `_yourchosencategoryid_` must be a number. 70 66 71 67 *Additional shortcode paramaters:* … … 84 80 - Default is always newest (DESC) first. 85 81 * `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) 87 83 1. Plugin directiry: `WP_CONTENT_DIR/plugins/blog-in-blog/<your filename>` 88 84 * `post_id=<a post id>` If specified only show a single post. All other parameters are ignored. … … 128 124 * French `fr_FR` - Stef Walter 129 125 126 The .pot file was extensively rewritten as of version 1.0.3. You may wish to send me your new translations? 127 130 128 == 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. 131 136 132 137 = 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% --> 2 3 <div class="post"> 3 4 <!-- Post Headline --> -
blog-in-blog/trunk/blog-in-blog.php
r348059 r351820 4 4 Plugin URI: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/ 5 5 Description: 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. 36 Version: 1.0.4 7 7 Author: Tim Hodson 8 8 Author URI: http://timhodson.com … … 31 31 */ 32 32 33 34 33 if ( ! defined( 'BIB_VERSION' ) ) 35 define( 'BIB_VERSION', '1.0. 3' );34 define( 'BIB_VERSION', '1.0.4' ); 36 35 37 36 // Pre-2.6 compatibility … … 45 44 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); 46 45 46 47 if (!defined('BIB_WP_UPLOADS_DIR')){ 48 $uploads = wp_upload_dir(); 49 define ('BIB_WP_UPLOADS_DIR', $uploads['basedir']); 50 } 47 51 48 52 include_once( WP_PLUGIN_DIR."/blog-in-blog/options.php" ); … … 78 82 $blog_in_blog_opts['host_page'] = $wp_query->post->ID; 79 83 80 //echo "POST_ID=".$blog_in_blog_opts['host_page'] ;81 82 84 if(strstr($thumbnail_size,'x')) 83 85 { … … 765 767 766 768 /* 767 * Hide the category chosen to be the blog769 * Hide the category(ies) chosen to be the blog 768 770 */ 769 function bib_hide_category($ notused) {771 function bib_hide_category($unused) { 770 772 global $wp_query; 771 772 773 $c = ''; 773 774 774 $cat = get_option('bib_hide_category'); 775 775 776 if ( is_home() ) { 777 //var_dump($cat); 778 779 // if option to show latest is used 780 // 776 if ( is_home()) { 781 777 // else just hide the categories 782 778 if (is_array($cat)) { 783 784 779 foreach ($cat as $v) { 785 786 780 if($v != "NONE") { 787 781 $c .= '-' . $v . ','; 788 782 } 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 794 add_filter('pre_get_posts', 'bib_hide_category'); 800 795 801 796 … … 815 810 816 811 $query->set('cat', $c); 812 $query->set('category__not_in', array_values($cat)); 817 813 } 818 814 } … … 823 819 add_filter('pre_get_posts','bib_hide_category_feed'); 824 820 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 825 826 ?> -
blog-in-blog/trunk/options.php
r347736 r351820 41 41 // bib_set_option_default('bib_single', 1); 42 42 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'))){ 44 44 //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')) ); 46 46 } elseif ( ! get_option('bib_html') && file_exists(WP_PLUGIN_DIR."/blog-in-blog/".get_option('bib_post_template'))) { 47 47 //echo "plugin dir for template"; … … 231 231 232 232 if (is_array($categories)) { 233 234 233 foreach ($categories as $cat) { 235 236 234 if (in_array($cat->cat_ID, $catselected)) { 237 235 $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; 239 237 $select .= ', ' . $cat->category_count . ' posts)'; 240 238 $select .= '</option>'; … … 242 240 } else { 243 241 $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; 245 243 $select .= ', ' . $cat->category_count . ' posts)'; 246 244 $select .= '</option>'; 247 245 } 248 249 246 } 250 247 } … … 429 426 function bib_get_help() { 430 427 $rt = file_get_contents( WP_PLUGIN_DIR.'/blog-in-blog/readme.txt' ); 431 $rc = p arsePluginReadme($rt, true);428 $rc = pm_parsePluginReadme($rt, true); 432 429 foreach ($rc['sections'] as $section){ 433 430 echo $section; 434 431 } 432 echo "<p>Help ends!</p>"; 435 433 } 436 434 … … 443 441 // apply click functions to nav tabs. 444 442 jQuery(".nav-tab").click(function(){ 445 console.log("nav-tab toggle others off") ;446 443 jQuery("a.nav-tab.nav-tab-active").toggleClass("nav-tab-active") ; 447 console.log("nav-tab toggle this on") ;448 444 jQuery(this).toggleClass("nav-tab-active") ; 449 445 }); 450 446 451 447 // take clickevent off donate div! 452 console.log(jQuery("div.nav-tab").unbind("click"));448 jQuery("div.nav-tab").unbind("click"); 453 449 454 450 // first time through hide everything but category section -
blog-in-blog/trunk/plugin-meta/markdown.php
r347736 r351820 41 41 42 42 # 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 ); 45 45 46 46 -
blog-in-blog/trunk/plugin-meta/plugin-meta.php
r347736 r351820 1 1 <?php 2 2 3 include 'markdown.php'; //Used to convert readme.txt contents to HTML. 4 5 /** 3 include 'markdown.php'; //Used to convert readme.txt contents to HTML. 4 5 /** 6 * Tim Hodson: renamed functions to avoid collisions. 7 * 6 8 * Extract plugin headers and readme.txt data from a plugin's ZIP archive. 7 9 * … … 21 23 * @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. 22 24 */ 23 function analysePluginPackage($packageFilename, $applyMarkdown = false){25 function pm_analysePluginPackage($packageFilename, $applyMarkdown = false){ 24 26 if ( !file_exists($packageFilename) || !is_readable($packageFilename) ){ 25 27 return false; … … 43 45 if ( empty($readme) && (strtolower(basename($fileName)) == 'readme.txt') ){ 44 46 //Try to parse the readme 45 $readme = p arsePluginReadme($zip->getFromIndex($fileIndex), $applyMarkdown);47 $readme = pm_parsePluginReadme($zip->getFromIndex($fileIndex), $applyMarkdown); 46 48 continue; //Skip the rest of the checks. 47 49 } … … 64 66 //Try to read the header. WP only scans the first 8kiB, so we do the same. 65 67 $fileContents = substr($zip->getFromIndex($fileIndex), 0, 8*1024); 66 $header = getPluginHeader($fileContents);68 $header = pm_getPluginHeader($fileContents); 67 69 if ( !empty($header) ){ 68 70 $pluginFile = $fileName; … … 77 79 } 78 80 } 81 82 79 83 80 84 /** … … 102 106 * @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. 103 107 */ 104 function p arsePluginReadme($readmeTxtContents, $applyMarkdown = false){108 function pm_parsePluginReadme($readmeTxtContents, $applyMarkdown = false){ 105 109 $readmeTxtContents = trim($readmeTxtContents, " \t\n\r"); 106 110 $readme = array( … … 188 192 //Apply Markdown to sections 189 193 if ( $applyMarkdown ){ 190 $sections = array_map(' applyMarkdown', $sections);194 $sections = array_map('pm_applyMarkdown', $sections); 191 195 } 192 196 … … 219 223 * @return array Associative array 220 224 */ 221 function getPluginPackageMeta($packageInfo){225 function pm_getPluginPackageMeta($packageInfo){ 222 226 if ( is_string($packageInfo) && file_exists($packageInfo) ){ 223 $packageInfo = analysePluginPackage($packageInfo, true);227 $packageInfo = pm_analysePluginPackage($packageInfo, true); 224 228 } 225 229 … … 279 283 * @return string 280 284 */ 281 function applyMarkdown($text){285 function pm_applyMarkdown($text){ 282 286 //The WP standard for readme files uses some custom markup, like "= H4 headers =" 283 287 $text = preg_replace('@^\s*=\s*(.+?)\s*=\s*$@m', "<h4>$1</h4>\n", $text); … … 340 344 * @return array|null See above for description. 341 345 */ 342 function getPluginHeader( $file_data ) {346 function pm_getPluginHeader( $file_data ) { 343 347 344 348 $default_headers = array( … … 356 360 ); 357 361 358 $plugin_data = _get_file_data( $file_data, $default_headers );362 $plugin_data = pm_get_file_data( $file_data, $default_headers ); 359 363 360 364 // Site Wide Only is the old header for Network … … 390 394 * @param array $all_headers The list of headers to search for in the file. 391 395 */ 392 function _get_file_data( $file_data, $all_headers ) {396 function pm_get_file_data( $file_data, $all_headers ) { 393 397 foreach ( $all_headers as $field => $regex ) { 394 398 preg_match( '/' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field}); 395 399 if ( !empty( ${$field} ) ) 396 ${$field} = __cleanup_header_comment( ${$field}[1] );400 ${$field} = pm_cleanup_header_comment( ${$field}[1] ); 397 401 else 398 402 ${$field} = ''; … … 413 417 * @return string 414 418 */ 415 function __cleanup_header_comment($str) {419 function pm_cleanup_header_comment($str) { 416 420 return trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $str)); 417 421 } -
blog-in-blog/trunk/readme.txt
r347784 r351820 4 4 Tags: categories, blog, hide, cms 5 5 Requires at least: 2.7.1 6 Tested up to: 3. 0.57 Stable tag: 1.0. 36 Tested up to: 3.1 7 Stable tag: 1.0.4 8 8 9 9 Create multiple blogs within a blog using a category. This plugin shows posts from a category on any page you like using shortcodes. … … 46 46 = Tips = 47 47 1. 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).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/` (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). 49 49 50 50 == Frequently Asked Questions == … … 58 58 59 59 As a minimum you need the following shortcode: 60 61 60 `[blog_in_blog category_id=_yourchosencategoryid_]` 62 61 63 62 or to save you typing `[blog_in_blog]` every time... 64 65 63 `[bib category_id=_yourchosencategoryid_]` 66 64 67 68 69 `_yourchosencategoryid_` must be a number. 65 The value used for `_yourchosencategoryid_` must be a number. 70 66 71 67 *Additional shortcode paramaters:* … … 84 80 - Default is always newest (DESC) first. 85 81 * `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) 87 83 1. Plugin directiry: `WP_CONTENT_DIR/plugins/blog-in-blog/<your filename>` 88 84 * `post_id=<a post id>` If specified only show a single post. All other parameters are ignored. … … 128 124 * French `fr_FR` - Stef Walter 129 125 126 The .pot file was extensively rewritten as of version 1.0.3. You may wish to send me your new translations? 127 130 128 == 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. 131 136 132 137 = 1.0.3 =
Note: See TracChangeset
for help on using the changeset viewer.