From c09843f28627bf9655cfd7cf8bfbc32070cfa765 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Mon, 14 Mar 2005 07:42:38 +0000 Subject: [PATCH] allow redirects in categories; show cats on redirect page --- includes/Article.php | 9 +++++++-- includes/CategoryPage.php | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 4e56f69109..a65b07d405 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -566,7 +566,7 @@ class Article { function view() { global $wgUser, $wgOut, $wgRequest, $wgOnlySysopsCanPatrol, $wgLang; global $wgLinkCache, $IP, $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol; - global $wgEnotif; + global $wgEnotif, $wgParser; $sk = $wgUser->getSkin(); $fname = 'Article::view'; @@ -669,7 +669,12 @@ class Article { $wgOut->addHTML( '#REDIRECT' . ''.$link.'' ); - + + $parseout = $wgParser->parse($text, $this->mTitle, ParserOptions::newFromUser($wgUser)); + $catlinks = $parseout->getCategoryLinks(); + $wgOut->addCategoryLinks($catlinks); + $skin = $wgUser->getSkin(); + #$wgOut->addHTML($skin->getCategoryLinks()); } else if ( $pcache ) { # Display content and save to parser cache $wgOut->addPrimaryWikiText( $text, $this ); diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 911f017028..2922b7159a 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -91,8 +91,8 @@ class CategoryPage extends Article { array( 'page_title', 'page_namespace', 'cl_sortkey' ), array( $pageCondition, 'cl_from = page_id', - 'cl_to' => $this->mTitle->getDBKey(), - 'page_is_redirect' => 0), + 'cl_to' => $this->mTitle->getDBKey()), + #'page_is_redirect' => 0), #+ $pageCondition, $fname, array( 'ORDER BY' => $flip ? 'cl_sortkey DESC' : 'cl_sortkey', -- 2.20.1