* moved characters.php html code to Twig template

* moved news.php to Twig news.html template
* fixed some duplicated code in signature generators
* always check if name parameter is set when generating signatures
This commit is contained in:
slawkens
2017-09-01 17:00:29 +02:00
parent 37502c5562
commit d50fb7a291
14 changed files with 1139 additions and 1093 deletions

View File

@@ -1,42 +0,0 @@
<?php
defined('MYAAC') or die('Direct access not allowed!');
function news_parse($title, $content, $date, $icon = 0, $author = '', $comments = '')
{
global $template_path;
$firstLetter = '';
if($content[0] != '<')
{
$tmp = $template_path.'/images/letters/'.$content[0].'.gif';
if(file_exists($tmp)) {
$firstLetter = '<img src="' . $tmp . '" alt="'.$content[0].'" BORDER=0 ALIGN=bottom>';
$content = substr($content, 1);
}
}
return '
<div id="News">
<div class="NewsHeadline">
<div class="NewsHeadlineBackground" style="background-image:url(' . $template_path . '/images/news/newsheadline_background.gif)">
<img src="' . $template_path . '/images/news/icon_' . $icon . '.gif" class=\'NewsHeadlineIcon\' />
<div class="NewsHeadlineDate">' . date("j.n.Y", $date) . ' - </div>
<div class="NewsHeadlineText">' . stripslashes($title) . '</div>
' . (isset($author[0]) ? '
<div class="NewsHeadlineAuthor"><b>Author: </b><i>' . $author . '</i></div>' : '') . '
</div>
</div>
</div>
<table style="clear:both" border=0 cellpadding=0 cellspacing=0 width="100%" >
<tr>
<td style="padding-left:10px;padding-right:10px;" >' . $firstLetter.$content . '</td>
</tr>'
. (isset($comments[0]) ? '
<tr>
<td>
<div style="text-align: right; margin-right: 10px;"><a href="' . $comments . '">» Comment on this news</a></div>
</td>
</tr>' : '') .
'</table><br/>';
}
?>

View File

@@ -0,0 +1,25 @@
<div id="News">
<div class="NewsHeadline">
<div class="NewsHeadlineBackground" style="background-image:url({{template_path }}/images/news/newsheadline_background.gif)">
<img src="{{ template_path }}/images/news/icon_{{ icon }}.gif" class="NewsHeadlineIcon" />
<div class="NewsHeadlineDate">{{ date|date(news_date_format) }} - </div>
<div class="NewsHeadlineText">{{ title }}</div>
{% if author is not empty %}
<div class="NewsHeadlineAuthor"><b>Author: </b><i>{{ author }}</i></div>
{% endif %}
</div>
</div>
</div>
<table style="clear:both" border=0 cellpadding=0 cellspacing=0 width="100%" >
<tr>
<td style="padding-left:10px;padding-right:10px;" >{{ content|raw }}</td>
</tr>
{% if comments is not null %}
<tr>
<td>
<div style="text-align: right; margin-right: 10px;"><a href="{{ comments }}">» Comment on this news</a></div>
</td>
</tr>
{% endif %}
</table>
<br/>