aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2015-06-23 20:22:02 +0200
committerArthurHoaro <arthur@hoa.ro>2015-06-23 20:22:02 +0200
commitc68da3ffbfe1d73681e3d6288a7a74ef7aa8bb03 (patch)
tree1f4d961a02b3e3256ecdfe6dece37aefb6675b5b /index.php
parent0923a2bc1b097bf1def882722db489d83d95c423 (diff)
downloadShaarli-c68da3ffbfe1d73681e3d6288a7a74ef7aa8bb03.tar.gz
Shaarli-c68da3ffbfe1d73681e3d6288a7a74ef7aa8bb03.tar.zst
Shaarli-c68da3ffbfe1d73681e3d6288a7a74ef7aa8bb03.zip
Page title if there is a single link
Fixes #232
Diffstat (limited to 'index.php')
-rw-r--r--index.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/index.php b/index.php
index 5aa7116f..db2b7521 100644
--- a/index.php
+++ b/index.php
@@ -1706,8 +1706,10 @@ function buildLinkList($PAGE,$LINKSDB)
1706 */ 1706 */
1707 $keys=array(); foreach($linksToDisplay as $key=>$value) { $keys[]=$key; } // Stupid and ugly. Thanks PHP. 1707 $keys=array(); foreach($linksToDisplay as $key=>$value) { $keys[]=$key; } // Stupid and ugly. Thanks PHP.
1708 1708
1709 // If there is only a single link, we change on-the-fly the title of the page. 1709 // If it's a permalink, we change on-the-fly the title of the page.
1710 if (count($linksToDisplay)==1) $GLOBALS['pagetitle'] = $linksToDisplay[$keys[0]]['title'].' - '.$GLOBALS['title']; 1710 if(!empty($search_type && $search_type == 'permalink')) {
1711 $GLOBALS['pagetitle'] = $linksToDisplay[$keys[0]]['title'] . ' - ' . $GLOBALS['title'];
1712 }
1711 1713
1712 // Select articles according to paging. 1714 // Select articles according to paging.
1713 $pagecount = ceil(count($keys)/$_SESSION['LINKS_PER_PAGE']); 1715 $pagecount = ceil(count($keys)/$_SESSION['LINKS_PER_PAGE']);