Colorful Users Nicknames

Started on the old forum in August 2007 · view the original in the archive · old links redirect here

74 replies · 5,614 views · started 19 years ago · 1 min read

14 participants
alesh Lead · 604 posts #1

okay heres the thng...

im done with converting my site into xhtml......

now i just want 1 more thng....

i wanna make tht users have colorful nicknames, but i realy dnt knw where 2 start....

4 e.g. i want tht just my nickname is in red color..........

i knw its posible but i need help!!!!!

okay i knw tht 1st i have 2 make a new row in users table and a 1 new db table, but then starts a problem ...whts next.. etc. lol

cn sum1 tell me where 2 start, how 2 start, how 2 conect db with script etc.. pls????

i dnt asking tht u put a whole coding here.....im just asking tht if sum1 is good enough 2 explain the whole thng 2 me....

pls!!!!!

thanx in advance!!!

eeeeerrr....

ibro9801 #2

okay heres the thng...

im done with converting my site into xhtml......

now i just want 1 more thng....

i wanna make tht users have colorful nicknames, but i realy dnt knw where 2 start....

4 e.g. i want tht just my nickname is in red color..........

i knw its posible but i need help!!!!! okay i knw tht 1st i have 2 make a new row in users table and a 1 new db table, but then starts a problem ...whts next.. etc. lol

cn sum1 tell me where 2 start, how 2 start, how 2 conect db with script etc.. pls????

i dnt asking tht u put a whole coding here.....im just asking tht if sum1 is good enough 2 explain the whole thng 2 me....

pls!!!!! thanx in advance!!!

Pozdrav heh You want to all nicknames are for example in red color?

alesh Lead · 604 posts #4

Pozdrav heh You want to all nicknames are for example in red color?

pozZzz i tebi susjed! no i dnt wanna all nicknames in just 1 color, thts easy and i knw how 2 do it... i want tht wht hypetype said but i got a lil problem with writing the code and with modifing it into the script.....

jus write the code. n put it in there c panel to choose the colors of there name.

lil help pls!!!???

eeeeerrr....

WhiteWarrior Principal · 1,419 posts #5

search google for html colours and you will find the colures

alesh Lead · 604 posts #6

search google for html colours and you will find the colures

lol i knw codes 4 colors...........

eeeeerrr....

linkrx7 #7

this may b of help u will need tables to record the colors rgb or what ever u wana use but this will display it ths only example to get u going

$usercolor=mysql_fetch_array(mysql_query("SELECT color FROM ibwf_users WHERE uid='".$uid."'")); if($usercolor==""){$usercolor[0]="#000000";} $main.="<a href="index.php?action=action&sid=$sid" style="color:$usercolor[0]">$item[1]</a>

alesh Lead · 604 posts #8

this may b of help u will need tables to record the colors rgb or what ever u wana use but this will display it ths only example to get u going $usercolor=mysql_fetch_array(mysql_query("SELECT color FROM ibwf_users WHERE uid='".$uid."'")); if($usercolor==""){$usercolor[0]="#000000";} $main.="<a href="index.php?action=action&sid=$sid" style="color:$usercolor[0]">$item[1]</a>

hmmmm okay now... 1st i need a new row in users table right? and then new table with colors????

but i dnt understand this part

$main.="<a href="index.php?action=action&sid=$sid" style="color:$usercolor[0]">$item[1]</a>

eeeeerrr....

linkrx7 #9

heres the rite 1 4 u lol that was from my script 4got 2 edit it fully 4u lol

echo "<a href="index.php?action=viewuser&who=$item[3]&sid=$sid" style="color:$usercolor[0]">$item[1]</a> ";

ibro9801 #10

You can try something like this

<?php

$usercolor=mysql_fetch_array(mysql_query("SELECT color FROM ibwf_users WHERE uid='".$uid."'"));
if($usercolor==""){$usercolor[0]="#000000";}
$show.="<a href=\"index.php?action=action&sid=$sid\" style=\"color:$usercolor[0]\">$item[1]</a>";
if(!$usercolor==""){
$rnubmer=rand(1,10);

$show.="<a href=\"index.php?action=action&sid=$sid\" style=\"color:$usercolor[$rnubmer]\">$item[1]</a>";

}
?>

