aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php30
1 files changed, 6 insertions, 24 deletions
diff --git a/index.php b/index.php
index 5e61cbb0..40539a04 100644
--- a/index.php
+++ b/index.php
@@ -225,27 +225,6 @@ function setup_login_state($conf)
225} 225}
226$userIsLoggedIn = setup_login_state($conf); 226$userIsLoggedIn = setup_login_state($conf);
227 227
228/**
229 * PubSubHubbub protocol support (if enabled) [UNTESTED]
230 * (Source: http://aldarone.fr/les-flux-rss-shaarli-et-pubsubhubbub/ )
231 *
232 * @param ConfigManager $conf Configuration Manager instance.
233 */
234function pubsubhub($conf)
235{
236 $pshUrl = $conf->get('config.PUBSUBHUB_URL');
237 if (!empty($pshUrl))
238 {
239 include_once './publisher.php';
240 $p = new Publisher($pshUrl);
241 $topic_url = array (
242 index_url($_SERVER).'?do=atom',
243 index_url($_SERVER).'?do=rss'
244 );
245 $p->publish_update($topic_url);
246 }
247}
248
249// ------------------------------------------------------------------------------------------ 228// ------------------------------------------------------------------------------------------
250// Session management 229// Session management
251 230
@@ -811,7 +790,9 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
811 // -------- Tag cloud 790 // -------- Tag cloud
812 if ($targetPage == Router::$PAGE_TAGCLOUD) 791 if ($targetPage == Router::$PAGE_TAGCLOUD)
813 { 792 {
814 $tags= $LINKSDB->allTags(); 793 $visibility = ! empty($_SESSION['privateonly']) ? 'private' : 'all';
794 $filteringTags = isset($_GET['searchtags']) ? explode(' ', $_GET['searchtags']) : array();
795 $tags = $LINKSDB->linksCountPerTag($filteringTags, $visibility);
815 796
816 // We sort tags alphabetically, then choose a font size according to count. 797 // We sort tags alphabetically, then choose a font size according to count.
817 // First, find max value. 798 // First, find max value.
@@ -845,6 +826,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
845 } 826 }
846 827
847 $data = array( 828 $data = array(
829 'search_tags' => implode(' ', $filteringTags),
848 'tags' => $tagList, 830 'tags' => $tagList,
849 ); 831 );
850 $pluginManager->executeHooks('render_tagcloud', $data, array('loggedin' => isLoggedIn())); 832 $pluginManager->executeHooks('render_tagcloud', $data, array('loggedin' => isLoggedIn()));
@@ -1375,7 +1357,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
1375 'link' => $link, 1357 'link' => $link,
1376 'link_is_new' => false, 1358 'link_is_new' => false,
1377 'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''), 1359 'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''),
1378 'tags' => $LINKSDB->allTags(), 1360 'tags' => $LINKSDB->linksCountPerTag(),
1379 ); 1361 );
1380 $pluginManager->executeHooks('render_editlink', $data); 1362 $pluginManager->executeHooks('render_editlink', $data);
1381 1363
@@ -1444,7 +1426,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
1444 'link_is_new' => $link_is_new, 1426 'link_is_new' => $link_is_new,
1445 'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''), 1427 'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''),
1446 'source' => (isset($_GET['source']) ? $_GET['source'] : ''), 1428 'source' => (isset($_GET['source']) ? $_GET['source'] : ''),
1447 'tags' => $LINKSDB->allTags(), 1429 'tags' => $LINKSDB->linksCountPerTag(),
1448 'default_private_links' => $conf->get('privacy.default_private_links', false), 1430 'default_private_links' => $conf->get('privacy.default_private_links', false),
1449 ); 1431 );
1450 $pluginManager->executeHooks('render_editlink', $data); 1432 $pluginManager->executeHooks('render_editlink', $data);