Extension talk:ParserFunctions/LQT Archive 1

See: meta:Help_talk:ParserFunctions for much more conversations about this extension.

Strings
Suggestion: It would be useful if also strings could be compared.--Eloy 23:16, 27 March 2008 (UTC)

Am I missing some major fact here?
I feel dumb! I installed the extension (I'm on MW 1.12.0), it shows up on Special:Version but when I add or some other easy example on some article it only displays in plain text. Maybe I need to install something else? --Subfader 12:37, 9 April 2008 (UTC)
 * No idea if this is it / what I should do, but it was introduced in 1.12 Manual:$wgParserConf --Subfader 13:19, 9 April 2008 (UTC)
 * Ok got it working by moving require... above all other require... --Subfader 16:49, 10 April 2008 (UTC)

Similar problem as the one of Subfader
I have a similar problem, but with a small exentension I wrote. Before upgrading to 1.12 it worked OK, now just displays in the article. Moving the includes/reuqire statement didn't work. The exetension was developed based on an example for the parser extensions, but I can't find the link anymore. ParserFunctions as well as the file are includesd/required in the LocalSettings.php

setFunctionHook( 'arreminderdisplay', 'wfArReminderFunction_Render' ); } function wfArReminderFunction_Magic( &$magicWords, $langCode ) {    # Add the magic word # The first array element is case sensitive, in this case it is not case sensitive # All remaining elements are synonyms for our parser function $magicWords['arreminderdisplay'] = array( 0, 'arreminderdisplay' ); # unless we return true, other parser functions extensions won't get loaded. return true; } function wfArReminderFunction_Render( &$parser ) {    # The parser function itself # The input parameters are wikitext with templates expanded # The output should be wikitext too //Erinnerung erst nach dem 25. jeden Monats anzeigen //if((int)date("j") < 25) //{ 	// return ""; //}    return "  "; } ?> --151.71.24.254 09:15, 22 April 2008 (UTC)
 * 1) Define a setup function
 * 1) Add a hook to initialise the magic word

Problems with #switch
I just installed v.1.1.1 on MW 1.12.0, but any time I try to create a page with a "#switch" in it, my server won't serve the page correctly. Instead of showing a page, it gives me the option to download "index.php" which is a 0 byte file. Other parserfunctions ("ifexist" for example) work fine. Does this happen to anyone else? -SColombo 12:06, 5 June 2008 (UTC)

Older versions
Is there any way to get old versions of this extension? I'm specifically interested in a version which would work with MediaWiki 1.5.6 under PHP4 (not PHP5, which is required for modern versions).

Parse error
On 1.12, I've run into what may be an interesting problem: ''Parse error: syntax error, unexpected '{' in extensions/ParserFunctions/ParserFunctions.php on line 74. (http://rafb.net/p/NEDkaT63.html)'' This occurs on multiple wikis/different websites I operate, all under the same host. I'm told by several proficient mwikians/devs that the code is correct (they can't figure it out either); yet no matter what I do, fresh installs, etc., the error persists. I'm trying to fathom if it's a server or filepath issue and what the nature of it is, if that's the case, so I can explain it to them. (They're wiki-illiterate.) --Sasoriza 19:12, 21 July 2008 (UTC)
 * Disregard. Apparently it was a PHP version problem (thanks domas). If anyone should ever encounter the above issue, make sure you're running PHP5x. Still, the timing was very strange. Happened right after I tried installing this extension (and no, I won't try again; call me superstitious). -- Sasoriza 04:18, 22 July 2008 (UTC)

Error with a Function
I have discovered an error with #ifexist function from this extension. If there is an internal link in the either of the outputs for the function, then that link will show up in all of the relevant Special Pages regardless of whether the target pages exists or not.--Mjr162006 22:59, 21 July 2008 (UTC)
 * It's not an error, it's just how the Parser works. Everything inside both the then and else statements get evaluated, regardless of which one is true. The true one is then displayed. Depending on the contents of the output statements, some things may trigger unexpectedly. -- Skiz zerz  02:08, 22 July 2008 (UTC)


 * Hmm... Even if it is not an error, it is still a problem correct? Is there any way at all to program this out of the extension? The other parser functions don't seem to have this problem. The reason this is an issue, is because it messed up our Special Pages: Disambiguations, Whatlinkshere, and Wanted Pages. It kept on showing links that didn't exist. That was all thanks to the ifexist function. Those of us that were trying to fix redirecting links and links to disambiguation pages were essentialed stopped in our tracks by this problem. For now, we went into the templates that used the function and formated the links as external links, but made them look like normal links with plainlinks option with the span tags. But it would be nice if this was corrected in the extension itself. I'm my wiki's resident expert on such things, and it took me a few days to realize that the ifexist function was the cause of it all.--Mjr162006 05:27, 22 July 2008 (UTC)