Jack Phoenix has uploaded a new change for review. https://gerrit.wikimedia.org/r/278605
Change subject: Make use of the special page parameter to allow for easier linking in wikitext ...................................................................... Make use of the special page parameter to allow for easier linking in wikitext Now you can do stuff like [[Special:TopFansByStat/friends_count|this]] in wikitext instead of having to mess around with {{fullurl:}} and external link syntax. Yay! Change-Id: Iccfcf7879149828b29a84876124e55af6c8c9fc6 --- M UserStats/TopFansByStat.php M UserStats/TopFansRecent.php 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SocialProfile refs/changes/05/278605/1 diff --git a/UserStats/TopFansByStat.php b/UserStats/TopFansByStat.php index 1614669..4e27d1b 100644 --- a/UserStats/TopFansByStat.php +++ b/UserStats/TopFansByStat.php @@ -19,7 +19,7 @@ /** * Show the special page * - * @param $par Mixed: parameter passed to the page or null + * @param @param string|null $par Statistic name, i.e. friends_count or edit_count, etc. (or null) */ public function execute( $par ) { global $wgMemc; @@ -37,7 +37,7 @@ $dbr = wfGetDB( DB_SLAVE ); - $statistic = trim( $request->getVal( 'stat' ) ); + $statistic = trim( $request->getVal( 'stat', $par ) ); $column = "stats_{$statistic}"; // Error if the query string value does not match our stat column diff --git a/UserStats/TopFansRecent.php b/UserStats/TopFansRecent.php index b5d19e5..93dc517 100644 --- a/UserStats/TopFansRecent.php +++ b/UserStats/TopFansRecent.php @@ -12,7 +12,7 @@ /** * Show the special page * - * @param $par Mixed: parameter passed to the page or null + * @param string|null $par Period name, i.e. weekly or monthly (or null) */ public function execute( $par ) { global $wgMemc; @@ -27,7 +27,7 @@ // Load CSS $out->addModuleStyles( 'ext.socialprofile.userstats.css' ); - $periodFromRequest = $request->getVal( 'period' ); + $periodFromRequest = $request->getVal( 'period', $par ); if ( $periodFromRequest == 'weekly' ) { $period = 'weekly'; } elseif ( $periodFromRequest == 'monthly' ) { -- To view, visit https://gerrit.wikimedia.org/r/278605 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iccfcf7879149828b29a84876124e55af6c8c9fc6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SocialProfile Gerrit-Branch: master Gerrit-Owner: Jack Phoenix <j...@countervandalism.net> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits