From 47b2cdebaeab8a69e5bd98cbc48d036b6e2afab5 Mon Sep 17 00:00:00 2001 From: mambax7 Date: Thu, 12 Aug 2021 03:48:37 -0400 Subject: [PATCH 1/4] PHP8 Smarty defaults --- templates/adslight_category.tpl | 22 +++++++++--------- templates/adslight_index.tpl | 10 ++++----- templates/adslight_item.tpl | 31 +++++++++++++------------- templates/adslight_maps.tpl | 2 +- templates/adslight_members.tpl | 31 ++++++++++++++------------ templates/adslight_menu.tpl | 2 +- templates/adslight_replies.tpl | 6 ++--- templates/adslight_search.tpl | 9 ++++---- templates/adslight_tips_writing_ad.tpl | 2 +- templates/adslight_view_photos.tpl | 12 +++++----- 10 files changed, 64 insertions(+), 63 deletions(-) diff --git a/templates/adslight_category.tpl b/templates/adslight_category.tpl index 5478267..26cb597 100644 --- a/templates/adslight_category.tpl +++ b/templates/adslight_category.tpl @@ -3,7 +3,7 @@ <{/if}> <{include file='db:adslight_search.tpl'}>
-<{$select_go_cats}> +<{$select_go_cats|default:''}>

<{$cat_title}><{$Feed_RSS_cat}>

<{$category_path}>

@@ -11,7 +11,7 @@ - <{if $lang_subcat}> + <{if $lang_subcat|default:''}>
<{$lang_subcat}> @@ -27,7 +27,7 @@
- <{foreach item=subcat from=$subcategories}> + <{foreach item=subcat from=$subcategories|default:null}> <{/if}> <{/if}> <{/foreach}>
@@ -54,7 +54,7 @@
- <{if $lang_subcat}> + <{if $lang_subcat|default:''}> <{if $adslight_use_catscode == 1}> <{$adslight_cats_code}> <{/if}> @@ -67,7 +67,7 @@
- <{if $show_nav == true}> + <{if $show_nav|default:false == true}>
<{$lang_sortby}> <{$lang_title}> @@ -86,7 +86,7 @@ <{$lang_cursortedby}>
<{/if}> -
<{$nav_page}>
+
<{$nav_page|default:false}>
<{if $use_extra_code == 1}> <{foreach from=$items item=item name=items}> <{if $smarty.foreach.items.iteration eq $index_code_place}> @@ -111,7 +111,7 @@
- <{if $item.photo}> + <{if $item.photo|default:''}> <{$item.photo}> <{else}> <{$item.no_photo}> @@ -143,7 +143,7 @@ - <{if $item.photo}> + <{if $item.photo|default:''}> <{$item.photo}> <{else}> <{$item.no_photo}> @@ -157,7 +157,7 @@ <{$item.price}> - <{$item.price_typeprice}> <{else}>  <{/if}>
- <{if $item.sold}><{$item.sold}><{/if}> + <{if $item.sold|default:''}><{$item.sold}><{/if}>
<{$item.local}> @@ -165,7 +165,7 @@
- <{/if}><{if !$lang_subcat}><{if !$item}> + <{/if}><{if !$lang_subcat|default:''}><{if !$item}>
<{$not_adds_in_this_cat}>

@@ -175,7 +175,7 @@

<{$category_path}> -

<{$nav_page}>
+

<{$nav_page|default:false}>
<{include file='db:system_notification_select.tpl'}>

