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.

Last 24 hour logged in members name colors

View previous topic View next topic Go down

Solved Last 24 hour logged in members name colors

Post by Anzo on September 29th 2014, 2:15 pm

Hi.

Is it possible to organize colors in the last 24 hour logged in members field? Like, for example, we got Admins - Mods Assistants - ABD League - Obelisk Blue - Ra Yellow - Slifer Red.

These are our groups at my forum. I want them to look in that order below in the last 24 hour online users, instead of randomly showed. Like, I want it to show admins first, mods second, assistants third, etc.

Is that possible?

Anzo
Forumember

Posts : 316
Reputation : 6
Language : English/Arabic
Location : Baghdad - Iraq

http://www.duelacademy.net/forum

Back to top Go down

Solved Re: Last 24 hour logged in members name colors

Post by Ange Tuteur on September 29th 2014, 4:53 pm

Hello Anzo,

Go to Administration Panel > Display > Templates > General > index_body

Find :
Code:
{L_CONNECTED_MEMBERS}<br />

Replace by :
Code:
<span id="lastOnline">{L_CONNECTED_MEMBERS}</span><br />

Save and publish.

Then go to Modules > JavaScript codes management and create a new script :

Title : Your choice
Placement : in the homepage
Paste the code below and save
Code:
$(function() {
  group('#FF6699').appendTo('#lastOnline'); // -
  group('#FFFFFF').appendTo('#lastOnline'); // Admin
  group('#24E9F0').appendTo('#lastOnline'); // Moderator
  group('#1CE695').appendTo('#lastOnline'); // Assistants
  group('#B700FF').appendTo('#lastOnline'); // ADL
  group('#006EF5').appendTo('#lastOnline'); // Obelisk
  group('#FFE600').appendTo('#lastOnline'); // Ra
  group('#DE0000').appendTo('#lastOnline'); // Slifer
  
  $('#lastOnline').html($('#lastOnline').html().replace(/,\s/g,'').replace(/<\/a>/g,'</a>, '));
  $('p:has(#lastOnline)').html($('p:has(#lastOnline)').html().replace(/<\/a>, <\/span>/,'</a></span>'));
  function group(hex){return $('#lastOnline a:has(span[style="color:'+hex+'"] strong)')}
});

To order a group write group(hex) and then the method you want to perform on it .appendTo('#lastOnline') :
Code:
group('#FFFFFF').appendTo('#lastOnline');

hex is the color of the group, you can see that color here :
Users and groups > groups management > edit group > color

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Last 24 hour logged in members name colors

Post by Anzo on September 29th 2014, 6:03 pm

I did as you said, nothing has changed.

EDIT: Nvm It worked! I accidentally only copied half the JS code lol

Thanks a lot, it looks awesome.

Anzo
Forumember

Posts : 316
Reputation : 6
Language : English/Arabic
Location : Baghdad - Iraq

http://www.duelacademy.net/forum

Back to top Go down

Solved Re: Last 24 hour logged in members name colors

Post by Ange Tuteur on September 29th 2014, 6:48 pm

You're welcome Very Happy

Topic archived

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.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