From 17bf023e48140c6b09e33bf421f7c9b36445b9d6 Mon Sep 17 00:00:00 2001 From: rurban Date: Sun, 19 Mar 2006 14:26:29 +0000 Subject: [PATCH] sf.net patch by Matt Brown: Add rel=nofollow to more actions git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@5033 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/display.php | 27 ++++++++++++++++++++++++--- lib/plugin/Calendar.php | 8 ++++++-- lib/plugin/RecentChanges.php | 12 +++++++++--- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/lib/display.php b/lib/display.php index e6c9e2a3a..025b1ad76 100644 --- a/lib/display.php +++ b/lib/display.php @@ -1,6 +1,6 @@ "noindex,nofollow"); + GeneratePage($template, $pagetitle, $revision, $args); $request->checkValidators(); flush(); } @@ -90,6 +93,8 @@ function displayPage(&$request, $template=false) { $revision = $page->getRevision($version); if (!$revision) NoSuchRevision($request, $page, $version); + /* Tell Google (and others) to ignore old versions of pages */ + $toks['ROBOTS_META'] = "noindex,nofollow"; } else { $revision = $page->getCurrentRevision(); @@ -202,6 +207,20 @@ function displayPage(&$request, $template=false) { } } + /* Check for special pagenames */ + /* + if ( $pagename == _("RecentChanges") + || $pagename == _("RecentEdits") + || $pagename == _("RecentVisitors")) { + $toks['ROBOTS_META']="noindex,follow"; + } else + */ + if ($pagename == _("SandBox")) { + $toks['ROBOTS_META']="noindex,nofollow"; + } else if (!isset($toks['ROBOTS_META'])) { + $toks['ROBOTS_META'] = "index,follow"; + } + $toks['CONTENT'] = new Template('browse', $request, $page_content); $toks['TITLE'] = $pagetitle; // tag @@ -209,7 +228,6 @@ function displayPage(&$request, $template=false) { $toks['revision'] = $revision; if (!empty($redirect_message)) $toks['redirected'] = $redirect_message; - $toks['ROBOTS_META'] = 'index,follow'; $toks['PAGE_DESCRIPTION'] = $page_content->getDescription(); $toks['PAGE_KEYWORDS'] = GleanKeywords($page); if (!$template) @@ -224,6 +242,9 @@ function displayPage(&$request, $template=false) { } // $Log: not supported by cvs2svn $ +// Revision 1.65 2005/05/05 08:54:40 rurban +// fix pagename split for title and header +// // Revision 1.64 2005/04/23 11:21:55 rurban // honor theme-specific SplitWikiWord in the HEADER // diff --git a/lib/plugin/Calendar.php b/lib/plugin/Calendar.php index 566b159d4..db646d74b 100644 --- a/lib/plugin/Calendar.php +++ b/lib/plugin/Calendar.php @@ -1,5 +1,5 @@ <?php // -*-php-*- -rcs_id('$Id: Calendar.php,v 1.30 2005-04-02 03:05:44 uckelman Exp $'); +rcs_id('$Id: Calendar.php,v 1.31 2006-03-19 14:26:29 rurban Exp $'); /** Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam @@ -47,7 +47,7 @@ extends WikiPlugin function getVersion() { return preg_replace("/[Revision: $]/", '', - "\$Revision: 1.30 $"); + "\$Revision: 1.31 $"); } function getDefaultArguments() { @@ -163,6 +163,7 @@ extends WikiPlugin } else { $date = HTML::a(array('class' => 'cal-hide', + 'rel' => 'nofollow', 'href' => WikiURL($page_for_date, array('action' => 'edit')), 'title' => sprintf(_("Edit %s"), @@ -239,6 +240,9 @@ extends WikiPlugin }; // $Log: not supported by cvs2svn $ +// Revision 1.30 2005/04/02 03:05:44 uckelman +// Removed & from vars passed by reference (not needed, causes PHP to complain). +// // Revision 1.29 2004/12/06 19:15:04 rurban // save edit-time links as requested in #946679 // diff --git a/lib/plugin/RecentChanges.php b/lib/plugin/RecentChanges.php index 3d4e94ff0..b453d703e 100644 --- a/lib/plugin/RecentChanges.php +++ b/lib/plugin/RecentChanges.php @@ -1,5 +1,5 @@ <?php // -*-php-*- -rcs_id('$Id: RecentChanges.php,v 1.108 2005-04-01 16:09:35 rurban Exp $'); +rcs_id('$Id: RecentChanges.php,v 1.109 2006-03-19 14:26:29 rurban Exp $'); /** Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam @@ -125,7 +125,9 @@ extends _RecentChanges_Formatter { function diffLink ($rev) { global $WikiTheme; - return $WikiTheme->makeButton(_("(diff)"), $this->diffURL($rev), 'wiki-rc-action'); + $button = $WikiTheme->makeButton(_("(diff)"), $this->diffURL($rev), 'wiki-rc-action'); + $button->setAttr('rel', 'nofollow'); + return $button; } function historyLink ($rev) { @@ -415,6 +417,7 @@ extends _RecentChanges_HtmlFormatter function diffLink ($rev) { $linkurl = parent::diffLink($rev); $linkurl->setAttr('target', '_content'); + $linkurl->setAttr('rel', 'nofollow'); // FIXME: Smelly hack to get smaller diff buttons in sidebar $linkurl = new RawXML(str_replace('<img ', '<img style="height:2ex" ', asXML($linkurl))); return $linkurl; @@ -736,7 +739,7 @@ extends WikiPlugin function getVersion() { return preg_replace("/[Revision: $]/", '', - "\$Revision: 1.108 $"); + "\$Revision: 1.109 $"); } function managesValidators() { @@ -924,6 +927,9 @@ class DayButtonBar extends HtmlElement { } // $Log: not supported by cvs2svn $ +// Revision 1.108 2005/04/01 16:09:35 rurban +// fix defaults in RecentChanges plugins: e.g. invalid pagenames for PageHistory +// // Revision 1.107 2005/02/04 13:45:28 rurban // improve box layout a bit // -- 2.45.0