Wikipedia talk:Emoticons
This project page does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||
|
Template not working as specified
[edit]re Template:Smiley2
a. {{=2|4}}
b. {{=2|5}}
c. {{=2|shocked}}'4'
d. {{=2|confused}}'5'
According to the page, emoticons a & c or b & d should the same. However a & b are swapped, c & d are 'correct'.
Seems the shocked/confused word 'switches' are working, but the number 'switches' 4 and 5 only are swapped.
All others seem OK! - 220 of Borg 06:40, 26 September 2013 (UTC)
- Oops! I have now changed the documentation to reflect what the template actually produces:
- Thanks for pointing this out! - benzband (talk) 18:39, 26 September 2013 (UTC)
- No worries. I even had a look at the template code and though I have never programmed like this it seems 'obviously' correct:
|4|confused=Confused-tpvgames.gif|20px
|5|shocked=Shocked-tpvgames.gif|20px
- i.e.. 4 or confused=Confused ... gif, 5 or shocked=Shocked ... gif. What language is this by the way, HTML?
(ps I borrowed <span style="color: green"><span style="color: green"> from your sig to make the code green. Other things I tried didn't work!
- No worries. I even had a look at the template code and though I have never programmed like this it seems 'obviously' correct:
- Just FYI , the error seems to have crept in here @ 12:01, 8 May 2012. '4' was once the 'confused' № in the Docs, but got changed to 5.
- I'm wondering how many people were confused , when they meant to be surprised . (& vice versa!). 220 of Borg 14:48, 27 September 2013 (UTC)
- Ah right. The language is wiki markup (the template uses a #switch: function which I imitated from the original {{smiley}} template). And yeah I'm hoping not too many people got the wrong face showing up! ツ benzband (talk) 19:29, 27 September 2013 (UTC)
- (edit conflict) It's not HTML: HTML has no programmable constructs such as decision making. It's Wiki markup, although in a form that is normally only used in templates - the
{{#switch:}}
parser function. If we look at the source of{{smiley2}}
and ignore the two instances of{{{|safesubst:}}}
also everything inside<noinclude>...</noinclude>
, what's left is:
- (edit conflict) It's not HTML: HTML has no programmable constructs such as decision making. It's Wiki markup, although in a form that is normally only used in templates - the
[[File:{{#switch:{{lc:{{{1|}}}}}
|2|cute=Smile-tpvgames.gif{{!}}20px
|3|sad=Sad-tpvgames.gif{{!}}20px
|4|confused=Confused-tpvgames.gif{{!}}20px
|5|shocked=Shocked-tpvgames.gif{{!}}20px
|6|tongue|crazy=Misc-tpvgames.gif{{!}}20px
|7|rude|raspberry=Ras.gif{{!}}20px
|8|doh|facepalm=Smiley emoticons doh.gif{{!}}25px
|1|smile|#default=Smile.gif{{!}}20px}}|link=]]
The {{#switch:}}
parser function is very like the case
statement in programming languages such as Pascal or the switch
statement in C or JavaScript. The value to be tested (in this case {{lc:{{{1|}}}}}
which is the first positional parameter to the template, lowercased) goes after the switch:
and before the first pipe. Each pipe introduces a value to test against; when a match is found, the value after the very next =
sign is returned and the switch:
terminates. If there is no match, the value after #default=
is returned. --Redrose64 (talk) 19:39, 27 September 2013 (UTC)
- Ah, thanks benzband and Redrose64. I have used BASIC, Assembler, machine code and did a course in 'C' (but haven't put it to much use), so I can see what you are getting at.
- Ah, thanks benzband and Redrose64. I have used BASIC, Assembler, machine code and did a course in 'C' (but haven't put it to much use), so I can see what you are getting at.
- This simple matter of fixing a document error has taken up way too much of everyone's time, thought it has also been useful to me in term of learning a few new templates, 'magic words'(<span style>), a bit of how templates operate etc. (even a few new smilies! ) Thanks again, regards--220 of Borg 03:30, 28 September 2013 (UTC)
Flower(s)
[edit]There is none. -- Mr. Prophet (talk) 07:26, 28 May 2015 (UTC)
Tongue.png
[edit]Tongue.png Tongue.png Tongue.png Tongue.png Tongue.png Tongue.png Tongue.png Tongue.png Tongue.png — Preceding unsigned comment added by Handatoe (talk • contribs) 11:37, 9 October 2018 (UTC)
No Need For Two (2) 'See also' Subsections
[edit]No Need For Two (2) 'See also' Subsections! They even slightly repeat by educating about { { smiley } } so it seems there's an overlap of content too. Ok if I merge this section, or does someone want to take the helm on that? Thanks. -From Peter {a.k.a. Vid2vid (talk | contribs)} 20:37, 27 November 2022 (UTC)