summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2013-08-01 22:46:16 +0200
committerChristopher Smith <chris@jalakai.co.uk>2013-08-01 22:46:16 +0200
commit74ef17786eb9ce751a8dd7c66ab7523efa92c79f (patch)
tree03dda663b29febf4bb25c6b9b5fa674d103885c7 /inc
parentb1af90141d42f8844159ff4fad76968a8ee78687 (diff)
downloadrpg-74ef17786eb9ce751a8dd7c66ab7523efa92c79f.tar.gz
rpg-74ef17786eb9ce751a8dd7c66ab7523efa92c79f.tar.bz2
include namespace links when index access from the wiki start page
and no automatic sitemap.xml is being generated.
Diffstat (limited to 'inc')
-rw-r--r--inc/html.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/inc/html.php b/inc/html.php
index 53a100ec7..5f94d7dce 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -854,13 +854,17 @@ function html_index($ns){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_list_index($item){
- global $ID;
+ global $ID, $conf;
+
+ // prevent searchbots needlessly following links - only necessary when accessed from the homepage and no sitemap.xml is being generated
+ $nofollow = ($ID != $conf['start'] || $conf['sitemap']) ? ' rel="nofollow"' : '';
+
$ret = '';
$base = ':'.$item['id'];
$base = substr($base,strrpos($base,':')+1);
if($item['type']=='d'){
// FS#2766, no need for search bots to follow namespace links in the index
- $ret .= '<a href="'.wl($ID,'idx='.rawurlencode($item['id'])).'" title="' . $item['id'] . '" class="idx_dir" rel="nofollow"><strong>';
+ $ret .= '<a href="'.wl($ID,'idx='.rawurlencode($item['id'])).'" title="' . $item['id'] . '" class="idx_dir"' . $nofollow . '><strong>';
$ret .= $base;
$ret .= '</strong></a>';
}else{