[Share] Ranking Script

Re: [Share]Ranking Script

Hey as i found it a bit of a mess i rewrote it for you guys

Code:
<?php
$FlyFF_Settings['db_host'] = "localhost";
$FlyFF_Settings['db_user'] = "root";
$FlyFF_Settings['db_pass'] = "";
$FlyFF_Settings['db_dbname'] = "flyff";

@mysql_connect($FlyFF_Settings['db_host'], $FlyFF_Settings['db_user'], $FlyFF_Settings['db_pass']) or die("Couldn't establish connection to MySQL: " . mysql_error());
@mysql_select_db($FlyFF_Settings['db_dbname']) or die("Couldn't select MySQL database: " . mysql_error());

$job_array = array("Vagrant","Mercenary","Acrobat","Assist","Magician",
"Puppeteer","Knight","Blade","Jester","Ranger",
"Ringmaster","Billposter","Psykeeper","Elementor","GateKeeper",
"Doppler","Knight","Blade","Jester","Ranger",
"Ringmaster","Billposter","Psykeeper","Elementor","Knight",
"Blade","Jester","Ranger","Ringmaster","Billposter",
"Psykeeper","Elementor");
$gender_array = array("M","F");
?>
<table width="34%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#666666">
  <tr align="center"> 
    <td colspan="5"><b><font size="4">Character Ranking</font></b></td>
  </tr>
  <tr>
    <td>Rank</td>
    <td>Name</td>
    <td>Level</td>
    <td>Class</td>
    <td>Gender</td>
  </tr>
<?
	$rank_query = mysql_query("SELECT `charname`,`level`,`sex`,`accountname`,`exp`,`class` FROM characters WHERE `level` > 0 ORDER BY level DESC LIMIT 11");
	while($rank_result = mysql_fetch_assoc($rank_query)) {
	$i++;
?>
    <tr>
    <td><?=$i;?></td>
    <td><?=$rank_result['charname'];?></td>
    <td><?=$rank_result['level'];?></td>
    <td><?=$job_array[$rank_result['class']];?></td>
    <td><?=$gender_array[$rank_result['sex']];?></td>
  </tr>
< } ?>
</table>

Just so you guys know i simply wrote it havent tested it or anything so if your planning on using it tell me what the problem is if any ;).
 
Last edited:
u should change this
if ($job == 0) { $job2 = Vagrant; }
if ($job == 1) { $job2 = Mercenary; }
if ($job == 2) { $job2 = Acrobat; }
if ($job == 3) { $job2 = Assist; }
if ($job == 4) { $job2 = Magician; }
if ($job == 5) { $job2 = Puppeteer; }
if ($job == 6) { $job2 = Knight; }
if ($job == 7) { $job2 = Blade; }
if ($job == 8) { $job2 = Jester; }
if ($job == 9) { $job2 = Ranger; }
if ($job == 10) { $job2 = Ringmaster; }
if ($job == 11) { $job2 = Billposter; }
if ($job == 12) { $job2 = Psykeeper; }
if ($job == 13) { $job2 = Elementor; }
if ($job == 14) { $job2 = GateKeeper; }
if ($job == 15) { $job2 = Doppler; }
if ($job == 16) { $job2 = Knight; }
if ($job == 17) { $job2 = Blade; }
if ($job == 18) { $job2 = Jester; }
if ($job == 19) { $job2 = Ranger; }
if ($job == 20) { $job2 = Ringmaster; }
if ($job == 21) { $job2 = Billposter; }
if ($job == 22) { $job2 = Psykeeper; }
if ($job == 23) { $job2 = Elementor; }
if ($job == 24) { $job2 = Knight; }
if ($job == 25) { $job2 = Blade; }
if ($job == 26) { $job2 = Jester; }
if ($job == 27) { $job2 = Ranger; }
if ($job == 28) { $job2 = Ringmaster; }
if ($job == 29) { $job2 = Billposter; }
if ($job == 30) { $job2 = Psykeeper; }
if ($job == 31) { $job2 = Elementor; }
to this
if ($job == 0) { $job2 = Vagrant; }
if ($job == 1) { $job2 = Mercenary; }
if ($job == 2) { $job2 = Acrobat; }
if ($job == 3) { $job2 = Assist; }
if ($job == 4) { $job2 = Magician; }
if ($job == 5) { $job2 = Puppeteer; }
if ($job == 6) { $job2 = Knight; }
if ($job == 7) { $job2 = Blade; }
if ($job == 8) { $job2 = Jester; }
if ($job == 9) { $job2 = Ranger; }
if ($job == 10) { $job2 = Ringmaster; }
if ($job == 11) { $job2 = Billposter; }
if ($job == 12) { $job2 = Psykeeper; }
if ($job == 13) { $job2 = Elementor; }
if ($job == 14) { $job2 = GateKeeper; }
if ($job == 15) { $job2 = Doppler; }
if ($job == 16) { $job2 = "Master Knight"; }
if ($job == 17) { $job2 = "Master Blade"; }
if ($job == 18) { $job2 = "Master Jester"; }
if ($job == 19) { $job2 = "Master Ranger"; }
if ($job == 20) { $job2 = "Master Ringmaster"; }
if ($job == 21) { $job2 = "Master Billposter"; }
if ($job == 22) { $job2 = "Master Psykeeper"; }
if ($job == 23) { $job2 = "Master Elementor"; }
if ($job == 24) { $job2 = "Hero Knight"; }
if ($job == 25) { $job2 = "Hero Blade"; }
if ($job == 26) { $job2 = "Hero Jester"; }
if ($job == 27) { $job2 = "Hero Ranger"; }
if ($job == 28) { $job2 = "Hero Ringmaster"; }
if ($job == 29) { $job2 = "Hero Billposter"; }
if ($job == 30) { $job2 = "Hero Psykeeper"; }
if ($job == 31) { $job2 = "Hero Elementor"; }
:)
 