diff --git a/templates/adslight_index.tpl b/templates/adslight_index.tpl index 1d5bc72..5098430 100644 --- a/templates/adslight_index.tpl +++ b/templates/adslight_index.tpl @@ -6,7 +6,7 @@ - <{foreach item=category from=$categories}> + <{foreach item=category from=$categories|default:null}> <{/if}>
<{if $category.image != ""}> <{$category.image}> @@ -75,7 +75,7 @@ - <{if $item.photo}> + <{if $item.photo|default:''}> <{$item.photo}> <{else}> <{$item.no_photo}> @@ -98,7 +98,7 @@
<{/foreach}><{else}> - <{foreach item=item from=$items}> + <{foreach item=item from=$items|default:null}> <{if $xoops_isadmin}> <{/if}> <{/if}> <{/if}><{/if}> @@ -63,7 +62,7 @@
@@ -106,7 +106,7 @@ - <{if $item.photo}> + <{if $item.photo|default:''}> <{$item.photo}> <{else}> <{$item.no_photo}> @@ -120,7 +120,7 @@ <{$item.price}> - <{$item.price_typeprice}> <{else}>  <{/if}>
- <{if $item.sold}><{$item.sold}><{/if}> + <{if $item.sold|default:false}><{$item.sold}><{/if}>
<{$item.local}> diff --git a/templates/adslight_item.tpl b/templates/adslight_item.tpl index ac12852..7c84c4b 100644 --- a/templates/adslight_item.tpl +++ b/templates/adslight_item.tpl @@ -11,11 +11,11 @@

<{$title}>

<{$type}> <{$price_price}> - <{$price_typeprice}> - <{$usure_typeusure}>  - <{$admin}> + <{$price_typeprice}> - <{$user_typeuser|default:''}>  + <{$admin|default:false}>

- <{if $sold}> + <{if $sold|default:false}>
<{$sold}>
@@ -30,7 +30,7 @@

<{if $photo != "0"}> - <{section name=i loop=$pics_array}> + <{section name=i loop=$pics_array|default:null}> <{/if}> <{if $xoops_isuser}> - <{if $adslight_active_xpayement == 1 }> + <{if $adslight_active_xpayement|default:false == 1 }> <{if $purchasable && !$sold && $price_amount > 0}> <{include file="db:adslight_xpayment_form.tpl"}> - +
- <{$date}>
+ <{$date|default:false}>
<{$local_head}> <{$local_town}>
<{$country_head}> <{$local_country}>

@@ -72,9 +71,9 @@ <{$printA}>
<{$friend}>

- <{$add_photos}>
- <{$modifyads}>
- <{$deleteads}>
+ <{$add_photos|default:false}>
+ <{$modifyads|default:false}>
+ <{$deleteads|default:false}>
<{$alerteabus}>

<{if $local_country}> @@ -90,15 +89,15 @@
- <{$commentsnav}> - <{$lang_notice}> + <{$commentsnav|default:false}> + <{$lang_notice|default:false}>
- <{if $comment_mode == "flat"}> + <{if $comment_mode|default:false == "flat"}> <{include file="db:system_comments_flat.tpl"}> - <{elseif $comment_mode == "thread"}> + <{elseif $comment_mode|default:false == "thread"}> <{include file="db:system_comments_thread.tpl"}> - <{elseif $comment_mode == "nest"}> + <{elseif $comment_mode|default:false == "nest"}> <{include file="db:system_comments_nest.tpl"}> <{/if}>
diff --git a/templates/adslight_maps.tpl b/templates/adslight_maps.tpl index b30b6ce..fa27f84 100644 --- a/templates/adslight_maps.tpl +++ b/templates/adslight_maps.tpl @@ -23,6 +23,6 @@ -

<{$nav_page}>
+

<{$nav_page|default:false}>
<{include file='db:system_notification_select.tpl'}>
diff --git a/templates/adslight_members.tpl b/templates/adslight_members.tpl index 9dae42f..7ac9621 100644 --- a/templates/adslight_members.tpl +++ b/templates/adslight_members.tpl @@ -7,42 +7,41 @@ <{$nav_main}> - <{$all_user_listings}><{$submitter}> + <{$all_user_listings}><{$submitter|default:''}>
-<{if $istheirs == "1"}><{if $rate !='0'}> +<{if $istheirs|default:'' == "1"}><{if $rate !='0'}> <{$lang_user_rating}> <{$rating}> (<{$user_votes}>)<{/if}><{else}> <{if $rate !='0'}><{$lang_user_rating}> <{$rating}> (<{$user_votes}>)
- > - " rel="nofollow"><{$lang_ratethisuser}><{/if}> + <{$lang_ratethisuser}><{/if}> <{/if}> -

