From 11acc476f42f3b43f43864bb7be0730f54bd8e33 Mon Sep 17 00:00:00 2001 From: Alexander Sigachov Date: Tue, 12 Jul 2005 21:23:28 +0000 Subject: [PATCH] Add categories to meta KEYWORDS --- includes/OutputPage.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 05e2756bca..36e5871365 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -765,14 +765,15 @@ class OutputPage { } /** - * This function takes the existing and broken links for the page + * This function takes the title (first item of mGoodLinks), categories, existing and broken links for the page * and uses the first 10 of them for META keywords */ function addMetaTags () { global $wgLinkCache , $wgOut ; + $categories = array_keys ( $wgLinkCache->mCategoryLinks ) ; $good = array_keys ( $wgLinkCache->mGoodLinks ) ; $bad = array_keys ( $wgLinkCache->mBadLinks ) ; - $a = array_merge ( $good , $bad ) ; + $a = array_merge ( array_slice ( $good , 0 , 1 ), $categories, array_slice ( $good , 1 , 9 ) , $bad ) ; $a = array_slice ( $a , 0 , 10 ) ; # 10 keywords max $a = implode ( ',' , $a ) ; $strip = array( -- 2.20.1