Give me the link of script, and tell me in whic part of code you have found where it should it be and I will make it, I think that you must mannualy change every part where is nick shown...I don't know which script is it...

alesh Lead · 604 posts #11

i converted my site into xhtml from basic wml lava script..... and i modified it sumthng like tht funmobile script.... i mean i took idea from it.... cuz i wanted tht users cn change themes by urself etc and tht script got the easiest way 2 do tht.....

okay now i understand i have 2 change the whole script where it shows nicknames but i got trouble 2 put tht code into tany part where it shows nicknames......

4 e.g.

        echo webhead($ctema,$imes);
    echo "<p align=\"center\">";
    include("pop.php");
    echo "$f1";
    echo "[b]$tnm[/b]";
    $num_pages = getnumpages($tid);
    if($page==""||$page<1)$page=1;
    if($go!="")$page=getpage_go($go,$tid);
    $posts_per_page = 5;
    if($page>$num_pages)$page=$num_pages;
    $limit_start = $posts_per_page *($page-1);
    //echo "<a href=\"index.php?action=post&sid=$sid&tid=$tid\">Post reply</a>";
    $lastlink = "<a href=\"index.php?action=$action&tid=$tid&sid=$sid&go=last\">Zadnja strana</a>";
    $firstlink = "<a href=\"index.php?action=$action&tid=$tid&sid=$sid&page=1\">Prva strana</a> ";
    $golink = "";
    if($page>1)
    {
      $golink = $firstlink;
    }
    if($page<$num_pages)
    {
      $golink .= $lastlink;
    }
    if($golink !="")
    {
      echo "
$golink";
    }
    echo "$f2";
    echo "</p>";
    echo "

";
    echo "$f1";
    $vws = $tinfo[4]+1;
    $rpls = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM sw_posts WHERE tid='".$tid."'"));
    echo "Odgovora: $rpls[0] - Pregleda: $vws
