From cae64e52e47811a3fbef534f296b8952680d0d8f Mon Sep 17 00:00:00 2001 From: Florian Eula Date: Mon, 22 Dec 2014 17:11:53 +0100 Subject: [PATCH] Refactored the daily column generation (only one loop) --- index.php | 5 +--- tpl/daily.html | 67 +++++++++++++++++++++++--------------------------- 2 files changed, 32 insertions(+), 40 deletions(-) diff --git a/index.php b/index.php index 02a6725f..b280ee9b 100644 --- a/index.php +++ b/index.php @@ -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); diff --git a/tpl/daily.html b/tpl/daily.html index c15a7062..b92425b5 100644 --- a/tpl/daily.html +++ b/tpl/daily.html @@ -7,7 +7,7 @@
All links of one day
in a single page.
{if="$previousday"} <Previous day{else}<Previous day{/if} - - + - {if="$nextday"}Next day>{else}Next day>{/if}

Daily RSS Feed @@ -15,43 +15,38 @@
The Daily Shaarli
——————————— {$day} ———————————
- + {if="$linksToDisplay"} -
- {loop="col1"} -
- - {if="$value.tags"}
{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}
{/if} - - {if="$value.thumbnail"}
{$value.thumbnail}
{/if} -
{$value.formatedDescription}
-
+ {loop="cols"} + {if="isset($value[0])"} +
+ {loop="value"} + {$link=$value} +
+ + {if="$link.tags"} +
+ {loop="link.taglist"} + {$value|htmlspecialchars} - + {/loop} +
+ {/if} + + {if="$link.thumbnail"} +
{$link.thumbnail}
+ {/if} +
{$link.formatedDescription}
+
+ {/loop} +
+ {/if} {/loop} -
- -
- {loop="col2"} -
- - {if="$value.tags"}
{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}
{/if} - - {if="$value.thumbnail"}
{$value.thumbnail}
{/if} -
{$value.formatedDescription}
-
- {/loop} -
- -
- {loop="col3"} -
- - {if="$value.tags"}
{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}
{/if} - - {if="$value.thumbnail"}
{$value.thumbnail}
{/if} -
{$value.formatedDescription}
-
- {/loop} -
{else}
No articles on this day.
{/if}