Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: pabloalcorta - huhtikuu 21, 2020, 04:31:06 IP

Otsikko: Change message color
Kirjoitti: pabloalcorta - huhtikuu 21, 2020, 04:31:06 IP
hello I change the theme of my forum from dark to light there is a post that some users used the color yellow to write the text
is there a way to change all messages using the yellow font to black thanks
Otsikko: Re: Change message color
Kirjoitti: Doug Heffernan - huhtikuu 21, 2020, 04:54:14 IP
What theme are you using? It will require some css changes most likely. Try to post at that theme 's support topic.
Otsikko: Re: Change message color
Kirjoitti: Sir Osis of Liver - huhtikuu 21, 2020, 05:38:06 IP
I think OP wants to convert existing posts that used yellow bbc tag to black because they're difficult to see in light theme.  If that's the case, simplest way would be to run query on _messages table.
Otsikko: Re: Change message color
Kirjoitti: efk - huhtikuu 21, 2020, 09:05:14 IP
Can he just change default yellow to some orange color or similar? Sounds easiest to do.
Otsikko: Re: Change message color
Kirjoitti: pabloalcorta - huhtikuu 22, 2020, 11:12:28 AP
Lainaus käyttäjältä: Sir Osis of Liver - huhtikuu 21, 2020, 05:38:06 IP
I think OP wants to convert existing posts that used yellow bbc tag to black because they're difficult to see in light theme.  If that's the case, simplest way would be to run query on _messages table.



hello thank you all if what I want to do is what you say but I don't know how to do the query thanks
Otsikko: Re: Change message color
Kirjoitti: Sir Osis of Liver - huhtikuu 22, 2020, 12:39:20 IP
Don't have time to do it just now, maybe someone else can post the query.  If _messages table is not too large, you can export it, load it in text editor, do find/replace where [color=yellow], import back to db.
Otsikko: Re: Change message color
Kirjoitti: Sir Osis of Liver - huhtikuu 22, 2020, 09:45:13 IP
Ok, here's the query -



UPDATE smf_messages
SET
    body = REPLACE(body,
        '[color=yellow]',
        '[color=black]')



This assumes table prefix is smf_ , if not replace with your table prefix.

You run it in phpmyadmin, click on database in left window, then SQL in right window, copy the query into the text box, click Go.  It will replace all [color=yellow] tags with [color=black].  This will change yellow text to black IN ALL THEMES.  Backup your database before you try this.
Otsikko: Re: Change message color
Kirjoitti: Illori - huhtikuu 23, 2020, 05:09:30 AP
or they can add something like this to their themes CSS file

span[style*="color: black"] { color: #bcbcbc !important;}

that will change the color of the black bbc text to gray or whatever other color they want to put in place.

just put that line at the very bottom of the index.css file.
Otsikko: Re: Change message color
Kirjoitti: Sir Osis of Liver - huhtikuu 23, 2020, 04:00:57 IP
Nice fix, that's a better idea than messing with the database.  To change yellow to black -

span[style*="color: yellow"] { color: #000000 !important;}

And it only affects the one theme.
Otsikko: Re: Change message color
Kirjoitti: pabloalcorta - huhtikuu 23, 2020, 05:23:00 IP
hello thank Illori, Sir Osis of  I have tried it and it has not changed I put it in the wgame theme folder and modify the index.css file



thanks
Otsikko: Re: Change message color
Kirjoitti: Sir Osis of Liver - huhtikuu 23, 2020, 05:31:46 IP
Works on test install.  You have to put it here, at the end of the file -

/Themes/Wgame/css/index.css



/.fa-poll_lock:before {content: "\f023";}
.fa-poll_edit:before{content: "\f044";}
.fa-poll_remove:before {content: "\f00d";}
.fa-calendar_link:before {content: "\f073";}
.fa-calendar_post_event:before {content: "\f067";}

span[style*="color: yellow"]
{
color: #000000 !important;
}



Changes yellow text in posts to black.

Otsikko: Re: Change message color
Kirjoitti: Gary - huhtikuu 23, 2020, 08:29:12 IP
The CSS file could end up being cached. Try to force a refresh by pressing Ctrl + F5
Otsikko: Re: Change message color
Kirjoitti: pabloalcorta - huhtikuu 24, 2020, 09:08:10 AP
Lainaus käyttäjältä: Sir Osis of Liver - huhtikuu 23, 2020, 05:31:46 IP
Works on test install.  You have to put it here, at the end of the file -

/Themes/Wgame/css/index.css



/.fa-poll_lock:before {content: "\f023";}
.fa-poll_edit:before{content: "\f044";}
.fa-poll_remove:before {content: "\f00d";}
.fa-calendar_link:before {content: "\f073";}
.fa-calendar_post_event:before {content: "\f067";}

span[style*="color: yellow"]
{
color: #000000 !important;
}



Changes yellow text in posts to black.

thank I have it there

Lainaus käyttäjältä: Gary - huhtikuu 23, 2020, 08:29:12 IP
The CSS file could end up being cached. Try to force a refresh by pressing Ctrl + F5


was this refreshing the web did not work either I had to pass the ccleaner and there I could see the changes


it would be impossible without the help they give in the forum to carry out the projects

thanks