Difference between revisions of "Template:Mark online"

From cm2.liecourt.com
(Created page with "{{subst:New}}")
 
 
Line 7: Line 7:
 
This is the '''Mark online''' template. It should be called in the following format:
 
This is the '''Mark online''' template. It should be called in the following format:
  
 +
{{Alert|To be used on User pages only}}
 
<pre>
 
<pre>
 
{{Mark online }}
 
{{Mark online }}
 
</pre>
 
</pre>
  
</noinclude><includeonly>
+
</noinclude><includeonly><!--
  
</includeonly>
+
-->{{#vardefine:@onlinerecently|<!--
 +
-->{{#vardefine:@useronlinesince|{{#show:User:{{PAGENAME}}|?Online since}} }}<!--
 +
-->{{#if:{{#var:@useronlinesince}}|<!--
 +
  // User has an online status
 +
  -->{{#vardefine:@useronlinesince-unixtimestamp|{{#time: U | {{#var:@useronlinesince}} }} }}<!--
 +
  -->{{#vardefine:@onehourago-unixtimestamp|{{#time: U | now - 1 hour }} }}<!--
 +
  -->{{#ifexpr: {{#var:@useronlinesince-unixtimestamp}} > {{#var:@onehourago-unixtimestamp}}<!--
 +
  -->|Yes<!--
 +
  -->|No<!--
 +
  -->}}<!--
 +
-->}}<!--
 +
-->}}<!--
 +
 
 +
-->{{#ifeq: {{#var: @onlinerecently}} | Yes <!--
 +
-->|<!--
 +
-->{{#vardefine:@buttontext | {{Fa|toggle-on|text-success}} (Mark offline)}}<!--
 +
-->{{#vardefine:@marktimestamp | now - 1 hour}}<!--
 +
-->|<!--
 +
-->{{#vardefine:@buttontext | {{Fa|toggle-off|text-warning}} (Mark online) }}<!--
 +
-->{{#vardefine:@marktimestamp | now}}<!--
 +
-->}}<!--
 +
 
 +
-->{{#vardefine:@timestamp|<nowiki>{{subst:#time: r | </nowiki>{{#var:@marktimestamp}}<nowiki>}}</nowiki>}}<!--
 +
--><wsform action="addToWiki"><!-- 
 +
--><wsedit target="{{PAGEID:User:{{PAGENAME}} }}" formfield="Online since" template="User"  value="{{#var:@timestamp}}" /><!--
 +
-->{{#widget: Link
 +
|type=button
 +
|class=btn btn-default color-blue
 +
|style=
 +
|text={{#var:@buttontext}}
 +
|onclick=this.form.submit();
 +
}}
 +
</wsform></includeonly>

Latest revision as of 09:50, 14 June 2021


This is the Mark online template. It should be called in the following format:

Note: To be used on User pages only
{{Mark online }}