From: <var...@us...> - 2010-05-18 15:19:47
|
Revision: 7406 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7406&view=rev Author: vargenau Date: 2010-05-18 15:19:41 +0000 (Tue, 18 May 2010) Log Message: ----------- Let us make robots work for Gforge Modified Paths: -------------- trunk/lib/display.php Modified: trunk/lib/display.php =================================================================== --- trunk/lib/display.php 2010-05-18 14:58:20 UTC (rev 7405) +++ trunk/lib/display.php 2010-05-18 15:19:41 UTC (rev 7406) @@ -40,6 +40,7 @@ /* only on ?action= */ function actionPage(&$request, $action) { global $WikiTheme; + global $robots; $pagename = $request->getArg('pagename'); $version = $request->getArg('version'); @@ -68,8 +69,10 @@ RecentChanges or AllPages might be an exception. */ $args = array(); - if (GOOGLE_LINKS_NOFOLLOW) - $args = array('ROBOTS_META' => "noindex,nofollow"); + if (GOOGLE_LINKS_NOFOLLOW) { + $robots = "noindex,nofollow"; + $args = array('ROBOTS_META' => $robots); + } /* Handle other formats: So far we had html only. xml is requested by loaddump, rss is handled by recentchanges, @@ -195,6 +198,7 @@ function displayPage(&$request, $template=false) { global $WikiTheme; + global $robots; $pagename = $request->getArg('pagename'); $version = $request->getArg('version'); $page = $request->getPage(); @@ -203,7 +207,8 @@ if (!$revision) NoSuchRevision($request, $page, $version); /* Tell Google (and others) to ignore old versions of pages */ - $toks['ROBOTS_META'] = "noindex,nofollow"; + $robots = "noindex,nofollow"; + $toks['ROBOTS_META'] = $robots; } else { $revision = $page->getCurrentRevision(); @@ -339,16 +344,20 @@ /* Check for special pagenames, which are no actionpages. */ /* if ( $pagename == _("RecentVisitors")) { - $toks['ROBOTS_META']="noindex,follow"; + $robots = "noindex,follow"; + $toks['ROBOTS_META'] = $robots; } else */ if ($pagename == _("SandBox")) { - $toks['ROBOTS_META']="noindex,nofollow"; + $robots = "noindex,nofollow"; + $toks['ROBOTS_META'] = $robots; } else if (isActionPage($pagename)) { // AllPages must not be indexed, but must be followed to get all pages - $toks['ROBOTS_META']="noindex,follow"; + $robots = "noindex,follow"; + $toks['ROBOTS_META'] = $robots; } else if (!isset($toks['ROBOTS_META'])) { - $toks['ROBOTS_META'] = "index,follow"; + $robots = "index,follow"; + $toks['ROBOTS_META'] = $robots; } if (!isset($toks['CONTENT'])) $toks['CONTENT'] = new Template('browse', $request, $page_content); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |