[Mediawiki-l] Re: Certain counters not showing

Jan Steinman Jan at Bytesmiths.com
Sun Apr 17 17:38:39 UTC 2005


Well, this got a big yawn last time I posted this, so I had to go 
digging. I did find out something further: SpecialPopularpages.php 
hard-codes for namespace 0.

I had to hack in the following to make it work for all namespaces. 
Sorry this isn't in the form of a diff. If this hasn't been done for 
1.5, and the powers that be want it so, I'm willing to figure out 
enough about CVS to get it into 1.5, but I think I need some 
authorization, or at least a little hand-holding.

You can see this work at 
http://www.islandseeds.org/wiki/Special:Popularpages

-------- SpecialPopularpages.php, lines 40-53 --------

			WHERE cur_is_redirect=0";
//			WHERE cur_namespace=0 AND cur_is_redirect=0";
	}

	function formatResult( $skin, $result ) {
		global $wgLang, $wgContLang, $wgCanonicalNamespaceNames;

		$link = $skin->makeKnownLink(
			($result->namespace ? 
($wgCanonicalNamespaceNames[$result->namespace] . ':') : '') . 
$result->title,
			$wgContLang->convert( $result->title ) );
		$nv = wfMsg( "nviews", $wgLang->formatNum( $result->value ) );
		return "{$link} ({$nv})";
	}
}

Begin forwarded message:

> From: Jan Steinman <Jan at Bytesmiths.com>
> Date: 14 April 2005 00:27:19 GMT-07:00
>
> I took a static HTML page that had a CGI-based counter on it, and put 
> it in MediaWiki. I then took the count that was on its CGI-based 
> counter, and put that in the mw_cur.cur_counter field. Great! It shows 
> up on that page with the proper count, and increments with each hit! 
> <http://www.IslandSeeds.org>
>
> However, this did not cause it to show up in Special:Popularpages. Is 
> there someplace else that the count needs to be stuffed for it to be 
> seen by Special:Popularpages?
>
> Thanks!

:::: Nature must, in the not too distant future, institute bankruptcy 
proceedings against industrial civilization. -- William Catton
:::: Jan Steinman <http://www.Bytesmiths.com/Van>




More information about the MediaWiki-l mailing list