I'm trying to set up a system of Infoboxes for use on a few pages (with a running theme) on my Wiki, but all my searches on how to actually go about creating an Infobox are turning up nil. A Google search only revealed other Wiki's infoboxes and their Talk pages on them. I couldn't find a wiki page in the MediaWiki meta on how to do it, so I'm turning here for help. I don't think just copy-pasting the source of the infoboxes I need from Wikipedia is a good idea, as Wikipedia uses a different version of the software than me (I can only use up to 1.6.10), and there is so much syntax and other templates there in use that I'm not aware of. Does anyone have any pointers? Thanks in advance, -Azurite
I would recommend you install Tim Starling's ParserFunctions - http://www.mediawiki.org/wiki/Extension:ParserFunctions - as lots of Wikipedia's templates and infoboxes use these.
Copying from Wikipedia is probably the best way to learn about infoboxes. Beware however that just copying them will likely result in them looking like an odd bunch of <td> tags; you'll need to find the relevant CSS in (I think) MediaWiki:Common.css
On 26/05/07, Azurite azurite@seventh-star.net wrote:
I'm trying to set up a system of Infoboxes for use on a few pages (with a running theme) on my Wiki, but all my searches on how to actually go about creating an Infobox are turning up nil. A Google search only revealed other Wiki's infoboxes and their Talk pages on them. I couldn't find a wiki page in the MediaWiki meta on how to do it, so I'm turning here for help. I don't think just copy-pasting the source of the infoboxes I need from Wikipedia is a good idea, as Wikipedia uses a different version of the software than me (I can only use up to 1.6.10), and there is so much syntax and other templates there in use that I'm not aware of. Does anyone have any pointers? Thanks in advance, -Azurite
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Gary Kirk wrote:
I would recommend you install Tim Starling's ParserFunctions - http://www.mediawiki.org/wiki/Extension:ParserFunctions - as lots of Wikipedia's templates and infoboxes use these.
Copying from Wikipedia is probably the best way to learn about infoboxes. Beware however that just copying them will likely result in them looking like an odd bunch of <td> tags; you'll need to find the relevant CSS in (I think) MediaWiki:Common.css
The link I got from Gary Kirk wasn't the right one, but after some digging, I found the extension he mentioned. However, it seems to require PHP5, which I don't have- that's why I'm still running MediaWiki 1.6.10, because it was the last version to support PHP4. My server has no plans to upgrade, last time I checked. Is there an older version of the ParserFunctions extension which is compatible with PHP4? Thanks, -Azurite
On Saturday 26 May 2007 08:43, Azurite wrote:
Is there an older version of the ParserFunctions extension which is compatible with PHP4?
The page on meta has instructions for getting PF to work on 1.6:
http://meta.wikimedia.org/wiki/ParserFunctions#Installation
Ian
I installed the ParserFunctions version for older wikis that don't have PHP5, but then I got this error: "*Warning*: Missing argument 2 for wfparserfunctionslanguagegetmagic() in */home/*****/public_html/wikific/extensions/ParserFunctions/ParserFunctions.php* on line *169"* This is line 169: function wfParserFunctionsLanguageGetMagic( &$magicWords, $langCode ) { Yikes! What can I do? -Azurite
I actually found the fixes for 1.6 on the bottom of the page... I'm a bit too impatient with errors.
Well, I implemented them, and they seemed to work, until I got this: *Parse error*: syntax error, unexpected T_DEFAULT in */home/*****/public_html/wikific/extensions/ParserFunctions/ParserFunctions.php* on line *179*
Line 179 is this:
default:
followed by this:
$magicWords['expr'] = array( 0, 'expr' );
$magicWords['if'] = array( 0, 'if' );
$magicWords['ifeq'] = array( 0, 'ifeq' );
$magicWords['ifexpr'] = array( 0, 'ifexpr' );
$magicWords['switch'] = array( 0, 'switch' );
$magicWords['default'] = array( 0, '#default' );
$magicWords['ifexist'] = array( 0, 'ifexist' );
$magicWords['time'] = array( 0, 'time' );
}
I'm not sure if this is a matter of quotes not being where they should, though I read that's a common cause of the T_DEFAULT error.
The changes I made:
* Uploaded SprintfDateCompat.php to my ParserFunctions extension folder
* Replaced the #-less section of this with the one that includes them:
$wgParser->setFunctionHook( '#expr', array( &$wgExtParserFunctions, 'expr' ) ); $wgParser->setFunctionHook( '#if', array( &$wgExtParserFunctions, 'ifHook' ) ); $wgParser->setFunctionHook( '#ifeq', array( &$wgExtParserFunctions, 'ifeq' ) ); $wgParser->setFunctionHook( '#ifexpr', array( &$wgExtParserFunctions, 'ifexpr' ) ); $wgParser->setFunctionHook( '#switch', array( &$wgExtParserFunctions, 'switchHook' ) ); $wgParser->setFunctionHook( '#ifexist', array( &$wgExtParserFunctions, 'ifexist' ) );
* Added this to line 169: function wfParserFunctionsLanguageGetMagic( &$magicWords, $langCode='en' ) {
* Replaced the older version of this on line 57 with this: function ifHook( &$parser, $test = '', $then = '', $else = '' ) { if ( (string)$test !== '' ){
Those are all the fixes mentioned on the Meta page, but I'm not running PHP 4.3.9, which is the only version cited as being incompatible with that last fix. Any ideas? -Azurite
I went through the steps again on the Parser Functions page for 1.6, making sure to grab the version that's for PHP4 servers. I made sure I searched and replaced the appropriate lines, deleted the other lines mentioned, etc. I got rid of the error I last mentioned, but now a new one pops up:
array(2) { ["UnknownAction"]=> array(1) { [0]=> string(12) "actionCreate" } ["ParserClearState"]=> array(2) { [0]=> array(2) { [0]=> &NULL [1]=> string(10) "clearState" } [1]=> array(2) { [0]=> &object(extparserfunctions)(4) { ["mExprParser"]=> NULL ["mTimeCache"]=> array(0) { } ["mTimeChars"]=> int(0) ["mMaxTimeChars"]=> int(1000) } [1]=> string(10) "clearState" } } } Unknown datatype in hooks for ParserClearState
Backtrace:
* GlobalFunctions.php line 602 calls wfbacktrace() * Hooks.php line 85 calls wfdebugdiebacktrace() * Parser.php line 172 calls wfrunhooks() * Parser.php line 3507 calls parser::clearstate() * MessageCache.php line 457 calls parser::transformmsg() * MessageCache.php line 406 calls messagecache::transform() * GlobalFunctions.php line 449 calls messagecache::get() * GlobalFunctions.php line 408 calls wfmsggetkey() * GlobalFunctions.php line 319 calls wfmsgreal() * Skin.php line 1085 calls wfmsg() * SkinTemplate.php line 369 calls skinmonobook::aboutlink() * OutputPage.php line 583 calls skinmonobook::outputpage() * Wiki.php line 251 calls outputpage::output() * index.php line 124 calls mediawiki::finalcleanup()
I wouldn't have the first clue what to look at for this... Sorry to be such a pest to the list, but I really hope someone can help me with this. All I wanted was some simple Infoboxes! -Azurite
mediawiki-l@lists.wikimedia.org