FM Themes
Welcome to FM Themes
where you can share your 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.

How to add staff moderation color icon?

View previous topic View next topic Go down

brandon_g
Coder
Reputation : 67
Points : 2249
Posts : 492
View user profile http://broadcastingduo.forumotion.com/

Postbrandon_g 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 [You must be registered and logged in to see this link.] 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: [You must be registered and logged in to see this link.] 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
SLGray
Administrator
Reputation : 290
Points : 1514
Posts : 3644
View user profile http://fmthemes.forumotion.com

PostSLGray on Sun Apr 19, 2015 3:34 pm

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
Ange Tuteur
Themer
Reputation : 204
Points : 9161
Posts : 303
View user profile http://fmdesign.forumotion.com/

PostAnge Tuteur on Sun Apr 19, 2015 4:39 pm

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;
}
brandon_g
Coder
Reputation : 67
Points : 2249
Posts : 492
View user profile http://broadcastingduo.forumotion.com/

Postbrandon_g 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?
Ange Tuteur
Themer
Reputation : 204
Points : 9161
Posts : 303
View user profile http://fmdesign.forumotion.com/

PostAnge Tuteur on Mon Apr 20, 2015 8:47 pm

There's no problem. Wink
[You must be registered and logged in to see this link.]
brandon_g
Coder
Reputation : 67
Points : 2249
Posts : 492
View user profile http://broadcastingduo.forumotion.com/

Postbrandon_g on Mon Apr 20, 2015 9:29 pm

Ok I will add it soon Very Happy.
brandon_g
Coder
Reputation : 67
Points : 2249
Posts : 492
View user profile http://broadcastingduo.forumotion.com/

Postbrandon_g 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:
[You must be registered and logged in to see this image.]

It is the last one in the editor.

Is there a way to fix this?

-Brandon
SLGray
Administrator
Reputation : 290
Points : 1514
Posts : 3644
View user profile http://fmthemes.forumotion.com

PostSLGray on Fri Apr 24, 2015 3:34 pm

This happened to me when I added the three new editor buttons. Reenter the codes again.
brandon_g
Coder
Reputation : 67
Points : 2249
Posts : 492
View user profile http://broadcastingduo.forumotion.com/

Postbrandon_g 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
SLGray
Administrator
Reputation : 290
Points : 1514
Posts : 3644
View user profile http://fmthemes.forumotion.com

PostSLGray on Fri Apr 24, 2015 10:53 pm

That is correct.
brandon_g
Coder
Reputation : 67
Points : 2249
Posts : 492
View user profile http://broadcastingduo.forumotion.com/

Postbrandon_g 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
SLGray
Administrator
Reputation : 290
Points : 1514
Posts : 3644
View user profile http://fmthemes.forumotion.com

PostSLGray on Sat Apr 25, 2015 5:01 pm

Have you cleared your browser's cache?
brandon_g
Coder
Reputation : 67
Points : 2249
Posts : 492
View user profile http://broadcastingduo.forumotion.com/

Postbrandon_g 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
Ange Tuteur
Themer
Reputation : 204
Points : 9161
Posts : 303
View user profile http://fmdesign.forumotion.com/

PostAnge Tuteur on Sun Apr 26, 2015 8:43 pm

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
brandon_g
Coder
Reputation : 67
Points : 2249
Posts : 492
View user profile http://broadcastingduo.forumotion.com/

Postbrandon_g on Mon May 04, 2015 3:32 pm

[You must be registered and logged in to see this link.] 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 topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

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