Any PHP Coder out there?

Joined
Dec 21, 2005
Messages
830
Reaction score
20
I made a layout for ran cp...
And I can share it now at any moment...
But I want to fix some minor problems first before releasing it..
Any php coder out there willing to give a helping hand?
Cuz I just need a few more page to be added...
Thanks!

^^,
 
Ok here are the pages that I wanna edit...
This is the "All-Class Ranking Page"
The page is ok but...
I just want it to display 'SG' 'PHX' 'MP' for school column...
And 'Brawler' 'Swordsman' 'Archer' 'Shaman' 'Extreme-M' 'Extreme-W' for character column...
Since they are displaying numbers only...

Code:
<?php
//
echopage('header', 'Ranking - All Class');

echo"
<center><table width=500><tr><td width=9% bgcolor=#FFFFFF> <Font size=2><strong>Rank</strong></font></td>
<td width=30% bgcolor=#FFFFFF> <Font size=2><strong>Character Name</strong></font></td>
<td width=15% bgcolor=#FFFFFF> <Font size=2><strong>Level</strong></font></td>
<td width=15% bgcolor=#FFFFFF> <Font size=2><strong>Class</strong></font></td>
<td width=15% bgcolor=#FFFFFF> <Font size=2><strong>School</strong></font></td>
<td width=16% bgcolor=#FFFFFF> <Font size=2><strong>Gold</strong></font></td></tr>
";

$rank = 100;
connectdb($CONFIG['dbdbname1'], $CONFIG['dbaddress'], $CONFIG['dbuser'], $CONFIG['dbpass']);
$result = mssql_query(sprintf(SELECT_ALL_RANK,$rank));
$rows=mssql_num_rows($result);
if ($rows>0) {
	$current_rank = 0;
	while ($line = mssql_fetch_assoc($result)) {
		$current_rank++;
		echo "<tr><td><font size=2 color=cyan><b>  $current_rank</td>";

		foreach ($line as $display_index => $col_value) {
			if ($display_index == 3) {
				$col_value = determine_class($col_value);
			}
			elseif ($display_index == 4) {
				$col_value = determine_school($col_value);
			}

		echo "\n\t\t<td><font size=2 color=cyan><b> $col_value</td>";
		}
	}
}
echo "<tr><td> </td></tr></table>";

echopage('footer', '');
?>

And can you give me hints on how to change this ranking page to Guild Ranking page, and Money Ranking page...

Code:
<?php
//
echopage('header', 'Ranking - Extreme-W Class');

echo"
<center><table width=500><tr><td width=9% bgcolor=#FFFFFF> <Font size=2><strong>Rank</strong></font></td>
<td width=40% bgcolor=#FFFFFF> <Font size=2><strong>Character Name</strong></font></td>
<td width=15% bgcolor=#FFFFFF> <Font size=2><strong>Level</strong></font></td>
<td width=20% bgcolor=#FFFFFF> <Font size=2><strong>School</strong></font></td>
<td width=16% bgcolor=#FFFFFF> <Font size=2><strong>Gold</strong></font></td></tr>
";

$rank = 50;
$Rclass = 32;
connectdb($CONFIG['dbdbname1'], $CONFIG['dbaddress'], $CONFIG['dbuser'], $CONFIG['dbpass']);
$result = mssql_query(sprintf(SELECT_CLASS_RANK,$rank,$Rclass));
$rows=mssql_num_rows($result);
if ($rows>0) {
	$current_rank = 0;
	while ($line = mssql_fetch_assoc($result)) {
		$current_rank++;
		echo "<tr><td><font size=2 color=cyan><b>  $current_rank</td>";

		foreach ($line as $display_index => $col_value) {
			if ($display_index == 3) {
				$col_value = determine_school($col_value);
			}

		echo "\n\t\t<td><font size=2 color=cyan><b> $col_value</td>";
		}
	}
}
echo "<tr><td> </td></tr></table>";

echopage('footer', '');
?>

Thanks bro!...
^^,
 
