This is the old (read-only) version of the site running Mediwiki 1.25

Difference between revisions of "Template:Articleoftheday"

From Scientolipedia
Jump to: navigation, search
(Created page with "{{Tip |Extension=Semantic MediaWiki }} <noinclude> To get this working, copy the [{{fullurl:PAGENAME|action=edit}} entire source of this page] to your Template namespace and t...")
 
Line 1: Line 1:
{{Tip
+
{{
 
|Extension=Semantic MediaWiki
 
|Extension=Semantic MediaWiki
 
}}
 
}}

Revision as of 22:36, October 10, 2013

{{ |Extension=SemanticAs used in this context, it refers to re-using data from web pages that would otherwise not be available anywhere other than the single web page it is published on. A Semantic Wiki like this one, is enhanced Wiki software (like this in-line glossary function) that is far more complex and sophisticated, with advanced data collection, display and reporting methods. It is able to make relationships in the presentation of data to the user in ways regular Internet applications cannot. MediaWiki }}

To get this working, copy the entire source of this page to your Template namespace and then transclude it where desired.

This template generates a pseudo-random article for today. The article selected is based on today's date so that the article will remain constant for one day but change automatically the next day. This is done by getting the number of seconds from epoch until the beginning of today, doing an expression on it and then modding it by the number of articles in the wiki. So the final result is a pseudo-random number between 0 and the (number of keywords in the wiki - 1). Then it uses that result as an offset to retrieve that number article in the wiki based on the order returned by the ask query. In truth, the article selected will change on a day that the number of articles in the wiki changes.

The sample query in this page will pick from all articles in the main namespace. You can customize the queries to select whichever pages you'd like. (You must modify both ask queries to select the same set of pages.)

Loosely based on: wikipedia:Template:Random_number. Requires the Parser functions extension.

You can see this in action here: User:Tosfos#Random_article_of_the_day_demonstration