php8 compat for 2k11 frontend templates

This commit is contained in:
onli 2021-03-15 23:28:15 +01:00
parent 0a4911566c
commit 48211e27b1
4 changed files with 31 additions and 27 deletions

View File

@ -8,20 +8,20 @@
<input id="serendipity_commentform_name" name="serendipity[name]" type="text" value="{$commentform_name}" placeholder="{$CONST.TWOK11_PLACE_NAME}"{if $required_fields.name} required{/if}>
</div>
<div class="form_field">
<label for="serendipity_commentform_email">{$CONST.EMAIL}{if $required_fields.email}*{/if}</label>
<input id="serendipity_commentform_email" name="serendipity[email]" type="email" value="{$commentform_email}" placeholder="{$CONST.TWOK11_PLACE_MAIL}"{if $required_fields.email} required{/if}>
<label for="serendipity_commentform_email">{$CONST.EMAIL}{if 'email'|array_key_exists:$required_fields and $required_fields.email}*{/if}</label>
<input id="serendipity_commentform_email" name="serendipity[email]" type="email" value="{$commentform_email}" placeholder="{$CONST.TWOK11_PLACE_MAIL}"{if 'email'|array_key_exists:$required_fields and $required_fields.email} required{/if}>
</div>
{if $spice.inputtwitter}
{if isset($spice) and $spice.inputtwitter}
<div id="serendipity_commentspice_twitter" class="form_field">
<label for="serendipity_commentform_twitter">{$spice.inputtwitterlabel}</label>
<input id="serendipity_commentform_twitter" name="serendipity[twitter]" type="text" value="{$spice.inputtwittervalue}" placeholder="{$spice.inputtwitterplaceholder}">
</div>
{/if}
<div class="form_field">
<label for="serendipity_commentform_url">{$CONST.HOMEPAGE}{if $required_fields.url}*{/if}</label>
<input id="serendipity_commentform_url" name="serendipity[url]" type="url" value="{$commentform_url}" placeholder="{$CONST.TWOK11_PLACE_URL}"{if $required_fields.url} required{/if}>
<label for="serendipity_commentform_url">{$CONST.HOMEPAGE}{if 'url'|array_key_exists:$required_fields and $required_fields.url}*{/if}</label>
<input id="serendipity_commentform_url" name="serendipity[url]" type="url" value="{$commentform_url}" placeholder="{$CONST.TWOK11_PLACE_URL}"{if 'url'|array_key_exists:$required_fields and $required_fields.url} required{/if}>
</div>
{if $spice.inputarticle}
{if isset($spice) and $spice.inputarticle}
<div id="serendipity_commentspice_rss" class="form_tarea spicehidden">
<label for="serendipity_commentform_rss">{$spice.inputarticlelabel}</label>
<select class="commentspice_rss_input" id="serendipity_commentform_rss" name="serendipity[promorss]"></select>

View File

