Meta:Sandbox

From No LJ Ads Wiki

Jump to: navigation, search

Contents

[edit] Yaaay sandbox for testing!

[edit] User tags!!

Code Output Comment
<ljuser>kunzite1</ljuser> [info]kunzite1 // normal <ljuser>
<ljuser>bob_underscore</ljuser> [info]bob_underscore // single_mid_underscore <ljuser>
<ljuser>_brightness_</ljuser> [info]_brightness_ // _single_first_underscore <ljuser>
<ljuser>the_unadvocate</ljuser> [info]the_unadvocate // single_mid_underscore <ljuser>
<ljuser>the-unadvocate</ljuser> [info]the-unadvocate // mid-hyphen <ljuser>
<ljcomm>no_lj_ads</ljcomm> [info]no_lj_ads // multiple_mid_underscore <ljcomm>
<ljcomm>no-lj-ads</ljcomm> [info]no-lj-ads // multiple-mid-hyphen <ljcomm>
<ljsyn>moz_exts</ljsyn> [info]moz_exts // mid_underscore <ljsyn>
<ljsyn>moz-exts</ljsyn> [info]moz-exts // mid-hyphen <ljsyn>
<ljuser>news</ljuser> [info]news // <ljuser> news
<ljcomm>news</ljcomm> [info]news // <ljcomm> news
<ijcomm>announcements</ijcomm> [info]announcements // Insane Journal comm
<ijuser>squeaky</ijuser> [info]squeaky // normal <ijuser>
<ijuser>_squeaky</ijuser> [info]_squeaky // <ijuser> with starting underscore
<ijuser>squeaky_squeaky</ijuser> [info]squeaky_squeaky // <ijuser> with middle underscore
<jfcomm>fandom_wank</jfcomm> [info]fandom_wank (JF) // JournalFen comm
<jfuser>snacky</jfuser> [info]snacky (JF) // normal <jfuser>
<vox>team</vox> [info]team // normal <vox>

[edit] LJ Links!!!

Code

Output
Comment


<ljlink href="http://community.livejournal.com/no_lj_ads/30690.html">Latest post</ljlink>

Latest post ([info]no_lj_ads)
Latest post ([info]no_lj_ads)


<ljlink href="http://foxfirefey.livejournal.com/204505.html">Oh the wank</ljlink>

Oh the wank ([info]foxfirefey)
Oh the wank ([info]foxfirefey)


<ljlink href="http://users.livejournal.com/_brightness_/44613.html">Underscore test</ljlink>

Underscore test ([info]_brightness_)
Underscore test ([info]_brightness_)


<ljlink href="http://syndicated.livejournal.com/sinfestfeed/230802.html?view=9194642#t9194642">Syndicated test</ljlink>

Syndicated test ([info]sinfestfeed)
Syndicated test ([info]sinfestfeed)

[edit] IJ Links!!!

<ijlink href="http://asylums.insanejournal.com/announcements/49583.html">1 day fundraising sale</ljlink>

1 day fundraising sale ([info]announcements)
1 day fundraising sale ([info]announcements)

<ijlink href="http://stewardess.insanejournal.com/228245.html">Circle the one that doesn't belong</ljlink>

Circle the one that doesn't belong ([info]stewardess)
Circle the one that doesn't belong ([info]stewardess)

[edit] Vox Links!!!!

Code

Output
Comment


<voxlink href="http://kunzite1.vox.com/profile/">Kunzite</voxlink>

Kunzite ([info]kunzite1)
Kunzite ([info]kunzite1)


[edit] ParserFunctions tests!!!!!

[edit] #expr:

Evaluates an expression and returns the value

