Forum:Need help understanding

Hi,

I ran into the code below and I'm having a hard time understanding how it works.



if someone could explain it to me i'd really appreciate it.

Dem0n Hunter 20:55, April 1, 2012 (UTC)


 * That code uses parser functions, string functions, magic words and template parameters.
 * #if: is a parser function that produces a different result depending on whether a string of text is blank or contains content. Look here for more info.
 * #pos: is a string function which outputs the numerical position of a given search term within the string. Look here for more info.
 * lc: is a magic word which converts every letter in a string to lower case. Look here for more info.
 *   is a parameter for the template.


 * Basically, the code converts the input for the parameter into lower case and then checks for the position of ".png" within the input. If the input contains ".png", then the output of #pos will be non-empty. The #if function then checks whether that output is empty or not, and does one of two things:
 * If it is empty, the #if outputs the lowercase form of the parameter with a default value of "Temp" and adds .png to the end of it.
 * If it is non-empty, then the #if just outputs the lowercase form of the parameter.


 * Here are a few scenarios to illustrate what you would get for different values of.


 * --Gardimuer { ʈalk } 21:38, April 1, 2012 (UTC)

Thanks so much Gardimuer. You're a life saver. Dem0n Hunter 22:10, April 1, 2012 (UTC)


 * Alright so I tried to remove the png check thingy cuz I want to be able to use .jpg files or anything else. now the image doesn't even show


 * -> [[File:|32px]] <!--


 * Can you tell me what I did wrong? Btw here is the link to the template if you need it.


 * http://impossiblebosses.wikia.com/wiki/Template:Talenttip


 * Never mind. Problem solved.