URI:
   DIR Return Create A Forum - Home
       ---------------------------------------------------------
       Create A Forum - Support Forums
  HTML https://support.createaforum.com
       ---------------------------------------------------------
       *****************************************************
   DIR Return to: Create a Forum Codes and Support
       *****************************************************
       #Post#: 16558--------------------------------------------------
       [Code] Hoverover Member Legend
       By: Agent Moose Date: November 22, 2015, 9:23 pm
       ---------------------------------------------------------
       Add this to your footers:
       [code]
       <script type="text/javascript">
       var Groups = new Array(), YES;
       //Created by Agent Moose (November 22, 2015)
       Groups["#00aabb"] = "Administrator";
       Groups["green"] = "Moderator";
       Groups["COLOR"] = "MEMBERGROUP NAME";
       //Only Edit the word "Newbie".  This is used for Membergroups
       who don't have a color.
       Groups["none"] = "Newbie";
       
       var hc = document.getElementById("upshrinkHeaderIC");
       var para = hc.getElementsByTagName("p");
       for(x=0;x<para.length;x++){
       if(para[x].innerHTML.match(/Users active in/i)){
       para[x].innerHTML += "
       Legend: <span id='legend'></span>";
       var h = para[x].getElementsByTagName("a");
       for(i=0;i<h.length;i++){
       h[i].innerHTML = "<span onmouseover='red(this);'
       onmouseout='blue();'>" + h[i].innerHTML + "</span>";
       };
       };
       };
       function red(AgentMoose){
       (AgentMoose.parentNode.style.color) ? YES =
       AgentMoose.parentNode.style.color : YES = "none";
       if(YES !== undefined && /rgb\((.*)\,(.*)\,(.*)\)/i.test(YES)){
       var SEY = "#" + toHex(RegExp.$1) + toHex(RegExp.$2) +
       toHex(RegExp.$3);
       YES = SEY;
       };
       document.getElementById("legend").innerHTML =
       Groups[YES.toLowerCase() || YES.toUpperCase()];
       };
       function blue(){
       setTimeout(function(){
       document.getElementById("legend").innerHTML = "&n" + "bsp;";
       }, 500);
       };
       function toHex(N) {
       if(N === null){
       return "00";
       };
       N = parseInt(N);
       if(N === 0 || isNaN(N)){
       return "00";
       };
       N = Math.max(0,N);
       N = Math.min(N,255);
       N = Math.round(N);
       return "0123456789ABCDEF".charAt((N - N % 16) / 16) +
       "0123456789ABCDEF".charAt(N % 16);
       };
       </script>
       [/code]
       It's been awhile since I've created a code. Years, probably.
       Anyway, this code has been created for some time, but I never
       did release it.
       It adds a member legend to the bottom of your forum under the
       users online list.  When you hover of a user, it will tell you
       what membergroup that person is in.
       You can edit the code by adding more of these lines:
       [code]Groups["COLOR"] = "MEMBERGROUP NAME";[/code]
       Replace the COLOR with the color of the membergroup name.  You
       can use HEX (#00aabb) or color codes (red, blue, green, ect.)
       Replace MEMBERGROUP NAME with the name of the membergroup that
       color resides with.  (Admin, Moderator, ect.)
       There is this line:
       [code]Groups["none"] = "Default";[/code]
       That line is there so that if there is no color for that
       membergroup, it will default to showing the word "Default".  You
       can change that if you wish.
       As always, enjoy the code!  If you have any questions, please
       ask.  I'll try to answer as soon as I can.
       *****************************************************