[Pmwiki-users] Searching for information about PmWiki

Christian Ridderström chr
Sun Jan 18 08:09:47 CST 2004


Bah, there was an typo in the code I sent just before.

This seems to work:

// Return path of page source or empty string if page does not exist
function PageSource($pagename) {
  global $WikiLibDirs,$PageFileFmt;
  $pagefile = FmtPageName($PageFileFmt,$pagename);
  if (!$pagefile) return "";
  foreach ($WikiLibDirs as $dir) {
    if (file_exists("$dir/$pagefile")) return "$dir/$pagefile";
  }
  return "";
}

// Return true if the source of the page comes fromm wikilib.d
function IsPageFromWikiLib($pagename) {
  return strpos(PageSource($pagename), "wikilib.d/") !== false;
}

if(($action and $action!='browse') or IsPageFromWikiLib($pagename))
  $robots="noindex,nofollow";
else
  $robots="index,follow";

$HTMLTitleFmt = array ("<title>\$Titlespaced</title>",
                       "<META CONTENT=\"$robots\" NAME=\"robots\">");


Patrick, maybe you should consider adding something like this to the other 
robot-handling code.

/Christian



-- 
Dr. Christian Ridderstr?m, +46-8-768 39 44       http://www.md.kth.se/~chr






More information about the pmwiki-users mailing list