Fandom

Wikia Developers Wiki

Global Lua Modules/Tempnotice

< Global Lua Modules

846pages on
this wiki
Add New Page
Talk0 Share

Displays a notice for XX days.

Install

Installing modules

To get a brief introduction to lua read the basics page first. On Wikia, one can use modules by either accessing a module remotely or copying all its contents to a Wiki. Modules accessed remotely from dev.wikia are subject to change while 'correctly' copied modules are controlled by a particular wiki.

Using a module "remotely" using Module:Devmodule

Create Module:Devmodule and copy the following code to remotely access modules in dev's repository. See more details in Global Lua Modules/Devmodule.
--[[This imports modules from dev.wikia]]
return require("Dev:Devmodule")

Loading modules remotely from dev.wikia

Create Module:Tempnotice in your wiki and add the following code:
--This loads modules directly from dev.wikia.com
return require("Dev:Tempnotice")

Using Module:Tempnotice in another wiki

To use modules without depending on dev see this page. Create Template:Tempnotice in your wiki and add the following code:
{{#invoke:Tempnotice|main}}

Using template in a page

You can use this module in a page using syntax such as:
{{Tempnotice|main|arg1|arg2}}

Syntax

  • {{#invoke:Tempnotice|main|days=2|notice=This message will self-destruct in ...|template=true}}
  • {{#invoke:Tempnotice|main|days=2| notice=selfdestruct|template=true}}

Examples

CodeOutput
{{#invoke:Tempnotice|main|days=2|notice=This message will self-destruct in ...}}

The notice above will be blank after some days, for the sake of an example the one below will always show the same output.

{{#invoke:Tempnotice|main|days={{#expr:({{#time: U |now + 3 days }} -{{#time:U|{{REVISIONYEAR}}-{{REVISIONMONTH}}-{{REVISIONDAY}}}})/(3600*24) }}|notice=selfdestruct|template=true}}

Output: {{selfdestruct}}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.