Help talk:Variable

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
WikiProject iconWikipedia Help NA‑class Mid‑importance
WikiProject iconThis redirect is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
NAThis redirect does not require a rating on the project's quality scale.
MidThis redirect has been rated as Mid-importance on the project's importance scale.

Localtime[edit]

Maybe there is a mistake in Section Local Time... should the Variables for Localtime be LOCALTIME? Not CURRENTTIME? This is the same as above. —Preceding unsigned comment added by 145.253.2.27 (talk) 10:26, 19 May 2008 (UTC)[reply]

Thanks for this comment. You are right. LOCALDAY, LOCALMONTH etc work properly. —Preceding unsigned comment added by 75.157.238.138 (talk) 02:10, 1 September 2008 (UTC)[reply]

Function ns allows end text[edit]

24-Sep-2007: I've been testing the namespace function 'ns' for use as a numeric-validation trick for numbers above 20 (as in "{{ns: 12,567}}"), and it returns "Help" or "Talk" or "Category_talk" when letters or commas are inside a number. When the data begins with a letter, then function 'ns' tries to call the named template; however, it accepts ending letters/commas as okay in numeric data. Some examples:

  • {{ns: 12567}} returns "" (empty string, valid number);
  • {{ns: 12,567}} returns "Help" (not numeric);
  • {{ns: 12x567}} returns "Help" (not numeric);
  • {{ns: 1}} returns "Talk" (NOT valid number);
  • {{ns: 4}} returns "Wikipedia" (INVALID number);
  • {{ns: 12}} returns "Help" (INVALID number);
  • {{ns: 120}} returns "" (valid number);
  • {{ns: 21}} returns "" (valid number);
  • {{ns: 567ab}} returns "" (valid number);
  • {{ns: 567px}} returns "" (valid number);
Function 'ns' cannot detect "px" ending a size parameter.
  • {{ns: 567,}} returns "" (valid number);
Apparently, text/commas after a number are allowed (!).
  • {{ns: 12xx567}} returns "Help" (not numeric);
  • {{ns: a12567}} returns "{{ns: a12567}}" (not numeric);
  • {{ns: a12,567}} returns "{{ns: a12,567}}" (not numeric);
Apparently, leading alpha causes the named template to be called.
So "one man's bug is another man's feature bizarro".
  • {{ns: mydog2}} returns "{{ns: mydog2}}" (not numeric);
  • {{ns: ,12,567}} returns "{{ns: ,12,567}}" (not numeric);
  • {{ns: 12,567,000}} returns "Help" (not numeric);
  • {{ns: 12567000}} returns "" (valid number);
  • {{ns: 12.567}} returns "Help" (NOT numeric!!);
Apparently, some valid decimal fraction numbers are rejected (!).
  • {{ns: 12.056}} returns "Help" (not numeric!);
  • {{ns: 12.05}} returns "Help" (not numeric!);
  • {{ns: 12567.000}} returns "" (valid);
  • {{ns: 12567.0}} returns "" (valid);

The above 23 examples show that function 'ns' works for numeric validation, somewhat (rejecting decimal "12.567"), but it is peculiar, and I would consider the passing of "567px" (as numeric) to be another software bug in 'ns' as failing to detect non-numeric "px" ending a number. However, function 'ns' does catch commas within data (not at end). -Wikid77 12:16, 25 September 2007 (UTC)[reply]

{{USERNAME}}[edit]

Is there not, and if not why can't we have, a variable taking the user who is reading the page's username? There is on Uncyclopedia. Jake the Editor Man (talk) 12:15, 9 December 2007 (UTC)[reply]

Date and Time Variables[edit]

The second table should apparently use LOCAL variables.

To support generation of ISO 8601 date strings, the following are needed :

  Day of Week Mon=1 to Sun=7
  Week Number as 01 to 53 (and as 1 to 53 not needed)
  Corresponding year number (as 2008-12-31 is 2009-W01-3, 2006-01-01 is 2005-W52-7)

((CURRENTMINUTE)) would seem useful.

((CURRENTDAYCOUNT)) & ((CURRENTSECONDSCOUNT)) would seem useful, signed 64-bit integer from stated date.

82.163.24.100 (talk) 16:30, 9 September 2008 (UTC)[reply]

User time[edit]

I want to display a message which depends on the date and time that the user has on their computer. So how can I display the local time of the user - that is UTC + offset set in preferences? The WikiMedia article on MAGICWORDS suggests that time functions do use this but I have yet to find a wiki installation where it happens. Barfbagger (talk) 14:29, 20 September 2008 (UTC)[reply]

PAGESINCATEGORY[edit]

I would like to propose a "recursive" flag to this variable item. (though R is used for returning raw numbers) It would reduce the number of "/Total" pages that people are creating to count articles to show on both portals and projects. I would volunteer to help (I am a programmer), but have no previous experience with Wikipedia internals. -- Mjquin_id (talk) 21:10, 16 November 2008 (UTC)[reply]