Last 24 hour logged in members name colors

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?
avatar
Anzo
Forumember

Posts : 365
Reputation : 8
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
avatar
Ange Tuteur
Forumaster

Male Posts : 13195
Reputation : 2910
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

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

Posts : 365
Reputation : 8
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
avatar
Ange Tuteur
Forumaster

Male Posts : 13195
Reputation : 2910
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Back to top


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