@ -1,8 +1,8 @@
{foreach from=$comments item=comment name="comments"}
<article id="c{$comment.id}" class="serendipity_comment{if $entry.author == $comment.author} serendipity_comment_author_self{/if} {cycle values="odd,even"} {if $comment.depth > 8}commentlevel-9{else}commentlevel-{$comment.depth}{/if}">
<header class="clearfix">
<h4{if $comment.spice_twitter_name && $comment.spice_twitter_followme} class="short-heading"{/if}>{if $comment.url}<a href="{$comment.url}">{/if}{$comment.author|default:$CONST.ANONYMOUS}{if $comment.url}</a>{/if}{if $comment.spice_twitter_name and not $comment.spice_twitter_followme} (<a href="{$comment.spice_twitter_url}"{if $comment.spice_twitter_nofollow} rel="nofollow"{/if}>@{$comment.spice_twitter_name}</a>){/if} {$CONST.ON} <time datetime="{$comment.timestamp|@serendipity_html5time}">{$comment.timestamp|@formatTime:$template_option.date_format}</time>:</h4>
{if $comment.spice_twitter_name && $comment.spice_twitter_followme}
<h4{if 'spice_twitter_name'|array_key_exists:$comment and $comment.spice_twitter_name && $comment.spice_twitter_followme} class="short-heading"{/if}>{if $comment.url}<a href="{$comment.url}">{/if}{$comment.author|default:$CONST.ANONYMOUS}{if $comment.url}</a>{/if}{if 'spice_twitter_name'|array_key_exists:$comment and $comment.spice_twitter_name and not $comment.spice_twitter_followme} (<a href="{$comment.spice_twitter_url}"{if $comment.spice_twitter_nofollow} rel="nofollow"{/if}>@{$comment.spice_twitter_name}</a>){/if} {$CONST.ON} <time datetime="{$comment.timestamp|@serendipity_html5time}">{$comment.timestamp|@formatTime:$template_option.date_format}</time>:</h4>
{if 'spice_twitter_name'|array_key_exists:$comment and $comment.spice_twitter_name && $comment.spice_twitter_followme}
<div class="twitter_follow"><a href="{$comment.spice_twitter_url}"{if $comment.spice_twitter_nofollow} rel="nofollow"{/if}><span class="visuallyhidden">@{$comment.spice_twitter_name}</span></a>
{if $comment.spice_twitter_followme}{$comment.spice_twitter_followme}{/if}
</div>
@ -10,7 +10,7 @@
</header>
<div class="serendipity_commentBody clearfix content">
{if $comment.avatar}{$comment.avatar}{/if}
{if 'avatar'|array_key_exists:$comment and $comment.avatar}{$comment.avatar}{/if}
{if $comment.body == 'COMMENT_DELETED'}
{$CONST.COMMENT_IS_DELETED}
{else}
@ -21,7 +21,7 @@
<footer>
<time>{$comment.timestamp|@formatTime:'%H:%M'}</time>
| <a class="comment_source_trace" href="#c{$comment.id}" title="{$CONST.TWOK11_PLINK_TITLE}">{$CONST.TWOK11_PLINK_TEXT}</a>
{if $entry.is_entry_owner}
{if 'is_entry_owner'|array_key_exists:$entry and $entry.is_entry_owner}
| <a class="comment_source_ownerlink" href="{$comment.link_delete}" title="{$CONST.COMMENT_DELETE_CONFIRM|@sprintf:$comment.id:$comment.author}">{$CONST.DELETE}</a>
{/if}
{if $template_option.refcomments == true}
@ -29,7 +29,7 @@
| <a class="reply_origin" href="#c{$comment.parent_id}" title="{$CONST.TWOK11_REPLYORIGIN}: {$CONST.COMMENT} #c{$comment.parent_id}">{$CONST.TWOK11_REPLYORIGIN}</a>
{/if}
{/if}
| <a class="comment_reply" href="#serendipity_CommentForm" id="serendipity_reply_{$comment.id}"{if $comment_onchange != ''} onclick="{$comment_onchange}"{/if}>{$CONST.REPLY}</a>
| <a class="comment_reply" href="#serendipity_CommentForm" id="serendipity_reply_{$comment.id}"{if isset($comment_onchange) and $comment_onchange != ''} onclick="{$comment_onchange}"{/if}>{$CONST.REPLY}</a>
<div id="serendipity_replyform_{$comment.id}"></div>
</footer>
</article>

View File

