summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2026-03-25 10:20:14 +0000
committerlsces <lester@lsces.co.uk>2026-03-25 10:20:14 +0000
commitf763de248d66c0e3686b3ded6017088370e5f421 (patch)
tree9d16c1818161711f4a3ec29e449d4b0d5097440b
parenteaf50adda987c0782daea8cd5a6c506b6db91db6 (diff)
downloadrss-f763de248d66c0e3686b3ded6017088370e5f421.tar.gz
rss-f763de248d66c0e3686b3ded6017088370e5f421.tar.bz2
rss-f763de248d66c0e3686b3ded6017088370e5f421.zip
Smarty5 code tidies for templates
-rw-r--r--modules/mod_rss_feed.php16
-rw-r--r--templates/admin_rss.tpl6
-rw-r--r--templates/rss.tpl2
3 files changed, 12 insertions, 12 deletions
diff --git a/modules/mod_rss_feed.php b/modules/mod_rss_feed.php
index b94240b..035fe29 100644
--- a/modules/mod_rss_feed.php
+++ b/modules/mod_rss_feed.php
@@ -7,27 +7,28 @@
/**
* required setup
*/
+use Bitweaver\RSS\RSSLib;
global $rsslib;
-require_once( RSS_PKG_PATH.'rss_lib.php' );
+$rsslib = new RSSLib;
extract( $moduleParams );
-$listHash = Array();
+$listHash = [];
$listHash['id'] = $module_params['id'];
$listHash['cache_time'] = !empty($cache_time)?$cache_time:1;
if ( $items = $rsslib->parse_feeds( $listHash ) ){
- $_template->tpl_vars['modRSSItems'] = new Smarty_variable( $items );
+ $_template->assign( 'modRSSItems', $items );
//if we want short descriptions get them
- $shortdescs = Array();
+ $shortdescs = [];
if ( !empty($module_params['desc_length']) && is_numeric($module_params['desc_length']) && !empty($items)){
$shortdescs = $rsslib->get_short_descs( $items, $module_params['desc_length'] );
}
- $_template->tpl_vars['short_desc'] = new Smarty_variable( $shortdescs );
+ $_template->assign( 'short_desc', $shortdescs );
//if desc is set and no desc_length is given then we present the full description/content of each item
$hideDesc = TRUE;
@@ -35,9 +36,8 @@ if ( $items = $rsslib->parse_feeds( $listHash ) ){
$hideDesc = FALSE;
}
- $_template->tpl_vars['hideDesc'] = new Smarty_variable( $hideDesc );
+ $_template->assign( 'hideDesc', $hideDesc );
$max = !empty( $module_params['max'] ) ? $module_params['max'] : 10;
- $_template->tpl_vars['max'] = new Smarty_variable( $max );
+ $_template->assign( 'max', $max );
}
-?>
diff --git a/templates/admin_rss.tpl b/templates/admin_rss.tpl
index 68ccb0d..5db2cdd 100644
--- a/templates/admin_rss.tpl
+++ b/templates/admin_rss.tpl
@@ -13,7 +13,7 @@
{assign var="rss_max" value="`$pkg_rss`_max_records"}
{assign var="rss_title" value="`$pkg_rss`_title"}
{assign var="rss_description" value="`$pkg_rss`_description"}
- {formhelp note=$output.note}
+ {formhelp note=$output.note|default:''}
{/forminput}
</div>
@@ -73,7 +73,7 @@
{formlabel label=$output.label for=$setting}
{forminput}
<input type="text" name="{$setting}" id="{$setting}" size="50" value="{$gBitSystem->getConfig($setting)}" />
- {formhelp note=$output.note}
+ {formhelp note=$output.note|default:''}
{/forminput}
</div>
{/foreach}
@@ -83,7 +83,7 @@
{formlabel label=$output.label for=$item}
{forminput}
{html_checkboxes name="$item" values="y" checked=$gBitSystem->getConfig($item) labels=false id=$item}
- {formhelp note=$output.note page=$output.page}
+ {formhelp note=$output.note|default:'' page=$output.page|default:''}
{/forminput}
</div>
{/foreach}
diff --git a/templates/rss.tpl b/templates/rss.tpl
index 93abadf..98cfbac 100644
--- a/templates/rss.tpl
+++ b/templates/rss.tpl
@@ -7,7 +7,7 @@
<div class="body">
{form}
{legend legend="Syndication Feeds"}
- {if $feedlink.url}
+ {if !empty($feedlink.url)}
<div id="rssid" class="fade-000000 row">
{formlabel label="Requested Feed"}
{forminput}