Topic: Forcing a user to type white?

Hi guys,

I was wondering if there a way to make it so every color people choose, it spits out white? I don't want to remove colors totally, because all of my forums post in the past, that use color, will probably have that [color=blah] here if i disable it, so I was wondering if there was a way to mod punbb so if people choose a hex color, or a regular color, it'd just put out white no matter what.

2

Re: Forcing a user to type white?

Here is something that might work.
Didn't test it so...

in post.php,  around line 145
After

$message = pun_linebreaks(pun_trim($_POST['req_message']));

try

$message = ereg_replace("\[color=[^\]]+\]","",$message)
$message = ereg_replace("\[/color\]","",$message)

and if you also want to strip the code color in the subject go to line 85 or around there and find

$subject = pun_trim($_POST['req_subject']);

an after that, write

$subject = ereg_replace("\[color=[^\]]+\]","",$subject)
$subject = ereg_replace("\[/color\]","",$subject)

That way no color code will be entered at all anymore, but the old stuff is still there.

The German PunBB Site:
PunBB-forum.de

Re: Forcing a user to type white?

Nope, didn't work :\

4

Re: Forcing a user to type white?

Try

$message = ereg_replace("\[color\=[^]]+\]","",$message);
$message = ereg_replace("\[/color\]","",$message);

instead of

$message = ereg_replace("\[color=[^\]]+\]","",$message);
$message = ereg_replace("\[/color\]","",$message);

That works

The German PunBB Site:
PunBB-forum.de

Re: Forcing a user to type white?

I was actually wondering if there was a way to make it so old posts remain white as well, but I guess this is fine. smile

Thanks.

6

Re: Forcing a user to type white?

If you want to remove all colors from all posts you should add a line similar to the above in viewtopic.php but I think in the long run it is more efficient to remove the tags in the database.

The German PunBB Site:
PunBB-forum.de

Re: Forcing a user to type white?

Sounds good, thanks for the responses.