The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to have a "Group online " widget when you already have a staff one

View previous topic View next topic Go down

How to have a "Group online " widget when you already have a staff one

Post by Mad on April 22nd 2016, 11:32 pm

So I have a staff online widget but I would like one which shows a group or some members by a different name then "staff online" and I need to be able to have both at the same time.

E.G.


Staff Online:
Mad

(A group) online:
Mad
(name)


Mad
New Member

Posts : 14
Reputation : 1
Language : english

http://amgcclan.forumtl.com/

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by SLGray on April 23rd 2016, 12:04 am

Are you asking for support? If yes, this is the wrong section.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35641
Reputation : 2374
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by Mad on April 23rd 2016, 12:19 am

@SLGray wrote:Are you asking for support? If yes, this is the wrong section.

I am asking for help on how to do something if I have put this in the wrong section I apologise you can move it to the right one.

Mad
New Member

Posts : 14
Reputation : 1
Language : english

http://amgcclan.forumtl.com/

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by SLGray on April 23rd 2016, 12:41 am

Moved to the correct section.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35641
Reputation : 2374
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by Draxion on April 23rd 2016, 12:43 am

Hi there,

Sorry, I don't quite understand your issue. Can you go into more specifics?

Draxion
Forumember

Posts : 361
Reputation : 48
Language : English

http://www.draxionsgameden.com/

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by Mad on April 23rd 2016, 1:02 am

@Draxion wrote:Hi there,

Sorry, I don't quite understand your issue. Can you go into more specifics?

As simple as I would like a widget that shows which members of the group you a sign it to is online

Mad
New Member

Posts : 14
Reputation : 1
Language : english

http://amgcclan.forumtl.com/

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by Genesis on April 23rd 2016, 1:04 am

What's the code for the staff online widget?

Genesis
Forum Reviewer
Forum Reviewer

Male Posts : 2331
Reputation : 322
Language : English
Location : Forumountain

http://forumpromocean.com

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by Mad on April 23rd 2016, 1:06 am

@Genesis wrote:What's the code for the staff online widget?

Code:

<script type="text/javascript">
myStaff = ['Mad', 'Becky Queen Of Love', 'SirGrey', 'K A W'];
staff_cache_time = 4*60*1000; // mm*ss*ms;
</script>
<div id="theStaff">
</div>
<div style="display:none" id="theContent">
</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;
}
})

Mad
New Member

Posts : 14
Reputation : 1
Language : english

http://amgcclan.forumtl.com/

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by Genesis on April 23rd 2016, 1:15 am

What's your forum link?

Genesis
Forum Reviewer
Forum Reviewer

Male Posts : 2331
Reputation : 322
Language : English
Location : Forumountain

http://forumpromocean.com

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by Ange Tuteur on April 23rd 2016, 1:30 am

Try using this for groups :
Code:
<script type="text/javascript">
myGroups = ['#990099', '#CC0000'];
groups_cache_time = 4*60*1000; // mm*ss*ms;
</script>
 
<div id="theGroups"></div>
<div id="theGroupsContent" 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.groupOn && localStorage.groupEx > +new Date - group_cache_time) jQuery('#theGroups').html(localStorage.groupOn);
else loadStaff();
function loadStaff() {
  jQuery.get('/viewonline', function(d) {
    for (var groups = document.getElementById('theGroups'), a = jQuery('#main-content a, a.gen', d), i = 0, j = a.length; i<j; i++) {
      for (var k = 0, l = myGroups.length; k < l; k++) {
        if (a[i].style.color.toLowerCase() == myGroups[k].toLowerCase()) {
          $(a[i]).appendTo(groups).wrap('<div class="myGroup">');
        }
      }
    }

    if (!jQuery('#theGroups .myGroup').length) jQuery('#theGroups').html('No groups online');
    if (window.localStorage) {
      localStorage.groupOn = groups.innerHTML;
      localStorage.groupEx = +new Date;
    }
  })
}
</script>

