Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

User talk:Joe Beaudoin Jr.

Discussion page of User:Joe Beaudoin Jr.
Revision as of 21:40, 5 September 2007 by Catrope (talk | contribs) (→‎MediaWiki 1.11: better link)


Feelin' Chicken

8) Shane (T - C - E) 10:44, 27 August 2007 (CDT)

Indeed. -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 10:58, 27 August 2007 (CDT)

SkinTemplate.php

Nice job on the image tabs. If you can provide a diff between the MediaWiki 1.10 version of SkinTemplate.php and your modified version, I may be able to add this feature in MediaWiki 1.11 (I have commit access to the MediaWiki SVN). I may also be able to find a cleaner way of translating Bild: back to Image: (which should be possible). --Catrope(Talk to me or e-mail me) 16:24, 27 August 2007 (CDT)

Actually, all the work I did is between lines 801 and 889 of the file. I did not modify anything else outside that. Of course, any ways you can find to improve the addition would be great -- and even more so if you can get something like this committed in the next MediaWiki release. ;-) -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 17:15, 27 August 2007 (CDT)
:o Commit Access? I been trying to get that for a while. Shane (T - C - E) 00:48, 28 August 2007 (CDT)
Whether you get it depends on what you want it for. Before summer break I've been helping out Yuri Astrakhan with his bot API (I intend to continue doing so now that school has started again), and at a certain point in time he suggested I start a new branch (called apiedit) for state-changing actions in the API and he requested commit access for me. Anyway, I'll look at ll. 801-889 some day this week and see if I can improve anything. When I'm done improving and all, I'll commit it to the trunk (mentioning your name, of course). Note, though, that it's possible some top guy at MediaWiki (like Rob Church, who is essentially in command of the MediaWiki code) decides this addition doesn't belong in the trunk (should be an extension or something like that) and takes it out again. Whatever happens, I'll keep you updated on the fate of your writing. --Catrope(Talk to me or e-mail me) 09:16, 28 August 2007 (CDT)

I've had a quick look at your code, and I think I can generalize it and make it easily configurable for other wikis. However, I have one question:

if ( !$istalk || $wgOut->showNewSectionLink() ) {
        if ( $isimage == NS_IMAGE || $wgOut->showNewSectionLink() ) {

This if construct looks very weird to me. Firstly, all talk pages show new section links, so the first if() doesn't exclude any pages at all. The second if() restricts the tabs to only those pages that are in the Image: namespace OR have a new section link (the + next to the edit tab) on them (i.e. all talk pages). In some weird way these tabs don't appear on all talk pages, so I'm missing something here. Could you explain why you wrote this if construct the way you wrote it and didn't just use

if($this->mTitle->getNamespace() == NS_IMAGE) {

? --Catrope(Talk to me or e-mail me) 08:20, 30 August 2007 (CDT)

That was a remnant of a test I was conducting... but I'm not sure now what exactly I was testing, only that something was being tested. (I think I was concerned about the tabs being repeated on the talk page as well, but seeing as the second if deals with that as well, it is, as you say, redundant.) You can remove it.
Coincidentally, I was thinking... is there a way to convert the links section on the image description page so that it can read the imagelinks table off the other databases? Ultimately, what I want is to show where the image is used across all wikis, regardless of what wiki the user is currently on. -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 11:46, 30 August 2007 (CDT)
The best way to do that is probably to write a simple PHP script that queries the imagelinks tables in all DBs and prints a (linked) list of titles that use a certain image. A link to this PHP script could then be added to the image tagging template(s). I would advise against trying to do this inside the MediaWiki code.
Meanwhile, I've rewritten your code to be much shorter and much easier to adapt to someone else's needs:
/**
 * Interwiki tabs above Image: pages
 * Original code by Joe Beaudoin Jr. from www.battlestarwiki.org (joe(AT)frakmedia(DOT)net)
 * Modified for more generic usage by Roan Kattouw (AKA Catrope) (roan(DOT)kattouw(AT)home(DOT)nl)
 * If you want to use this, you need to set $wgEnableInterwikiImageTabs to true in LocalSettings.php
 */
global $wgEnableInterwikiImageTabs, $wgInterwikiImageTabs;
if($wgEnableInterwikiImageTabs && $this->mTitle->getNamespace() == NS_IMAGE)
{
        $i = 0;
	foreach($wgInterwikiImageTabs as $prefix => $caption)
	{
		// Go to prefix:Image:title. Image: is automatically translated if necessary.
		$titleObj = Title::newFromText($prefix . ":Image:" . $this->mTitle->getText());
		if($titleObj->getFullURL() != $this->mTitle->getFullURL()) // Don't link to ourselves
			$content_actions['interwikitab-'.$i++] = array(
				'class' => false,
				'text' => $caption,
				'href' => $titleObj->getFullURL()
			);
	}
}
The two $wg* variables need to be set in LocalSettings.php, like so:
$wgEnableInterwikiImageTabs = true;
$wgInterwikiImageTabs = array('en' => 'English', 'de' => 'Deutsch', 'media' => 'Media repository');
The text before the => sign is the interwiki prefix to link to, the text after it is the tab caption. The code also checks whether one of the tabs links to the page currently being viewed, and hides it if so. In other words, the "Deutsch" tab won't show up when viewing an image on de:. --Catrope(Talk to me or e-mail me) 14:02, 30 August 2007 (CDT)
I'll file an enhancement request at MediaZilla tomorrow, so the MediaWiki community can decide whether this belongs in the trunk. It's possible that it has to go in an extension instead, in which case you and I will be able to call ourselves extension maintainers ;) Whatever happens, I'll keep you posted. --Catrope(Talk to me or e-mail me) 14:02, 30 August 2007 (CDT)
I've sent you an e-mail at your frakmedia.net address. Please read it and reply. --Catrope(Talk to me or e-mail me) 16:27, 30 August 2007 (CDT)
You've got mail. ;-) -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 17:11, 30 August 2007 (CDT)

The extension has gone live. You can find it in SVN here, and the associated page on MediaWiki is here. --Catrope(Talk to me or e-mail me) 11:07, 31 August 2007 (CDT)

Sweet! W00t! :-) -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 11:29, 31 August 2007 (CDT)

MediaWiki 1.11

I just saw Brion Vibber archiving the MediaWiki trunk into the 1_11 branch, which means a 1.11 release candidate will be released very soon. Keep an eye on MediaWiki.org. --Catrope(Talk to me or e-mail me) 15:31, 5 September 2007 (CDT)

About time! :-) Better late than never, I suppose. Speaking of which, the new bot API is being rolled out... are there any working bots that can be used with that API yet? -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 15:34, 5 September 2007 (CDT)
Not that I know of. The query part of the API has grown a lot since 1.10, but the state-changing part is still under heavy development, and is unlikely to be included in the final 1.11 release. When I'm done writing my part of the state-changing stuff (everything except edit, upload and register, which is done by 5 Vodafone employees), I'll start writing a graphical interface for the API, which can also be run as a bot. But those are long-term plans right now. Meanwhile, Brion has his tarball ready, and 1.11.0rc1 will appear on MediaWiki.org any minute now. --Catrope(Talk to me or e-mail me) 15:50, 5 September 2007 (CDT)
It's there. --Catrope(Talk to me or e-mail me) 16:31, 5 September 2007 (CDT)