|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Help needed :: Ranking system for a member profile
Dear experts here,
Actually I asked this question at PHPDN forum but looks like no one can answer my question. Anyway, I hope experts here will be able to help me out. I just made an online chatting machine with PHP. Anyway, I would like to make a ranking system for registered members by using stars beside text. But I can only fill in text intead of stars for it. Below are the codes. Please teach me what should I add in to make the stars appear in front of the "Moderator". Member can't change the ranking except I add it in his/her profile. Thanks and appreciate your help. profile.php -------------- <tr> <td><? echo "<font face="$font" size="$size" color="$color">"; ?>Ranking:</td> <td><? echo "<font face="$font" size="$size">"; ?><? echo "$ranking"; ?> </td> </tr> memberid.php ------------------- <? $ranking = "Moderator"; ?> how it appears: ------------------- | Ranking: | Moderator |
|
#2
|
|||
|
|||
|
RE: Help needed :: Ranking system for a member profile
|
|
#3
|
|||
|
|||
|
RE: Help needed :: Ranking system for a member profile
I am guessing that you want to display a different amount of stars per a ranking? If that is the case, give ranking a numberic value (i.e., 1 through 5). Then you can have an image called star.png (or whatever) on your webserver...then you can something like:
for($i=0;$i<$ranking;$i++) { echo "<img src="star.png" border="0">"; } and you can use that code wherever you want to display a ranking with stars... |
|
#4
|
|||
|
|||
|
RE: Help needed :: Ranking system for a member profile
Thanks for helping me
Below is the code. Please teach me where to put it in. Really appreciate it!! profile.php ---------------- <? if (file_exists("vars.php")): include("vars.php"); endif; ?> <html> <head> <title><? echo "$title"; ?></title> </head> <? echo "<body bgcolor="$bgcolor" text="$text" link="$link" vlink="$vlink" alink="$alink">"; echo "<font face="$font" size="$size">"; ?> <? if (file_exists("users/$username.php")): include("users/$username.php"); endif; ?> <center> <P> <table width="450" border="1" cellspacing="0" cellpadding="5" bordercolor="<? echo "$bordercolor"; ?>" bordercolorlight="<? echo "$bordercolor"; ?>" bordercolordark="<? echo "$bordercolor"; ?>"> <!--DWLayoutTable--> <tr> <td width="115"><? echo "<font face="$font" size="$size" color="$color">"; ?>Screen Name:</td> <td width="309"><? echo "<font face="$font" size="$size">"; ?><? echo "$username"; ?> </td> </tr> <tr> <td><? echo "<font face="$font" size="$size" color="$color">"; ?>Ranking :</td> <td><? echo "<font face="$font" size="$size">"; ?><? echo "$ranking"; ?> </td> </tr> <tr> <td><? echo "<font face="$font" size="$size" color="$color">"; ?>Name:</td> <td><? echo "<font face="$font" size="$size">"; ?><? echo "$name"; ?> </td> </tr> <tr> <td><? echo "<font face="$font" size="$size" color="$color">"; ?>Age:</td> <td><? echo "<font face="$font" size="$size">"; ?><? echo "$age"; ?> </td> </tr> <tr> <td><? echo "<font face="$font" size="$size" color="$color">"; ?>Sex:</td> <td><? echo "<font face="$font" size="$size">"; ?><? echo "$sex"; ?> </td> </tr> <tr> <td><? echo "<font face="$font" size="$size" color="$color">"; ?>Email:</td> <td><? echo "<font face="$font" size="$size">"; ?><a href="mailto:<? echo "$email1"; ?>"><? echo "$email1"; ?></a> </td> </tr> <tr> <td><? echo "<font face="$font" size="$size" color="$color">"; ?>City:</td> <td><? echo "<font face="$font" size="$size">"; ?><? echo "$city"; ?> </td> </tr> <tr> <td><? echo "<font face="$font" size="$size" color="$color">"; ?>Country:</td> <td><? echo "<font face="$font" size="$size">"; ?><? echo "$country"; ?> </td> </tr> <tr> <td><? echo "<font face="$font" size="$size" color="$color">"; ?>Web Site URL:</td> <td><? echo "<font face="$font" size="$size">"; ?><? echo "<a href="$url" target="new">$url</a>"; ?> </td> </tr> <tr> <td valign="top"><? echo "<font face="$font" size="$size" color="$color">"; ?>About Me:</td> <td><? echo "<font face="$font" size="$size">"; ?><? echo "$descrip"; ?> </td> </tr> </table> </center> </body> </html> guest.php (member file) -------------------------- <? $username = "guest"; $ranking = "Founder"; $user = ""; $passwd = "abcdefghijklmnop"; $pass = ""; $name = "Anonymous"; $age = "111"; $sex = "Male"; $email = "someone@abc.com"; $email1 = "someone@abc.com"; $city = "LA"; $country = "Mars"; $url = "http://nationalzoo.tk"; $descrip = ""; ?> |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Help needed :: Ranking system for a member profile |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|