inherit
156956
0
Oct 8, 2024 11:05:59 GMT -8
Lady Squid
California Squid
1,134
August 2010
squidknox
|
Post by Lady Squid on Nov 13, 2013 6:35:45 GMT -8
In V4 we had our Info Center shown as broken down, staff separately from members.
I believe that this is the code that made that happen:
<script type="text/javascript"><!-- /* Staff Online by snap2000 */
var staffIcon = "http://i1357./q741/ArmitageArmy1/Smileys/angrywife_zps17e3cb9e.gif"; //icon to use in Info Center var staffGroups=[ ["Administrator", "1"], ["Global Moderator", "2"], ["Moderator", "3"], ["Technical Administrator", "1000"] ];
var row=document.getElementsByTagName("tr"); if(!location.href.match(/\?action\=(?!home)/)) { for(r=0;r<row.length;r++) { if(row[r].firstChild.className=="catbg" && row[r].firstChild.innerHTML.match("Users Online")) { var staffList=[],staffCount=[]; for(g=0;g<staffGroups.length;g++) staffCount[g]=0; var newCat=row[r].cloneNode(true); newCat.firstChild.getElementsByTagName("b")[0].innerHTML="Staff Online"; var newWin=row[r+2].cloneNode(true); var onlineCell=row[r+2].lastChild.getElementsByTagName("font")[0]; var staffCell=newWin.lastChild.getElementsByTagName("font")[0]; newWin.firstChild.innerHTML=(newWin.firstChild.firstChild.nodeName=="IMG") ? '<img src="'+staffIcon+'" border="0" alt="s" />' : 's'; onlineCell.innerHTML=onlineCell.innerHTML.replace(/\d+ Staff Members*,\s/,""); var links=onlineCell.getElementsByTagName("a"); for(a=0;a<links.length;a++) { if(links.className && links.className.match(/^group(\d+)$/)) { reg=eval("\/\\b"+RegExp.$1+"\\b\/"); for(g=0;g<staffGroups.length;g++) { if(staffGroups[g][1].match(reg)) { staffCount[g]++; staffList.push(links); if(a<links.length-1) links.nextSibling.parentNode.removeChild(links.nextSibling); break; } } } }
staffCell.innerHTML=""; for(g=0;g<staffGroups.length;g++) { staffCell.innerHTML+=staffCount[g]+' '+staffGroups[g][0]+(staffCount[g]!=1?'s':''); staffCell.innerHTML+=(g+1<staffGroups.length ? ', ' : '<br />'); } for(a=0;a<staffList.length;a++) { staffCell.appendChild(staffList); if(a<staffList.length-1) staffCell.innerHTML+=", "; }
if(onlineCell.lastChild.nodeType==3) onlineCell.lastChild.parentNode.removeChild(onlineCell.lastChild); row[r].parentNode.insertBefore(newWin,row[r]); row[r].parentNode.insertBefore(newCat,row[r]); break; } } } //--></script>
<script type="text/javascript"> <!--
Could we do this in V5?
thanks squid
|
|
inherit
Jack of All Trades, Master of None
27090
0
May 30, 2013 20:36:34 GMT -8
Stinky666
8,818
July 2004
stinky666
|
Post by Stinky666 on Nov 14, 2013 1:59:22 GMT -8
How exactly is it you are wanting it? Do you currently have the default info center for V5, or have you got modifications done to it or... ? Do you want it so it simply appears like so in the default users online:
Staff: Name 1, Name 2 Members: Name 1, Name 2, Name 3, Name 4
|
|
inherit
156956
0
Oct 8, 2024 11:05:59 GMT -8
Lady Squid
California Squid
1,134
August 2010
squidknox
|
Post by Lady Squid on Nov 14, 2013 6:41:01 GMT -8
Hi Stinky666We have the default info center, have not touched it. The way you have it listed is fine. Even though it's only been 8 days I cannot picture EXACTLY how it was listed before, I know that staff members had their titles listed too. (you can see them listed in "var staffGroups" in the code above) Maybe something like: Users online: Staff: One Moderator, One Global Moderator (etc.) (staff names) Members: (names) but if you can't get the titles in, that is OK. Thanks in advance!
|
|
inherit
190024
0
Nov 6, 2015 21:17:35 GMT -8
Ace Of Charts
136
February 2013
aceofcharts
|
Post by Ace Of Charts on Jan 17, 2014 12:52:35 GMT -8
I've managed to separate staff from regular members, but I know of no way to separate them into individual groups at the moment.
For Online Now (Past 15 Minutes)
<tr><th><i>Online Within the Last 15 Minutes</i></th></tr> <tr><td> <script type="text/javascript"> var x=$[total_staff_online]; var y=$[total_members_online]; var z=x+y; document.write("<b>" + z + " Registered Members</b>, including:"); </script> <br> * <i>$[total_staff_online] Staff</i> {foreach $[online_user]} {if $[online_user.is_member]}{/if}{if $[online_user.is_staff]}| $[online_user]{if $[online_user.invisible]} <span class="small"><font color="#777777">(Invisible)</font></span>{/if}{/if} {/foreach}<br> * <i>$[total_members_online] Member{if $[total_members_online] != 1}s{/if}</i> {foreach $[online_user]} {if $[online_user.is_staff]}{/if}{if !$[online_user.is_staff]}| $[online_user]{if $[online_user.invisible]} <span class="small"><font color="#777777">(Invisible)</font></span>{/if}{/if} {/foreach}<br> <b>$[total_guests_online] Guest{if $[total_guests_online] != 1}s{/if}</b> {if $[total_guests_online] = !1}are{else}is{/if} currently checking us out.{if $[view_guests_online_link]}{/if} {if $[total_online_not_shown]}<br>Too many people are online right now to show them all here; $[total_online_not_shown] people were left out of these lists. [<a class="$[view_active_members_link.class]" href="$[view_active_members_link.href]">View the Entire List</a>] {/if}
For "Online in Past 24 Hours"
<tr><th><i>Online Sometime in the Last 24 Hours</i></th></tr> <tr><td> <script type="text/javascript"> var x=$[total_staff_online_24]; var y=$[total_members_online_24]; var z=x+y; document.write("<b>" + z + " Registered Members</b>, including:"); </script> <br> * <i>$[total_staff_online_24] Staff</i> {foreach $[online_user_24]} {if $[online_user_24.is_member]}{/if}{if $[online_user_24.is_staff]}| $[online_user_24]{if $[online_user_24.invisible]} <span class="small"><font color="#777777">(Invisible)</font></span>{/if}{/if} {/foreach}<br> * <i>$[total_members_online_24] Members</i> {foreach $[online_user_24]} {if $[online_user_24.is_staff]}{/if}{if !$[online_user_24.is_staff]}| $[online_user_24]{if $[online_user_24.invisible]} <span class="small"><font color="#777777">(Invisible)</font></span>{/if}{/if} {/foreach}<br> <b>$[total_guests_online_24] Guest{if $[total_guests_online_24] != 1}s{/if}</b> checked us out. {if $[total_online_not_shown_24]}<br>Too many people were online in the last 24 hours to show them all here; $[total_online_not_shown_24] people got left out of these lists. [<a class="$[view_active_members_link_24.class]" href="$[view_todays_active_members_link.href]"> View the Entire List</a>] {/if}
Should be pretty easy to tell where those go in your Forum Wrapper template; the sections are pretty easy to spot.
How I worked this was I simply had it call the list of all online members (the usual 15-minute span and the 24-hour span, as appropriate for the category) twice in each instance (once for the staff list, and again for regular members). For the staff list, I simply had it not display regular members - same goes for the regular-members-only list (I simply had it not display staff members).
There is, however, a workaround for the commas; with the commas it'd usually have, it would display one at the end of a list when that name wasn't the last on the list of all online users. To work around that, I put a bar | in instead before each; that's the best workaround I could find that looks decent.
As a bonus, you also get some JavaScript that gives a count for all registered members by adding staff and regular members together (because the code designation that calls for "members" counts only counts non-staff).
If someone can figure out how to separate online users by exact group rather than...whatever it is the list's ordering is based upon, that'd be great.
|
|
inherit
156956
0
Oct 8, 2024 11:05:59 GMT -8
Lady Squid
California Squid
1,134
August 2010
squidknox
|
Post by Lady Squid on Jan 18, 2014 17:27:04 GMT -8
|
|