View Single Post
  #51  
Old 13th March 2013, 20:17
eckeO5 eckeO5 is offline
Senior Member
 
Join Date: Jan 2011
P2P
Posts: 117
Wink ?????
Quote:
Originally Posted by lafouine022 View Post
Just do a loop on the 'str' that searches the user name for user preg replace color name

it's work for me :bubble:

well lafouine, can you tell us fools how we can imagine it works?

greetz

ecke the fool

Bump: hi peeps,

may be i would be very glad if some1 could help and tell us all fools how lafouine has realized that thing with that loop in the string ....

.........to do the colour thing with usercolor for $username in shoutbox




eckeO5

Bump:
Quote:
Originally Posted by gabkoko View Post
already work it...


Search:
PHP Code:
$username htmlspecialchars_uni ($shout_row['username']);
    
$valasz "<a href='javascript:window.top.SmileIT(\">>>  $username:\",\"shoutbox\",\"shoutbox\")'><img height=10px  style=border:none alt=válasz title=válasz  src=$BASEURL/$pic_base_url/jobbra.gif></a>"
and change to:
PHP Code:
    $resowner mysql_query("SELECT id, username, usergroup FROM users WHERE id=$shout_row[userid]");
    
$arr2 htmlspecialchars_uni (mysql_fetch_array($resowner));
    if (
$arr2["usergroup"] == "13")
    
$arr1"[color=#999900]";
    if (
$arr2["usergroup"] == "11")
    
$arr1"[color=grey]";
    if (
$arr2["usergroup"] == "10")
    
$arr1"[color=darkgreen]";
    if (
$arr2["usergroup"] == "8")
    
$arr1"[color=darkred]";
    if (
$arr2["usergroup"] == "7")
    
$arr1"[color=#2587A7]";
    if (
$arr2["usergroup"] == "6")
    
$arr1"[color=#B000B0]";
    if (
$arr2["usergroup"] == "5")
    
$arr1"[color=#ff5151]";
    if (
$arr2["usergroup"] == "4")
    
$arr1"[color=navy]";
    if (
$arr2["usergroup"] == "3")
    
$arr1"[color=#66CC00]";
    if (
$arr2["usergroup"] == "2")
    
$arr1"[color=#0099FF]";
    if (
$arr2["usergroup"] == "1")
    
$arr1"[color=black]";

    
$valasz "<a href='javascript:window.top.SmileIT(\"[i][b]$arr1$arr2[username]>>[/b][/i][/color]\",\"shoutbox\",\"shoutbox\")'><img height=10px style=border:none alt=válasz title=válasz src=$BASEURL/$pic_base_url/jobbra.gif></a>"
The colors change your own

Thx gabkoko, i´ve got it working. modified it a little bit, but now colors are right to userclass colors.

Well done man....thx.
Reply With Quote
The Following User Says Thank You to eckeO5 For This Useful Post:
Marco (2nd April 2013)