";

    
    if($page==1)
    {
      $posts_per_page=4;
      mysql_query("UPDATE ibwf_topics SET views='".$vws."' WHERE  id='".$tid."'");
      $ttext = mysql_fetch_array(mysql_query("SELECT authorid, text, crdate, pollid FROM sw_topics WHERE id='".$tid."'"));
      $unick = getnick_uid($ttext[0]);
      if(isonline($ttext[0]))
    {
      $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";
    }else{
        $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
    }
    $usl = "
<a href=\"index.php?action=viewuser&sid=$sid&who=$ttext[0]\">$iml$unick</a>";
    $topt = "<a href=\"index.php?action=tpcopt&sid=$sid&tid=$tid\">*</a>";
    if($go==$tid)
    {
      $fli = "<img src=\"images/flag.gif\" alt=\"!\"/>";
    }else{
      $fli ="";
    }

    $pst = parsemsg($ttext[1],$sid);
    echo "$usl: $fli$pst $topt
";
    $dtot = date("d-m-y - H:i:s",$ttext[2]);
    echo $dtot;
    echo "
";

its the part from where u reading the topic.....so how 2 put tht code properly??

eeeeerrr....

ibro9801 #12

i converted my site into xhtml from basic wml lava script..... and i modified it sumthng like tht funmobile script.... i mean i took idea from it.... cuz i wanted tht users cn change themes by urself etc and tht script got the easiest way 2 do tht.....

okay now i understand i have 2 change the whole script where it shows nicknames but i got trouble 2 put tht code into tany part where it shows nicknames......

4 e.g.

        echo webhead($ctema,$imes);
    echo "<p align=\"center\">";
    include("pop.php");
    echo "$f1";
    echo "$tnm";
    $num_pages = getnumpages($tid);
    if($page==""||$page<1)$page=1;
    if($go!="")$page=getpage_go($go,$tid);
    $posts_per_page = 5;
    if($page>$num_pages)$page=$num_pages;
    $limit_start = $posts_per_page *($page-1);
    //echo "<a href=\"index.php?action=post&sid=$sid&tid=$tid\">Post reply</a>";
    $lastlink = "<a href=\"index.php?action=$action&tid=$tid&sid=$sid&go=last\">Zadnja strana</a>";
    $firstlink = "<a href=\"index.php?action=$action&tid=$tid&sid=$sid&page=1\">Prva strana</a> ";
    $golink = "";
    if($page>1)
    {
      $golink = $firstlink;
    }
    if($page<$num_pages)
    {
      $golink .= $lastlink;
    }
    if($golink !="")
    {
      echo "
$golink";
    }
    echo "$f2";
    echo "</p>";
    echo "

";
    echo "$f1";
    $vws = $tinfo[4]+1;
    $rpls = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM sw_posts WHERE tid='".$tid."'"));
    echo "Odgovora: $rpls[0] - Pregleda: $vws
";

    
    if($page==1)
    {
      $posts_per_page=4;
      mysql_query("UPDATE ibwf_topics SET views='".$vws."' WHERE  id='".$tid."'");
      $ttext = mysql_fetch_array(mysql_query("SELECT authorid, text, crdate, pollid FROM sw_topics WHERE id='".$tid."'"));
      $unick = getnick_uid($ttext[0]);
      if(isonline($ttext[0]))
    {
      $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";
    }else{
        $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
    }
    $usl = "
<a href=\"index.php?action=viewuser&sid=$sid&who=$ttext[0]\">$iml$unick</a>";
    $topt = "<a href=\"index.php?action=tpcopt&sid=$sid&tid=$tid\">*</a>";
    if($go==$tid)
    {
      $fli = "<img src=\"images/flag.gif\" alt=\"!\"/>";
    }else{
      $fli ="";
    }

    $pst = parsemsg($ttext[1],$sid);
    echo "$usl: $fli$pst $topt
";
    $dtot = date("d-m-y - H:i:s",$ttext[2]);
    echo $dtot;
    echo "
";

its the part from where u reading the topic.....so how 2 put tht code properly??

change this part

$usl = "
<a href=\"index.php?action=viewuser&sid=$sid&who=$ttext[0]\">$iml$unick</a>";

to

<?php

$rnubmer=rand(1,7);*/you can change this to $rnumber=rand(1,10) but theen you must have 10 if conditions below:*/
if($rnubmer==1){
$usercolor="#000000";
}
if($rnubmer==2){
$usercolor="#FFFFFF";
}
if($rnubmer==3){
$usercolor="#FF00FF";
}
if($rnubmer==4){
$usercolor="#0000FF";
}
if($rnubmer==6){
$usercolor="#00FF00";
}
if($rnubmer==7){
$usercolor="#F0FF0F";
}

$usl = "
<font color=\"$usercolor\"><a href=\"index.php?action=viewuser&sid=$sid&who=$ttext[0]\">$iml$unick</a></font>";

}
?>

do you understand how to change it?

alesh Lead · 604 posts #13

oooohhhhhh yes i c the point now......

yes i understant it now...

but does tht mean tht i dnt need a whole new database table, but only a new row in users table???

so corect me pls if im wrong...

1st i've 2 make a new row in users table... 4 e.g. color int(10) NOT NULL default '1'

and then i put this in script....

$color = mysql_fetch_array(mysql_query("SELECT color FROM sw_users WHERE userid='".$uid."'"));

if($color==1){
$usercolor="#000000";
}
if($color==2){
$usercolor="#FFFFFF";
}
if($color==3){
$usercolor="#FF00FF";
}
if($color==4){
$usercolor="#0000FF";
}
if($color==6){
$usercolor="#00FF00";
}
if($color==7){
$usercolor="#F0FF0F";
}

$usl = "
<font color=\"$usercolor\"><a href=\"index.php?action=viewuser&sid=$sid&who=$ttext[0]\">$iml$unick</a></font>";

}

am i right??? or did i miss sumthng cuz im lil lost now... lol

eeeeerrr....

ibro9801 #14

oooohhhhhh yes i c the point now......

yes i understant it now...

but does tht mean tht i dnt need a whole new database table, but only a new row in users table??? so corect me pls if im wrong...

1st i've 2 make a new row in users table... 4 e.g. color int(10) NOT NULL default '1' and then i put this in script....

$color = mysql_fetch_array(mysql_query("SELECT color FROM sw_users WHERE userid='".$uid."'"));

if($color==1){
$usercolor="#000000";
}
if($color==2){
$usercolor="#FFFFFF";
}
if($color==3){
$usercolor="#FF00FF";
}
if($color==4){
$usercolor="#0000FF";
}
if($color==6){
$usercolor="#00FF00";
}
if($color==7){
$usercolor="#F0FF0F";
}

