Skip to content
Snippets Groups Projects
Commit 8e441dc6 authored by echicken's avatar echicken :chicken:
Browse files

Use var for server-side stuff. Formatting.

parent 4372b80e
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
<?xjs
const logonlist_lib = load({}, 'logonlist_lib.js');
const options = load("modopts.js", "logonlist") || {};
var logonlist_lib = load({}, 'logonlist_lib.js');
var options = load("modopts.js", "logonlist") || {};
if (options.last_few_callers === undefined) options.last_few_callers = 4;
const ll = logonlist_lib.get(-options.last_few_callers);
if (Array.isArray(ll)) {
var ll = logonlist_lib.get(-options.last_few_callers);
if (!Array.isArray(ll)) exit();
?>
<h4><? locale.write('label_title', 'sidebar_recent_visitors'); ?></h4>
<ul class="list-group">
<?xjs ll.reverse().forEach(function (e) { ?>
<li class="list-group-item striped">
<strong><? write(e.user.alias); ?></strong>
<br>
<em><? write(new Date(e.time * 1000).toLocaleString()); ?></em>
<br>
<?xjs if (e.user.location != '') { ?>
<? locale.write('label_location', 'sidebar_recent_visitors'); ?>
<strong><? write(e.user.location); ?></strong>
<?xjs } ?>
<? locale.write('label_connection', 'sidebar_recent_visitors'); ?>
<strong><? write(e.user.connection); ?></strong>
</li>
<?xjs }); ?>
</ul>
<?xjs } ?>
<h4>
<? locale.write('label_title', 'sidebar_recent_visitors'); ?>
</h4>
<ul class="list-group">
<? ll.reverse().forEach(function (e) { ?>
<li class="list-group-item striped">
<strong>
<? write(e.user.alias); ?>
</strong>
<br>
<em>
<? write(new Date(e.time * 1000).toLocaleString()); ?>
</em>
<br>
<? if (e.user.location != '') { ?>
<? locale.write('label_location', 'sidebar_recent_visitors'); ?>
<strong>
<? write(e.user.location); ?>
</strong>
<? } ?>
<? locale.write('label_connection', 'sidebar_recent_visitors'); ?>
<strong>
<? write(e.user.connection); ?>
</strong>
</li>
<? }); ?>
</ul>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment