diff options
author | ArthurHoaro <arthur@hoa.ro> | 2015-06-23 20:22:02 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2015-06-23 20:22:02 +0200 |
commit | c68da3ffbfe1d73681e3d6288a7a74ef7aa8bb03 (patch) | |
tree | 1f4d961a02b3e3256ecdfe6dece37aefb6675b5b | |
parent | 0923a2bc1b097bf1def882722db489d83d95c423 (diff) | |
download | Shaarli-c68da3ffbfe1d73681e3d6288a7a74ef7aa8bb03.tar.gz Shaarli-c68da3ffbfe1d73681e3d6288a7a74ef7aa8bb03.tar.zst Shaarli-c68da3ffbfe1d73681e3d6288a7a74ef7aa8bb03.zip |
Page title if there is a single link
Fixes #232
-rw-r--r-- | index.php | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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']); |