@ -6,17 +6,17 @@
<header class="clearfix">
<h2><a href="{$entry.link}">{$entry.title}</a></h2>
<span class="serendipity_byline block_level"><span class="single_user">{$CONST.POSTED_BY} <a href="{$entry.link_author}">{$entry.author}</a> {$CONST.ON} </span><time datetime="{$entry.timestamp|@serendipity_html5time}">{$entry.timestamp|@formatTime:$template_option.date_format}</time>{if $entry.is_entry_owner and not $is_preview} | <a href="{$entry.link_edit}">{$CONST.EDIT_ENTRY}</a>{/if}</span>
<span class="serendipity_byline block_level"><span class="single_user">{$CONST.POSTED_BY} <a href="{$entry.link_author}">{$entry.author}</a> {$CONST.ON} </span><time datetime="{$entry.timestamp|@serendipity_html5time}">{$entry.timestamp|@formatTime:$template_option.date_format}</time>{if 'is_entry_owner'|array_key_exists:$entry and $entry.is_entry_owner and not $is_preview} | <a href="{$entry.link_edit}">{$CONST.EDIT_ENTRY}</a>{/if}</span>
</header>
<div class="clearfix content serendipity_entry_body">
{if $entry.categories}{foreach from=$entry.categories item="entry_category"}{if $entry_category.category_icon}<a href="{$entry_category.category_link}"><img class="serendipity_entryIcon" title="{$entry_category.category_name|escape}{$entry_category.category_description|@emptyPrefix}" alt="{$entry_category.category_name|escape}" src="{$entry_category.category_icon|escape}"></a>{/if}{/foreach}{/if}
{$entry.body}
{if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
{if 'has_extended'|array_key_exists:$entry and $entry.has_extended and not $is_single_entry and not $entry.is_extended}
<a class="read_more block_level" href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a>
{/if}
</div>
{if $entry.is_extended}
{if 'is_extended'|array_key_exists:$entry and $entry.is_extended}
<div id="extended" class="clearfix content">
{$entry.extended}
</div>
@ -29,24 +29,26 @@
{if $entry.categories}
<span class="visuallyhidden">{$CONST.CATEGORIES}: </span>{foreach from=$entry.categories item="entry_category" name="categories"}<a href="{$entry_category.category_link}">{$entry_category.category_name|escape}</a>{if not $smarty.foreach.categories.last}, {/if}{/foreach}
{/if}
{if $entry.categories and ($entry.has_comments or $entry.has_disqus)} | {/if}
{if ($entry.has_comments or $entry.has_disqus)}
{if $entry.has_disqus }
{if $entry.categories and ($entry.has_comments or ('has_disqus'|array_key_exists:$entry and $entry.has_disqus))} | {/if}
{if ($entry.has_comments or ('has_disqus'|array_key_exists:$entry and $entry.has_disqus))}
{if ('has_disqus'|array_key_exists:$entry and $entry.has_disqus) }
{$entry.comments}{if $entry.has_trackbacks}, <a href="{$entry.link}#trackbacks">{$entry.trackbacks} {$entry.label_trackbacks}</a>{/if}
{else}
<a href="{$entry.link}#comments" title="{$entry.comments} {$entry.label_comments}{if $entry.has_trackbacks}, {$entry.trackbacks} {$entry.label_trackbacks}{/if}">{$entry.comments} {$entry.label_comments}</a>
{/if}
{/if}
{if $entry.url_tweetthis}
{if ('url_tweetthis'|array_key_exists:$entry and $entry.url_tweetthis)}
| <a href="{$entry.url_tweetthis}" title="{$CONST.TWOK11_TWEET_THIS}">Twitter</a>
{/if}
{if $entry.url_dentthis}
{if ('url_dentthis'|array_key_exists:$entry and $entry.url_dentthis)}
| <a href="{$entry.url_dentthis}" title="{$CONST.TWOK11_DENT_THIS}">Identica</a>
{/if}
{if $entry.url_shorturl}
{if ('url_shorturl'|array_key_exists:$entry and $entry.url_shorturl)}
| <a href="{$entry.url_shorturl}" title="{$CONST.TWOK11_SHORT_URL_HINT}" class="short-url">{$CONST.TWOK11_SHORT_URL}</a>
{/if}
{$entry.add_footer}
{if 'add_footer'|array_key_exists:$entry}
{$entry.add_footer}
{/if}
</footer>
<!--
@ -98,7 +100,7 @@
</p>
{serendipity_printComments entry=$entry.id mode=$entry.viewmode}
{if $entry.is_entry_owner}
{if 'is_entry_owner'|array_key_exists:$entry and $entry.is_entry_owner}
<p class="manage_comments">
{if $entry.allow_comments}
<a href="{$entry.link_deny_comments}">{$CONST.COMMENTS_DISABLE}</a>
@ -125,15 +127,17 @@
</section>
{/if}
{$entry.backend_preview}
{if 'backend_preview'|array_key_exists:$entry}
{$entry.backend_preview}
{/if}
</article>
{/foreach}
{foreachelse}
{if not $plugin_clean_page}
{if isset($plugin_clean_page) and not $plugin_clean_page}
<p class="nocontent">{$CONST.NO_ENTRIES_TO_PRINT}</p>
{/if}
{/foreach}
{if $footer_info or $footer_prev_page or $footer_next_page}
{if isset($footer_info) and $footer_info or isset($footer_prev_page) and $footer_prev_page or isset($footer_next_page) and $footer_next_page}
<nav class="serendipity_pagination block_level">
<h2 class="visuallyhidden">{$CONST.TWOK11_PAG_TITLE}</h2>
@ -146,4 +150,4 @@
</ul>
</nav>
{/if}
{serendipity_hookPlugin hook="entries_footer"}
{serendipity_hookPlugin hook="entries_footer"}

View File

@ -9,7 +9,7 @@
<title>{$head_title|default:$blogTitle}{if $head_subtitle} | {$head_subtitle}{/if}</title>
<meta name="generator" content="Serendipity v.{$serendipityVersion}">
<meta name="viewport" content="width=device-width, initial-scale=1">
{if ($view == "entry" || $view == "start" || $view == "feed" || $view == "plugin" || $staticpage_pagetitle != "" || $robots_index == 'index')}
{if ($view == "entry" || $view == "start" || $view == "feed" || $view == "plugin" || (isset($staticpage_pagetitle) and $staticpage_pagetitle != "") || (isset($robots_index) and $robots_index == 'index'))}
<meta name="robots" content="index,follow">
{else}
<meta name="robots" content="noindex,follow">