Page title if there is a single link

Fixes #232
This commit is contained in:
ArthurHoaro 2015-06-23 20:22:02 +02:00 committed by Knah Tsaeb
parent 5bc8d56ae8
commit 17c45348fe

View file

@ -1877,8 +1877,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']);