Staff colors without changing them in the editor
+2
Razor12345
eupdorguk
6 posters
Page 1 of 1
Staff colors without changing them in the editor
Technical Details
Forum version : #ModernBB
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : All members
Forum link : https://community.eupd.org.uk
Description of problem
Hello all,I was hoping for somewhere you could point me to, possibly a tutorial or somewhere I can learn how to change staff colours, so for example, in a topic message a staff member is a purple colour in their text. I want to do this with code instead of having to do it from the text editor, so the code would automatically change the staffs colours to purple for example.
Last edited by eupdorguk on October 31st 2022, 12:19 pm; edited 1 time in total
Re: Staff colors without changing them in the editor
Good evening,
read the tutorial: Organizing Groups / Colors in Legend
You may also be interested:
Group's style on legend: glitter, icon & glow
Customize usernames according to group
read the tutorial: Organizing Groups / Colors in Legend
You may also be interested:
Group's style on legend: glitter, icon & glow
Customize usernames according to group
Razor12345- Support Moderator
- Posts : 1584
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
Re: Staff colors without changing them in the editor
I believe the member means text in messages, not usernames.Razor12345 wrote:Good evening,
read the tutorial: Organizing Groups / Colors in Legend
You may also be interested:
Group's style on legend: glitter, icon & glow
Customize usernames according to group
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Staff colors without changing them in the editor
SLGray wrote:I believe the member means text in messages, not usernames.Razor12345 wrote:Good evening,
read the tutorial: Organizing Groups / Colors in Legend
You may also be interested:
Group's style on legend: glitter, icon & glow
Customize usernames according to group
That is correct, I meant in text messages, without having to keep changing it in the text editor.
Re: Staff colors without changing them in the editor
hi
code java
Placement : In the topics
Replace
with the color of the group
Replace
with the text color you want to be for the group
version AwesomeBB
code java
Placement : In the topics
- Code:
(function($) {
'use strict';
$(function() {
$('.post-wrap').each(function() {
var $post = $(this);
var color = $post.find('[style="color:xxxx"]').css('color');
if (!color.length) return;
$post
.find('.post-content')
.css({
'color': 'yyyy'
});
});
});
})(jQuery);
Replace
|
Replace
|
version AwesomeBB
TonnyKamper and eupdorguk like this post
Re: Staff colors without changing them in the editor
كونان2000 wrote:hi
code java
Placement : In the topics
- Code:
(function($) {
'use strict';
$(function() {
$('.post-wrap').each(function() {
var $post = $(this);
var color = $post.find('[style="color:xxxx"]').css('color');
if (!color.length) return;
$post
.find('.post-content')
.css({
'color': 'yyyy'
});
});
});
})(jQuery);
Replacewith the color of the group
- Code:
xxxx
Replacewith the text color you want to be for the group
- Code:
yyyy
version AwesomeBB
Thanks for this, but unfortunately, that did not work. The text color is still the same.
Re: Staff colors without changing them in the editor
hi
new java code
I added to it the color of your forum group
https://community.eupd.org.uk/t7-my-introduction
Check the java settings
new java code
I added to it the color of your forum group
https://community.eupd.org.uk/t7-my-introduction
- Code:
(function($) {
'use strict';
$(function() {
$('.post-wrap').each(function() {
var $post = $(this);
var color = $post.find('[style="color:#744DB3"]').css('color');
if (!color.length) return;
$post
.find('.post-content')
.css({
'color': '#744DB3'
});
});
});
})(jQuery);
Check the java settings
eupdorguk likes this post
Re: Staff colors without changing them in the editor
I'm sorry, I made a mistake in editing the code
Try the following new code
Try the following new code
- Code:
(function($) {
'use strict';
$(function() {
$('.post-wrap').each(function() {
var $post = $(this);
var color = $post.find('[style="color:#744DB3"]').css('color');
if (!color.length) return;
$post
.find('.post-content')
.css({
'color': '#744DB3'
});
});
});
})(jQuery);
TonnyKamper likes this post
Re: Staff colors without changing them in the editor
Thank you, how do I do, different colors for different ranks please?
Edit: It seems to be working only on a certain thread, please can you advise on what to do next? Thank you.
Edit: It seems to be working only on a certain thread, please can you advise on what to do next? Thank you.
Re: Staff colors without changing them in the editor
كونان2000 wrote:hi
We'll make a new one, wait for me tomorrow
As you can see from the tests I have done, it's no longer working for administrators now either, It just seems to be old messages. Thanks!
Re: Staff colors without changing them in the editor
hi @eupdorguk
code java
Placement : In the topics
Replace
with usernames
Replace
with the text color you want
Put the text color you want below the usernames
as in the picture
code java
Placement : In the topics
- Code:
$(function() {
var pseudos_couleur = ["xxxx","xxxx"];
var color_texte_admin = "yyyy";
function estPseudoCouleur(pseudo){
for(i=0;i<pseudos_couleur.length;i++){
if(pseudo == pseudos_couleur[i]){ return true; } } return false;}
$(function() {
$("span.post-author-name strong").each(function(){
if(estPseudoCouleur($(this).text())){
$(this).parents(".post-body").find(".post-content").css('color',color_texte_admin);
} });});
});
$(function() {
var pseudos_couleur = ["xxxx","xxxx"];
var color_texte_admin = "yyyy";
function estPseudoCouleur(pseudo){
for(i=0;i<pseudos_couleur.length;i++){
if(pseudo == pseudos_couleur[i]){ return true; } } return false;}
$(function() {
$("span.post-author-name strong").each(function(){
if(estPseudoCouleur($(this).text())){
$(this).parents(".post-body").find(".post-content").css('color',color_texte_admin);
} });});
});
$(function() {
var pseudos_couleur = ["xxxx","xxxx"];
var color_texte_admin = "yyyy";
function estPseudoCouleur(pseudo){
for(i=0;i<pseudos_couleur.length;i++){
if(pseudo == pseudos_couleur[i]){ return true; } } return false;}
$(function() {
$("span.post-author-name strong").each(function(){
if(estPseudoCouleur($(this).text())){
$(this).parents(".post-body").find(".post-content").css('color',color_texte_admin);
} });});
});
Replace
|
Replace
|
Put the text color you want below the usernames
as in the picture
Razor12345 likes this post
Re: Staff colors without changing them in the editor
Hello @eupdorguk,
Remove all scripts and replace byكونان2000 wrote:hi
code java
Placement : In the topicsversion AwesomeBB
- Code:
(function($) {
'use strict';
$(function() {
$('.post-wrap').each(function() {
var $post = $(this);
var color = $post.find('[style="color:xxxx"]').css('color');
if (!color.length) return;
$post
.find('.post-content')
.css({
'color': 'yyyy'
});
});
});
})(jQuery);
- Code:
(function($) {
'use strict';
$(function() {
$('.post-wrap').each(function() {
var $post = $(this);
var color = $post.find('.post-author-name [style]').css('color');
if (!color.length) return;
$post
.find('.post-content')
.css({
'color': color
});
});
});
})(jQuery);
SarkZKalie, TonnyKamper and Razor12345 like this post
Re: Staff colors without changing them in the editor
You're both genius' thank you so much, this is solved now!
كونان2000 likes this post
Re: Staff colors without changing them in the editor
topic marked as solved
Problem solved & topic archived.
|
Similar topics
» Changing colors.
» Colors Not changing...
» How to have changing colors?(Solved)
» Text colors not changing
» Staff button on text editor
» Colors Not changing...
» How to have changing colors?(Solved)
» Text colors not changing
» Staff button on text editor
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum