Preventing users from changing fonts/font size/colour?

GregF

Active member
Is there any way of adjusting settings to prevent members from changing fonts, font sizes & colours? As they can sometimes be a little too creative, which can make things a bit distracting sometimes...

Thanks,
Greg
 
There are no settings available which will prevent that.
I just tried forcing font settings in the Style Properties -> Message Elements -> Message Text but it doesn't work as the styling is applied inline.

You could likely do it with code modifications to the server files.
 
Code:
.messageList .messageText
{
font-family:@messageText.font-family !important;
font-size:@messageText.size !important;
color:@body.color !important;
}


Would force it to be the defaults all the time.
 
I tried that and it didn't work.

Although I only tried it in Style Properties and EXTRA.css, not by editing the css template directly.
 
Is there any way of adjusting settings to prevent members from changing fonts, font sizes & colours? As they can sometimes be a little too creative, which can make things a bit distracting sometimes...

Thanks,
Greg

I wonder if this would require modifications to the TinyMCE editor itself ?
 
Code:
.messageList .messageText span
{
font-family:@messageText.font-family !important;
font-size:@messageText.font-size !important;
color:@body.color !important;
}

If you remove any of the declarations, you can allow them to change whichever they want. It basically just replaces the <span> inline style that BBCode produces.
 
Wordpress uses TinyMCE.
Here is an article about customizing the TinyMCE Text editor in Wordpress.
I don't know if that provides any further clues ?
:)
I guess Xenforo would be considered a Third Party Plugin of TinyMCE ? non ?
There is a forum for that:
Third party plugins
http://tinymce.moxiecode.com/forum/viewforum.php?id=3
Tips, Tricks & HowTo's
http://tinymce.moxiecode.com/forum/viewforum.php?id=1
I see some TinyMCE API documentation.
http://tinymce.moxiecode.com/wiki.php/API3:class.tinymce

I think many people would like to know more about tweaking TinyMCE in Xenforo.
 
ive had an edit posted for ages to remove colour functionality from tinymce.
one could use that as a guide for disabling font size/face as well. the edits would be similar and would be located in the same files.
 
Code:
.messageList .messageText span
{
font-family:@messageText.font-family !important;
font-size:@messageText.font-size !important;
color:@body.color !important;
}

If you remove any of the declarations, you can allow them to change whichever they want. It basically just replaces the <span> inline style that BBCode produces.
Apologies for bumping this up, but I can vouch for this--it works on font color (which I needed) and the others. The key was adding "span" to the CSS above.

And since we're in Redactor now, this CSS will handily remove the buttons; comment out or delete what you want to keep:

HTML:
/* Remove editor buttons */
.redactor_btn_container_fontfamily {display: none;}
.redactor_btn_container_fontsize {display: none;}
.redactor_btn_container_fontcolor {display: none;}

Colored text has been a major annoyance of mine. Good riddance. ;)
 
You can also use this add-on to remove any pasted BB Code you wish to have removed once the post is saved.

https://xenforo.com/community/resources/bb-code-parser.2796/
Ooooh, that's interesting--thanks! Indeed, I will take a look at that. That would also help avoid member confusion since in the editor, the colored text still remains when editing, but disappears upon display.

Many years ago, I added CSS to get rid of "weirdness" in member signatures by forcing some parameters in CSS (disallowing IMG, or "blocks" like quotes or code), along with making it 80% opaque and restricting the font size. That was before XF added a few settings and permissions for signatures.
 
Members want signatures in the posts (including links), but I wanted to control how they appeared. I keep signatures disabled on most forums I visit (including here) since I find them highly distracting (and don't get me started on images in signatures!). I figured for forums that I run (and need to monitor signatures in, as being part of the staff), I would limit the font size so they would not ever appear larger than the post text, and made them slightly opaque (80%) so that regardless of the theme's font color, the signature would adapt and appear slightly more faint. On all forums, too, I have installed the add-on which displays the signature only once per page (in that person's first post on the page).

A key point is that I did these changes really early, right after we converted, so members would not get hung up on something that had changed.
 
UPDATE, for XF 2.1.

CSS:
/* Prevent colored body text */
.block--messages .message span, .block--messages .block-row span
{
color: @xf-textColor !important;
}

We had someone figure out how to manually type in the BBCode and of course, once they switched back to "normal" text (by setting color to black), the posts disappeared on our black background in our dark theme.

It's nice that this CSS fix removes the color property forum-wide, so staff does not have to manually find and edit hundreds of posts.
 
Could it really be as easy as this?

.bbWrapper span {color: @xf-textColor !important;}

This works. I wonder if it will have an effect anywhere else. I'm poking around at the moment and not really seeing any adverse effects as of yet. If I find anything, I'll follow up.
 
Top Bottom