• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

username and another variable?

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
3 posts • Page 1 of 1

Postby zilveer » Tue Dec 19, 2006 11:34 am

Hi,
I have a community where I have a "username" and also another variable called "username_color". The "username" variable contains the name of the user. for i.e username = zilveer
but the "username_color" variable contains css code which for instance could contain:
<div style="float: left; "><span style="color: #FFFF00">zilv</span><span style="color: #FF00FF">eer</span></div>.

this makes it possible and great to use different colors on different letters in the username.

wouldnt it be great if there was an extra variable so we can set the username_color in phpfreechat?
for i.e:

Code: Select all
$username_color = '<div style="float: left; "><span style="color: #FFFF00">zilv</span><span style="color: #FF00FF">eer</span></div>';

$params["username_color"] = $username_color;

I dont know if this is possible yet, that is why I am posting it in this part of the forum.

anyhow, if you someone could do shuch a thing it would be great.
/Isa Acar, the truth is infront of you
zilveer
Member
 
Posts: 38
Joined: Sat Oct 07, 2006 11:35 am
Top

Postby daviddu54 » Tue Dec 19, 2006 10:50 pm

hi
yes its possible to return a different colors by tags,but your function must inclued an array like so

Code: Select all
$params["nickname_colorlist"] = array($color);

for an exemple look my code for xoops community,i call colors sex of member

Code: Select all
if (is_object($xoopsUser)) {
$sexe = $xoopsUser->getVar('sexe');
if ($sexe == "Homme" ) { $color = '#009900'; }
if ($sexe == "Femme" ) { $color = '#ff00ff'; }
if ($sexe == "Couple" ) { $color = '#996600'; }

} else {

$color = '#000000';

}

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["nickname_colorlist"] = array($color);

this exemple dont work by you ,but you can adapted.
in this exemple ,if is it a xoops member the scipt check the sex of member and return a color green for man, fushia for women ou brun for couple ,and black for guest or anonymous
daviddu54
New member
 
Posts: 7
Joined: Thu Dec 14, 2006 4:06 am
Top

Postby zilveer » Fri Dec 22, 2006 5:08 pm

hi and thank you for your reply.

as you see it is not only colors I use, I also use <div> tags. how can I do this?

/thanks
/Isa Acar, the truth is infront of you
zilveer
Member
 
Posts: 38
Joined: Sat Oct 07, 2006 11:35 am
Top


Post a reply
3 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 5 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub