Loki.yggdrasill.info


RandomArea

Posted in General by Loki on the September 22nd, 2006

Is an extension for MediaWiki for multiple random contents.
Example MW code:

<randomArea >
Klaus
Mark
Otto
</randomArea>

Shows one of the contents on each cach flush of media wiki page or article.

<randomArea count="2" >
Klaus
Mark
Otto
</randomArea>

Shows two of the contents, but never the same twice. It shows e.g. “MarkPaul” or “OttoMark” or …
You can use it with inclusion other articles with or without inclusion syntax

<randomArea include="1" >
Klaus
Mark
Otto
</randomArea>

produces Mediawiki syntax like: “{{:Mark}}” or “{{:Otto}}”

<randomArea include="1" nsPrefix="MyRandPrefix:" >
Klaus
Mark
Otto
</randomArea>

produces a Mediawiki syntax “{{:MyRandPrefix:Klaus}}” …

<randomArea>
{{:MyRandPrefix:Klaus}}
{{:MyRandPrefix:Mark}}
{{:MyRandPrefix:Otto}}
</randomArea>

produces the same like the upper vatiant.

Download

11 Responses to 'RandomArea'

Subscribe to comments with RSS or TrackBack to 'RandomArea'.

  1. loki said,

    on September 27th, 2006 at 1:50 pm

    http://www.mediawiki.org/wiki/Extension:RandomArea

  2. Andy Heath said,

    on November 21st, 2006 at 1:59 pm

    Having a bit of trouble using it in table cells.
    What I want is a random selection of images one per cell.
    When I use the cel start character | it comes out as ouptut on th page and is not interpreted as a cell start.

    andy

  3. loki said,

    on November 21st, 2006 at 3:11 pm

    {|
    |<randomArea count="2" >
    [[Image:Red.jpg]]
    [[Image:Blue.jpg]]
    [[Image:Green.jpg]]
    </randomArea>
    |}

    The code above works or what do you mean?

  4. scott said,

    on February 22nd, 2007 at 7:22 am

    any way of getting this to work with the codes?

  5. scott said,

    on February 22nd, 2007 at 7:22 am

    I meant to put the code…

  6. scott said,

    on February 22nd, 2007 at 7:23 am

    Code keeps vanishing how about if I say youtube

  7. loki said,

    on March 13th, 2007 at 8:37 pm

    sorry, no idea what you are meaning

  8. steffen said,

    on February 14th, 2008 at 5:35 pm

    Whoa, this extension has some MAJOR bugs.
    It totally breaks the wiki if you try to randomly output anything that has only 1 character, like a single digit.
    So inserting

    1
    2
    3
    4

    generates an endless loop. Seriously, check your code before you upload it anywhere.
    My patch:
    Search for “if (strlen($randTemp) > 1 && !array_key_exists($randVal, $valueIndex)) {”, replace with “if (strlen($randTemp) >= 1 && !array_key_exists($randVal, $valueIndex)) {”.
    Search for “$valueIndex[$randVal] = true;
    $i++;
    }”, replace with “$valueIndex[$randVal] = true;
    }
    $i++;”.

  9. Sypie said,

    on July 26th, 2009 at 9:30 pm

    Why not edit the source code with this last reply? It’s over a year that this is clear and still not updated.

  10. loki said,

    on July 30th, 2009 at 3:57 pm

    ups you are right. I moved all contents to the mediawiki pages and edit the src there.

  11. sandy said,

    on May 28th, 2010 at 4:44 pm

    UpFuTf http://f8j3ndYbs83Bbq06Wlavp.com

Leave a Reply