diff options
| author | lsces <lester@lsces.co.uk> | 2026-03-27 16:05:33 +0000 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2026-03-27 16:05:33 +0000 |
| commit | 821f398456201e21fef4d29f6804ca0d1f8b0ea5 (patch) | |
| tree | d74e0ee3dc307902982f8f65cd79f2ac04cc6f76 | |
| parent | 9eccb7e00e9fcd715efe54812237eba20be5009e (diff) | |
| download | articles-821f398456201e21fef4d29f6804ca0d1f8b0ea5.tar.gz articles-821f398456201e21fef4d29f6804ca0d1f8b0ea5.tar.bz2 articles-821f398456201e21fef4d29f6804ca0d1f8b0ea5.zip | |
Figured what has been causing a problem with using && and || in smarty templates and related to mistake in processing {2} elements that should use curly brackets and not revert to square ones.
| -rwxr-xr-x | templates/article_display.tpl | 10 | ||||
| -rwxr-xr-x | templates/article_filter_inc.tpl | 2 | ||||
| -rwxr-xr-x | templates/edit_article.tpl | 6 | ||||
| -rwxr-xr-x | templates/html_head_inc.tpl | 2 | ||||
| -rwxr-xr-x | templates/list_articles.tpl | 8 |
5 files changed, 14 insertions, 14 deletions
diff --git a/templates/article_display.tpl b/templates/article_display.tpl index b457631..637726d 100755 --- a/templates/article_display.tpl +++ b/templates/article_display.tpl @@ -35,20 +35,20 @@ {/if} </div> - <div class="body"{if $gBitUser->getPreference( 'users_double_click' ) and $gContent->hasUpdatePermission()} ondblclick="location.href='{$smarty.const.ARTICLES_PKG_URL}edit.php?article_id={$article.article_id}';"{/if}> + <div class="body"{if $gBitUser->getPreference( 'users_double_click' ) && $gContent->hasUpdatePermission()} ondblclick="location.href='{$smarty.const.ARTICLES_PKG_URL}edit.php?article_id={$article.article_id}';"{/if}> <div class="content"> {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$article} {* deal with the article image if there is one *} {if $article.show_image eq 'y' && ( $article.thumbnail_url || $article.primary_attachment )} <div class="image"> {assign var=size value=$gBitSystem->getConfig('articles_image_size','small')} - {if $showDescriptionsOnly and $article.has_more}<a href="{$article.display_url}">{/if} + {if $showDescriptionsOnly && $article.has_more}<a href="{$article.display_url}">{/if} {if $article.primary_attachment} {include file=$gLibertySystem->getMimeTemplate('inline',$article.primary_attachment.attachment_plugin_guid) attachment=$article.primary_attachment thumbsize=$size} {else} <img class="icon" alt="{$article.topic_name|default:$article.title|escape}" title="{$article.topic_name|default:$article.title|escape}" src="{$article.thumbnail_url}"/> {/if} - {if $showDescriptionsOnly and $article.has_more}</a>{/if} + {if $showDescriptionsOnly && $article.has_more}</a>{/if} </div> {/if} @@ -82,7 +82,7 @@ {$article.hits|default:0} {tr}reads{/tr} {/if} - {if $showDescriptionsOnly and $article.has_more} + {if $showDescriptionsOnly && $article.has_more} {if $spacer} • {/if} {assign var=spacer value=TRUE} <a class="more" href="{$article.display_url}">{tr}Read More…{/tr}</a> @@ -122,7 +122,7 @@ </div><!-- end .body --> </div><!-- end .article --> -{if $print_page ne 'y' and $article.allow_comments eq 'y' and !$preview && !$showDescriptionsOnly and $article.status_id eq $smarty.const.ARTICLE_STATUS_APPROVED} +{if $print_page ne 'y' && $article.allow_comments eq 'y' && !$preview && !$showDescriptionsOnly && $article.status_id eq $smarty.const.ARTICLE_STATUS_APPROVED} {include file="bitpackage:liberty/comments.tpl"} {/if} diff --git a/templates/article_filter_inc.tpl b/templates/article_filter_inc.tpl index ce6b8ee..4b5a9db 100755 --- a/templates/article_filter_inc.tpl +++ b/templates/article_filter_inc.tpl @@ -1,4 +1,4 @@ -{if ( $gBitUser->isAdmin() || $gBitUser->hasPermission( 'p_articles_admin' ) ) and $gBitSystem->isFeatureActive( 'articles_display_filter_bar' ) and $filter} +{if ( $gBitUser->isAdmin() || $gBitUser->hasPermission( 'p_articles_admin' ) ) && $gBitSystem->isFeatureActive( 'articles_display_filter_bar' ) && $filter} {form} <table class="optionbar"> <caption>{tr}Article Filter{/tr}</caption> diff --git a/templates/edit_article.tpl b/templates/edit_article.tpl index 6f27f40..d55b5ad 100755 --- a/templates/edit_article.tpl +++ b/templates/edit_article.tpl @@ -50,7 +50,7 @@ {/forminput} </div> - {if $topics or $gContent->hasUserPermission( 'p_articles_admin' )} + {if $topics || $gContent->hasUserPermission( 'p_articles_admin' )} <div class="form-group"> {formlabel label="Topic" for="topic_id"} {forminput} @@ -58,7 +58,7 @@ <select name="topic_id" id="topic_id"> <option value="">{tr}None{/tr}</option> {section name=t loop=$topics} - <option value="{$topics[t].topic_id}" {if $article.topic_id eq $topics[t].topic_id or $topic eq $topics[t].topic_name}selected="selected"{/if}>{$topics[t].topic_name|escape}</option> + <option value="{$topics[t].topic_id}" {if $article.topic_id eq $topics[t].topic_id || $topic eq $topics[t].topic_name}selected="selected"{/if}>{$topics[t].topic_name|escape}</option> {/section} </select> {else} @@ -95,7 +95,7 @@ <select name="rating" id="rating"> <option value="5" {if $article.rating eq 5}selected="selected"{/if}>{tr}5{/tr}</option> <option value="4" {if $article.rating eq 4}selected="selected"{/if}>{tr}4{/tr}</option> - <option value="3" {if $article.rating eq 3 or !$article.rating}selected="selected"{/if}>{tr}3{/tr}</option> + <option value="3" {if $article.rating eq 3 || !$article.rating}selected="selected"{/if}>{tr}3{/tr}</option> <option value="2" {if $article.rating eq 2}selected="selected"{/if}>{tr}2{/tr}</option> <option value="1" {if $article.rating eq 1}selected="selected"{/if}>{tr}1{/tr}</option> </select> diff --git a/templates/html_head_inc.tpl b/templates/html_head_inc.tpl index 76826a7..93a7177 100755 --- a/templates/html_head_inc.tpl +++ b/templates/html_head_inc.tpl @@ -1,6 +1,6 @@ {* $Header$ *} {strip} -{if $gBitSystem->isPackageActive( 'rss' ) and $gBitSystem->isFeatureActive( 'articles_rss' ) and $gBitSystem->getActivePackage() eq 'articles' and $gBitUser->hasPermission( 'p_articles_read' )} +{if $gBitSystem->isPackageActive( 'rss' ) && $gBitSystem->isFeatureActive( 'articles_rss' ) && $gBitSystem->getActivePackage() eq 'articles' && $gBitUser->hasPermission( 'p_articles_read' )} <link rel="alternate" type="application/rss+xml" title="{$gBitSystem->getConfig('articles_rss_title',"{tr}Articles{/tr} RSS")}" href="{$smarty.const.ARTICLES_PKG_URL}articles_rss.php?version={$gBitSystem->getConfig('rssfeed_default_version',0)}" /> {/if} {/strip} diff --git a/templates/list_articles.tpl b/templates/list_articles.tpl index a243f5b..5c970ca 100755 --- a/templates/list_articles.tpl +++ b/templates/list_articles.tpl @@ -89,9 +89,9 @@ {tr}Created by{/tr}: {displayname user_id=$article.user_id} {/if} - {if $gBitSystem->isFeatureActive( 'articles_list_date' ) or $gBitSystem->isFeatureActive( 'articles_list_expire' )}<br />{/if} + {if $gBitSystem->isFeatureActive( 'articles_list_date' ) || $gBitSystem->isFeatureActive( 'articles_list_expire' )}<br />{/if} - {if $gBitSystem->isFeatureActive( 'articles_list_date' ) and $gBitSystem->isFeatureActive( 'articles_list_expire' )} + {if $gBitSystem->isFeatureActive( 'articles_list_date' ) && $gBitSystem->isFeatureActive( 'articles_list_expire' )} {tr}Displayed from <strong>{$article.publish_date|bit_short_datetime}</strong> until <strong>{$article.expire_date|bit_short_datetime}</strong>{/tr} {elseif $gBitSystem->isFeatureActive( 'articles_list_date' )} {tr}Displayed from <strong>{$article.publish_date|bit_short_datetime}</strong>{/tr} @@ -133,11 +133,11 @@ <td style="text-align:right;">{$article.hits}</td> {/if} <td style="text-align:right;"> - {if $article.status_id eq $smarty.const.ARTICLE_STATUS_PENDING and $gBitUser->hasPermission( 'p_articles_approve_submission' )} + {if $article.status_id eq $smarty.const.ARTICLE_STATUS_PENDING && $gBitUser->hasPermission( 'p_articles_approve_submission' )} {smartlink ititle="Approve Article" booticon="icon-ok" sort_mode=$sort_mode status_id=$smarty.request.status_id article_id=$article.article_id content_id=$article.content_id set_status_id=$smarty.const.ARTICLE_STATUS_APPROVED action=approve} {/if} - {if $gBitUser->hasPermission( 'p_articles_update' ) or ( $article.author eq $user and $article.creator_edit eq 'y' )} + {if $gBitUser->hasPermission( 'p_articles_update' ) || ( $article.author eq $user && $article.creator_edit eq 'y' )} {smartlink ititle="Edit" ifile="edit.php" booticon="icon-edit" article_id=$article.article_id} {/if} |
