aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/index.php b/index.php
index 891a2ece..9025df58 100644
--- a/index.php
+++ b/index.php
@@ -287,6 +287,7 @@ function logout() {
287 unset($_SESSION['ip']); 287 unset($_SESSION['ip']);
288 unset($_SESSION['username']); 288 unset($_SESSION['username']);
289 unset($_SESSION['privateonly']); 289 unset($_SESSION['privateonly']);
290 unset($_SESSION['untaggedonly']);
290 } 291 }
291 setcookie('shaarli_staySignedIn', FALSE, 0, WEB_PATH); 292 setcookie('shaarli_staySignedIn', FALSE, 0, WEB_PATH);
292} 293}
@@ -806,6 +807,9 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
806 807
807 $tagList = array(); 808 $tagList = array();
808 foreach($tags as $key => $value) { 809 foreach($tags as $key => $value) {
810 if (in_array($key, $filteringTags)) {
811 continue;
812 }
809 // Tag font size scaling: 813 // Tag font size scaling:
810 // default 15 and 30 logarithm bases affect scaling, 814 // default 15 and 30 logarithm bases affect scaling,
811 // 22 and 6 are arbitrary font sizes for max and min sizes. 815 // 22 and 6 are arbitrary font sizes for max and min sizes.
@@ -830,12 +834,17 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
830 exit; 834 exit;
831 } 835 }
832 836
833 // -------- Tag cloud 837 // -------- Tag list
834 if ($targetPage == Router::$PAGE_TAGLIST) 838 if ($targetPage == Router::$PAGE_TAGLIST)
835 { 839 {
836 $visibility = ! empty($_SESSION['privateonly']) ? 'private' : 'all'; 840 $visibility = ! empty($_SESSION['privateonly']) ? 'private' : 'all';
837 $filteringTags = isset($_GET['searchtags']) ? explode(' ', $_GET['searchtags']) : []; 841 $filteringTags = isset($_GET['searchtags']) ? explode(' ', $_GET['searchtags']) : [];
838 $tags = $LINKSDB->linksCountPerTag($filteringTags, $visibility); 842 $tags = $LINKSDB->linksCountPerTag($filteringTags, $visibility);
843 foreach ($filteringTags as $tag) {
844 if (array_key_exists($tag, $tags)) {
845 unset($tags[$tag]);
846 }
847 }
839 848
840 if (! empty($_GET['sort']) && $_GET['sort'] === 'alpha') { 849 if (! empty($_GET['sort']) && $_GET['sort'] === 'alpha') {
841 alphabetical_sort($tags, false, true); 850 alphabetical_sort($tags, false, true);
@@ -1010,6 +1019,19 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
1010 exit; 1019 exit;
1011 } 1020 }
1012 1021
1022 // -------- User wants to see only untagged links (toggle)
1023 if (isset($_GET['untaggedonly'])) {
1024 $_SESSION['untaggedonly'] = !$_SESSION['untaggedonly'];
1025
1026 if (! empty($_SERVER['HTTP_REFERER'])) {
1027 $location = generateLocation($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'], array('untaggedonly'));
1028 } else {
1029 $location = '?';
1030 }
1031 header('Location: '. $location);
1032 exit;
1033 }
1034
1013 // -------- Handle other actions allowed for non-logged in users: 1035 // -------- Handle other actions allowed for non-logged in users:
1014 if (!isLoggedIn()) 1036 if (!isLoggedIn())
1015 { 1037 {
@@ -1621,7 +1643,7 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
1621 'searchtags' => $searchtags, 1643 'searchtags' => $searchtags,
1622 'searchterm' => $searchterm, 1644 'searchterm' => $searchterm,
1623 ]; 1645 ];
1624 $linksToDisplay = $LINKSDB->filterSearch($request, false, $visibility); 1646 $linksToDisplay = $LINKSDB->filterSearch($request, false, $visibility, !empty($_SESSION['untaggedonly']));
1625 } 1647 }
1626 1648
1627 // ---- Handle paging. 1649 // ---- Handle paging.