<{$nav_page}>

+

<{$nav_page|default:false}>

- <{if $isadmin}> + <{if $isadmin|default:''}> <{/if}> - <{if $istheirs}><{if $permit}> + <{if $istheirs|default:''}><{if $permit}> <{/if}><{/if}> - <{if $istheirs}> + <{if $istheirs|default:''}> <{/if}> - - <{if $istheirs}><{if $permit}> + + <{if $istheirs|default:''}><{if $permit}> <{/if}><{/if}> - <{foreach item=item from=$items}> + <{foreach item=item from=$items|default:null}> > <{if $isadmin}> <{/if}> @@ -52,8 +51,12 @@ <{/if}><{/if}> *}> + <{$type}>
<{$priceHtml|default:''}> + <{if $item.sold}><{$item.sold}><{/if}>
<{if $istheirs}> @@ -73,7 +76,7 @@
<{$status_head}><{$title_head}><{$edit_ad}><{$expires_head}><{$local_head}><{$local_head|default:''}><{$replies_head}><{$views_head}>
<{$item.adminlink}><{$item.status}><{$item.title}> <{$item.new}>
- <{$item.type}>
- <{$item.price}> <{$money_sign}> <{$item.typeprice}>

+<{* <{$item.type}>
*}> +<{* <{$item.price}> <{$money_sign}> <{$item.typeprice}>

*}> + +<{*
<{$type}>
-

<{$nav_page}>

+

<{$nav_page|default:false}>

<{$comments_head}>
diff --git a/templates/adslight_menu.tpl b/templates/adslight_menu.tpl index 4f2aaa9..831b203 100644 --- a/templates/adslight_menu.tpl +++ b/templates/adslight_menu.tpl @@ -24,7 +24,7 @@   <{else}> - <{$smarty.const._ADSLIGHT_ADD_TITLEMENU1}>   diff --git a/templates/adslight_replies.tpl b/templates/adslight_replies.tpl index 96c0a33..7571e9a 100644 --- a/templates/adslight_replies.tpl +++ b/templates/adslight_replies.tpl @@ -9,7 +9,7 @@


- <{$nav_page}> + <{$nav_page|default:false}>

<{foreach item=item from=$items}> @@ -21,7 +21,7 @@ <{$submitter_head}>  <{$submitter}>

- <{$date_head}>  <{$item.date}>

+ <{$date_head}>  <{$item.date_created}>

<{$email_head}>  <{$email}>

@@ -40,7 +40,7 @@ <{/foreach}>
- <{$nav_page}> + <{$nav_page|default:false}>

<{else}> diff --git a/templates/adslight_search.tpl b/templates/adslight_search.tpl index bfd43e7..6a512a6 100644 --- a/templates/adslight_search.tpl +++ b/templates/adslight_search.tpl @@ -2,7 +2,7 @@ <{$add_from_title}> <{$add_from_sitename}> - <{if $moderated}> + <{if $moderated|default:false}> <{if $xoops_isadmin}> @@ -65,8 +65,7 @@ diff --git a/templates/adslight_tips_writing_ad.tpl b/templates/adslight_tips_writing_ad.tpl index 2bf999a..f64d0ff 100644 --- a/templates/adslight_tips_writing_ad.tpl +++ b/templates/adslight_tips_writing_ad.tpl @@ -23,7 +23,7 @@ -

<{$nav_page}>
+

<{$nav_page|default:false}>
<{include file='db:system_notification_select.tpl'}>

diff --git a/templates/adslight_view_photos.tpl b/templates/adslight_view_photos.tpl index 16154bb..093eca9 100644 --- a/templates/adslight_view_photos.tpl +++ b/templates/adslight_view_photos.tpl @@ -16,7 +16,7 @@
<{$lang_upgrade_now}> <{/if}> -

<{$lang_nopicyet}>

+

<{$lang_nopicyet|default:''}>