Application code and other suggestions

View previous topic View next topic Go down

Application code and other suggestions

Post by Eats on Tue Jan 01, 2019 2:19 pm

Code:

<ul id="staff_widget"></ul>
<script type="text/javascript">
/*
 *  Application: Staff Online Widget
 *  Date: 14/06/2018
 *  Version: 2.014062018
 *  Copyright (c) 2018 Daemon <help.forumotion.com>
 *  This work is free. You can redistribute it and/or modify it
 */
jQuery(function() {
 
    function staffOnline() {
 
        var staff = [
            {group: "Administrator", color: "FF0000"},
            {group: "Moderator", color: "008C09"},
            {group: "Helper", color: "D69A45"}
        ];
 
        jQuery.get("/viewonline", function(data) {
            staffWidget.html("");
            // variables
            var table = jQuery(".table, .table1, .ipbtable, .three-col .forumline", data);
            // List each item in the array
            jQuery.each(staff, function(i, val) {
                var staffColor = table.find("span[style*='" + val.color + "']");
                // Check span elements that contain array colors
                if (typeof(staffColor) != "undefined" && staffColor != null) {
                    // For each existing color
                    jQuery.each(staffColor, function(i, el) {
                        var stafferHref = jQuery(el).closest("a").attr("href");
                        jQuery.get(stafferHref, function(data2) {
                            var stafferName = jQuery(el).closest("a").parent().html(),
                                stafferId = stafferHref.split("/u")[1],
                                avatarSrc = jQuery(".module", data2).find("img").attr("src");
                            staffWidget.append(
                                '<li class="online_staff clearfix">' +
                                '  <div class="div-icon-staff">' +
                                '    <div class="staff-avatar"><img src="' + avatarSrc + '" alt="avatar"></div>' +
                                '  </div>' +
                                '  <div class="div-main-staff">' +
                                '    <div class="staff-mp"><a href="/privmsg?mode=post&u=' + stafferId + '"><img src="https://hitsk.in/t/18/09/33/i_icon_pm.png" title="Send PM"></a></div>' +
                                '    <div class="staff-name">' + stafferName + '</div>' +
                                '    <p class="staff-rank">' + val.group + '</p>' +
                                '  </div>' +
                                '</li>'
                            );
                            sessionStorage.setItem("online_staff", staffWidget.html());
                        }); // end request 2
                    }); // end each staffColor
                }// end if
            });// end each staff
        });// end request 1
    }
 
    var staffWidget = jQuery("#staff_widget");
    storedValue = sessionStorage.getItem("online_staff");
    staffWidget.html((storedValue !== null) ? storedValue : staffOnline());
 
    setInterval(function() {
        sessionStorage.removeItem("online_staff");
        staffOnline();
    }, 180000); // staffOnline function, reload every 3 minutes
 
});
</script>
<style type="text/css">
#staff_widget {padding: 0;}
#staff_widget:empty:before {
    content: "Não há staff online!";
}
#staff_widget .online_staff {
  display: block;
  font-size: 14px;
  padding: 1px 0;
  zoom: 1;
}
#staff_widget .div-icon-staff {
  width: 25px;
  min-width: 25px;
  padding-top: 12px;
}
#staff_widget .div-icon-staff, #staff_widget .div-main-staff {
  display: table-cell;
  padding: 8px;
  vertical-align: top;
}
#staff_widget .staff-avatar {
  background: #fff;
  vertical-align: middle;
  display: inline-block;
  line-height: 1px;
  position: relative;
  margin: 2px;
}
#staff_widget .staff-avatar img {
  width: 34px;
  height: 34px;
  border: 1px solid #ddd;
}
#staff_widget .staff-mp {
  display: inline-block;
  float: right;
  margin-right: -25px;
}
#staff_widget .staff-rank {
  color: rgb(150, 150, 150);
  margin-top: 5px;
}
</style>

Also not being able to see the title of my topic if i am not focused on it with my cursor is annoying
avatar
Eats

Posts : 4

View user profile

Back to top Go down

Re: Application code and other suggestions

Post by Eats on Tue Jan 01, 2019 2:29 pm

Code:

<style type="text/css">
p {
  color: #fff;
  font-family: Verdana;
}
</style>
 
<center><p>Owner</p><br />
<br />
<a href="Profile-Link"><img src="Picture-Link" /></a><br />
<br />
<p>Head Administrator</p><br />
<br />
<a href="Profile-Link"><img src="Picture-Link" /></a><br />
<br />
<p>Administrators</p><br />
<a href="Profile-Link"><img src="Picture-Link" /></a><br />
<br />
<p>Global Moderators</p><br />
<a href="Profile-Link"><img src="Picture-Link" /></a><br />
<br />
<p>Junior Moderators</p><br />
<a href="Profile-Link"><img src="Picture-Link" /></a><br />
</center>
avatar
Eats

Posts : 4

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum