Wiki:Proposed Functions  

Wiki:Documentation

I have decided to stop putting proposed functions in the main Internal Functions page. New functions will be written up here, and when written, tested and revised, will be moved to the main doc page. -Bludwyng

You can see the documentation for all currently implemented Internal Functions at Internal Functions.

Contents [hide]

Game Wiki Admin Functions

#gametag

Format: {{#GameTag|gameid|option1|option2|switch1}}

This function is currently a Template at GameTag but, due to speed issues, will be rewritten in perl as an internal function.

GameTag's purpose is to display a small, right-floated box with the Game's Icon, name (linked to the Main Page for the game), and a subcategory link (if requested).

All icons used are from Category:Game Icons (Wiki). The actual page for a specific game will be "game_fullname (Game Icon)" and the contents of the wiki page there should be {{Icon|Wiki|Game}}. The page may also contain the game's tag to add it to that game's main category. The icon used will be the first image attached to that page (if there is more than one). Icons there are expected to be no more than 60px wide, but if larger (or smaller) that is how they will display! no automatic re-sizing is performed on these icons.

There are two ways this sub-category link can be requested. If option1 (usually the only option) is ADMIN, FAQ, D, G, L, LE or T then the page is linked to Admin Pages, Frequently Asked Questions, Dictionary, Guides, Lore, Live Events or Templates. If option1 is not equal to one of those 7 values then it is assumed to be the name of a subcategory. option2 can further define how the name of the subcategory will be displayed.

For most games the Category name is in the format "Category:category_name (gameid)" but a few games use the older "Category:gameid category_name" format.

EQ2, WAR, WoW, FFXI and TR use the older format, EXCEPT for "Guides (WoW)". Also, WoW uses Terms instead of Dictionary.

IF switch1 is defined it has one of the following values:

  • nolink - Display the GameTag but do NO linking (not even to the Game's Main Category)
  • gameonly - This tag is being made for a game that does not, currently, have a wiki so display the Name but without linking it.

Variable Manipulation Functions

#set

syntax: {{#set:varname|value}}

  • Sets or updates the named parameter, varname, to value. If varname does not exist, it creates it. Anytime in the current template, after the #set command, varname can be referred to just as any other named parameter, as in {{{varname|}}}, and it will expand to the set value.

This function would allow us to process data normalization tasks ONCE at the top of a template, then use the normalized value, which is stored in the set varname, in all subsequent references without having to re-process the same data normalization code, thus saving considerable processing time.

Database Access Functions

#tags

syntax: {{#tags:pagename[|n]}}

  • Returns a comma-delimited list of the tags attached to the specified page. If n is specified, returns only the nth tag in the list. If pagename is omitted, return the list of tags attached to the current page, or the nth tag.

#dblist

syntax: {{#dblist:game_id|db_name|record_title|relation_name}}

  • returns a comma-delimited list of records related to the record identified with record_title.
  • example: {{#dblist:eq2|zones|Sebilis|zones}} would return: The Crypt of Agony, Kunzar Jungle, Protector's Realm, Venril Sathir's Lair

#category

syntax: {{#category:category_name}}

  • Returns true if the current page is a member of category category_name
  • Rationale: With this function, coupled with a new pre and post template set (Wiki Top and Wiki Bottom) to be prepended or appended to all wiki pages, we can test for the game category and auto-display relevant data such as a copyright notice on the bottom of all EverQuest and EverQuest II pages.

Browser Manipulation

#copy

syntax: {{#copy:text2push|text2display|imageID}}

  • Displays a linked text (text2display) or image (imageID) and, if clicked, pushes text2push to the user's copy buffer.
This would primarily be used in the EQ2 Loc template to push a waypoint to the user.

This page last modified 2010-10-29 14:13:38.