• Web: Last callers

    From Fireball@VERT/FBEX to All on Saturday, December 12, 2015 08:37:59
    I didn't like the way the Last callers page just showed a black box with not much
    in it if there were no callers. So I got in there and made it do something other
    than just show that box. I'm by no means a pro, but I like to mess around with code every now and again. ;)

    In root/member/lastcallers.ssjs starting line 12 replace:

    if(user.number!=0) {
    var file = new File(system.data_dir + "logon.lst");
    if(file.open("r")) {
    template.lastcallers=file.readAll();
    file.close();
    }
    template.lastcallers.shift();

    template.lastcallers=html_encode(template.lastcallers.join("\r\n"),true,false,t ru
    e,true);
    }

    with

    if(user.number!=0) {
    var file = new File(system.data_dir + "logon.lst");
    if(file.open("r") && file.size >= 0) {
    template.lastcallers=file.readAll();
    file.close();
    template.lastcallers.shift();

    template.lastcallers=html_encode(template.lastcallers.join("\r\n"),true,false,t ru
    e,true);
    }
    else
    {
    template.lastcallers='<p style="weight:bold;color:cyan;">No callers today!</p>';
    }
    }

    and that'll fix it. You may have to clean up the wordwrap. I hope someone else finds this useful!

    -=Fireball=-

    ---
    þ Synchronet þ Fireball Express!!! BBS - http://fireballex.com telnet://fireballex.com