aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/index.php b/index.php
index 1480bbc5..4b86a3e2 100644
--- a/index.php
+++ b/index.php
@@ -356,7 +356,6 @@ function showDailyRSS($conf, $loginManager) {
356 $conf->get('redirector.url'), 356 $conf->get('redirector.url'),
357 $conf->get('redirector.encode_url') 357 $conf->get('redirector.encode_url')
358 ); 358 );
359 $link['thumbnail'] = thumbnail($conf, $link['url']);
360 $link['timestamp'] = $link['created']->getTimestamp(); 359 $link['timestamp'] = $link['created']->getTimestamp();
361 if (startsWith($link['url'], '?')) { 360 if (startsWith($link['url'], '?')) {
362 $link['url'] = index_url($_SERVER) . $link['url']; // make permalink URL absolute 361 $link['url'] = index_url($_SERVER) . $link['url']; // make permalink URL absolute
@@ -371,6 +370,7 @@ function showDailyRSS($conf, $loginManager) {
371 $tpl->assign('links', $links); 370 $tpl->assign('links', $links);
372 $tpl->assign('rssdate', escape($dayDate->format(DateTime::RSS))); 371 $tpl->assign('rssdate', escape($dayDate->format(DateTime::RSS)));
373 $tpl->assign('hide_timestamps', $conf->get('privacy.hide_timestamps', false)); 372 $tpl->assign('hide_timestamps', $conf->get('privacy.hide_timestamps', false));
373 $tpl->assign('index_url', $pageaddr);
374 $html = $tpl->draw('dailyrss', true); 374 $html = $tpl->draw('dailyrss', true);
375 375
376 echo $html . PHP_EOL; 376 echo $html . PHP_EOL;
@@ -433,7 +433,6 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
433 $conf->get('redirector.url'), 433 $conf->get('redirector.url'),
434 $conf->get('redirector.encode_url') 434 $conf->get('redirector.encode_url')
435 ); 435 );
436 $linksToDisplay[$key]['thumbnail'] = thumbnail($conf, $link['url']);
437 $linksToDisplay[$key]['timestamp'] = $link['created']->getTimestamp(); 436 $linksToDisplay[$key]['timestamp'] = $link['created']->getTimestamp();
438 } 437 }
439 438
@@ -1636,9 +1635,9 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
1636 uasort($taglist, 'strcasecmp'); 1635 uasort($taglist, 'strcasecmp');
1637 $link['taglist'] = $taglist; 1636 $link['taglist'] = $taglist;
1638 1637
1639 // Thumbnails enabled, not a note, 1638 // Logged in, thumbnails enabled, not a note,
1640 // and (never retrieved yet or no valid cache file) 1639 // and (never retrieved yet or no valid cache file)
1641 if ($thumbnailsEnabled && $link['url'][0] != '?' 1640 if ($loginManager->isLoggedIn() && $thumbnailsEnabled && $link['url'][0] != '?'
1642 && (! isset($link['thumbnail']) || ($link['thumbnail'] !== false && ! is_file($link['thumbnail']))) 1641 && (! isset($link['thumbnail']) || ($link['thumbnail'] !== false && ! is_file($link['thumbnail'])))
1643 ) { 1642 ) {
1644 $elem = $LINKSDB[$keys[$i]]; 1643 $elem = $LINKSDB[$keys[$i]];
@@ -1812,7 +1811,11 @@ function install($conf, $sessionManager, $loginManager) {
1812 exit; 1811 exit;
1813} 1812}
1814 1813
1815if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=dailyrss')) { showDailyRSS($conf); exit; } 1814if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=dailyrss')) {
1815 showDailyRSS($conf, $loginManager);
1816 exit;
1817}
1818
1816if (!isset($_SESSION['LINKS_PER_PAGE'])) { 1819if (!isset($_SESSION['LINKS_PER_PAGE'])) {
1817 $_SESSION['LINKS_PER_PAGE'] = $conf->get('general.links_per_page', 20); 1820 $_SESSION['LINKS_PER_PAGE'] = $conf->get('general.links_per_page', 20);
1818} 1821}