[TopLegions Rank]

02/05/2008 20:07 fusionkid#1
Hey everyone ive just made a top legions rank

Hres the code it shows the legions name rank money and how many members and leaders name ive also made pk rank health rank ep rank thats allready been done and exp rank but i cnt seem to get eudemons rank working so if any one has that working plz post thanks Heres code for legions if u want the other ranks just post

Legions rank code!
PHP Code:
  <?php            

    $myhost
="localhost";
    
$mypass="test";
    
$myuser="test";
    
$mydb="my";
    
mysql_connect($myhost,$myuser,$mypass);
    
mysql_select_db($mydb);?>
                            Top Ranking 5 Best Legions </strong></p>
                          <p>&nbsp;</p>
                        </div>
                          <table width="310" height="56" border="0">
                            <tr>
                              <td width="35"><div align="center"><span style="padding-left: 11px;"><a title="Contact" href="http://eo.91.com/contact/contact.shtml"> </a><a href="/eudemons2/index.php"></a><strong>Rank</strong></span></div></td>
                              <td width="102"><div align="center">
                                <p style="padding-left: 11px;"><strong>Legions-</strong><strong>Name</strong></p>
                                </div></td>
                              <td width="52"><div align="center"><span style="padding-left: 11px;"><strong>Leaders </strong></span></div></td>
                              <td width="52"><div align="center"><span style="padding-left: 11px;"><strong>Money</strong></span></div></td>
                              <td width="52"><span style="padding-left: 11px;"><strong>Members</strong></span></td>
                            </tr>
                            <tr>
                              <?php    
                
    $rank 
mysql_query("SELECT NAME,leader_name,money,amount FROM cq_syndicate ORDER by money desc limit 5");
    
//$row = mysql_fetch_array($rank);
    
$i=1;
    while(
$row mysql_fetch_array($rank)){
    if(
$row['profession']==10){
        
$profesion='<img src="images/staff.jpg" width="34" height="37">';
    }
    else{
            
$profesion='<img src="images/weapon.jpg" width="34" height="37">';
    
    }
        echo 
'
    <td>'
.$i.'-</td>
    <td><div align="center">'
.$row['NAME'].'</td>
    <td><div align="center">'
.$row['leader_name'].'</td>
    <td><div align="center">£'
.$row['money'].'</td>
    <td><div align="center">'
.$row['amount'].'</td>
  </tr> '
;
  
$i=$i+1;
    }
    
?>
Feel free to edit!
02/05/2008 21:24 DarkBebi#2
um i got eudemons working just fine i cant seem to change the star rank to actual stars so if you could help me on that but heres the code

<?php
require_once './inc/class.captcha.php';
$myhost="localhost";
$mypass="test";
$myuser="test";
$mydb="my";
mysql_connect($myhost,$myuser,$mypass);
mysql_select_db($mydb);?>

<table width="217" height="137" border="0">
<tr>
<td width="38"><div align="center">
<a href="status.php"><<</a><strong>Rank</td>
<td width="107"><div align="center"><strong>Name</td>
<td width="50"><div align="center"><strong>Owner Name</td>
<td width="107"><div align="center"><strong>Stars</td>
<td width="50"><div align="center"><strong>Level</td>
</tr>
<tr>
<?php

$rank = mysql_query("SELECT name,level,star_lev,ori_owner_name FROM cq_eudemon ORDER by star_lev desc;");
//$row = mysql_fetch_array($rank);
$i=1;
while($row = mysql_fetch_array($rank)){

echo '
<td>'.$i.'-</td>
<td><div align="center">'.$row['name'].'</td>
<td><div align="center">'.$row['ori_owner_name'].'</td>
<td><div align="center">'.$row['star_lev'].'</td>
<td><div align="center">'.$row['level'].'</td>
</tr> ';
$i=$i+1;
}


?>
02/05/2008 22:37 fusionkid#3
Ok ill have a look thanks for the share maybe i can have a look i just don't no what table acctuly has the stars or u have to enter somthing to make it show acctuly stars
02/05/2008 23:06 DarkBebi#4
hey fusionkid (off-topic) maybe you could still add me on msn i have alittle thing to show you on your post up there where it shows Top Ranking 5 Best Legions </strong></p>, you dont have the starting strong and p... just alittle hint so you can correct your self

EDIT:Sorry my email is [Only registered and activated users can see links. Click Here To Register...]
02/05/2008 23:34 jackyyll#5
Quote:
Originally Posted by fusionkid View Post
Ok ill have a look thanks for the share maybe i can have a look i just don't no what table acctuly has the stars or u have to enter somthing to make it show acctuly stars
cq_eudemon has a field called star_lev It shows the stars in points.. ie 10* = star_lev 1000. So you'd have to do

(Pseudo-code)

$star_lev = "1234";
$stars = "";

if (Length($star_lev) == 4) {
$stars = $star_lev[0] + $star_lev[1];
} else if (Length($star_lev) == 5 {
$stars = $star_lev[0] + $star_lev[1] + $star_lev[2];
}

echo $stars;



(It wont shows variables in [ code] or [ php]
02/06/2008 00:34 fusionkid#6
Quote:
Originally Posted by jackyyll View Post
cq_eudemon has a field called star_lev It shows the stars in points.. ie 10* = star_lev 1000. So you'd have to do

(Pseudo-code)

= "1234";
= "";

if (Length() == 4) {
= + ;
} else if (Length() == 5 {
= + + ;
}

echo ;



(It wont shows variables in [ code] or [ php]
Thanks for this but if its no trouble may u wud post the whole code with this one?
02/06/2008 03:29 jackyyll#7
Don't you know what pseudo-code means -.-