First commit in 2021 \o/

Fixed more template errors in order to get everything running with PHP 8.0.
This commit is contained in:
azett 2021-01-01 00:24:24 +01:00
parent 5ee2cce5df
commit eba24702df
5 changed files with 38 additions and 20 deletions

View File

@ -122,7 +122,7 @@ class admin_entry_commentcenter extends AdminPanelAction {
$smarty->assign('pl_conf', $conf); $smarty->assign('pl_conf', $conf);
$conf=$plugin->getConf(); $conf=$plugin->getConf();
if($conf['akismet_check']) { if(isset($conf) && array_key_exists('akismet_check', $conf) && $conf['akismet_check']) {
$akismet=$plugin->akismetLoad(); $akismet=$plugin->akismetLoad();
if(is_numeric($akismet)) { if(is_numeric($akismet)) {
$error=$lang['admin']['entry']['commentcenter']['akismet_errors'][$akismet]; $error=$lang['admin']['entry']['commentcenter']['akismet_errors'][$akismet];

View File

@ -2,6 +2,9 @@
{html_form} {html_form}
<h2>{$plang.configure}</h2> <h2>{$plang.configure}</h2>
<p>{$plang.desc_conf}</p> <p>{$plang.desc_conf}</p>
{if !isset($pl_conf)}
{assign var=pl_conf value=""}
{/if}
<dl class="option-set"> <dl class="option-set">
<dt><label for="log_all">{$plang.log_all}</label></dt> <dt><label for="log_all">{$plang.log_all}</label></dt>
@ -25,12 +28,22 @@
</dd> </dd>
<dt class="akismet_opts"><label for="akismet_key">{$plang.akismet_key}</label></dt> <dt class="akismet_opts"><label for="akismet_key">{$plang.akismet_key}</label></dt>
<dd class="akismet_opts"> <dd class="akismet_opts">
<input type="text" name="akismet_key" id="akismet_key" value="{$pl_conf.akismet_key}" /><br /> {if isset($pl_conf.akismet_key)}
{assign var=akismet_key value=$pl_conf.akismet_key}
{else}
{assign var=akismet_key value=""}
{/if}
<input type="text" name="akismet_key" id="akismet_key" value="{$akismet_key}" /><br />
{$plang.akismet_key_long} {$plang.akismet_key_long}
</dd> </dd>
<dt class="akismet_opts"><label for="akismet_url">{$plang.akismet_url}</label></dt> <dt class="akismet_opts"><label for="akismet_url">{$plang.akismet_url}</label></dt>
<dd class="akismet_opts"> <dd class="akismet_opts">
<input type="text" name="akismet_url" id="akismet_url" value="{$pl_conf.akismet_url}" /><br /> {if isset($pl_conf.akismet_url)}
{assign var=akismet_url value=$pl_conf.akismet_url}
{else}
{assign var=akismet_url value=""}
{/if}
<input type="text" name="akismet_url" id="akismet_url" value="{$akismet_url}" /><br />
{$plang.akismet_url_long|sprintf:$smarty.const.BLOG_BASEURL} {$plang.akismet_url_long|sprintf:$smarty.const.BLOG_BASEURL}
</dd> </dd>
</dl> </dl>

View File

@ -1,34 +1,36 @@
<table class="entrylist"> <table class="entrylist">
<thead><tr> <thead><tr>
{if !$delete}<th></th>{/if} {if !isset($delete)}<th></th>{/if}
<th>{$plang.app_date}</th> <th>{$plang.app_date}</th>
<th>{$plang.app_content}</th> <th>{$plang.app_content}</th>
<th>{$plang.app_author}</th> <th>{$plang.app_author}</th>
<th>{$plang.app_email}</th> <th>{$plang.app_email}</th>
<th>{$plang.app_ip}</th> <th>{$plang.app_ip}</th>
{if !$delete}<th>{$plang.app_actions}</th>{/if} {if !isset($delete)}<th>{$plang.app_actions}</th>{/if}
</tr></thead> </tr></thead>
<tbody> <tbody>
{assign var="i" value=0} {assign var="i" value=0}
{foreach from=$entries key=entryid item=entry} {foreach from=$entries key=entryid item=entry}
{if count($entry.$fetch)>0 && !$is_managing}<tr><td colspan="{if $delete}5{else}7{/if}">{$entryid|idToSubject} ({$entryid})</td></tr> {if count($entry.$fetch)>0 && !$is_managing}<tr><td colspan="{if isset($delete)}5{else}7{/if}">{$entryid|idToSubject} ({$entryid})</td></tr>
{/if} {/if}
{foreach from=$entry.$fetch item=comm key=comm_id} {foreach from=$entry.$fetch item=comm key=comm_id}
{assign var="i" value=$i+1} {assign var="i" value=$i+1}
<tr> <tr>
{if !$delete}<td class="td_select_{$fetch}"><input type="checkbox" name="select[e{$entryid}_c{$comm_id}]" /></td>{/if} {if !isset($delete)}<td class="td_select_{$fetch}"><input type="checkbox" name="select[e{$entryid}_c{$comm_id}]" /></td>{/if}
<td>{$comm.date|date_format:"%D, %T"}</td> <td>{$comm.date|date_format:"%D, %T"}</td>
<td class="main_cell"> <td class="main_cell">
{$comm.content|strip_tags} {$comm.content|strip_tags}
{if $delete}<input type="hidden" value="on" name="select[e{$entryid}_c{$comm_id}]" /> {if isset($delete)}<input type="hidden" value="on" name="select[e{$entryid}_c{$comm_id}]" />
{/if} {/if}
</td> </td>
<td>{if $comm.url}<a href="{$comm.url|wp_specialchars}">{$comm.name|wp_specialchars}</a>{else}{$comm.name|wp_specialchars}{/if}</td> <td>{if isset($comm.url)}<a href="{$comm.url|wp_specialchars}">{$comm.name|wp_specialchars}</a>{else}{$comm.name|wp_specialchars}{/if}</td>
<td><a href="mailto:{$comm.email|wp_specialchars}">{$comm.email|wp_specialchars}</a></td> <td><a href="mailto:{$comm.email|wp_specialchars}">{$comm.email|wp_specialchars}</a></td>
<td>{$comm.ip-address}</td> {* a bit hackish: {$comm.ip-adress} would lead to $this->_tpl_vars['comm']['ip']-$this->_tpl_vars['ddress']; *}
{if !$delete}<td> {assign var=ipadress value="ip-address"}
{if $is_managing && $use_akismet} <td>{$comm.$ipadress}</td>
{if !isset($delete)}<td>
{if isset($is_managing) && isset($use_akismet)}
<a href="{$action_url|cmd_link:commspam:"e`$entryid`_c`$comm_id`"}" title="{$plang.man_spam}"><img src="{$plugin_url}imgs/spam.png" alt="{$plang.man_spam}" /></a> <a href="{$action_url|cmd_link:commspam:"e`$entryid`_c`$comm_id`"}" title="{$plang.man_spam}"><img src="{$plugin_url}imgs/spam.png" alt="{$plang.man_spam}" /></a>
{elseif !$is_managing} {elseif !$is_managing}
<a href="{$action_url|cmd_link:publishcomm:"e`$entryid`_c`$comm.id`"}" title="{$plang.app_publish}"><img src="{$plugin_url}imgs/publish.png" alt="{$plang.app_publish}" /></a> <a href="{$action_url|cmd_link:publishcomm:"e`$entryid`_c`$comm.id`"}" title="{$plang.app_publish}"><img src="{$plugin_url}imgs/publish.png" alt="{$plang.app_publish}" /></a>
@ -48,10 +50,10 @@
{/foreach} {/foreach}
{/foreach} {/foreach}
{if $i==0} {if $i==0}
<tr><td colspan="{if $delete}5{else}7{/if}">{$plang.app_nocomms}</td></tr>{/if} <tr><td colspan="{if isset($delete)}5{else}7{/if}">{$plang.app_nocomms}</td></tr>{/if}
</tbody> </tbody>
</table> </table>
{if !$delete} {if !isset($delete)}
<div class="commentcenter_select" style="display: none;"> <div class="commentcenter_select" style="display: none;">
<a href="#" rel="selectAll[td_select_{$fetch}]">{$plang.select_all}</a> <a href="#" rel="selectAll[td_select_{$fetch}]">{$plang.select_all}</a>
<a href="#" rel="deselectAll[td_select_{$fetch}]">{$plang.deselect_all}</a> <a href="#" rel="deselectAll[td_select_{$fetch}]">{$plang.deselect_all}</a>

View File

@ -1,18 +1,18 @@
<table id="commencenter-table"> <table id="commencenter-table">
<thead id="commencenter-table-head"> <thead id="commencenter-table-head">
<tr> <tr>
{if !$delete} <th style="width: 10%;">{$plang.select}</th>{/if} {if !isset($delete)} <th style="width: 10%;">{$plang.select}</th>{/if}
<th class="main-cell">{$plang.criteria}</th> <th class="main-cell">{$plang.criteria}</th>
<th style="width: 20%;">{$plang.behavoir}</th> <th style="width: 20%;">{$plang.behavoir}</th>
{if !$delete} <th style="width: 25%;">{$plang.options}</th>{/if} {if !isset($delete)} <th style="width: 25%;">{$plang.options}</th>{/if}
</tr> </tr>
</thead> </thead>
<tbody id="commencenter-table-body"> <tbody id="commencenter-table-body">
{foreach name=policies from=$policies key=id item=policy} {foreach name=policies from=$policies key=id item=policy}
<tr class="tr_policy{$id}"> <tr class="tr_policy{$id}">
{if !$delete} <td class="td_select"><input type="checkbox" name="select[{$id}]" /></td>{/if} {if !isset($delete)} <td class="td_select"><input type="checkbox" name="select[{$id}]" /></td>{/if}
<td class="main-cell"> <td class="main-cell">
{if $delete}<input type="hidden" name="del_policy[]" value="{$id}" /> {if isset($delete)}<input type="hidden" name="del_policy[]" value="{$id}" />
{/if} {/if}
{if $policy.is_all} {if $policy.is_all}
{$plang.all_entries} {$plang.all_entries}
@ -45,7 +45,7 @@
{elseif $policy.do==-1} {elseif $policy.do==-1}
<td>{$plang.block}</td> <td>{$plang.block}</td>
{/if} {/if}
{if !$delete} <td> {if !isset($delete)} <td>
<a href="{$action_url|cmd_link:polup:$id}" title="{$plang.up}" rel="polup[{$id}]"><img src="{$plugin_url}imgs/up.png" alt="{$plang.up}" /></a> <a href="{$action_url|cmd_link:polup:$id}" title="{$plang.up}" rel="polup[{$id}]"><img src="{$plugin_url}imgs/up.png" alt="{$plang.up}" /></a>
<a href="{$action_url|cmd_link:poldown:$id}" title="{$plang.down}" rel="poldown[{$id}]"><img src="{$plugin_url}imgs/down.png" alt="{$plang.down}" /></a> <a href="{$action_url|cmd_link:poldown:$id}" title="{$plang.down}" rel="poldown[{$id}]"><img src="{$plugin_url}imgs/down.png" alt="{$plang.down}" /></a>
<a href="{$action_url|cmd_link:poledit:$id}" title="{$plang.edit}"><img src="{$plugin_url}imgs/edit.png" alt="{$plang.edit}" /></a> <a href="{$action_url|cmd_link:poledit:$id}" title="{$plang.edit}"><img src="{$plugin_url}imgs/edit.png" alt="{$plang.edit}" /></a>
@ -54,7 +54,7 @@
</tr> </tr>
{foreachelse} {foreachelse}
<tr> <tr>
<td colspan="{if $delete}2{else}4{/if}">{$plang.nopolicies}</td> <td colspan="{if isset($delete)}2{else}4{/if}">{$plang.nopolicies}</td>
</tr> </tr>
{/foreach} {/foreach}
</tbody> </tbody>

View File

@ -2,6 +2,9 @@
{html_form} {html_form}
<h2>{$plang.man_searcht}</h2> <h2>{$plang.man_searcht}</h2>
<p>{$plang.man_searchd}</p> <p>{$plang.man_searchd}</p>
{if !isset($entry_id)}
{assign var=entry_id value=""}
{/if}
<p><input type="text" name="entry" value="{$entry_id}" /> <p><input type="text" name="entry" value="{$entry_id}" />
{html_submit name="entry_search" id="entry_search" value=$plang.man_search}</p> {html_submit name="entry_search" id="entry_search" value=$plang.man_search}</p>