Merge pull request #1308 from ArthurHoaro/feature/daily-date
Daily - display the current day instead of the previous one
This commit is contained in:
commit
bd231539e9
5 changed files with 444 additions and 325 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -47,3 +47,6 @@ tpl/default/img
|
|||
tpl/vintage/js
|
||||
tpl/vintage/css
|
||||
tpl/vintage/img
|
||||
|
||||
# Documented scripts
|
||||
generate_templates.php
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -392,9 +392,16 @@ function showDailyRSS($conf, $loginManager)
|
|||
*/
|
||||
function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
|
||||
{
|
||||
$day = date('Ymd', strtotime('-1 day')); // Yesterday, in format YYYYMMDD.
|
||||
if (isset($_GET['day'])) {
|
||||
$day = $_GET['day'];
|
||||
if ($day === date('Ymd', strtotime('now'))) {
|
||||
$pageBuilder->assign('dayDesc', t('Today'));
|
||||
} elseif ($day === date('Ymd', strtotime('-1 days'))) {
|
||||
$pageBuilder->assign('dayDesc', t('Yesterday'));
|
||||
}
|
||||
} else {
|
||||
$day = date('Ymd', strtotime('now')); // Today, in format YYYYMMDD.
|
||||
$pageBuilder->assign('dayDesc', t('Today'));
|
||||
}
|
||||
|
||||
$days = $LINKSDB->days();
|
||||
|
|
|
@ -44,7 +44,12 @@ <h2 class="window-title">
|
|||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="window-subtitle">{function="format_date($dayDate, false)"}</h3>
|
||||
<h3 class="window-subtitle">
|
||||
{if="!empty($dayDesc)"}
|
||||
{$dayDesc} -
|
||||
{/if}
|
||||
{function="format_date($dayDate, false)"}
|
||||
</h3>
|
||||
|
||||
<div id="plugin_zone_about_daily" class="plugin_zone">
|
||||
{loop="$daily_about_plugin"}
|
||||
|
|
|
@ -35,6 +35,9 @@
|
|||
|
||||
<div class="dailyDate">
|
||||
<span class="nomobile">———————————</span>
|
||||
{if="!empty($dayDesc)"}
|
||||
{$dayDesc} -
|
||||
{/if}
|
||||
{function="strftime('%A %d, %B %Y', $day)"}
|
||||
<span class="nomobile">———————————</span>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue