From f0d0bd6451fc0fc08c919a2208a9ac6bee3657a1 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Sat, 16 May 2026 16:08:07 +0100 Subject: Access blog posts history which is all contained in the database already --- templates/blog_list_post.tpl | 1 + templates/post_history.tpl | 120 +++++++++++++++++++++++++++++++++++++++++++ templates/view_blog_post.tpl | 1 + 3 files changed, 122 insertions(+) create mode 100644 templates/post_history.tpl (limited to 'templates') diff --git a/templates/blog_list_post.tpl b/templates/blog_list_post.tpl index c77e1ff..fd7c337 100755 --- a/templates/blog_list_post.tpl +++ b/templates/blog_list_post.tpl @@ -19,6 +19,7 @@ {if ($aPost.ownsblog eq 'y') || ($gBitUser->mUserId && $aPost.user_id eq $gBitUser->mUserId) || $gBitUser->hasPermission( 'p_blogs_admin' )} {booticon iname="icon-edit" ipackage="icons" iexplain="edit"} + {booticon iname="fa-clock" iexplain="History"} {booticon iname="icon-trash" ipackage="icons" iexplain="delete"} {/if} diff --git a/templates/post_history.tpl b/templates/post_history.tpl new file mode 100644 index 0000000..beacc2f --- /dev/null +++ b/templates/post_history.tpl @@ -0,0 +1,120 @@ +{strip} +
+
+

{tr}History of{/tr} {$gContent->mInfo.title|escape}

+
+ +
+ {if $version} +

{tr}Version{/tr} {$version}

+ {/if} + + {if $smarty.request.preview ?? false} + {include file="bitpackage:blogs/blog_post.tpl"} + {/if} + + {if $source} +
{$sourcev}
+ {/if} + + {if $compare eq 'y'} + + + + + + + + + + +
{tr}Comparing versions{/tr}
{tr}Version {$version_from}{/tr} + {tr}Current version{/tr} +
{$diff_from}
 
{$diff_to}
+ {/if} + + {if $diff2 eq 'y'} +

{tr}Differences from version{/tr} {$version_from} to {$version_to}

+ + {if $gContent->mInfo.format_guid eq 'bithtml'} + {$diffdata|html_entity_decode} + {else} + {$diffdata} + {/if} + + {/if} + + {form} + + + + + + + + + + + + + + + + + + + + + + + + {foreach from=$data item=item} + + + + + + + + + + + {foreachelse} + + + + {/foreach} +
{tr}Post History{/tr}
{tr}Date{/tr}/{tr}Comment{/tr}{tr}User{/tr}{tr}IP{/tr}{tr}Version{/tr}
+ {$gContent->mInfo.last_modified|bit_short_datetime} +
+ {$gContent->mInfo.edit_comment|escape|default:"—"} +
{displayname link_label=$gContent->mInfo.modifier_real_name user=$gContent->mInfo.modifier_user user_id=$gContent->mInfo.modifier_user_id real_name=$gContent->mInfo.modifier_real_name}{$gContent->mInfo.ip}{$gContent->mInfo.version}
+ {tr}Current{/tr} +  • {smartlink ititle="Source" content_id=$gContent->mInfo.content_id source="current"} +
{displayname hash=$item link_label=$item.modifier_real_name}{$item.ip}{$item.version}
+ {smartlink ititle="View" content_id=$gContent->mInfo.content_id preview=$item.version} +  • {smartlink ititle="Compare" content_id=$gContent->mInfo.content_id compare=$item.version} +  • {smartlink ititle="Difference" content_id=$gContent->mInfo.content_id diff2=$item.version} +  • {smartlink ititle="Source" content_id=$gContent->mInfo.content_id source=$item.version} + {if $gBitUser->hasPermission( 'p_blogs_update' )} +  • {smartlink ititle="Rollback" content_id=$gContent->mInfo.content_id rollback=$item.version} + {/if} + + {if $gBitUser->hasPermission( 'p_blogs_admin' )} + + {/if} +
+ {tr}No records found{/tr} +
+ + {if $gBitUser->hasPermission( 'p_blogs_admin' )} +
+ +
+ {/if} + {/form} + + {pagination content_id=$gContent->mInfo.content_id} +
+
+{/strip} diff --git a/templates/view_blog_post.tpl b/templates/view_blog_post.tpl index 05a7170..d1c8f52 100755 --- a/templates/view_blog_post.tpl +++ b/templates/view_blog_post.tpl @@ -38,6 +38,7 @@ {if $gContent->hasUpdatePermission()} {booticon iname="icon-edit" ipackage="icons" iexplain="edit"} + {booticon iname="fa-clock" iexplain="History"} {/if} {if $gContent->hasUserPermission( 'p_blogs_admin' )} {booticon iname="icon-trash" ipackage="icons" iexplain="delete"} -- cgit v1.3