FM Themes
Welcome to FM Themes
where you can share your ModernBB, punBB, phpBB 2, Invision, & phpBB 3 themes for Forumotion forums.

You are viewing the forum as a guest, so you will not be able to use the full forum. To use all the features of the forum, you need to log in or create a FREE account by registering.
Share
View previous topicGo downView next topic
avatar
Administrator
Administrator
Posts : 517
Points : 2280
Reputation : 70
View user profilehttp://broadcastingduo.forumotion.com/

Solved How to add staff moderation color icon?

on Sat Apr 18, 2015 5:07 pm
Hello,

I am sorry if this is in the wrong section at all... there was no section for all versions and since my forum is #phpBB2 I figured I should create the topic here even though I bet the code works for all versions.

I have created this topic to inquire about adding a staff moderation color icon similar  to what we have here at FMThemes. It could really be useful for my staff and I have no idea how to install one or where to find the codes for one.

What I mean is something like this: http://prntscr.com/6vet07 the icon with the hat in colors.

How can I add one to my forum? A test forum is available to test all codes on Smile.

Any help on this matter would be greatly appericated.

-Brandon
avatar
Administrator
Administrator
Posts : 3943
Points : 1840
Reputation : 311
View user profilehttps://www.fmthemes.net

Solved Re: How to add staff moderation color icon?

on Sun Apr 19, 2015 3:34 pm
Message reputation : 100% (1 vote)
Are you referring to the mod color button in the editor?


Last edited by SLGray on Sun Apr 19, 2015 5:50 pm; edited 1 time in total
avatar
VIP Member
VIP Member
Posts : 303
Points : 9165
Reputation : 207
View user profilehttp://fmdesign.forumotion.com/

Solved Re: How to add staff moderation color icon?

on Sun Apr 19, 2015 4:39 pm
Message reputation : 100% (1 vote)
Administration Panel > Modules > JavaScript codes management > New

Title : SCEditor Mod color
Placement : In all the pages
Code:
$(function() {
  if (!$.sceditor || !_userdata.user_level) return;
 
  var mods = {
    'u1' : '#FF6600',
    'u2' : '#FF0000',
    'u3' : '#FFFF00',
    'u4' : '#00FF00'
  },
  c = '#000000', i, u = 'u' + _userdata.user_id;
 
  for (i in mods) {
    if (i == u) {
      c = mods[i];
      break;
    }
  }
 
  $.sceditor.command.set('modcolor', {
    exec : function() { this.insert('[color=' + c + '][b]','[/b][/color]') },
    txtExec : function() { this.insert('[color=' + c + '][b]','[/b][/color]') },
    tooltip : 'Insert mod color'
  });
 
  toolbar += '|modcolor';
});

At the top you'll see a mods object with id:color pairs. To the right of the colon is the ID of the member, and to the left is their color. That's all you need to edit in the script.. Wink

As for the image, you'll need to add your own via CSS. Replace IMAGE by the URL of your image.
Display > Colors > CSS
Code:
.sceditor-button-modcolor {
  background-image:url(IMAGE) !important;
}
avatar
Administrator
Administrator
Posts : 517
Points : 2280
Reputation : 70
View user profilehttp://broadcastingduo.forumotion.com/

Solved Re: How to add staff moderation color icon?

on Sun Apr 19, 2015 8:01 pm
Thanks guys I will give these a try first thing! Smile

Edit: Is it ok if I use the icon you guys have? If so what is the url to the icon/image?
avatar
VIP Member
VIP Member
Posts : 303
Points : 9165
Reputation : 207
View user profilehttp://fmdesign.forumotion.com/

Solved Re: How to add staff moderation color icon?

on Mon Apr 20, 2015 8:47 pm
Message reputation : 100% (1 vote)
avatar
Administrator
Administrator
Posts : 517
Points : 2280
Reputation : 70
View user profilehttp://broadcastingduo.forumotion.com/

Solved Re: How to add staff moderation color icon?

on Mon Apr 20, 2015 9:29 pm
Ok I will add it soon Very Happy.
avatar
Administrator
Administrator
Posts : 517
Points : 2280
Reputation : 70
View user profilehttp://broadcastingduo.forumotion.com/

Solved Re: How to add staff moderation color icon?

on Thu Apr 23, 2015 8:03 am
Hello,

After running a test of this on my test forum and adding the image url to the css. It works fine... but why is there the word youtube on the icon?

See:


It is the last one in the editor.

Is there a way to fix this?

-Brandon
avatar
Administrator
Administrator
Posts : 3943
Points : 1840
Reputation : 311
View user profilehttps://www.fmthemes.net

Solved Re: How to add staff moderation color icon?

on Fri Apr 24, 2015 3:34 pm
Message reputation : 100% (1 vote)
This happened to me when I added the three new editor buttons. Reenter the codes again.
avatar
Administrator
Administrator
Posts : 517
Points : 2280
Reputation : 70
View user profilehttp://broadcastingduo.forumotion.com/

Solved Re: How to add staff moderation color icon?

on Fri Apr 24, 2015 3:58 pm
What do you mean re enter the codes again... Like uninstall it and then reinstall it?

-Brandon
avatar
Administrator
Administrator
Posts : 3943
Points : 1840
Reputation : 311
View user profilehttps://www.fmthemes.net

Solved Re: How to add staff moderation color icon?

on Fri Apr 24, 2015 10:53 pm
Message reputation : 100% (1 vote)
That is correct.
avatar
Administrator
Administrator
Posts : 517
Points : 2280
Reputation : 70
View user profilehttp://broadcastingduo.forumotion.com/

Solved Re: How to add staff moderation color icon?

on Sat Apr 25, 2015 4:41 pm
Ok I just removed all code relating to this feature, then re added it again... The word youtube is still appears on the icon. Mad Crying or Very sad Neutral

Ang other ideas?

-Brandon
avatar
Administrator
Administrator
Posts : 3943
Points : 1840
Reputation : 311
View user profilehttps://www.fmthemes.net

Solved Re: How to add staff moderation color icon?

on Sat Apr 25, 2015 5:01 pm
Have you cleared your browser's cache?
avatar
Administrator
Administrator
Posts : 517
Points : 2280
Reputation : 70
View user profilehttp://broadcastingduo.forumotion.com/

Solved Re: How to add staff moderation color icon?

on Sat Apr 25, 2015 6:36 pm
I am using my mobile phone... I am pretty sure it isn't the cache... Should i try clearing the forum cookies
avatar
VIP Member
VIP Member
Posts : 303
Points : 9165
Reputation : 207
View user profilehttp://fmdesign.forumotion.com/

Solved Re: How to add staff moderation color icon?

on Sun Apr 26, 2015 8:43 pm
Message reputation : 100% (1 vote)
My bad, I forgot to select the inner DIV of the button. That's where the icon is applied, the default for the FA SCEditor is a YT icone.

Change .sceditor-button-modcolor to .sceditor-button-modcolor div
avatar
Administrator
Administrator
Posts : 517
Points : 2280
Reputation : 70
View user profilehttp://broadcastingduo.forumotion.com/

Solved Re: How to add staff moderation color icon?

on Mon May 04, 2015 3:32 pm
Ange Tuteur wrote:My bad, I forgot to select the inner DIV of the button. That's where the icon is applied, the default for the FA SCEditor is a YT icone.

Change .sceditor-button-modcolor to .sceditor-button-modcolor div

Thanks Ange, that indeed did the trick. Smile

Thanks so much... Solved and Archived Smile.
View previous topicBack to topView next topic
Permissions in this forum:
You cannot reply to topics in this forum