Blog entries from May 2007.
Version 0.1 of the ShoutBox Extension has just been released and is available for download.
This extension adds a parser function called #shoutbox which allows editors to embed ShoutBox frames into articles (see the project page for a demo).
As always, I'll be happy to answer any questions. Enjoy![read more ...] -or- [leave a comment ...]
--Jim Wilson 23:22, 29 May 2007 (MST)
Version 0.1 of the EditOnlyYourOwnPage Extension has just been released and is available for download.
This extension prevents non-sysop users from creating or editing any pages other than their own user page, their own talk page, or subpages thereof. This is more stringent than the KeepYourHandsToYourself Extension, which merely prevents edits in the User namespace to pages other than a user's own page or subpages.
EditOnlyYourOwnPage is suitable as a protection mechanism for wikis that have a limited, trusted editorship, but still want visitors to be able to create their own accounts and corresponding user page (like my blog).
Since this extension will prevent users from editing other users' talk pages, it makes sense to install an extension to provide this facility through another means (something like the ArticleComments Extension).
As always, I'll be happy to answer any questions. Enjoy![read more ...] -or- [leave a comment ...]
--Jim Wilson 14:55, 29 May 2007 (MST)
Version 0.6.3 of the WikiArticleFeeds Extension has just been released and is available for download. Sorry for the short turn-around, those of you who recently upgraded to 0.6.2.
This version has just one change: hook functions which were previously object methods are now first-order (global) functions for MediaWiki installations less than 1.7.
What this means is that any servers running MediaWiki 1.7 or higher will see no change upgrading to 0.6.3. This only affects version 1.6 and lower, and only under certain circumstances.
I suspect there's a bug in the 1.6.x codebase, but I haven't done extensive testing to confirm. Here are the steps to produce the issue:
The issue happens when wgRunHooks() attempts to execute on the stack for the event listed above. You'll find (if the bug is occurring properly) that it fails with an error and backtrace, and the dump of $wgHooks will show that the object reference used in the original hook specification has been changed to NULL.
I suspect, this only happens on 1.6.x - though I've only tested on 1.6 and 1.10, so it's possible it happens in 1.9 also (no need to discuss 1.7 or 1.8 since they've cycled out).
The problem can be effectively avoided by shying away from object/method hooks in lieu of pure function hooks. To this end, the latest version of the WikiArticleFeeds Extension will check if the version is less than 1.7 and insert global functions to call as hooks instead of attempting an object/method strategy.
As always, I'll be happy to answer any questions. Enjoy![read more ...] -or- [leave a comment ...]
--Jim Wilson 22:37, 21 May 2007 (MST)
Version 0.1 of the EmbedVideo Extension has been released and is available for download. It adds a parser function called #ev for embedding video frames within wiki pages.
Although it's true that the VideoFlash Extension achieves roughly the same thing via an extension tag, I required a parser function solution in order to support template parameter speficication. (Extension tags can't interpret {{{1}}} and the like while parser functions can).
The EmbedVideo parser function expects to be called in either of the following ways:
Where:
For example, to include the famous "evolution of dance" YouTube video, you'd enter:
{{#ev:youtube|dMH0bHeiRNg}}
And if you wanted scaled down to thumbnail size, you could use:
{{#ev:youtube|dMH0bHeiRNg|100}}
In addition to YouTube, EmbedVideo currently supports FunnyOrDie, Google Video, Dailymotion, sevenload and Revver, and may be configured to support any number of other video sharing services.
Note: See the project page for more examples.
Enjoy! As always, I'll be happy to answer any questions.
[read more ...] -or- [leave a comment ...]
--Jim Wilson 21:59, 21 May 2007 (MST)
Version 0.1 of the SMW_InlineQueryParserFunction Extension has been released and is available for download. It adds a parser function called #ask, which is logical counterpart to Semantic's inline query extension tag called <ask>.
For a quick example of how this works, consider a query for an unordered list of results. In extension tag form, you might do something like this:
<ask format="ul">[[some relation to::Some Page]]</ask>
The equivalent {{#ask}} parser function form is this:
{{#ask:format=ul|[[some relation to::Some Page]]}}
{{#ask:[[some relation to::Some Page]]|format=ul}}
I hope to get the code for this extension integrated into the Semantic MediaWiki codebase as soon as reasonable. It does not affect existing functionality in any way I can conceive - if the community can find something out of place, I'll be happy (eager) to fix it.
Enjoy! As always, I'll be happy to answer any questions.
[read more ...] -or- [leave a comment ...]
--Jim Wilson 11:31, 21 May 2007 (MST)
The MetaKeywordsTag Extension was created primarily as a demonstration of the concepts described in the article Doing more with MediaWiki parser extensions. Since its release, I've received several comments, questions and feature requests that I felt a need to summarize and answer here.
[read more ...] -or- [leave a comment ...]
--Jim Wilson 10:43, 16 May 2007 (MST)
Version 0.1 of the RegexParserFunctions Extension has been released and is available for download. It adds a parser function called #regex, which is used to perform regular expression matches and replacements.
For example, say you're trying to grab the last portion of a Title which is using '/' characters to delimit subpages. For that, you might use:
{{#regex:{{PAGENAME}}|%^.*/(.*)$%|$1}}
Where:
Note: A full discussion of regular expression syntax is outside the scope of this article.
Like PHP's preg_match() method, the pattern can use '|', '%' or '/' as expression delimiters.
Enjoy! As always, I'll be happy to answer any questions.
[read more ...] -or- [leave a comment ...]
--Jim Wilson 00:12, 12 May 2007 (MST)
Version 0.6.2 of the WikiArticleFeeds Extension has just been released and is available for download.
This version has two enhancements submitted by Charlie Huggard:
Of course, the latter of the above means that wikis with pages undergoing rapid purging may suffer a performance hit as the feeds are regenerated on every action=feed request. Maybe I should insert a configuration parameter which toggles this behavior. Any thoughts?
As always, I'll be happy to answer any questions. Enjoy![read more ...] -or- [leave a comment ...]
--Jim Wilson 20:56, 9 May 2007 (MST)
One complaint about MediaWiki articles when printing is the handling of page breaks. In Word, PDF or other page-oriented media, page breaks sometimes reflect a semantic distinction between the content before and after the page.
Here's a way to force a page break in the printed version of a Wiki article:
<div style="page-break-before:always"></div>
{{pagebreak}}
[read more ...] -or- [leave a comment ...]
--Jim Wilson 13:32, 9 May 2007 (MST)
Hi, I'm Jim R. Wilson - and I want to be the one.
My handle is Jimbojw, which I've had since about AOL 3.0 (1995). I wanted to be "JimboJ" but that was already taken (go figure). I control jimbojw.com which I registered several years ago and recently started using for my blog.
I am not Jimbo Wales, nor his impersonator - despite incessant accusations to the contrary on the #mediawiki IRC channel.
Funny story about that. I was banned from Wikipedia approximately 20 seconds after my first edit: I created the page Livebearers and immediately redirected it to Live-bearing aquarium fish having noticed that several pages linked there. They thought I was an impersonator/vandal. I guess aquarium fish were a hot target those days.
After pleading my case to the admin that blocked me, it was decided that as a longstanding nickname, "Jimbojw" conformed to the Wikipedia Username conventions and I was unbanned. At the time of this writing, "Livebearers" still redirects to "Live-bearing aquarium fish" having never been altered or redacted.
In any case, I'm not him. Nor am I James R. Wilson the software architect or Jim Wilson the contemporary pianist. I also haven't authored any of these books - or any other books for that matter (yet).
I'm not Jim R. Wilson (Microsoft's MVP of the month of January '07), nor am I any of these Jim Wilsons, though I did submit my contact info for inclusion and was subsequently ignored.
It should go without saying that I'm not James Wilson (signer of the Declaration of Independence) or any other historical James Wilson or Jim Wilson. And I'm definitely not this guy.
I'm just a lowly software developer - trying to take my own name.
I say that because searching for Jim R. Wilson leads you James R. Wilson - head of NCSU's department of Industrial Engineering - another guy that I'm not. In fact, I'm not even on the first page of results, which is especially sad considering Robert James Wilson made it and his page doesn't even exist!
Oddly enough, searching for "Jim R. Wilson" (with quotes) does better - most links after the first one are at least tangentially about me or reflect something I've written or done.
But I want more. I want to be the "I Feel Lucky" of "Jim R. Wilson" (with and without quotes).
I guess I'll just have to keep writing MediaWiki Extensions, Greasemonkey Userscripts, and good old-fashioned technical articles; because we all know that true SEO comes from good content.
(Just kidding - please send me some link love. Thanks in advance).[read more ...] -or- [leave a comment ...]
--Jim Wilson 15:47, 8 May 2007 (MST)