From 00a38a4be58467654794db404bb7ee69382072fe Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Sat, 16 May 2026 18:55:57 +0100 Subject: Extend recent_blogs to allow Read More to create a pop-up of the full post --- includes/classes/BitBlogPost.php | 2 +- includes/display_bitblogpost_inc.php | 2 +- recent_posts.php | 9 ++------- templates/blog_list_post.tpl | 16 +++++++++------- templates/center_list_blog_posts.tpl | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 16 deletions(-) diff --git a/includes/classes/BitBlogPost.php b/includes/classes/BitBlogPost.php index 81f41c7..4cbc069 100755 --- a/includes/classes/BitBlogPost.php +++ b/includes/classes/BitBlogPost.php @@ -948,7 +948,7 @@ class BitBlogPost extends LibertyMime { $res['post_url'] = BitBlogPost::getDisplayUrlFromHash( $res ); $res['display_url'] = $res['post_url']; $res['display_link'] = $this->getDisplayLink( $res['title'], $res ); - $res['blogs'] = $this->getBlogMemberships( $res ); + $res['blogs'] = $this->getBlogMemberships( $res['content_id'] ); // trackbacks if($res['trackbacks_from']!=null) diff --git a/includes/display_bitblogpost_inc.php b/includes/display_bitblogpost_inc.php index 4844b6e..2633c9f 100755 --- a/includes/display_bitblogpost_inc.php +++ b/includes/display_bitblogpost_inc.php @@ -84,7 +84,7 @@ $gBitSmarty->assign('parsed_data', $parsed_data); $gBitSmarty->assign('post_info', $gContent->mInfo ); // Display the template -if ( isset( $_REQUEST['output'] ) && $_REQUEST['output']="ajax"){ +if ( isset( $_REQUEST['output'] ) && $_REQUEST['output'] == "ajax"){ $gBitSystem->display( 'bitpackage:blogs/view_blog_post_xml.tpl', null, [ 'format' => 'center_only', 'display_mode' => 'display' ] ); }else{ $gBitSystem->display( 'bitpackage:blogs/view_blog_post.tpl' , null, [ 'display_mode' => 'display' ] ); diff --git a/recent_posts.php b/recent_posts.php index e48cccf..73072da 100755 --- a/recent_posts.php +++ b/recent_posts.php @@ -19,13 +19,8 @@ require_once BLOGS_PKG_INCLUDE_PATH.'lookup_blog_inc.php'; // Is package installed and enabled $gBitSystem->verifyPackage( 'blogs' ); -// Now check permissions to access this page -// $gContent->verifyViewPermission(); - -if ( $gBitSystem->isFeatureActive( 'blog_ajax_more' ) && $gBitThemes->isJavascriptEnabled() ){ - $gBitSmarty->assign('ajax_more', true); - $gBitThemes->loadAjax( 'mochikit', [ 'Iter.js', 'DOM.js', 'Style.js', 'Color.js', 'Position.js', 'Visual.js' ] ); -} +// Now check permissions to access this page - global check only, no specific blog loaded here +$gBitUser->verifyPermission( 'p_blogs_view' ); // Display the template $gDefaultCenter = 'bitpackage:blogs/center_list_blog_posts.tpl'; diff --git a/templates/blog_list_post.tpl b/templates/blog_list_post.tpl index fd7c337..9c05bab 100755 --- a/templates/blog_list_post.tpl +++ b/templates/blog_list_post.tpl @@ -26,6 +26,13 @@ {/if}
+ {if $showBlogTitle eq 'y' && $aPost.blogs} +
+ {foreach from=$aPost.blogs item=memberBlog key=blogContentId name=blogTitleLoop} + {if !$smarty.foreach.blogTitleLoop.first} • {/if}{$memberBlog.title|escape} + {/foreach} +
+ {/if}

{if $aPost.title} {$aPost.title|escape:html} @@ -44,7 +51,7 @@ {/if}
{$aPost.publish_date|default:$aPost.created|bit_long_date}
- {if count($aPost.blogs) > 0} + {if $showBlogTitle ne 'y' && count($aPost.blogs) > 0} {tr}Posted to{/tr}  {foreach from=$aPost.blogs item=memberBlog key=blogContentId name=memberBlogLoop} {$memberBlog.title}{if $smarty.foreach.memberBlogLoop.total > 1 && !$smarty.foreach.memberBlogLoop.last }, {/if} @@ -71,7 +78,6 @@ {if $showDescriptionsOnly} {$aPost.summary|default:$aPost.parsed_description} - {if $ajax_more}
{/if} {else} {$aPost.parsed_data} {/if} @@ -90,11 +96,7 @@ {if $showDescriptionsOnly && $aPost.has_more} {if $spacer}  •  {/if} {assign var=spacer value=true} - {if $ajax_more} - {tr}Read More{/tr} - {else} - {tr}Read More…{/tr} - {/if} + {tr}Read More…{/tr} {/if} {if $aPost.trackbacks_from_count}({tr}referenced by{/tr}: {$aPost.trackbacks_from_count} {tr}posts{/tr} / {tr}references{/tr}: {$aPost.trackbacks_to_count} {tr}posts{/tr}){/if} diff --git a/templates/center_list_blog_posts.tpl b/templates/center_list_blog_posts.tpl index 5c380e8..b456951 100755 --- a/templates/center_list_blog_posts.tpl +++ b/templates/center_list_blog_posts.tpl @@ -35,4 +35,37 @@ {*minifind sort_mode=$sort_mode*}

+ + + {/if} -- cgit v1.3