I wanted to show my pvp rankings on this fluxcp and I got one add ons + sql files. Can you please help me with this? I can't manage to show the rankings. Hope you guys show some a helping hand.
Here's the addons on FluxCP of mine:
<?php if (!defined('FLUX_ROOT')) exit; ?>
<?php
/**
* ======================================
* TOP pvp Ranking Base on Kills
* Ranks are base on Player Kills ratio
* --------------------------------------
* Author: "Gerome" John Gerome Baldonado
* Email: [email protected]
* http://rathena.org/board/user/715-gerome/
* Requirements: Pvpladder Script by Annie.. or any Pvpladder Script
*/
$pvpladder = Flux::config('FluxTables.pvpladder');
$minimumkills = 1; // Minimum Kills..
$player = array();
$minimumRank = 5; // Minimim Player(s) that will Display. if the value is 3 it will display 1st - 3rd
$sql = "SELECT `char`.`name` , `kills`, `deaths` FROM {$server->charMapDatabase}.`char` JOIN $pvpladder ON $pvpladder.char_id = `char`.char_id WHERE `kills` > $minimumkills ORDER BY `kills` DESC LIMIT 5 ";
$sth = $server->connection->getStatement($sql);
$sth->execute();
$rankings= $sth->fetchAll();
$x = 0;
foreach($rankings as $rank):
$player['name'][$x] = $rank->name;
$player['kills'][$x] = $rank->kills;
$player['deaths'][$x] = $rank->deaths;
$x+=1;
endforeach;
?>
<div id="PvpRankTop">
Ranks are based on <br/>Player kill death ratio<br/> (minimum of <?php echo $minimumkills; ?> kills)
</div>
<table id="Rankings" class="cleanMP">
<tr>
<th> </th>
<th> </th>
<th id="Kills">Kills</th>
<th id="Deaths">Deaths</th>
</tr>
<?php for( $x=0; $x < $minimumRank ;$x++ ): ?>
<?php $y = $x+1; ?>
<tr>
<td id="pvprank" class="cleanMP"><?php if($x == 0) {echo $y.'st';}elseif($x == 1) {echo $y.'nd';}elseif($x == 2) {echo $y.'rd';}elseif($x == 3) {echo $y.'th';} else { echo $y.'th'; } ?></td>
<td id="pvpname" class="cleanMP"><?php echo $player['name'][$x]; ?></td>
<td id="pvpkills" class="cleanMP"><?php echo $player['kills'][$x]; ?></td>
<td id="pvpdeaths"><?php echo $player['deaths'][$x]; ?></td>
</tr>
<?php endfor; ?>
</table>
<a href="<?php echo $this->url('ranking','pvpranking'); ?>" id="seemore">See More..</a>
And here is the SQL Files.
//SQL Table for Ghost's PvP System
CREATE TABLE IF NOT EXISTS `pvpladder` (
`char_id` int(11) NOT NULL,
`account_id` int(11) NOT NULL,
`char` varchar(30) NOT NULL,
`kill` int(11) NOT NULL,
`death` int(11) NOT NULL,
`kdr` varchar(30) NOT NULL,
`killingstreak` int(11) NOT NULL,
`multikill` int(11) NOT NULL,
`killingspree` int(11) NOT NULL,
`dominating` int(11) NOT NULL,
`megakill` int(11) NOT NULL,
`unstoppable` int(11) NOT NULL,
`wickedsick` int(11) NOT NULL,
`monsterkill` int(11) NOT NULL,
`godlike` int(11) NOT NULL,
`beyondgodlike` int(11) NOT NULL,
`doublekill` int(11) NOT NULL,
`triplekill` int(11) NOT NULL,
`ultrakill` int(11) NOT NULL,
`rampage` int(11) NOT NULL,
`ownage` int(11) NOT NULL,
`nemesiskill` int(11) NOT NULL,
`feedcount` int(11) NOT NULL,
PRIMARY KEY (`char_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Hello rA,
I wanted to show my pvp rankings on this fluxcp and I got one add ons + sql files. Can you please help me with this? I can't manage to show the rankings. Hope you guys show some a helping hand.
Here's the addons on FluxCP of mine:
<?php if (!defined('FLUX_ROOT')) exit; ?> <?php /** * ====================================== * TOP pvp Ranking Base on Kills * Ranks are base on Player Kills ratio * -------------------------------------- * Author: "Gerome" John Gerome Baldonado * Email: [email protected] * http://rathena.org/board/user/715-gerome/ * Requirements: Pvpladder Script by Annie.. or any Pvpladder Script */ $pvpladder = Flux::config('FluxTables.pvpladder'); $minimumkills = 1; // Minimum Kills.. $player = array(); $minimumRank = 5; // Minimim Player(s) that will Display. if the value is 3 it will display 1st - 3rd $sql = "SELECT `char`.`name` , `kills`, `deaths` FROM {$server->charMapDatabase}.`char` JOIN $pvpladder ON $pvpladder.char_id = `char`.char_id WHERE `kills` > $minimumkills ORDER BY `kills` DESC LIMIT 5 "; $sth = $server->connection->getStatement($sql); $sth->execute(); $rankings= $sth->fetchAll(); $x = 0; foreach($rankings as $rank): $player['name'][$x] = $rank->name; $player['kills'][$x] = $rank->kills; $player['deaths'][$x] = $rank->deaths; $x+=1; endforeach; ?> <div id="PvpRankTop"> Ranks are based on <br/>Player kill death ratio<br/> (minimum of <?php echo $minimumkills; ?> kills) </div> <table id="Rankings" class="cleanMP"> <tr> <th> </th> <th> </th> <th id="Kills">Kills</th> <th id="Deaths">Deaths</th> </tr> <?php for( $x=0; $x < $minimumRank ;$x++ ): ?> <?php $y = $x+1; ?> <tr> <td id="pvprank" class="cleanMP"><?php if($x == 0) {echo $y.'st';}elseif($x == 1) {echo $y.'nd';}elseif($x == 2) {echo $y.'rd';}elseif($x == 3) {echo $y.'th';} else { echo $y.'th'; } ?></td> <td id="pvpname" class="cleanMP"><?php echo $player['name'][$x]; ?></td> <td id="pvpkills" class="cleanMP"><?php echo $player['kills'][$x]; ?></td> <td id="pvpdeaths"><?php echo $player['deaths'][$x]; ?></td> </tr> <?php endfor; ?> </table> <a href="<?php echo $this->url('ranking','pvpranking'); ?>" id="seemore">See More..</a>And here is the SQL Files.
and here's the config/addon.php
<?php return array( 'PvpRankingLimit' => 20, 'SubMenuItems' => array( 'ranking' => array( 'pvpranking' => 'Pvp Ranking' ), ), // Do not touch this. 'FluxTables' => array( 'pvpladder' => 'pvpladder', ) )Hope you guys lend me a hand to fix this thing. Thanks a lot! <3
Edited by JezuLink to comment
Share on other sites