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)

avatar
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.

avatar
SLGray
Administrator
Administrator

Male Posts : 39746
Reputation : 2681
Language : English
Location : United States

https://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.
avatar
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.

avatar
SLGray
Administrator
Administrator

Male Posts : 39746
Reputation : 2681
Language : English
Location : United States

https://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?


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1559
Reputation : 200
Language : English
Location : USA

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
avatar
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 Vanityy on April 23rd 2016, 1:04 am

What's the code for the staff online widget?
avatar
Vanityy
Helper
Helper

Male Posts : 2335
Reputation : 323
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;
}
})
avatar
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 Vanityy on April 23rd 2016, 1:15 am

What's your forum link?
avatar
Vanityy
Helper
Helper

Male Posts : 2335
Reputation : 323
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'];
avatar
Ange Tuteur
Forumaster

Male Posts : 13174
Reputation : 2873
Language : EN10, FR5
Location : Macungie, PA

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/
avatar
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
avatar
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>



avatar
APE
Manager
Manager

Male Posts : 10477
Reputation : 966
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 Vanityy 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.
avatar
Vanityy
Helper
Helper

Male Posts : 2335
Reputation : 323
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