Help talk:ParserFunctions/Archive 4

From Meta, a Wikimedia project coordination wiki

Bugs[edit]

If-statement, it's all defined[edit]

Media Wiki 1.6.7, most recent version of Extensions/ParserFunctions. When using the {{if:}} function, the statement will always be "True," regardless of whether or not it really is. I ran a few test scripts before dumbing it down to a simple {{if: {{{parm|}}}|1|0}}. Regardless of whether parm is defined or not, it always yields "1" as a result. (remind me to proofread next time) -- 71.87.182.37 15:17, 15 July 2006 (UTC)[reply]

  • I fixed it, see the main page - Andrew.

Conflict with Cite[edit]

If I have both ParserFunctions and Cite extensions active, they conflict. I have tried reversing those two require_once statements in LocalSettings.php. I am using MediaWiki 1.6.8 and and tried all of the workarounds suggested for MediaWiki 1.6 (along with several combinations)

array(1) { ["ParserClearState"]=> array(2) { [0]=> array(2) { [0]=> &NULL [1]=> string(10) "clearState" } [1]=> array(2) { [0]=> &object(Cite)#86 (6) { ["mRefs"]=> array(0) { } ["mOutCnt"]=> int(0) ["mInCnt"]=> int(0) ["mBacklinkLabels"]=> NULL ["mParser"]=> NULL ["mInCite"]=> bool(false) } [1]=> string(10) "clearState" } } } Unknown datatype in hooks for ParserClearState

Backtrace[edit]

  • GlobalFunctions.php line 602 calls wfBacktrace()
  • Hooks.php line 85 calls wfDebugDieBacktrace()
  • Parser.php line 172 calls wfRunHooks()
  • Parser.php line 208 calls Parser::clearState()
  • OutputPage.php line 292 calls Parser::parse()
  • OutputPage.php line 282 calls OutputPage::addWikiTextTitle()
  • SpecialVersion.php line 35 calls OutputPage::addWikiText()
  • SpecialVersion.php line 20 calls SpecialVersion::execute()
  • SpecialPage.php line 415 calls wfSpecialVersion()
  • SpecialPage.php line 276 calls SpecialPage::execute()
  • Wiki.php line 155 calls SpecialPage::executePath()
  • Wiki.php line 47 calls MediaWiki::initializeSpecialCases()
  • index.php line 123 calls MediaWiki::initialize()

--Midnightcomm 03:31, 6 September 2006 (UTC)[reply]

I'm having this same problem, same error. I'm running MediaWiki 1.6.10, PHP 4.4.3 (because my server won't upgrade). Any tips? --Azurite 03:56, 27 May 2007 (UTC)[reply]

I happened same case on MediaWiki 1.6.10 and PHP 4.4.7, and perhaps fixed. Please test this patch (Bug 11174, http://bugzilla.wikimedia.org/show_bug.cgi?id=11174). --Coryjp 11:39, 5 September 2007 (UTC)[reply]

--Patch works great! I'm using 1.7 by the way, and had the exact same problem. thanks! -Logicwax

# TIME[edit]

what i must to change that function #TIME will work with PHP4 and WM1.6.9 - 80.235.32.213 16:00, 20 January 2007 (UTC)[reply]

#expr doesn't work at all in MW 1.6[edit]

Can this be fixed? --Alfakim 06:49, 22 January 2007 (UTC) w:User:Alfakim[reply]

Mediawiki 1.9?[edit]

Does this work at all with Mediawiki 1.9? I installed it but the Special:Version page doesn't mention it and the functions are not working yet. --69.226.105.93 18:44, 14 March 2007 (UTC)[reply]

Never mind, yes it does. --69.226.105.93 18:59, 14 March 2007 (UTC)[reply]


Unable to install[edit]

Unable to Download[edit]

The link to download this library references http://svn.wikimedia.org/ which does not seem to be reachable.

Cannot Access SVN[edit]

I have tried to access the php files for this extension from svn but cannot. This is probably temporary, but I thought I should mention it. Thank you. 70.51.120.24 20:16, 24 October 2006 (UTC)[reply]

I'm also finding that svn.wikimedia.org is refusing connections. Are these files mirrored anywhere? 161.72.11.196 01:12, 25 October 2006 (UTC)[reply]
Seeing this as well... Can someone point out a mirror? --68.98.21.161 03:08, 25 October 2006 (UTC)[reply]
It's working now for me. 161.72.11.196 16:33, 25 October 2006 (UTC)[reply]

Unable to install 1[edit]

  • MediaWiki: 1.5.2 (restricted pages patch, cannot update it to newer versions normally as it is heavily patched)
  • PHP: 4.4.2 (cgi)
  • MySQL: 4.0.27-standard

I have tried all available versions but all of them use setFunctionHook() and it happens that my wiki does not know where that function is. I have attempted to convert the {{#expr: }} code to <expr> </expr> with no success. I am not that good of a coder and I have been working with mediawiki for only 6 months. Any simple solutions or similar sources I can use insted of the current ParserFunctions?

Back in a few days, --85.186.135.114 19:25, 25 May 2006 (UTC)[reply]

Nope. Upgrade to 1.6. — Ambush Commander(Talk) 23:25, 16 June 2006 (UTC)[reply]
My hosting service only has MySQL 3.23.xx, so I can't upgrade to 1.6. I patched the 1.5.x Parser.php with some code from the 1.6.9 version. It appears to work, but I'm not really a hardcoder here, so if anybody wants to give this a "big picture" check, it would be worth it. Forgive the lengthy post, but I didn't think it was worth it to make a new article out of something so transient.
*** Parser.php.orig Wed Oct 18 16:50:08 2006
--- Parser.php Tue Jan 16 12:32:32 2007
***************
*** 93,99 ****
    * @access private
    */
   # Persistent:
!  var $mTagHooks;
  
   # Cleared with clearState():
   var $mOutput, $mAutonumber, $mDTopen, $mStripState = array();
--- 93,100 ----
    * @access private
    */
   # Persistent:
!  var $mTagHooks, $mFunctionHooks;
! # ParserFunctions HACK
  
   # Cleared with clearState():
   var $mOutput, $mAutonumber, $mDTopen, $mStripState = array();
***************
*** 121,126 ****
--- 122,128 ----
    $this->mTemplates = array();
    $this->mTemplatePath = array();
   $this->mTagHooks = array();
+  $this->mFunctionHooks = array(); # ParserFunction HACK
   $this->clearState();
   }
  
***************
*** 2194,2199 ****
--- 2196,2231 ----
   }
   }
  
+ #
+ # ParserFunctions HACK
+ #
+ # Taken from 1.6.9 source tree
+  # Extensions
+  if ( !$found ) {
+  $colonPos = strpos( $part1, ':' );
+  if ( $colonPos !== false ) {
+  $function = strtolower( substr( $part1, 0, $colonPos ) );
+  if ( isset( $this->mFunctionHooks[$function] ) ) {
+  $funcArgs = array_merge( array( &$this, substr( $part1, $colonPos + 1 ) ), $args );
+  $result = call_user_func_array( $this->mFunctionHooks[$function], $funcArgs );
+  $found = true;
+  if ( is_array( $result ) ) {
+  $text = $linestart . $result[0];
+  unset( $result[0] );
+ 
+  // Extract flags into the local scope
+  // This allows callers to set flags such as nowiki, noparse, found, etc.
+  extract( $result );
+  } else {
+  $text = $linestart . $result;
+  }
+  }
+  }
+  }
+ #
+ # ParserFunctions HACK
+ #
+ 
   # Template table test
  
   # Did we encounter this template already? If yes, it is in the cache
***************
*** 2989,2994 ****
--- 3021,3063 ----
   return $oldVal;
   }
  
+ #
+ # ParserFunctions HACK
+ #
+ # Taken from the 1.6.9 source tree
+  /**
+   * Create a function, e.g. {{sum:1|2|3}}
+   * The callback function should have the form:
+   *    function myParserFunction( &$parser, $arg1, $arg2, $arg3 ) { ... }
+   *
+   * The callback may either return the text result of the function, or an array with the text 
+   * in element 0, and a number of flags in the other elements. The names of the flags are 
+   * specified in the keys. Valid flags are:
+   *   found                     The text returned is valid, stop processing the template. This 
+   *                             is on by default.
+   *   nowiki                    Wiki markup in the return value should be escaped
+   *   noparse                   Unsafe HTML tags should not be stripped, etc.
+   *   noargs                    Don't replace triple-brace arguments in the return value
+   *   isHTML                    The returned text is HTML, armour it against wikitext transformation
+   *
+   * @access public
+   *
+   * @param string $name The function name. Function names are case-insensitive.
+   * @param mixed $callback The callback function (and object) to use
+   *
+   * @return The old callback function for this name, if any
+   */
+  function setFunctionHook( $name, $callback ) {
+  $name = strtolower( $name );
+  $oldVal = @$this->mFunctionHooks[$name];
+  $this->mFunctionHooks[$name] = $callback;
+  return $oldVal;
+  }
+ #
+ # ParserFunctions HACK
+ #
+ 
+ 
   /**
    * Replace <!--LINK--> link placeholders with actual links, in the buffer
    * Placeholders created in Skin::makeLinkObj()

Unable to install 2[edit]

I have the warning like in this.

Warning: Missing argument 2 for wfParserFunctionsLanguageGetMagic() in .../extensions/ParserFunctions/ParserFunctions.php on line 144

And ParserFunctions is not working. What's the problem?

  • MediaWiki: 1.6.7 ( Install with emerge of Gentoo)

Same problem here, with additionnal notice:

Notice: Undefined variable: langCode in .../extensions/ParserFunctions/ParserFunctions.php on line 146

On MediaWiki 1.6.7 with the restriction-patch-beta-0.70 applied. --194.206.251.205 11:25, 28 June 2006 (UTC)[reply]

I have the same problem as above. Could someone help us?! --70.188.188.82 17:26, 30 June 2006 (UTC)[reply]


Solution: The reason for this problem is that wfparserfunctionslanguagegetmagic() is called without the $langCode parameter. To tell PHP how to still handle the situation, go to said line 144 and change it from

function wfParserFunctionsLanguageGetMagic( &$magicWords, $langCode) {

to

function wfParserFunctionsLanguageGetMagic( &$magicWords, $langCode = 'en') {

In this way, whenever $langCode is omitted, 'en' will be assumed as a language code. As you can see from the the code after line 144, this (in my current version, see date of this comment) does not have much impact unless your normal language code is 'he' in which case you might want to set this instead of 'en'. I assume the error is due to some changed calling conventions for hook "LanguageGetMagic" in 1.7alpha as compared to 1.6. --Markus Krötzsch 08:22, 6 July 2006 (UTC)[reply]

Unable to install 3[edit]

This error occour, if I try to install:

Warning: require_once(/srv/www/htdocs/openanno/wiki/extensions/ParserFunctions/ParserFunctions.php) [function.require-once]:
failed to open stream: No such file or directory in /srv/www/htdocs/openanno/wiki/LocalSettings.php on line 132

Fatal error: require_once() [function.require]: Failed opening required
'/srv/www/htdocs/openanno/wiki/extensions/ParserFunctions/ParserFunctions.php'
(include_path='/srv/www/htdocs/openanno/wiki:/srv/www/htdocs/openanno/wiki/includes:/srv/www/htdocs/openanno/wiki/languages:.:
/usr/share/php5:/usr/share/php5/PEAR')in /srv/www/htdocs/openanno/wiki/LocalSettings.php on line 132

Please help us! --62.224.217.222 18:57, 8 August 2006 (UTC) (AndreR)[reply]

try to put " character just after "(" and before ")" in the "require_once" syntax, i've done that for Cite parser function and it works 82.242.126.103 10:11, 20 August 2006 (UTC) (Sebfun on Wikipedia)[reply]
I had this problem and found that I hadn't placed the files in a "ParserFunctions" subdirectory of "extensions". (now I have another problem... heh) --202.20.97.233 06:01, 4 December 2006 (UTC)[reply]

same here[edit]

I am installing a Calendar, and it requires me to install the ParserFunctions, but after installation i get the following message

Warning: require_once(/home/www/web1/html/viki/extensions/ParserFunctions/ParserFunctions.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/web1/html/viki/LocalSettings.php on line 133 Fatal error: require_once() [function.require]: Failed opening required '/home/www/web1/html/viki/extensions/ParserFunctions/ParserFunctions.php' (include_path='/home/www/web1/html/viki:/home/www/web1/html/viki/includes:/home/www/web1/html/viki/languages:.:/usr/share/php:/usr/share/pear') in /home/www/web1/html/viki/LocalSettings.php on line 133

I triple-checked the files, and everything's AOK. Also the LocalSettings.php reference.

My LocalSettings read

require_once("$IP/extensions/ParserFunctions/ParserFunctions.php");

What's is this?

update: the directory was called ParserFuctions%20 Thats what you get when you are to lazy to type folder names, and copy them in. AAARGH --217.64.242.138 12:29, 13 April 2007 (UTC)[reply]

Unable to install 4[edit]

When I include the ParserFunctions.php file into my LocalSettings.php file, my entire wiki just goes blank. I am using MW 1.8.2 with PHP 5.1.6 - any suggestions? --213.84.175.133 16:40, 4 November 2006 (UTC)[reply]

Same Problem here. Help would be mighty appreciated 193.108.134.112 16:20, 24 December 2006 (UTC)[reply]

I had the same symptom, but it turned out to be a permissions problem.

Unable to install 5[edit]

When I include the ParserFunctions.php file into my LocalSettings.php file, I get a 'MediaWiki internal error', and it dumps a couple of arrays and a couple of exceptions. I've abridged the message for brevity. I hope it isn't too inconveniently large. If so, delete or trim.

array(2) {
  ["LanguageGetMagic"]=>
  array(1) {
    [0]=>
    string(33) "wfParserFunctionsLanguageGetMagic"
  }
  ["ParserClearState"]=>
  array(2) {
    [0]=>
    array(2) {
      [0]=>
      &NULL
      [1]=>
      string(10) "clearState"
    }
    [1]=>
    array(2) {
      [0]=>
      &object(ExtParserFunctions)#20 (4) {
        ["mExprParser"]=>
        NULL
        ["mTimeCache"]=>
        array(0) {
        }
        ["mTimeChars"]=>
        int(0)
        ["mMaxTimeChars"]=>
        int(1000)
      }
      [1]=>
      string(10) "clearState"
    }
  }
}
MediaWiki internal error.<br />
<br />
Original exception: exception 'MWException' with message 'Unknown datatype in hooks for ParserClearState<br />
' in D:\www\wiki\includes\Hooks.php:85<br />
Stack trace:<br />

#0 D:\www\wiki\includes\Parser.php(230): wfRunHooks('ParserClearStat...', Array)<br />
#1 D:\www\wiki\includes\Parser.php(266): Parser->clearState()<br />
#2 D:\www\wiki\includes\OutputPage.php(293): Parser->parse('__NOTOC__?This ...', Object(Title), Object(ParserOptions), true, true, NULL)<br />
#3 D:\www\wiki\includes\OutputPage.php(283): OutputPage->addWikiTextTitle('__NOTOC__?This ...', Object(Title), true)<br />
#4 D:\www\wiki\includes\SpecialVersion.php(35): OutputPage->addWikiText('__NOTOC__?This ...')<br />
#5 D:\www\wiki\includes\SpecialVersion.php(20): SpecialVersion->execute()<br />

#6 D:\www\wiki\includes\SpecialPage.php(511): wfSpecialVersion(NULL, Object(SpecialPage))<br />
#7 D:\www\wiki\includes\SpecialPage.php(372): SpecialPage->execute(NULL)<br />
#8 D:\www\wiki\includes\Wiki.php(156): SpecialPage->executePath(Object(Title))<br />
#9 D:\www\wiki\includes\Wiki.php(47): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))<br />
#10 D:\www\wiki\index.php(123): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))<br />
#11 {main}<br />

I'm running MediaWiki: 1.7.1, PHP: 5.1.2 (apache2handler), MySQL: 4.1.15-nt.

Can anyone help? --202.20.97.233 06:13, 4 December 2006 (UTC)[reply]

Oh, I just realised I had Cite installed. (oops) --202.20.97.233 06:22, 4 December 2006 (UTC)[reply]

Unable To Install 6[edit]

A basic install caused the require_once line to display on the page for a split second, then go to the site. Special:Version didn't show ParserFunctions to be installed. The $ip variable was the culprit. Here's a fix.

I had placed the original call on the outside of the php bracket. I'm tired.

require_once('extensions/ParserFunctions/ParserFunctions.php');

My method is still quicker: Replace the original require_once call with the above line. This MAY be an issue with recent versions of MediaWiki.

Works with 1.8.0?[edit]

I just installed the 1.8.0 version of MW that was released today and I got this nice error message repeated 5 times at the top of every page:

Warning: array_slice() [function.array-slice]: The first argument should be an array in D:\wwwroot\mediawiki\languages\Language.php on line 1083

The errors went away when I disabled this extension, so is a fix needed here or not? I get the feeling that I probably just have an outdated version of the extension, seeing as how the ParserFunctions.php file has a date stamp of May 1 but I wanted to ask here anyhow in case others are getting the same thing. --Billdorr 02:24, 11 October 2006 (UTC)[reply]

Do you know where I can get the hook: LanguageGetMagic for my 1.8.2 installation? I've been searching all over, but can't find it. ThanksRovo79 22:52, 30 November 2006 (UTC)[reply]

Problems with "#ifexpr" and blamk screens !![edit]

I have been battling for days trying to get the "#ifexpr" to work on my Wiki !! No matter what i do, I get a blank screen ...

I'm using

   * MediaWiki: 1.11.0
   * PHP: 5.1.2 (apache2handler)
   * MySQL: 5.0.18-Max 

I even did a fresh Wiki 1.11.0 install and installed only ParserFunction, but i get the same results - a blank screen ..

Can anyone help with this one please before i pull my hair out !!! ???

--Dick 22:29, 3 October 2007 (UTC)[reply]

Do any of the other parser functions cause blank screens? —Sledged (talk) 02:53, 4 October 2007 (UTC)[reply]
Sledged, It only appears to be the #ifexpr that causes the blank screen ... #expr gives me correct results ... --Dick 06:27, 4 October 2007 (UTC)[reply]
Then try changing the ParserFunctions.php file like this:
//
	function ifexpr( &$parser, $expr = '', $then = '', $else = '' ) {
		try{
			/*if($this->getExprParser()->doExpression( $expr )) {
				return $then;
			} else {
				return $else;
			}*/
			return $this->getExprParser()->doExpression( $expr );
		} catch (ExprError $e){
			return $e->getMessage();
		}
	}
This should make #ifexpr operate exactly like #expr. If you're still getting a blank screen, there maybe something funny with the function wfSetupParserFunctions, or the ParserFunctions.i18n.php file, though I have no idea why either would be the case. —Sledged (talk) 17:15, 4 October 2007 (UTC)[reply]
I tried the snippet of code but still get the blank screen !!!
If i try
{{#ifexpr:a >= 28|yes|no}} it gives this error 'Expression error: Unrecognised word "a"' on this wiki, but on my wiki it gives me a blank screen
If I use any #ifexpr function on my wiki it gives a blank screen .. If you want to try it on my wiki, go to http://www.zs6ro.co.za/wiki ...
Where do i find wfSetupParserFunctions ???
I removed the ParserFunctions.i18n.php file and I still got a blank screen ..
Any other ideas I could try ??? .. (Thanks for the help so far) ..
--Dick 19:34, 4 October 2007 (UTC)[reply]
No, no, don't remove the ParserFunctions.i18n.php file. You're guaranteed a blank screen if you do. I think there's something weird going on with the file Expr.php. I put in {{#ifexpr: 0 |yes|no}} and {{#expr: 0 }}, and both worked fine. But when I tried to put in an operator like a minus sign (e.g. {{#ifexpr: 4 - 4 |yes|no}} and {{#expr: 4 - 4 }}), I got blank pages. Make sure your copy of Expr.php matches what's in SVN (or simply replace it with what's in SVN). —Sledged (talk) 20:08, 4 October 2007 (UTC)[reply]
Well Sledged, I reinstalled a fresh ParserFunctions (all from the same suite) and still get the same blank screen ...
Interesting about you trying {{#ifexpr: 0 |yes|no}} - I tried it too - it show "no" as expected and when I did {{#ifexpr: 1 |yes|no}}, it gave me "yes", again, thats to be expected .. So, as you say, it appears that when an operator is used, it just goes belly up !! Are there any switches or flags or things i could try to sort this out ???
Has anyone experienced this similar problem ?? ... All my program criteria appear to be met (the right PHP and Apache releases etc) ...
What else could I try ??
--Dick 08:59, 5 October 2007 (UTC)[reply]
Any more testing would be to involved for me to give detailed instructions via correspondence like this. You could try debugging the Expr.php file which is where the error seems to be occurring (see How to debug).
On another note, when I created a username on http://www.zs6ro.co.za/wiki I got the following message:
Could not send confirmation mail. Check address for invalid characters.
 
Mailer returned: mailer error
The email address I entered contained only letters, the requisite at sign, a period in the local-part, and of course a period in the domain-part, which is a valid email address. It may be related to what ever is causing the expressions to fail with operators, which could be beyond the scope of your MediaWiki install. It could be your apache install, your php install, (I doubt it would be your MySQL install), or your OS. I can't really say for sure. Sorry I can't be of more help. —Sledged (talk) 21:38, 5 October 2007 (UTC)[reply]

All noted Sledged .. With regard the email - I haven't set up the mailer on that server (Postfix) .. My other (older) server has Postfix set up and runs an email server .. I must set it up on this server though so a potential user won't get that error that you got ...

I'll have a look at debug and see what happens and report back ... This problem is really getting to me :-( ..

But thanks for all the suggestions etc that you have offered so far ...

--Dick 05:48, 6 October 2007 (UTC)[reply]


Sledged, I followed the debug page (basically copied the sample into my LocalSettings.php file) and then took the example

wfDebug("This is just testing the debug tracing stuff\n");

and placed it into theParserFunctions.php file and then ran a test page with #ifexpr ... and I got a blank screen !!!!!!!!

What am I doing wrong Grrrr!!!  ???

--Dick 12:09, 6 October 2007 (UTC)[reply]

Did you check the log file to see if had the test text: "This is just testing the debug tracing stuff" —Sledged (talk) 17:03, 9 October 2007 (UTC)[reply]

There was no log file created !!!

I felt I must add this ... I had a mains power failure for two hours and when things settled down here I checked the function

{{#ifexpr:a >= 28|yes|no}}

and it gave me the CORRECT reply

Expression error: Unrecognised word "a"

So, I guess if I had rebooted the server back then it would have saved me a lot of time and hassles ... My apologies for using up this space for what appears to have been a lot of Red-Herrings ...

--Dick 17:11, 9 October 2007 (UTC)[reply]


Requests and proposals[edit]

Why requesting bugzilla:05121 ?[edit]

bugzilla:05121 – "Facilitate bidirectional editing / readability via a trailing escape character (as "\") at the end of line"

  • At the end of the section /Archive 1#Working example of if, to replace qif, using wiki pipe you can read: "There is a big drawback in this, when you have a lot of lines. In the above example, if you add like 10 lines with the if constructs and they are all empty, the result will be a lot of <br> and <p> tags. This can only be gotten around by putting them together on basically the same line. So right after the closing brackets of one if, the next opening brackets of the other. This looks ugly as hell in the template code, but will make the template work exactly as planed."

To demonstrate this see what

a{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}
{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}
{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}
{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}
{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}
{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}z

generates:‎
a



z

a{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}\
{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}\
{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}\
{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}\
{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}\
{{ #ifeq: comparison text 1 | comparison text 2 | equal text | }}z

should generate:‎
az

  • This is just a "side effect" but I assume it is good style. I requested this for long list items and / or long (page) source code with mixed right to left and left to right script. However when you handle conditional content you must keep in mind that every new line is parsed and multiple newlines generate this output. Gangleri · Th · T 01:04, 15 April 2006 (UTC)[reply]


a​

​ ​ ​ ​ ​z

foo


notes:
UTF-8 characters &amp:#8203; ZERO WIDTH SPACE - U 200B have been used here
bugzilla:02920 – "Empty templates should generate nothing instead of <p><br /></p>" is INVALID Gangleri · Th · T 03:45, 15 April 2006 (UTC)[reply]
Why not simply use...
a{{ 
#ifeq: comparison text 1 | comparison text 2 | equal text | }}{{
#ifeq: comparison text 1 | comparison text 2 | equal text | }}{{
#ifeq: comparison text 1 | comparison text 2 | equal text | }}{{
#ifeq: comparison text 1 | comparison text 2 | equal text | }}{{
#ifeq: comparison text 1 | comparison text 2 | equal text | }}{{
#ifeq: comparison text 1 | comparison text 2 | equal text | }}z
...resulting in az ? -- Omniplex (w:t) 13:39, 7 May 2006 (UTC)[reply]

This is the wrong place: it requires a change to the parser code. Also, I think it could have a lot of nasty side-effects. — Ambush Commander(Talk) 23:28, 16 June 2006 (UTC)[reply]

Request: function to convert from arabic to roman[edit]

At es: we are already using these functions to create a single {{Year}} template for navigation in the years' articles. We would like to have a function to convert arabic numbers into roman to do the links to the centuries' articles. --84.42.146.44 12:59, 16 April 2006 (UTC)[reply]

I've done the same for 960–2010 on no:; it's not much work to fill in the Roman number for each year. You do it almost automatically after a while. Jon Harald Søby 15:01, 16 April 2006 (UTC)[reply]
See also note about [[talk:WiktionaryZ#new magic words {{number:foo}} and {{value:bar}}]] at the section #localization of expressions above. 15:17, 16 April 2006 (UTC)
Solved by brute force -> es:Plantilla:Romano. --84.42.146.44 18:57, 16 April 2006 (UTC)[reply]
Now that there's the #switch function, the template can be made a lot less convoluted. – Minh Nguyễn (talk, contribs) 21:26, 18 April 2006 (UTC)[reply]
At en:Template:Roman is a version that works up to 4999999. At its heart, it functions a lot like the one mentioned above. I wish I'd known about that one earlier. Dpv 13:36, 11 June 2006 (UTC)[reply]
#time now has this capability via the xr modifier: {{#time:xrY}} produces MMXXIV. I could easily add another parser function to provide direct access to roman numeral conversion if desired. -- Tim Starling 02:15, 18 October 2006 (UTC)[reply]


Other[edit]

#time format[edit]

What should we write a literal "n" in #time format? "n" means a month number, "xn" means a next numeric code.-- 07:13, 8 September 2006 (UTC)sorry...-- 09:37, 8 September 2006 (UTC)[reply]

Mention at top that additional installation is needed[edit]

(Reading a cached 4 September 2006) I was banging my head as to why none of this works until only at the bottom of the page do we learn we must install something. Be forthright about that at the start of the article. --User:Jidanni 2006-11-26

In the near future, documentation and documentation is to be separated of each other. AzaToth 20:33, 27 November 2006 (UTC)[reply]

How to chek if the figure can be divided on 3,4 etc?[edit]

How to chek if the figure can be divided on 3,4 etc? Petro --213.154.215.137 11:36, 29 November 2006 (UTC)[reply]

could you please explain more what you want to do. AzaToth 12:20, 29 November 2006 (UTC)[reply]

Turn off $wgEnableParserCache in Case of Emergency Weirdness[edit]

Hopefully this text will get searched or indexed and save someone else some grief. If you get a parser function working on talk pages or in preview mode, but it won't work on regular pages, check that $wgEnableParserCache is set to false. I ran into this banging-head-against-wall issue on a MediaWiki WAMP installation running 1.8.2, formerly running 1.5.something. Just add this line to your LocalSettings.php to make it happy-happy:

 $wgEnableParserCache = false;

--Julie 23:58, 4 January 2007 (UTC)[reply]

ParserFunctions.i18n.php with Italian messages[edit]

I modified ParserFunctions.i18n.php to add messages in Italian (no need to localize functions names too, since we use English version, usually). How can I share the new version?--Dejudicibus 13:51, 28 August 2007 (UTC)[reply]

I'd say ask Tim Starling on his talk page. —Sledged (talk) 00:16, 4 October 2007 (UTC)[reply]

A little help[edit]

nvm fixed it. --82.46.105.8 19:11, 29 August 2007 (UTC)[reply]