|
|
(13 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | {{#vardefine:@useronlinesince|{{#show:User:{{CURRENTLOGGEDUSER}}|?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}}<!--
| |
− | -->|{{#vardefine:@onlinerecently|Yes}}<!--
| |
− | -->|{{#vardefine:@onlinerecently|No}}<!--
| |
− | -->}}<!--
| |
− | -->}}
| |
| | | |
− | {{#ifeq: {{#var: @onlinerecently}} | Yes <!--
| |
− | -->| {{#vardefine:@buttontext | {{Fa|toggle-off}} Mark offline}}<!--
| |
− | -->| {{Fa|toggle-on}} Mark online<!--
| |
− | -->}}
| |
− | {{#vardefine:@timestamp|<nowiki>{{subst:#time: r | now}}</nowiki>}}
| |
− |
| |
− | <wsform action="addToWiki"><!--
| |
− | --><wsedit target="{{PAGEID:User:{{CURRENTLOGGEDUSER}} }}" formfield="Online since" template="User" value="{{#var:@timestamp}}" /><!--
| |
− | --><wsfield type="hidden" /><!--
| |
− | --><wslabel onClick="alert(1)" >{{#var:@buttontext}}</wsfield>
| |
− | </wsform>
| |
− | {{#widget: Link
| |
− | |type=button
| |
− | |class=btn-success
| |
− | |style=
| |
− | |text={{#var:@buttontext}}
| |
− | |onclick=alert(1);
| |
− | }}
| |