Make sure to include your group(s) colors in this array :
Code:
myGroups = ['#990099', '#CC0000'];

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by Mad on April 23rd 2016, 9:30 am

@Genesis wrote:What's the code for the staff online widget?

http://amgcclan.forumtl.com/

Mad
New Member

Posts : 14
Reputation : 1
Language : english

http://amgcclan.forumtl.com/

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by Mad on April 23rd 2016, 9:32 am

@Ange Tuteur wrote:Try using this for groups :
Code:
<script type="text/javascript">
myGroups = ['#990099', '#CC0000'];
groups_cache_time = 4*60*1000; // mm*ss*ms;
</script>
 
<div id="theGroups"></div>
<div id="theGroupsContent" 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.groupOn && localStorage.groupEx > +new Date - group_cache_time) jQuery('#theGroups').html(localStorage.groupOn);
else loadStaff();
function loadStaff() {
  jQuery.get('/viewonline', function(d) {
    for (var groups = document.getElementById('theGroups'), a = jQuery('#main-content a, a.gen', d), i = 0, j = a.length; i<j; i++) {
      for (var k = 0, l = myGroups.length; k < l; k++) {
        if (a[i].style.color.toLowerCase() == myGroups[k].toLowerCase()) {
          $(a[i]).appendTo(groups).wrap('<div class="myGroup">');
        }
      }
    }

    if (!jQuery('#theGroups .myGroup').length) jQuery('#theGroups').html('No groups online');
    if (window.localStorage) {
      localStorage.groupOn = groups.innerHTML;
      localStorage.groupEx = +new Date;
    }
  })
}
</script>

Make sure to include your group(s) colors in this array :
Code:
myGroups = ['#990099', '#CC0000'];
Okay let me try that

Nope I need #FF0000 Red

Mad
New Member

Posts : 14
Reputation : 1
Language : english

http://amgcclan.forumtl.com/

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by APE on April 23rd 2016, 2:58 pm

Find this in the code and place your own colors in the place of this
Code:
myGroups = ['#990099', '#CC0000'];
so where it has #990099 change it to your red color.

Now to add the code in the widget you need to find this button on the editor >> click it so it looks like this >>
Now add your code and save Smile


it should look something like this
Code:
 <script type="text/javascript">
        myGroups = ['#FF0000', '#CC0000'];
        groups_cache_time = 4*60*1000; // mm*ss*ms;
        </script>
       
        <div id="theGroups"></div>
        <div id="theGroupsContent" 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.groupOn && localStorage.groupEx > +new Date - group_cache_time) jQuery('#theGroups').html(localStorage.groupOn);
        else loadStaff();
        function loadStaff() {
          jQuery.get('/viewonline', function(d) {
            for (var groups = document.getElementById('theGroups'), a = jQuery('#main-content a, a.gen', d), i = 0, j = a.length; i<j; i++) {
              for (var k = 0, l = myGroups.length; k < l; k++) {
                if (a[i].style.color.toLowerCase() == myGroups[k].toLowerCase()) {
                  $(a[i]).appendTo(groups).wrap('<div class="myGroup">');
                }
              }
            }
       
            if (!jQuery('#theGroups .myGroup').length) jQuery('#theGroups').html('No groups online');
            if (window.localStorage) {
              localStorage.groupOn = groups.innerHTML;
              localStorage.groupEx = +new Date;
            }
          })
        }
        </script>





APE
Manager
Manager

Male Posts : 8319
Reputation : 716
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Re: How to have a "Group online " widget when you already have a staff one

Post by Genesis on April 23rd 2016, 3:49 pm

I'm looking at your forum and it seems you are missing part of the code at the top and bottom.

Genesis
Forum Reviewer
Forum Reviewer

Male Posts : 2331
Reputation : 322
Language : English
Location : Forumountain

http://forumpromocean.com

Back to top Go down

View previous topic View next topic Back to top


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