From bf3c9934d2dc02cead5995570239c5c6230ed5e5 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 29 Jul 2018 17:40:05 +0200 Subject: Fix fatal error on daily page: use new thumbnail system Also fix: * include the login manager in the daily RSS feed function * remove redirector setting in the vintage theme Fixes #1190 --- index.php | 9 ++++++--- tpl/default/daily.html | 12 ++++++++---- tpl/default/dailyrss.html | 2 +- tpl/vintage/configure.html | 8 -------- tpl/vintage/daily.html | 9 +++++++-- tpl/vintage/dailyrss.html | 4 ++-- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/index.php b/index.php index 1480bbc5..925d47a5 100644 --- a/index.php +++ b/index.php @@ -356,7 +356,6 @@ function showDailyRSS($conf, $loginManager) { $conf->get('redirector.url'), $conf->get('redirector.encode_url') ); - $link['thumbnail'] = thumbnail($conf, $link['url']); $link['timestamp'] = $link['created']->getTimestamp(); if (startsWith($link['url'], '?')) { $link['url'] = index_url($_SERVER) . $link['url']; // make permalink URL absolute @@ -371,6 +370,7 @@ function showDailyRSS($conf, $loginManager) { $tpl->assign('links', $links); $tpl->assign('rssdate', escape($dayDate->format(DateTime::RSS))); $tpl->assign('hide_timestamps', $conf->get('privacy.hide_timestamps', false)); + $tpl->assign('index_url', $pageaddr); $html = $tpl->draw('dailyrss', true); echo $html . PHP_EOL; @@ -433,7 +433,6 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager) $conf->get('redirector.url'), $conf->get('redirector.encode_url') ); - $linksToDisplay[$key]['thumbnail'] = thumbnail($conf, $link['url']); $linksToDisplay[$key]['timestamp'] = $link['created']->getTimestamp(); } @@ -1812,7 +1811,11 @@ function install($conf, $sessionManager, $loginManager) { exit; } -if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=dailyrss')) { showDailyRSS($conf); exit; } +if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=dailyrss')) { + showDailyRSS($conf, $loginManager); + exit; +} + if (!isset($_SESSION['LINKS_PER_PAGE'])) { $_SESSION['LINKS_PER_PAGE'] = $conf->get('general.links_per_page', 20); } diff --git a/tpl/default/daily.html b/tpl/default/daily.html index 29d845d5..816e5d0a 100644 --- a/tpl/default/daily.html +++ b/tpl/default/daily.html @@ -69,9 +69,12 @@ {$link.title} - {$thumb=thumbnail($value.url)} - {if="$thumb!=false"} -
{$thumb}
+ {if="$thumbnails_enabled && !empty($link.thumbnail)"} +
+ thumbnail +
{/if}
{$link.formatedDescription}
{if="$link.tags"} @@ -83,7 +86,7 @@ {/loop} {/if} -
+
{loop="$link.link_plugin"} {$value} {/loop} @@ -108,6 +111,7 @@
{include="page.footer"} + diff --git a/tpl/default/dailyrss.html b/tpl/default/dailyrss.html index b14a3859..f589b06e 100644 --- a/tpl/default/dailyrss.html +++ b/tpl/default/dailyrss.html @@ -8,7 +8,7 @@

{$value.title}

{if="!$hide_timestamps"}{function="strftime('%c', $value.timestamp)"} - {/if}{if="$value.tags"}{$value.tags}{/if}
{$value.url}

- {if="$value.thumbnail"}{$value.thumbnail}{/if}
+ {if="$value.thumbnail"}thumbnail{/if}
{if="$value.description"}{$value.formatedDescription}{/if}


{/loop} diff --git a/tpl/vintage/configure.html b/tpl/vintage/configure.html index 9466c235..f1892fa1 100644 --- a/tpl/vintage/configure.html +++ b/tpl/vintage/configure.html @@ -58,14 +58,6 @@ - - Redirector - -
- (e.g. http://anonym.to/? will mask the HTTP_REFERER) - - - Security: diff --git a/tpl/vintage/daily.html b/tpl/vintage/daily.html index ede35910..00148a58 100644 --- a/tpl/vintage/daily.html +++ b/tpl/vintage/daily.html @@ -68,8 +68,12 @@
{$link.title}
- {if="$link.thumbnail"} -
{$link.thumbnail}
+ {if="$thumbnails_enabled && !empty($link.thumbnail)"} +
+ thumbnail +
{/if}
{$link.formatedDescription}
@@ -97,5 +101,6 @@
-
{include="page.footer"} + diff --git a/tpl/vintage/dailyrss.html b/tpl/vintage/dailyrss.html index ddbd6c5e..f589b06e 100644 --- a/tpl/vintage/dailyrss.html +++ b/tpl/vintage/dailyrss.html @@ -4,11 +4,11 @@ {$absurl} {$rssdate} {$value.title} {if="!$hide_timestamps"}{function="strftime('%c', $value.timestamp)"} - {/if}{if="$value.tags"}{$value.tags}{/if}
{$value.url}

- {if="$value.thumbnail"}{$value.thumbnail}{/if}
+ {if="$value.thumbnail"}thumbnail{/if}
{if="$value.description"}{$value.formatedDescription}{/if}


{/loop} -- cgit v1.2.3