Re: [Share]Ranking Script

Hey as i found it a bit of a mess i rewrote it for you guys

Code:
<?php
$FlyFF_Settings['db_host'] = "localhost";
$FlyFF_Settings['db_user'] = "root";
$FlyFF_Settings['db_pass'] = "";
$FlyFF_Settings['db_dbname'] = "flyff";

@mysql_connect($FlyFF_Settings['db_host'], $FlyFF_Settings['db_user'], $FlyFF_Settings['db_pass']) or die("Couldn't establish connection to MySQL: " . mysql_error());
@mysql_select_db($FlyFF_Settings['db_dbname']) or die("Couldn't select MySQL database: " . mysql_error());

$job_array("Vagrant","Mercenary","Acrobat","Assist","Magician",
"Puppeteer","Knight","Blade","Jester","Ranger",
"Ringmaster","Billposter","Psykeeper","Elementor","GateKeeper",
"Doppler","Knight","Blade","Jester","Ranger",
"Ringmaster","Billposter","Psykeeper","Elementor","Knight",
"Blade","Jester","Ranger","Ringmaster","Billposter",
"Psykeeper","Elementor");
$gender_array("M","F");
?>
<table width="34%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#666666">
  <tr align="center"> 
    <td colspan="5"><b><font size="4">Character Ranking</font></b></td>
  </tr>
  <tr>
    <td>Rank</td>
    <td>Name</td>
    <td>Level</td>
    <td>Class</td>
    <td>Gender</td>
  </tr>
<?
	$rank_query = mysql_query("SELECT `charname`,`level`,`sex`,`accountname`,`exp`,`class` FROM characters WHERE `level` > 0 ORDER BY level DESC LIMIT 11");
	while($rank_result = mysql_fetch_assoc($rank_query)) {
	$i++;
?>
    <tr>
    <td><?=$i;?></td>
    <td><?=$rank_result['charname'];?></td>
    <td><?=$rank_result['level'];?></td>
    <td><?=$job_array($rank_result['class']);?></td>
    <td><?=$gender_array($rank_result['sex']);?></td>
  </tr>
< } ?>
</table>

Just so you guys know i simply wrote it havent tested it or anything so if your planning on using it tell me what the problem is if any ;).

I got this error
Parse error: parse error in C:\xampp\htdocs\rank.php on line 43
 
Re: [Share] Ranking Script Fixed!!

Code:
<?php
$FlyFF_Settings['db_host'] = "localhost";
$FlyFF_Settings['db_user'] = "root";
$FlyFF_Settings['db_pass'] = "";
$FlyFF_Settings['db_dbname'] = "flyff";

@mysql_connect($FlyFF_Settings['db_host'], $FlyFF_Settings['db_user'], $FlyFF_Settings['db_pass']) or die("Couldn't establish connection to MySQL: " . mysql_error());
@mysql_select_db($FlyFF_Settings['db_dbname']) or die("Couldn't select MySQL database: " . mysql_error());

$job_array = array("Vagrant","Mercenary","Acrobat","Assist","Magician",
"Puppeteer","Knight","Blade","Jester","Ranger",
"Ringmaster","Billposter","Psykeeper","Elementor","GateKeeper",
"Doppler","Knight","Blade","Jester","Ranger",
"Ringmaster","Billposter","Psykeeper","Elementor","Knight",
"Blade","Jester","Ranger","Ringmaster","Billposter",
"Psykeeper","Elementor");
$gender_array = array("M","F");
?>
<table width="34%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#666666">
  <tr align="center"> 
    <td colspan="5"><b><font size="4">Character Ranking</font></b></td>
  </tr>
  <tr>
    <td>Rank</td>
    <td>Name</td>
    <td>Level</td>
    <td>Class</td>
    <td>Gender</td>
  </tr>
<?
	$rank_query = mysql_query("SELECT `charname`,`level`,`sex`,`accountname`,`exp`,`class` FROM characters WHERE `level` > 0 ORDER BY level DESC LIMIT 11");
	while($rank_result = mysql_fetch_assoc($rank_query)) {
	$i++;
?>
    <tr>
    <td><?=$i;?></td>
    <td><?=$rank_result['charname'];?></td>
    <td><?=$rank_result['level'];?></td>
    <td><?=$job_array = ($rank_result['class']);?></td>
    <td><?=$gender_array = ($rank_result['sex']);?></td>
  </tr>
<? } ?>
</table>

credits to sir ThuGie for helping me..
 
Last edited:
it doesnt filter my admin characters. can anyone please post the [GM] filter.. for instance if char name starts with [GM] it wont show here.
 
Back