Refactored the daily column generation (only one loop)

This commit is contained in:
Florian Eula 2014-12-22 17:11:53 +01:00
parent 60b83e7cf7
commit cae64e52e4
2 changed files with 32 additions and 40 deletions

View file

@ -1173,10 +1173,7 @@ function showDaily()
$PAGE = new pageBuilder;
$PAGE->assign('linksToDisplay',$linksToDisplay);
$PAGE->assign('linkcount',count($LINKSDB));
$PAGE->assign('col1',$columns[0]);
$PAGE->assign('col1',$columns[0]);
$PAGE->assign('col2',$columns[1]);
$PAGE->assign('col3',$columns[2]);
$PAGE->assign('cols', $columns);
$PAGE->assign('day',utf8_encode(strftime('%A %d, %B %Y',linkdate2timestamp($day.'_000000'))));
$PAGE->assign('previousday',$previousday);
$PAGE->assign('nextday',$nextday);

View file

@ -17,41 +17,36 @@
<div class="clear"></div>
{if="$linksToDisplay"}
<div id="daily_col1">
{loop="col1"}
{loop="cols"}
{if="isset($value[0])"}
<div id="daily_col{$counter+1}">
{loop="value"}
{$link=$value}
<div class="dailyEntry">
<div class="dailyEntryPermalink"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
{if="$value.tags"}<div class="dailyEntryTags">{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}</div>{/if}
<div class="dailyEntryTitle"><a href="{$value.url}">{$value.title|htmlspecialchars}</a></div>
{if="$value.thumbnail"}<div class="dailyEntryThumbnail">{$value.thumbnail}</div>{/if}
<div class="dailyEntryDescription">{$value.formatedDescription}</div>
<div class="dailyEntryPermalink">
<a href="?{$link.linkdate|smallHash}">
<img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink">
</a>
</div>
{if="$link.tags"}
<div class="dailyEntryTags">
{loop="link.taglist"}
{$value|htmlspecialchars} -
{/loop}
</div>
{/if}
<div class="dailyEntryTitle">
<a href="{$link.url}">{$link.title|htmlspecialchars}</a>
</div>
{if="$link.thumbnail"}
<div class="dailyEntryThumbnail">{$link.thumbnail}</div>
{/if}
<div class="dailyEntryDescription">{$link.formatedDescription}</div>
</div>
{/loop}
</div>
<div id="daily_col2">
{loop="col2"}
<div class="dailyEntry">
<div class="dailyEntryPermalink"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
{if="$value.tags"}<div class="dailyEntryTags">{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}</div>{/if}
<div class="dailyEntryTitle"><a href="{$value.url}">{$value.title|htmlspecialchars}</a></div>
{if="$value.thumbnail"}<div class="dailyEntryThumbnail">{$value.thumbnail}</div>{/if}
<div class="dailyEntryDescription">{$value.formatedDescription}</div>
</div>
{/if}
{/loop}
</div>
<div id="daily_col3">
{loop="col3"}
<div class="dailyEntry">
<div class="dailyEntryPermalink"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
{if="$value.tags"}<div class="dailyEntryTags">{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}</div>{/if}
<div class="dailyEntryTitle"><a href="{$value.url}">{$value.title|htmlspecialchars}</a></div>
{if="$value.thumbnail"}<div class="dailyEntryThumbnail">{$value.thumbnail}</div>{/if}
<div class="dailyEntryDescription">{$value.formatedDescription}</div>
</div>
{/loop}
</div>
{else}
<div class="dailyNoEntry">No articles on this day.</div>
{/if}