Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Simplemachines Cowboy - tammikuu 17, 2006, 10:12:09 IP

Otsikko: Help with 1 line of php code, please!
Kirjoitti: Simplemachines Cowboy - tammikuu 17, 2006, 10:12:09 IP
I need some quick help turning this:
return 'Currently there ' . $singularplural1 . ' <b><font color="#6B8EAE">' . $chatcount . ' User'.$singularplural2.' in XXX XXXX XXXXX Chat</font></b><br/>';
which displays like this:
Currently there are 0 Users in XXX XXXX XXXXX Chat

I'd like it to display this, all bold and using blue #6B8EAE & red #FF0000:
Currently there are 0 Users in XXX XXXX XXXXX Chat

I keep getting parse errors 'cause I can't get the . and ' right.

thanks,

Cowboy
Otsikko: Re: Help with 1 line of php code, please!
Kirjoitti: SleePy - tammikuu 17, 2006, 11:02:23 IP
i know what hex values you want for the colors but you can fix those...

return '<font color="blue">Currently there ' . $singularplural1 . '</font><font color="red">' . $chatcount . ' User'.$singularplural2.'</font><font color="blue" in XXX XXXX XXXXX Chat</font></b><br/>';
Otsikko: Re: Help with 1 line of php code, please!
Kirjoitti: Simplemachines Cowboy - tammikuu 17, 2006, 11:28:22 IP
Thanks SleePy.
It was close... and I made it work.
You didn't start the <b> and you left off a > on the last font color
return '<b><font color="#6B8EAE">Currently there ' . $singularplural1 . '</font><font color="red">' . $chatcount . ' Userer'.$singularplural2.'</font><font color="#6B8EAE"> in XXX XXX XXXXX Chat</font></b><br/>';
Otsikko: Re: Help with 1 line of php code, please!
Kirjoitti: SleePy - tammikuu 17, 2006, 11:33:10 IP
oops.. it was a quick type.. and my php syntax checker doesn't catch html mistakes...