User talk:Subfader/LQT Archive 1

Default User Page header
Have you considered Extension:HeaderFooter ? Jean-Lou Dupont 13:55, 14 May 2008 (UTC)
 * Hi, thanks. Will check, if not I think I found another way: Hack monobook, include MW message, problem: get DB data.--Subfader 15:21, 14 May 2008 (UTC)

Created pages
I've deleted a whole bunch of apparently meaningless pages you've created with  . Werdna 07:50, 16 May 2008 (UTC)
 * yep thanks, tried to include the signature date to my nicknake signature. no idea how it works, now using the standard again. --Subfader 09:14, 16 May 2008 (UTC)

Category Sorting Rules
Here's a first draft for your 'Category Sorting Rules' extension. There's a mechanism already built in for this, but after having a quick play with it, it has a few little bugs, which I tried to fix (hence the edits to core Mediawiki files).

languages/Language.php (or in the language plugin for the language you are using): Change (lines 1383-1385): function convertCategoryKey( $key ) { return $this->mConverter->convertCategoryKey( $key ); }

To: function convertCategoryKey( $key ) { global $wgSortkeyRegexes; # Do the standard conversion $key = $this->mConverter->convertCategoryKey( $key ); # Convert to lowercase $key = mb_strtolower( $key ); # Apply any other transformations (such as accents) $key = preg_replace( array_keys( $wgSortkeyRegexes ), array_values( $wgSortkeyRegexes ), $key ); return $key; }

includes/Title.php: After (line 1910): function moveTo( &$nt, $auth = true, $reason = '' ) { Add: global $wgContLang;

Change (lines 1929-1932): $sql = "UPDATE $categorylinks SET cl_sortkey=". $dbw->addQuotes( $nt->getPrefixedText ). " WHERE cl_from=". $dbw->addQuotes( $pageid ). " AND cl_sortkey=". $dbw->addQuotes( $this->getPrefixedText ); $dbw->query( $sql, 'SpecialMovepage::doSubmit' );

To: $sql = "UPDATE $categorylinks SET cl_sortkey=". $dbw->addQuotes( $wgContLang->convertCategoryKey( $nt->getPrefixedText ) ). " WHERE cl_from=". $dbw->addQuotes( $pageid ). " AND cl_sortkey=". $dbw->addQuotes( $wgContLang->convertCategoryKey( $this->getPrefixedText ) ); $dbw->query( $sql, 'SpecialMovepage::doSubmit' );

In LocalSettings.php (or wherever seems appropriate), include a set of sort rules (as regular expressions). For example: $wgSortkeyRegexes = array(               '/[aàáâãäå]/'  => 'a',                '/[èéêë]/'     => 'e',                '/[$¢£¥]/'     => '¤',                '/^the +/'     => ,                '/^le +/'      =>         );

Hope this is of some use to you. I can always work on a more user-friendly extension if you prefer. --MrAngel 12:22, 2 June 2008 (UTC)

Edit-link on Category pages
I've got an extension on a couple of my sites that does something similar, although it's not implemented as a gadget. Is this of any interest to you?


 * Staying with my parents for a while now, and forgot to bring the extension code with me. I'll continue that when I get back. While I'm here, I'm having a look at your other requests instead - something like this suit your needs? Just need to add the show/hide links now (with 'hide' by default, because generating this list is quite intensive on the database). --MrAngel 14:33, 15 June 2008 (UTC)


 * Yeah, absolutely as I described! Looks like we have much in common wiki-wise :D --Subfader 14:40, 15 June 2008 (UTC)


 * OK ... not sure how to paste a PHP file on here without it trying to parse bits as wikitext, so I emailed it to you. (Somehow I've ended up with more experience in writing extensions than actually using the thing). The show/hide link reloads the page at present ... I tried putting it in javascript, but generating the lists of links puts such a big load on the database that I figured we should only do it when the user actually wants it. --MrAngel 04:36, 16 June 2008 (UTC)