Plugin Directory

Changeset 514003


Ignore:
Timestamp:
03/03/2012 06:22:50 PM (14 years ago)
Author:
timhodson
Message:

Fixed more tag links

Location:
blog-in-blog
Files:
2 edited
4 copied

Legend:

Unmodified
Added
Removed
  • blog-in-blog/tags/1.1.1/blog-in-blog.php

    r448848 r514003  
    55  Plugin URI: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/
    66  Description: Create a blog within a blog using a category, post_type or tag. This plugin basically shows selected posts on a page using shortcodes.
    7   Version: 1.1
     7  Version: 1.1.1
    88  Author: Tim Hodson
    99  Author URI: http://timhodson.com
     
    3333
    3434if (!defined('BIB_VERSION'))
    35     define('BIB_VERSION', '1.1');
     35    define('BIB_VERSION', '1.1.1');
    3636
    3737// Pre-2.6 compatibility
     
    209209
    210210            $data['post_id'] = $post->ID;
     211            // Because some filters are not working in the same context as our individual posts,
     212            //  we need to track the current post id in a global variable!
     213            $blog_in_blog_opts['current_post_id'] = $post->ID;
    211214
    212215            $data['post_date'] = date_i18n($blog_in_blog_opts['date_format'], strtotime($post->post_date));
     
    346349        // adjust the offsett
    347350        if($blog_in_blog_opts['hidefirst'] != '' ){
    348             $params['offset'] = intval($blog_in_blog_opts['hidefirst']) + intval($blog_in_blog_opts['offset']);
     351            if($blog_in_blog_opts['offset'] != ''){
     352                $params['offset'] = intval($blog_in_blog_opts['hidefirst']) + intval($blog_in_blog_opts['offset']);
     353            } else {
     354                $params['offset'] = intval($blog_in_blog_opts['hidefirst']);
     355            }
    349356        }else{
    350357            $params['offset'] = $blog_in_blog_opts['offset'];
     
    648655}
    649656
     657/**
     658 * We need to know the post id of the post we are dealing with and not
     659 * the post of the page containing the BIB shortcode, so have a global being
     660 * reset with the current post id each time.
     661 */
    650662add_filter('excerpt_more', 'bib_filter_excerpt_more' , 99 ,2);
    651663function bib_filter_excerpt_more($more, $excerpt=''){
    652664    //$more isn't actually used, because we want to dump whatever has been applied to more already, and use our own.
    653665    global $post ;
     666    global $blog_in_blog_opts ;
    654667    bib_write_debug(__FUNCTION__, "Using excerpt more filter");
    655     $output = "$excerpt <a href=\"" . get_permalink($post->ID). "#more-{$post->ID}'\" class=\"more-link\">".get_option('bib_more_link_text')."</a>";
     668
     669    bib_write_debug(__FUNCTION__, "The permalink from wordpress is: ".get_permalink($blog_in_blog_opts['current_post_id']));
     670    bib_write_debug(__FUNCTION__, "The post ID is: ".$blog_in_blog_opts['current_post_id']);
     671
     672    $output = "$excerpt <a href=\"" . get_permalink($blog_in_blog_opts['current_post_id'])  . "#more-{$blog_in_blog_opts['current_post_id']}'\" class=\"more-link\">".get_option('bib_more_link_text')."</a>";
    656673    bib_write_debug(__FUNCTION__, "Generated this link:{$output}");
    657674
     
    11221139function bib_write_debug($function, $msg) {
    11231140    global $blog_in_blog_opts;
    1124    
    1125     $msg = "; " . $function . " :: ".$msg."\n" ;
    1126    
    1127     if(!isset ($blog_in_blog_opts['debug_output'])){
    1128         $blog_in_blog_opts['debug_output'] = "==================== Started Ouput ==================\n";
    1129         $blog_in_blog_opts['debug_output'] .= $msg."\n";
    1130     }
    1131     else {
    1132         $blog_in_blog_opts['debug_output'] .= $msg;
    1133     }
    1134    
     1141
     1142    $OPT = get_option('bib_debug');
     1143    if($OPT){
     1144        $msg = "; " . $function . " :: ".$msg."\n" ;
     1145
     1146        if(!isset ($blog_in_blog_opts['debug_output'])){
     1147            $blog_in_blog_opts['debug_output'] = "==================== Started Ouput ==================\n";
     1148            $blog_in_blog_opts['debug_output'] .= $msg."\n";
     1149        }
     1150        else {
     1151            $blog_in_blog_opts['debug_output'] .= $msg;
     1152        }
     1153    }
    11351154}
    11361155
  • blog-in-blog/tags/1.1.1/readme.txt

    r448848 r514003  
    44Tags: categories, blog, hide, cms
    55Requires at least: 3.0
    6 Tested up to: 3.2
    7 Stable tag: 1.1
     6Tested up to: 3.3.1
     7Stable tag: 1.1.1
    88
    99This plugin shows posts from a category on any page you like using shortcodes. Create multiple blogs within a blog using a category. Hode posts in a specific category from your homepage.
     
    193193== Changelog ==
    194194
     195= 1.1.1 =
     196
     197* Fixed: Read more links for post excerpts are now fixed.
     198* Fixed: Better calculation of offset if hidefirst n posts is used.
     199
    195200= 1.1 =
    196201
  • blog-in-blog/trunk/blog-in-blog.php

    r448848 r514003  
    55  Plugin URI: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/
    66  Description: Create a blog within a blog using a category, post_type or tag. This plugin basically shows selected posts on a page using shortcodes.
    7   Version: 1.1
     7  Version: 1.1.1
    88  Author: Tim Hodson
    99  Author URI: http://timhodson.com
     
    3333
    3434if (!defined('BIB_VERSION'))
    35     define('BIB_VERSION', '1.1');
     35    define('BIB_VERSION', '1.1.1');
    3636
    3737// Pre-2.6 compatibility
     
    209209
    210210            $data['post_id'] = $post->ID;
     211            // Because some filters are not working in the same context as our individual posts,
     212            //  we need to track the current post id in a global variable!
     213            $blog_in_blog_opts['current_post_id'] = $post->ID;
    211214
    212215            $data['post_date'] = date_i18n($blog_in_blog_opts['date_format'], strtotime($post->post_date));
     
    346349        // adjust the offsett
    347350        if($blog_in_blog_opts['hidefirst'] != '' ){
    348             $params['offset'] = intval($blog_in_blog_opts['hidefirst']) + intval($blog_in_blog_opts['offset']);
     351            if($blog_in_blog_opts['offset'] != ''){
     352                $params['offset'] = intval($blog_in_blog_opts['hidefirst']) + intval($blog_in_blog_opts['offset']);
     353            } else {
     354                $params['offset'] = intval($blog_in_blog_opts['hidefirst']);
     355            }
    349356        }else{
    350357            $params['offset'] = $blog_in_blog_opts['offset'];
     
    648655}
    649656
     657/**
     658 * We need to know the post id of the post we are dealing with and not
     659 * the post of the page containing the BIB shortcode, so have a global being
     660 * reset with the current post id each time.
     661 */
    650662add_filter('excerpt_more', 'bib_filter_excerpt_more' , 99 ,2);
    651663function bib_filter_excerpt_more($more, $excerpt=''){
    652664    //$more isn't actually used, because we want to dump whatever has been applied to more already, and use our own.
    653665    global $post ;
     666    global $blog_in_blog_opts ;
    654667    bib_write_debug(__FUNCTION__, "Using excerpt more filter");
    655     $output = "$excerpt <a href=\"" . get_permalink($post->ID). "#more-{$post->ID}'\" class=\"more-link\">".get_option('bib_more_link_text')."</a>";
     668
     669    bib_write_debug(__FUNCTION__, "The permalink from wordpress is: ".get_permalink($blog_in_blog_opts['current_post_id']));
     670    bib_write_debug(__FUNCTION__, "The post ID is: ".$blog_in_blog_opts['current_post_id']);
     671
     672    $output = "$excerpt <a href=\"" . get_permalink($blog_in_blog_opts['current_post_id'])  . "#more-{$blog_in_blog_opts['current_post_id']}'\" class=\"more-link\">".get_option('bib_more_link_text')."</a>";
    656673    bib_write_debug(__FUNCTION__, "Generated this link:{$output}");
    657674
     
    11221139function bib_write_debug($function, $msg) {
    11231140    global $blog_in_blog_opts;
    1124    
    1125     $msg = "; " . $function . " :: ".$msg."\n" ;
    1126    
    1127     if(!isset ($blog_in_blog_opts['debug_output'])){
    1128         $blog_in_blog_opts['debug_output'] = "==================== Started Ouput ==================\n";
    1129         $blog_in_blog_opts['debug_output'] .= $msg."\n";
    1130     }
    1131     else {
    1132         $blog_in_blog_opts['debug_output'] .= $msg;
    1133     }
    1134    
     1141
     1142    $OPT = get_option('bib_debug');
     1143    if($OPT){
     1144        $msg = "; " . $function . " :: ".$msg."\n" ;
     1145
     1146        if(!isset ($blog_in_blog_opts['debug_output'])){
     1147            $blog_in_blog_opts['debug_output'] = "==================== Started Ouput ==================\n";
     1148            $blog_in_blog_opts['debug_output'] .= $msg."\n";
     1149        }
     1150        else {
     1151            $blog_in_blog_opts['debug_output'] .= $msg;
     1152        }
     1153    }
    11351154}
    11361155
  • blog-in-blog/trunk/readme.txt

    r448848 r514003  
    44Tags: categories, blog, hide, cms
    55Requires at least: 3.0
    6 Tested up to: 3.2
    7 Stable tag: 1.1
     6Tested up to: 3.3.1
     7Stable tag: 1.1.1
    88
    99This plugin shows posts from a category on any page you like using shortcodes. Create multiple blogs within a blog using a category. Hode posts in a specific category from your homepage.
     
    193193== Changelog ==
    194194
     195= 1.1.1 =
     196
     197* Fixed: Read more links for post excerpts are now fixed.
     198* Fixed: Better calculation of offset if hidefirst n posts is used.
     199
    195200= 1.1 =
    196201
Note: See TracChangeset for help on using the changeset viewer.