{{#expr: <expression>}}
{{#expr: 0 + 1}} // should be: 1
1
{{#expr: 0 + 0}} // should be: 0
0
{{#expr: 1 + 5 * 8 + 1}} // should be: 42
42 // should be: 42
{{#expr: (1 + 5) * (8 + 1)}} // should be: 54
54 // should be: 54
{{#expr: 6 * 9}} // should be: 54
54 // should be: 54

[edit] #if:

Returns <true value> if <condition> is true. true means "not an empty string and not whitespace."

Returns <false value> if <condition> is false. false means "an empty string or just whitespace."

Note: #if is broken in MediaWiki v1.6. A proposed fix and some additional installation instructions can be found here.
{{#if: <condition> |<true value>|<false value>}}
{{#if: moo |true|false}} // should be: true, because not empty and not whitespace
true
{{#if:|true|false}} // should be: false, because is empty
false
{{#if: |true|false}} // should be: false, because is whitespace
false

[edit] #ifeq:

Returns <true value> if two numbers are equal or two strings are equal.

Returns <false value> if two numbers are not equal or two strings are not equal.

{{#ifeq: <number one> | <number two> |<equal value>|<not equal value>}}
{{#ifeq:<string one>|<string two>|<equal value>|<not equal value>}}
{{#ifeq:2|2|equal|not equal}} // should be: equal
equal // should be: equal
{{#ifeq:{{#expr:2 + 2}}|{{#expr:2 * 2}}|equal|not equal}} // should be: equal
equal // should be: equal
{{#ifeq:{{#expr:2 - 2}}|{{#expr:2 + 2}}|equal|not equal}} // should be: not equal
not equal // should be: not equal
{{#ifeq:one|one|equal|not equal}} // should be: equal
equal // should be: equal
{{#ifeq:one|two|equal|not equal}} // should be: not equal
not equal // should be: not equal

[edit] #ifexist:

Returns <true value> if the given Page called <page name> exists in the Wiki.

{{#ifexist:<page name>|<true value>|<false value>}}
{{#ifexist:Main Page|Does exist|Does not exist}} // should be: Does exist
Does exist // should be: Does exist
{{#ifexist:Main_Page|Does exist|Does not exist}} // should be: Does exist
Does exist // should be: Does exist
{{#ifexist:SnAfUbArMoOzIpPeRs|Does exist|Does not exist}} // should be: Does not exist
Does not exist // should be: Does not exist

[edit] #ifexpr:

Returns <true value> if <expression> evaluates to true or a non-zero value.

Returns <false value> if <expression> evaluates to false or zero.

{{#ifexpr:<expression>|<true value>|<false value>}}
{{#ifexpr:1|True/Non-zero|False/Zero}} // should be: True/Non-zero
True/Non-zero // should be: True/Non-zero
{{#ifexpr:0|True/Non-zero|False/Zero}} // should be: False/Zero
False/Zero // should be: False/Zero
{{#ifexpr:0=0|True/Non-zero|False/Zero}} // should be: True/Non-zero
True/Non-zero // should be: True/Non-zero
{{#ifexpr:1=1|True/Non-zero|False/Zero}} // should be: True/Non-zero
True/Non-zero // should be: True/Non-zero
{{#ifexpr:1=0|True/Non-zero|False/Zero}} // should be: False/Zero
False/Zero // should be: False/Zero
{{#ifexpr:2 + 2 = 2 * 2|True/Non-zero|False/Zero}} // should be: True/Non-zero
True/Non-zero // should be: True/Non-zero
{{#ifexpr:2 - 2 = 2 + 2|True/Non-zero|False/Zero}} // should be: False/Zero
False/Zero // should be: False/Zero

[edit] #switch:

Compares a single value against multiple others, returning a string if a match is found.

{{#switch: <comparison value>
| <case1> = <result1>
| <case2> = <result2>
| ...
| <casen> = <resultn>
| <default result>
}}

{{#switch: <comparison value>
| <case1>  = <result1>
| <case2>  = <result2>
| ...
| <casen>  = <resultn>
| #default = <default result>
}}

Consider the following #switch statement:

{{#switch: <char>
| A = 1
| B = 2
| C = 3
| D = 4
| 5
}}
1 // <char> = A
2 // <char> = B
3 // <char> = C
4 // <char> = D
5 // <char> = E
5 // <char> = F

Consider the following #switch statement:

{{#switch: <char>
| A        = 1
| B        = 2
| C        = 3
| D        = 4
| #default = 5
}}
1 // <char> = A
2 // <char> = B
3 // <char> = C
4 // <char> = D
5 // <char> = E
5 // <char> = F

[edit] NEW LJ TAGS TEST

<ljuser>exampleusername</ljuser> will make [info]exampleusername

<ljcomm>communityname</ljcomm> will make [info]communityname

<ljspon>sponsored_comm</ljspon> will make [info]sponsored_comm

<ljsyn>syndicated_feed</ljsyn> will make [info]syndicated_feed

<ljlink href="http://community.livejournal.com/communityname/21475.html">Link Text</ljlink> will make Link Text ([info]communityname)

<vox>voxuser</vox> will make [info]voxuser

<voxlink href="http://foxfirefey.vox.com/library/post/vox-to-receive-more-ads.html#comments">Link Text</voxlink> will make Link Text ([info]foxfirefey)

<genuser url="greatestjournal.com">coyotecult</genuser> will make [info]coyotecult (greatestjournal.com)

<gencomm url="greatestjournal.com">fandom_wank</gencomm> will make [info]fandom_wank (greatestjournal.com)

<gensyn url="greatestjournal.com">syn_random</gensyn> will make [info]syn_random (greatestjournal.com)

<openid>http://bradfitz.com/</openid> will make [info]bradfitz.com

<openid>foxfirefey.livejournal.com</openid> will make [info]foxfirefey.livejournal.com

<openid>http://www.livejournal.com/index.bml</openid> will make [info]www.livejournal.com/index.bml

<openid>http://foxfirefey.livejournal.com/</openid> will make [info]foxfirefey.livejournal.com

<openid>http://users.livejournal.com/exampleusername</openid> will make [info]users.livejournal.com/exampleusername

<openid>http://www.livejournal.com/users/exampleusername</openid> will make [info]www.livejournal.com/users/exampleusername