Rework code to work with array.

References Issue #201
This commit is contained in:
Garvin Hicking 2014-08-08 10:59:40 +02:00
parent e4a44c3663
commit f9bddffc3e
2 changed files with 4 additions and 5 deletions

View File

@ -315,13 +315,12 @@ switch($serendipity['GET']['adminAction']) {
$smartentries = array();
foreach ($entries as $ey) {
$entry_cats = '';
$entry_cats = array();
if (count($ey['categories'])) {
$cats = array();
foreach ($ey['categories'] as $cat) {
$cats[] = '<a href="' . serendipity_categoryURL($cat) . '">' . htmlspecialchars($cat['category_name']) . '</a>';
$cat['link'] = serendipity_categoryURL($cat);
$entry_cats[] = $cat;
}
$entry_cats = implode(', ', $cats);
}
$smartentries[] = array(

View File

@ -162,7 +162,7 @@
<span class="entry_meta">{$CONST.POSTED_BY} {$entry.author|escape}
{if count($entry.cats)} {$CONST.IN}
{foreach $entry.cats AS $cat}
{$cat}{if (count($entry.cats) > 1) && !$cat@last}, {/if}
<a href="{$cat.link}">{$cat.category_name|escape}</a>{if (count($entry.cats) > 1) && !$cat@last}, {/if}
{/foreach}
{/if}
</span>