User:Revansx

Hi. I am Rich

As an amateur web-nerd and open-source devotee, I run the semantic mediawikis over at:


 * http://www.family-connect.net/revansx

I am also the author of the WAMP-based mediawiki extension, MCCP which provides Metrology and Configuration Control functionality to an external database through special pages.

If you wish, you can contact me at:

revansx at gmail dot com

Cheers! -Rich

=Getting Behavior Switch "Number Headings" in MW1.15.1 with simple hack= fyi, I wanted this feature too (badly) and noticed that much has changed in MW since this hack. Still, you gave me the right idea and I was able to implement it to my satisfaction very easily.

The only file I had to modify was the "includes/MagicWords.php" file as follows:

function formatHeadings( $text, $isMain=true ) { global $wgMaxTocLevel, $wgContLang, $wgEnforceHtmlIds;

$doNumberHeadings = $this->mOptions->getNumberHeadings;

/** 		 * BEGIN - RKEVANS HACK FOR MAGIC WORD __NUMBERHEADINGS__ * modified from: http://www.mediawiki.org/wiki/User:Hvoss * (The User:Hvoss version is obsolete but has the right idea) * Note: I hijacked the already existing magic word __INDEX__ to * implement the "NUmber Headings" Behavior Switch :-) neato!		*/		if (! $doNumberHeadings )		{			if ( isset( $this->mDoubleUnderscores['index'] ) ) {				$doNumberHeadings = 1;			}		}		/** 		 * END - RKEVANS HACK FOR MAGIC WORD __NUMBERHEADINGS__ 		 *  modified from: http://www.mediawiki.org/wiki/User:Hvoss		 *  (The User:Hvoss version is obsolete but has the right idea)		 *  Note: I hijacked the already existing magic word __INDEX__ to 		 *  implement the "NUmber Headings" Behavior Switch :-) neato! */

you can see that I tied this behavior switch to the already existing called "__INDEX__"

let me know if you know of a more proper way to achieve this feature in MW v1.15.1