From c68da3ffbfe1d73681e3d6288a7a74ef7aa8bb03 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 23 Jun 2015 20:22:02 +0200 Subject: Page title if there is a single link Fixes #232 --- index.php | 6 ++++-- 1 file 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) */ $keys=array(); foreach($linksToDisplay as $key=>$value) { $keys[]=$key; } // Stupid and ugly. Thanks PHP. - // If there is only a single link, we change on-the-fly the title of the page. - if (count($linksToDisplay)==1) $GLOBALS['pagetitle'] = $linksToDisplay[$keys[0]]['title'].' - '.$GLOBALS['title']; + // If it's a permalink, we change on-the-fly the title of the page. + if(!empty($search_type && $search_type == 'permalink')) { + $GLOBALS['pagetitle'] = $linksToDisplay[$keys[0]]['title'] . ' - ' . $GLOBALS['title']; + } // Select articles according to paging. $pagecount = ceil(count($keys)/$_SESSION['LINKS_PER_PAGE']); -- cgit v1.2.3