Jump to content
  • 0

help About Flux + Rankings


Jezu

Question


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  566
  • Reputation:   34
  • Joined:  11/17/11
  • Last Seen:  

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.

//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;

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 /no1

Edited by Jezu
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   1
  • Joined:  10/10/18
  • Last Seen:  

On 5/3/2013 at 10:12 AM, Zeiyan said:

nope im using ghost's. anyway i got mine fixed it's kinda hard to explain but i edited some stuffs in addons folder and pvpranking.php in themes folder. (i also used ghost pvp ranking for flux tho) check it @ http://www.zeiyan-ro.com

i need more specific information about this.I'd like to ask a favor,i couldnt get it works pvp ranking not appear on my list tab 

 

need an assistant; currently using latest rathena fluxcp 

1. using a wampserver

2. ghost pvp script v1.4 + sql 

3. jupeto addon pvpranking  pack

1235542957_needassist.thumb.PNG.a03ffacad3fdb9d23db1183c24d53bd0.PNG

how to solve a problem like this?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

There you go

Is this the full pvprankings addon? why is it that data folder is empty? Wanna add this..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   39
  • Joined:  01/20/12
  • Last Seen:  

There you go

Is this the full pvprankings addon? why is it that data folder is empty? Wanna add this..

No, it isn't... I just used to create those folders by default whenever I work with add-ons for me to easily navigate to affected files and troubleshoot problems even for a small work like this. Anyways, the attached file is just a revised version of jezu's code.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  566
  • Reputation:   34
  • Joined:  11/17/11
  • Last Seen:  

There you go

Thanks master @Jupeto for this, I will like try this now and feedback later on... thank you so much!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

There you go

Is this the full pvprankings addon? why is it that data folder is empty? Wanna add this..

No, it isn't... I just used to create those folders by default whenever I work with add-ons for me to easily navigate to affected files and troubleshoot problems even for a small work like this. Anyways, the attached file is just a revised version of jezu's code.

Ooops EDITED POST.. I made it work but how can I add class column?

Any tutorial? Do I need to call a new sql table for it?

Edited by emong
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  275
  • Reputation:   23
  • Joined:  01/06/13
  • Last Seen:  

anyone got a solution?

nope im using ghost's. anyway i got mine fixed it's kinda hard to explain but i edited some stuffs in addons folder and pvpranking.php in themes folder. (i also used ghost pvp ranking for flux tho) check it @ http://www.zeiyan-ro.com

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   26
  • Joined:  12/07/11
  • Last Seen:  

@ZeiyanRO are you using Annie's Dota Pvp ladder Script?

Link to comment
Share on other sites

×
×
  • Create New...