Upvote 0
here put this after this line
echopage('header', 'Ranking - All Class');
function getClass ($str) {
if ($str == 1) { $char = "Brawler"; }
if ($str == 2) { $char = "Swordsman"; }
if ($str == 4) { $char = "Archer"; }
if ($str == 8) { $char = "Shaman"; }
if ($str == 16) { $char = "Extreme-W"; }
if ($str == 32) { $char = "Extreme-M"; }

return $char;
function getSchool ($int) {
if ($int == 0) { $char = "SG"; }
if ($int == 1) { $char = "MP"; }
if ($int == 2) { $char = "PHX"; }


THEN after this line
foreach ($line as $display_index => $col_value) {
if ($cols == 3) {
$col_value = getClass($col_value);
}
if ($cols == 4) {
$col_value1 = getSchool($col_value1);
}
return $char;
$cols++;
echo "<td valign=top><font size=2> $col_value</td>";
echo "<td valign=top><font size=2> $col_value1</td>";


about the blue part dont know if u have to add it cause ^_^ just try heheh hope this helps
 
Upvote 0
I tried this:

Code:
<?php
//
echopage('header', 'Ranking - All Class');
function getClass ($str) {
if ($str == 1) { $char = "Brawler"; }
if ($str == 2) { $char = "Swordsman"; }
if ($str == 4) { $char = "Archer"; }
if ($str == 8) { $char = "Shaman"; }
if ($str == 16) { $char = "Extreme-W"; }
if ($str == 32) { $char = "Extreme-M"; }

return $char;
function getSchool ($int) {
if ($int == 0) { $char = "SG"; }
if ($int == 1) { $char = "MP"; }
if ($int == 2) { $char = "PHX"; }

echo"
<center><table width=500><tr><td width=9% bgcolor=#FFFFFF> <Font size=2><strong>Rank</strong></font></td>
<td width=30% bgcolor=#FFFFFF> <Font size=2><strong>Character Name</strong></font></td>
<td width=15% bgcolor=#FFFFFF> <Font size=2><strong>Level</strong></font></td>
<td width=15% bgcolor=#FFFFFF> <Font size=2><strong>Class</strong></font></td>
<td width=15% bgcolor=#FFFFFF> <Font size=2><strong>School</strong></font></td>
<td width=16% bgcolor=#FFFFFF> <Font size=2><strong>Gold</strong></font></td></tr>
";

$rank = 100;
connectdb($CONFIG['dbdbname1'], $CONFIG['dbaddress'], $CONFIG['dbuser'], $CONFIG['dbpass']);
$result = mssql_query(sprintf(SELECT_ALL_RANK,$rank));
$rows=mssql_num_rows($result);
if ($rows>0) {
	$current_rank = 0;
	while ($line = mssql_fetch_assoc($result)) {
		$current_rank++;
		echo "<tr><td><font size=2 color=cyan><b>  $current_rank</td>";

                foreach ($line as $display_index => $col_value) {
if ($cols == 3) {
$col_value = getClass($col_value);
}
if ($cols == 4) {
$col_value1 = getSchool($col_value1);
}
return $char;
$cols++;
echo "<td valign=top><font size=2> $col_value</td>";
echo "<td valign=top><font size=2> $col_value1</td>";
		}
	}
}
echo "<tr><td> </td></tr></table>";

echopage('footer', '');
?>

But it's not displaying anything...
 
Upvote 0
It only displayed the first ss:

And when I'm using Cyclone's method it says

"Parse error: parse error, unexpected $end in E:\Server EP4\ran\page\rank-all.php on line 56"

And I dont have line 56...
See my 2nd ss:
 

Attachments

  • ampft - Any PHP Coder out there? - RaGEZONE Forums
    ampft.webp
    10 KB · Views: 88
  • a - Any PHP Coder out there? - RaGEZONE Forums
    aw.webp
    96.3 KB · Views: 53
Upvote 0
u leave me no choice then... i really don't like the programing style but ill just edit wat u posted

PHP:
<?php
//
echopage('header', 'Ranking - All Class');
 $class = array(1 => "Brawler", 2=> "Swordsman", 4=>"Archer", 8=>"Shaman", 16=>"Extreme-W", 32=> "Extreme-M");
 $school   = array(0=>"SG",1=>"MP",2=>"PHX");

echo"
<center><table width=500><tr><td width=9% bgcolor=#FFFFFF> <Font size=2><strong>Rank</strong></font></td>
<td width=30% bgcolor=#FFFFFF> <Font size=2><strong>Character Name</strong></font></td>
<td width=15% bgcolor=#FFFFFF> <Font size=2><strong>Level</strong></font></td>
<td width=15% bgcolor=#FFFFFF> <Font size=2><strong>Class</strong></font></td>
<td width=15% bgcolor=#FFFFFF> <Font size=2><strong>School</strong></font></td>
<td width=16% bgcolor=#FFFFFF> <Font size=2><strong>Gold</strong></font></td></tr>
";

$rank = 100;
connectdb($CONFIG['dbdbname1'], $CONFIG['dbaddress'], $CONFIG['dbuser'], $CONFIG['dbpass']);
$result = mssql_query(sprintf(SELECT_ALL_RANK,$rank));
$rows=mssql_num_rows($result);
if ($rows>0) {
	$current_rank = 0;
	while ($line = mssql_fetch_assoc($result)) {
		$current_rank++;
		echo "<tr><td><font size=2 color=cyan><b>  $current_rank</td>";

		foreach ($line as $display_index => $col_value) {
			if ($display_index == 3) {
				$col_value = $class[$col_value];
			}
			elseif ($display_index == 4) {
				$col_value = $school[$col_value];
			}

		echo "\n\t\t<td><font size=2 color=cyan><b> $col_value</td>";
		}
	}
}
echo "<tr><td> </td></tr></table>";

echopage('footer', '');
?>
 
Upvote 0
Back