https://bugzilla.wikimedia.org/show_bug.cgi?id=25476
Purodha Blissenbach <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] | |rodha.net --- Comment #21 from Purodha Blissenbach <[email protected]> 2011-09-02 06:18:54 UTC --- (In reply to comment #16) > However, if this data is only accessed from a > template ... How would user preferences being used or accessed inside the template? We currently have no other mechanism than providing a parser function for it. Maybe one function for each setting, maybe one function for all settings with a parameter selecting which setting is to be accessed. Then, as a matter of economic coding, why not pass the formatting string (template) as yet another parameter to the parser function as well, letting all the formatting happen there? This is independent of its source, it could be a global fixed wiki setting, a string from the MediaWiki name space, or an individual reader preference, even a cookie for logged-out users would be possible. Of course it could be explicitly passed to the formatting parser function from wikitext The order in which these possible souces need to be checked is obvious. Inside a parser function, caching can be dealt with, mechanims to do so are already in place - think of wikis having script or dialect variations such as Chinese or Serbian or Khasak, that do this type of caching already. Since there are several more uses for the abovementioned decisionmaking, it is likely to become a common subroutine in the MediaWiki code base sooner or later, if it is not already there. Inside parser function code, we can easily do string arithmetic which is excessively slow and expensive if done in templates with parser function calls. Thus, we can have a parser function use a string argument for the date which is human and machine readable, sortable and comaprable, such as in: {{#formatdateandtime|2011-12-31 23:59:59 }} {{#formatdateandtime|2011-12-31 23:59:59 | UTC }} {{#formatdateandtime|2011-12-31 23:59:59 | -800 | <formatstring> }} where the date-time is always UTC, the 2nd parameter gives the time zone that is currently used to insert fixed format dates and times, and a format string can be used ba users wanting to manually select one. Did I forget anything? -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
