PDA

View Full Version : Custom font color and face.



PK-Fortis
Wed 10th Oct '01, 4:23pm
I'm trying to add the option of custom fonts and font colors to my forums. That is, users can enter in either a color name or #RRGGBB notation in a custom profile field, a font name in another custom profile field, and their posts' text will have the specified attributes.

The way I have it set up now is in the main postbit template:
...<FONT COLOR="$post[field5]" FACE="$post[field6]">$post[message]...

That works in newer browsers, but some people see black text for users who haven't specified a color... that's a problem because my forums have a black background.

Is there any way to check fields 5 and 6, and if they have no value, insert the default color/font face into the HTML?

Chen
Wed 10th Oct '01, 4:26pm
Look in functions.php, getpostbit function.
You will need something like this:

if ($post[field5]=="")
$post[field5]="#FFFFFF";
if ($post[field6]=="")
$post[field6]="Verdana";

PK-Fortis
Wed 10th Oct '01, 8:48pm
That worked out perfectly; thanks.