aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php29
1 files changed, 7 insertions, 22 deletions
diff --git a/index.php b/index.php
index 633ab89e..3700504b 100644
--- a/index.php
+++ b/index.php
@@ -312,9 +312,7 @@ function showDailyRSS($conf, $loginManager)
312 $LINKSDB = new LinkDB( 312 $LINKSDB = new LinkDB(
313 $conf->get('resource.datastore'), 313 $conf->get('resource.datastore'),
314 $loginManager->isLoggedIn(), 314 $loginManager->isLoggedIn(),
315 $conf->get('privacy.hide_public_links'), 315 $conf->get('privacy.hide_public_links')
316 $conf->get('redirector.url'),
317 $conf->get('redirector.encode_url')
318 ); 316 );
319 317
320 /* Some Shaarlies may have very few links, so we need to look 318 /* Some Shaarlies may have very few links, so we need to look
@@ -356,11 +354,7 @@ function showDailyRSS($conf, $loginManager)
356 354
357 // We pre-format some fields for proper output. 355 // We pre-format some fields for proper output.
358 foreach ($links as &$link) { 356 foreach ($links as &$link) {
359 $link['formatedDescription'] = format_description( 357 $link['formatedDescription'] = format_description($link['description']);
360 $link['description'],
361 $conf->get('redirector.url'),
362 $conf->get('redirector.encode_url')
363 );
364 $link['timestamp'] = $link['created']->getTimestamp(); 358 $link['timestamp'] = $link['created']->getTimestamp();
365 if (startsWith($link['url'], '?')) { 359 if (startsWith($link['url'], '?')) {
366 $link['url'] = index_url($_SERVER) . $link['url']; // make permalink URL absolute 360 $link['url'] = index_url($_SERVER) . $link['url']; // make permalink URL absolute
@@ -433,11 +427,7 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
433 $taglist = explode(' ', $link['tags']); 427 $taglist = explode(' ', $link['tags']);
434 uasort($taglist, 'strcasecmp'); 428 uasort($taglist, 'strcasecmp');
435 $linksToDisplay[$key]['taglist']=$taglist; 429 $linksToDisplay[$key]['taglist']=$taglist;
436 $linksToDisplay[$key]['formatedDescription'] = format_description( 430 $linksToDisplay[$key]['formatedDescription'] = format_description($link['description']);
437 $link['description'],
438 $conf->get('redirector.url'),
439 $conf->get('redirector.encode_url')
440 );
441 $linksToDisplay[$key]['timestamp'] = $link['created']->getTimestamp(); 431 $linksToDisplay[$key]['timestamp'] = $link['created']->getTimestamp();
442 } 432 }
443 433
@@ -1181,6 +1171,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
1181 $link['thumbnail'] = $thumbnailer->get($url); 1171 $link['thumbnail'] = $thumbnailer->get($url);
1182 } 1172 }
1183 1173
1174 $link['sticky'] = isset($link['sticky']) ? $link['sticky'] : false;
1175
1184 $pluginManager->executeHooks('save_link', $link); 1176 $pluginManager->executeHooks('save_link', $link);
1185 1177
1186 $LINKSDB[$id] = $link; 1178 $LINKSDB[$id] = $link;
@@ -1662,11 +1654,7 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
1662 $linkDisp = array(); 1654 $linkDisp = array();
1663 while ($i<$end && $i<count($keys)) { 1655 while ($i<$end && $i<count($keys)) {
1664 $link = $linksToDisplay[$keys[$i]]; 1656 $link = $linksToDisplay[$keys[$i]];
1665 $link['description'] = format_description( 1657 $link['description'] = format_description($link['description']);
1666 $link['description'],
1667 $conf->get('redirector.url'),
1668 $conf->get('redirector.encode_url')
1669 );
1670 $classLi = ($i % 2) != 0 ? '' : 'publicLinkHightLight'; 1658 $classLi = ($i % 2) != 0 ? '' : 'publicLinkHightLight';
1671 $link['class'] = $link['private'] == 0 ? $classLi : 'private'; 1659 $link['class'] = $link['private'] == 0 ? $classLi : 'private';
1672 $link['timestamp'] = $link['created']->getTimestamp(); 1660 $link['timestamp'] = $link['created']->getTimestamp();
@@ -1727,7 +1715,6 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
1727 'search_term' => $searchterm, 1715 'search_term' => $searchterm,
1728 'search_tags' => $searchtags, 1716 'search_tags' => $searchtags,
1729 'visibility' => ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '', 1717 'visibility' => ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '',
1730 'redirector' => $conf->get('redirector.url'), // Optional redirector URL.
1731 'links' => $linkDisp, 1718 'links' => $linkDisp,
1732 ); 1719 );
1733 1720
@@ -1877,9 +1864,7 @@ try {
1877$linkDb = new LinkDB( 1864$linkDb = new LinkDB(
1878 $conf->get('resource.datastore'), 1865 $conf->get('resource.datastore'),
1879 $loginManager->isLoggedIn(), 1866 $loginManager->isLoggedIn(),
1880 $conf->get('privacy.hide_public_links'), 1867 $conf->get('privacy.hide_public_links')
1881 $conf->get('redirector.url'),
1882 $conf->get('redirector.encode_url')
1883); 1868);
1884 1869
1885$container = new \Slim\Container(); 1870$container = new \Slim\Container();