SunQuest
           PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old July 9th, 2002, 02:27 PM
mikefoo mikefoo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 mikefoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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"; ?>&nbsp;</td>
</tr>


memberid.php
-------------------
<?
$ranking = "Moderator";
?>


how it appears:
-------------------
| Ranking: | Moderator

Reply With Quote
  #2  
Old July 10th, 2002, 12:49 PM
CmdrDats CmdrDats is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: <br><img src='http://www.dats.co.za/icon.gif'>
Posts: 269 CmdrDats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to CmdrDats Send a message via AIM to CmdrDats Send a message via Yahoo to CmdrDats
RE: Help needed :: Ranking system for a member profile

I'm afraid you're not being terribly clear here.. but maybe change the code to :

Profile.php
-------------
php Code:
Original - php Code
  1.  
  2. <tr>
  3. <td><? echo "<font face="$font" size="$size" color="$color">"; ?>Ranking:</td>
  4. <td><? echo "<font face="$font" size="$size">"; ?><? echo "$stars - $ranking"; ?>&nbsp;</td>
  5. </tr> 


Remember to gives $stars a value?

If that's not quite the problem the please elaborate, thanks.

Reply With Quote
  #3  
Old July 10th, 2002, 01:22 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
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...


Reply With Quote
  #4  
Old July 11th, 2002, 04:44 AM
mikefoo mikefoo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 mikefoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Help needed :: Ranking system for a member profile

Thanks for helping me Anyway, I can't really understand it... I'll create few pics like star1.gif, star2.gif... etc

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"; ?>&nbsp;</td>
</tr>
<tr>
<td><? echo "<font face="$font" size="$size" color="$color">"; ?>Ranking
:</td>
<td><? echo "<font face="$font" size="$size">"; ?><? echo "$ranking"; ?>&nbsp;</td>
</tr>
<tr>
<td><? echo "<font face="$font" size="$size" color="$color">"; ?>Name:</td>
<td><? echo "<font face="$font" size="$size">"; ?><? echo "$name"; ?>&nbsp;</td>
</tr>
<tr>
<td><? echo "<font face="$font" size="$size" color="$color">"; ?>Age:</td>
<td><? echo "<font face="$font" size="$size">"; ?><? echo "$age"; ?>&nbsp;</td>
</tr>
<tr>
<td><? echo "<font face="$font" size="$size" color="$color">"; ?>Sex:</td>
<td><? echo "<font face="$font" size="$size">"; ?><? echo "$sex"; ?>&nbsp;
</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>&nbsp;</td>
</tr>
<tr>
<td><? echo "<font face="$font" size="$size" color="$color">"; ?>City:</td>
<td><? echo "<font face="$font" size="$size">"; ?><? echo "$city"; ?>&nbsp;</td>
</tr>
<tr>
<td><? echo "<font face="$font" size="$size" color="$color">"; ?>Country:</td>
<td><? echo "<font face="$font" size="$size">"; ?><? echo "$country"; ?>&nbsp;</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>"; ?>&nbsp;</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"; ?>&nbsp;
</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 = "";
?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Help needed :: Ranking system for a member profile


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway