r67778 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67777‎ | r67778 | r67779 >
Date:06:24, 10 June 2010
Author:werdna
Status:deferred
Tags:
Comment:
Fixes for ActiveStrategy:
1. Make sure that we pick up only actual task force pages, instead of their subpages.
2. Pull member count from link tables instead of trying to parse it out of the page with regexes.
Modified paths:
  • /trunk/extensions/StrategyWiki/ActiveStrategy/ActiveStrategy_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/StrategyWiki/ActiveStrategy/ActiveStrategy_body.php
@@ -14,6 +14,7 @@
1515 array(
1616 'page_namespace' => 0,
1717 "page_title LIKE 'Task_force/%'",
 18+ "page_title NOT LIKE 'Task_force/%/%'",
1819 ), __METHOD__ );
1920
2021 return $res;
@@ -206,9 +207,12 @@
207208 }
208209
209210 $article = new Article( Title::newFromText( $taskForce ) );
210 - $content = $article->getContent();
 211+
 212+ $dbr = wfGetDB( DB_SLAVE );
211213
212 - $count = self::parseMemberList( $content );
 214+ $count = $dbr->selectField( 'pagelinks', 'count(*)',
 215+ array( 'pl_from' => $article->getId(),
 216+ 'pl_namespace' => NS_USER ), __METHOD__ );
213217
214218 $wgMemc->set( $key, $count, 86400 );
215219

Follow-up revisions

RevisionCommit summaryAuthorDate
r67780Merge r67775 and r67778werdna06:29, 10 June 2010

Status & tagging log