$usl = "
<font color=\"$usercolor\"><a href=\"index.php?action=viewuser&sid=$sid&who=$ttext[0]\">$iml$unick</a></font>";

}

am i right??? or did i miss sumthng cuz im lil lost now... lol

You yust do what I did said in last/that post, you don't need to creat new row in database External image (may be gone) Try it and report External image (may be gone)

alesh Lead · 604 posts #15

but how then the user cn choose his/her favorite color???

eeeeerrr....

ibro9801 #16

but how then the user cn choose his/her favorite color???

Bro I thought that you want randomly choosed colorful nicknames External image (may be gone)

alesh Lead · 604 posts #17

noooo lol i wanna choose it 4 them or tht they cn choose it... okay i made this 2day but it wont work... what did i miss?

its the part from th inbox.php

echo "<div>";
            echo "$f1";
            $items = mysql_query($sql);
            echo mysql_error();
            while ($item = mysql_fetch_array($items))
            {
          if($item[3]=="1")
          {
            $iml = "<img src=\"images/npm.gif\" alt=\"+\"/>";
          }else{
            if($item[4]=="1")
            {
            $iml = "<img src=\"images/spm.gif\" alt=\"*\"/>";
            }else{

            $iml = "<img src=\"images/opm.gif\" alt=\"-\"/>";
            }
          }
        
$uid = getuid_sid($sid);        
$color = mysql_fetch_array(mysql_query("SELECT color FROM sw_users WHERE id='".$uid."'"));
if($color== 1){
$usercolor="#0000FF";
}
if($color==2){
$usercolor="#FFFFFF";
}
if($color==3){
$usercolor="#FF00FF";
}
if($color==4){
$usercolor="#0000FF";
}
if($color==6){
$usercolor="#00FF00";
}
if($color==7){
$usercolor="#F0FF0F";
}else{
$usercolor="#00FF00";
}

$lnk = "<a href=\"inbox.php?action=readpm&pmid=$item[1]&sid=$sid\">$iml <font color=\"$usercolor\">$item[0]</font></a>";
          echo "$lnk
";
            }

and i made a row in users table

SQLcolor char(1) not null default 0

but it doesnt wanna work.... i only get the last ELSE color which i put if the user didn choose the color...

so what did i made wrong????

eeeeerrr....

Guest #18

who insert this code? its is for color name status? red for administrator green for moderator?

alesh Lead · 604 posts #19

who insert this code? its is for color name status? red for administrator green for moderator?

lol yep it could b............ but it doesnt work........

i thnk maybe i made the wrong row in users table...

any1 knws??? it should b char or int or what??

eeeeerrr....

alesh Lead · 604 posts #20

noooo lol i wanna choose it 4 them or tht they cn choose it... okay i made this 2day but it wont work... what did i miss?

its the part from th inbox.php

echo "<div>";
            echo "$f1";
            $items = mysql_query($sql);
            echo mysql_error();
            while ($item = mysql_fetch_array($items))
            {
          if($item[3]=="1")
          {
            $iml = "<img src=\"images/npm.gif\" alt=\"+\"/>";
          }else{
            if($item[4]=="1")
            {
            $iml = "<img src=\"images/spm.gif\" alt=\"*\"/>";
            }else{

            $iml = "<img src=\"images/opm.gif\" alt=\"-\"/>";
            }
          }
        
$uid = getuid_sid($sid);        
$color = mysql_fetch_array(mysql_query("SELECT color FROM sw_users WHERE id='".$uid."'"));
if($color== 1){
$usercolor="#0000FF";
}
if($color==2){
$usercolor="#FFFFFF";
}
if($color==3){
$usercolor="#FF00FF";
}
if($color==4){
$usercolor="#0000FF";
}
if($color==6){
$usercolor="#00FF00";
}
if($color==7){
$usercolor="#F0FF0F";
}else{
$usercolor="#00FF00";
}

$lnk = "<a href=\"inbox.php?action=readpm&pmid=$item[1]&sid=$sid\">$iml <font color=\"$usercolor\">$item[0]</font></a>";
          echo "$lnk
";
            }

and i made a row in users table

SQLcolor char(1) not null default 0 but it doesnt wanna work.... i only get the last ELSE color which i put if the user didn choose the color...

so what did i made wrong????

pls sum1 tell me whts wrong here?

eeeeerrr....

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close