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)

Search-Replace-Move extension
I've just started working on an extension for this one, but am stopping work for today because my neighbour's music is making working here unbearable. I'll hopefully have a result for you in a couple of days. --MrAngel 18:04, 30 June 2008 (UTC)
 * Awesome :) Def check Extension:Replace Text to see how they do it; although I don't like that you#re not able to restrict it to "only pages in category X". --Subfader 19:08, 30 June 2008 (UTC)
 * So far, I've got the code to find and change the titles done, so I just need to do the forms. I'm looking at integrating it with the existing Replace Text extension, so you have a dropdown list option for "Change [page text/titles/both]". I think that putting the two functions together makes a lot of sense - if your search/replace is moving a page, you might also want it to change links on other pages; and if you're doing a search/replace on page texts, you might want it to avoid breaking links.
 * I'll have a look at being able to limit to certain categories - might be a bit challenging to make the extension work with all the databases (I use PostgreSQL, most people use MySQL, so I always prefer to write portable code even if it takes a bit longer). --MrAngel 22:42, 30 June 2008 (UTC)
 * Whoa straight forward eh? :) The integration on Special:Replace Text would be ace as I indeed requested it for the extension. The only thing bad about Extenions:Replace Text is the user problem while the job queue is running.
 * Changing Article Links ? in page content is great, didn't think of the fact that you wouldn't look at Whatlinkshere in such a batch list of course. Looking forward to it. --Subfader 07:01, 1 July 2008 (UTC)
 * I just posted on the extension's talk page with a fix for the user problem. Was just testing and I noticed that it also confused my Per-User Sidebar extension, so figured fixing that would be a higher priority.
 * At first, I expected changing the links to be a big job, but it seems it'll be relatively simple to pull out the contents of the linkcache. --MrAngel 17:08, 1 July 2008 (UTC)


 * OK, got a first prototype ready. Not tested yet, though, and still needs some work on the link-finding thing. Actually, I'm tempted to add a TitleMoveComplete hook, so that when you move/rename a page manually it presents a button to automatically search/replace oldtitle with newtitle . --MrAngel 16:10, 5 July 2008 (UTC)

Unsigned user request
Hi if you have interesting to add replace per-word will be great. I described the problem here http://www.mediawiki.org/wiki/Extension_talk:Replace_Text#Problems Yaron doesn't want to implement it. Any chance? --Unsigned User
 * I dunno how check boxes for every match per page should work for Extension:Replace Text, but this is not the place to request it. --Subfader 10:45, 2 July 2008 (UTC)
 * Hi Subfader, I just requested this here because i saw MrAngel user is implementing some functions to ReplaceText extension so as Yaron doesn't want to implement it, i thought MrAngel could. But thanks for listening me.