staff online widget stopped
4 posters
Page 1 of 2
Page 1 of 2 • 1, 2
staff online widget stopped
Technical Details
Forum version : #ModernBB
Position : Founder
Concerned browser(s) : Google Chrome
Screenshot of problem : https://imgur.com/wknA4u4
Who the problem concerns : All members
When the problem appeared : A 3 dias
Forum link : http://brasilrealplayrpg.forumeiros.com/
Description of problem
The staff online widget stopped showing admin avatars, but it was working perfectly.
Can someone help me?
Re: staff online widget stopped
Is the widget on the portal or on the forum? I do not see it.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: staff online widget stopped
PortalSLGray wrote:Is the widget on the portal or on the forum? I do not see it.
Code the widget
- 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: "Resp. Fórum",
color: "7A7373" // eb0008
},
{
group: "Fundador",
color: "971AEB"
},
{
group: "Dono",
color: "ED3737"
},
{
group: "Gerente",
color: "D16110"
},
{
group: "Diretor",
color: "0093A6"
},
{
group: "Master",
color: "80605B"
},
{
group: "Administrador",
color: "66ABFF"
},
{
group: "Helper",
color: "52F07C"
},
{
group: "Aux. Fórum",
color: "9BA2AD"
},
{
group: "Resp. Ts",
color: "5BCBCF"
},
{
group: "Resp. Ts",
color: "5BCBCF"
},
{
group: "Resp. Ts",
color: "5BCBCF"
},
{
group: "Aux. Ts",
color: "519FAD"
},
{
group: "Designer",
color: "F2C600"
}
];
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://2img.net/s/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();
}, 120000); // staffOnline function, reload every 2 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: 40px;
height: 40px;
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>
Re: staff online widget stopped
try this code instead
- Code:
<script type="text/javascript">
myStaff = ['Ange Tuteur', 'Ange'];
staff_cache_time = 4*60*1000; // mm*ss*ms;
</script>
<div id="theStaff"></div>
<div id="theContent" style="display:none"></div>
<noscript><div style="color:red;font-size:9px">Functionality of this widget is not possible, as JavaScript is disabled or unsupported.</div></noscript>
<script type="text/javascript">
if (localStorage.staffOn && localStorage.staffEx > +new Date - staff_cache_time) jQuery('#theStaff').html(localStorage.staffOn);
else loadStaff();
function loadStaff() {
jQuery('#theContent').load('/viewonline #main-content a, a.gen', function() {
for (i=0; i<myStaff.length; i++) jQuery('#theContent a').filter(function() { return jQuery(this).text() === myStaff[i] }).appendTo('#theStaff').wrap('<div class="myStaff">');
if (!jQuery('#theStaff .myStaff').length) jQuery('#theStaff').html('No staff online');
if (window.localStorage) {
localStorage.staffOn = jQuery('#theStaff').html();
localStorage.staffEx = +new Date;
}
})
}
</script>
Re: staff online widget stopped
Administration Panel... Modules ... Forum widgets management and create a new widget
Widget name: Your choice
Use a table type : Yes
Widget name: Your choice
Use a table type : Yes
Re: staff online widget stopped
ok can you make the widget to be visible to guests cause right now i see its saying no staff online so i cant view any avatar
Re: staff online widget stopped
I am disconnected at the time of this print, but the widget remains as if I had online and the avatar broken.
Re: staff online widget stopped
the codes are working in my test forum
please be connected in order to inspect the widget
please be connected in order to inspect the widget
Re: staff online widget stopped
the widget says no staff online http://brasilrealplayrpg.forumeiros.com/
Re: staff online widget stopped
Please don't double post. Your posts need to be separated by 24 hours before bumping. Please use the edit button, instead! Also Please speak English this is a English support forum.
|
Re: staff online widget stopped
Log into your forum so I can see the widget in action.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: staff online widget stopped
It is not showing any staff online.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Page 1 of 2 • 1, 2
Similar topics
» Staff online widget
» Staff online widget help.
» Staff online widget always offline
» How can I make a staff online widget?
» Staff Online Widget Problem
» Staff online widget help.
» Staff online widget always offline
» How can I make a staff online widget?
» Staff Online Widget Problem
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum