Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: ranking webengine desordenado  (Visto 2049 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline Tauro14 Posteado: September 21, 2019, 06:11:02 PM

  • -1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 287
  • Gracias recibida: 3076
  • ar
hola alguien me puede ayudar a ordenar el ranking de webengine el ranking de reset aparece desordenado por level

se supone que tendria q estar primero el que esta marcado el rojo

https://prnt.sc/p98hju

Gracias:


Offline Gaboo; #1 Posteado: September 21, 2019, 07:52:58 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 1.415
  • Gracias recibida: 2391
  • ve
Buenas noches, amigo que web engine estas usando?


Offline Cartman #2 Posteado: September 21, 2019, 08:13:26 PM

  • Php Coder
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 304
  • Gracias recibida: 11310
  • pe
el ranking que muestra es por reset no por nivel osea que el primero sera es el que haga el ultimo reset



Offline Tauro14 #3 Posteado: September 21, 2019, 08:34:21 PM

  • -1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 287
  • Gracias recibida: 3076
  • ar
Buenas noches, amigo que web engine estas usando?

hola WebEngine CMS 1.2.0

http://tuservermu.com.ve/index.php?topic=23668.0

este es el modulo de la web

Code: [Select]
<?php
/**
 * WebEngine CMS
 * https://webenginecms.org/
 *
 * @version 1.2.0
 * @author Lautaro Angelico <http://lautaroangelico.com/>
 * @copyright (c) 2013-2019 Lautaro Angelico, All Rights Reserved
 *
 * Licensed under the MIT license
 * http://opensource.org/licenses/MIT
 */

try {

echo '<div class="page-title"><span>'.lang('module_titles_txt_10',true).'</span></div>';

$Rankings = new Rankings();
$Rankings->rankingsMenu();
loadModuleConfigs('rankings');

if(!mconfig('rankings_enable_resets')) throw new Exception(lang('error_44',true));
if(!mconfig('active')) throw new Exception(lang('error_44',true));

$ranking_data = LoadCacheData('rankings_resets.cache');
if(!is_array($ranking_data)) throw new Exception(lang('error_58',true));

$showPlayerCountry = mconfig('show_country_flags') ? true : false;
$charactersCountry = loadCache('character_country.cache');
if(!is_array($charactersCountry)) $showPlayerCountry = false;

if(mconfig('show_online_status')) $onlineCharacters = loadCache('online_characters.cache');
if(!is_array($onlineCharacters)) $onlineCharacters = array();

echo '<table class="rankings-table">';
echo '<tr>';
if(mconfig('rankings_show_place_number')) {
echo '<td style="font-weight:bold;"></td>';
}
if($showPlayerCountry) echo '<td style="font-weight:bold;">'.lang('rankings_txt_33').'</td>';
echo '<td style="font-weight:bold;">'.lang('rankings_txt_11').'</td>';
echo '<td style="font-weight:bold;">'.lang('rankings_txt_10').'</td>';
echo '<td style="font-weight:bold;">'.lang('rankings_txt_12').'</td>';
echo '<td style="font-weight:bold;">'.lang('rankings_txt_13').'</td>';
if(mconfig('show_location')) echo '<td style="font-weight:bold;">'.lang('rankings_txt_34').'</td>';
echo '</tr>';
$i = 0;
foreach($ranking_data as $rdata) {
$characterIMG = getPlayerClassAvatar($rdata[1], true, true, 'rankings-class-image');
$onlineStatus = mconfig('show_online_status') ? in_array($rdata[0], $onlineCharacters) ? '<img src="'.__PATH_ONLINE_STATUS__.'" class="online-status-indicator"/>' : '<img src="'.__PATH_OFFLINE_STATUS__.'" class="online-status-indicator"/>' : '';
if($i>=1) {
echo '<tr>';
if(mconfig('rankings_show_place_number')) {
echo '<td class="rankings-table-place">'.$i.'</td>';
}
if($showPlayerCountry) echo '<td><img src="'.getCountryFlag($charactersCountry[$rdata[0]]).'" /></td>';
echo '<td>'.$characterIMG.'</td>';
echo '<td>'.playerProfile($rdata[0]).$onlineStatus.'</td>';
echo '<td>'.number_format($rdata[3]).'</td>';
echo '<td>'.number_format($rdata[2]).'</td>';
if(mconfig('show_location')) echo '<td>'.returnMapName($rdata[4]).'</td>';
echo '</tr>';
}
$i++;
}
echo '</table>';
if(mconfig('rankings_show_date')) {
echo '<div class="rankings-update-time">';
echo ''.lang('rankings_txt_20',true).' ' . date("m/d/Y - h:i A",$ranking_data[0][0]);
echo '</div>';
}

} catch(Exception $ex) {
message('error', $ex->getMessage());
}


Offline Tauro14 #4 Posteado: September 21, 2019, 09:57:08 PM

  • -1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 287
  • Gracias recibida: 3076
  • ar
alguien porfavor ????


Offline Tauro14 #5 Posteado: September 21, 2019, 11:09:49 PM

  • -1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 287
  • Gracias recibida: 3076
  • ar
el ranking que muestra es por reset no por nivel osea que el primero sera es el que haga el ultimo reset

no hay manera de acomodarlo por nivel ... o sacar del ranking el nivel y dejar los reset nomas...


Offline yhoon #6 Posteado: September 21, 2019, 11:15:37 PM

  • Diseñador
  • +1 puntos por ventas
  • *
  • *
  • Rank: Puto amo
  • Posts: 920
  • Gracias recibida: 7844
  • ar
Eso es facil de arreglar.

Vas a -> Includes -> Classes y abris el class.rankings.

Buscas la linea de
Code: [Select]
 private function _getResetRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) 

Y reemplazas toda esa funcion por esta:

Code: [Select]
 private function _getResetRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) {
$this->mu = Connection::Database('MuOnline');

// level only (no master level)
if(!$combineMasterLevel) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (in same table)
if($masterLevelInSameTable) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.",("._CLMN_CHR_LVL_."+"._CLMN_ML_LVL_.") as "._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (different tables)
$Character = new Character();
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
foreach($result as $key => $row) {
$masterLevelInfo = $Character->getMasterLevelInfo($row[_CLMN_CHR_NAME_]);
if(!is_array($masterLevelInfo)) continue;
$result[$key][_CLMN_CHR_LVL_] = $row[_CLMN_CHR_LVL_]+$masterLevelInfo[_CLMN_ML_LVL_];
}
return $result;
}

Si queres saber que se hizo, simplemente le agregue a las query, el parametro de orden de level.

Gracias:


Offline Tauro14 #7 Posteado: September 21, 2019, 11:58:17 PM

  • -1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 287
  • Gracias recibida: 3076
  • ar
Eso es facil de arreglar.

Vas a -> Includes -> Classes y abris el class.rankings.

Buscas la linea de
Code: [Select]
 private function _getResetRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) 

Y reemplazas toda esa funcion por esta:

Code: [Select]
 private function _getResetRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) {
$this->mu = Connection::Database('MuOnline');

// level only (no master level)
if(!$combineMasterLevel) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (in same table)
if($masterLevelInSameTable) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.",("._CLMN_CHR_LVL_."+"._CLMN_ML_LVL_.") as "._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (different tables)
$Character = new Character();
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
foreach($result as $key => $row) {
$masterLevelInfo = $Character->getMasterLevelInfo($row[_CLMN_CHR_NAME_]);
if(!is_array($masterLevelInfo)) continue;
$result[$key][_CLMN_CHR_LVL_] = $row[_CLMN_CHR_LVL_]+$masterLevelInfo[_CLMN_ML_LVL_];
}
return $result;
}

Si queres saber que se hizo, simplemente le agregue a las query, el parametro de orden de level.

hola cuando lo remplazo no me funciona el ranking este es mi class.rankings.

Code: [Select]
<?php
/**
 * WebEngine CMS
 * https://webenginecms.org/
 *
 * @version 1.2.0
 * @author Lautaro Angelico <http://lautaroangelico.com/>
 * @copyright (c) 2013-2019 Lautaro Angelico, All Rights Reserved
 *
 * Licensed under the MIT license
 * http://opensource.org/licenses/MIT
 */

class Rankings {

private $_results;
private $_excludedCharacters = array('');
private $_rankingsMenu;

function __construct() {

// webengine configs
$this->config = webengineConfigs();
$this->serverFiles = strtolower($this->config['server_files']);

// rankings configs
loadModuleConfigs('rankings');
$this->_results = (check_value(mconfig('rankings_results')) ? mconfig('rankings_results') : 25);

// excluded characters
if(check_value(mconfig('rankings_excluded_characters'))) {
$excludedCharacters = explode(",", mconfig('rankings_excluded_characters'));
$this->_excludedCharacters = $excludedCharacters;
}

// rankings menu
$this->_rankingsMenu = array(
// language phrase, module, status, file-exclusive (array)
array(lang('rankings_txt_1',true), 'level', mconfig('rankings_enable_level')),
array(lang('rankings_txt_2',true), 'resets', mconfig('rankings_enable_resets')),
array(lang('rankings_txt_3',true), 'killers', mconfig('rankings_enable_pk')),
array(lang('rankings_txt_4',true), 'guilds', mconfig('rankings_enable_guilds')),
array(lang('rankings_txt_5',true), 'grandresets', mconfig('rankings_enable_gr'), array('mue', 'muemu', 'louis', 'xteam')),
array(lang('rankings_txt_6',true), 'online', mconfig('rankings_enable_online'), array('mue', 'muemu', 'louis', 'xteam')),
array(lang('rankings_txt_7',true), 'votes', mconfig('rankings_enable_votes')),
array(lang('rankings_txt_8',true), 'gens', mconfig('rankings_enable_gens')),
array(lang('rankings_txt_22',true), 'master', mconfig('rankings_enable_master')),
array(lang('rankings_txt_24',true), 'pvplaststand', mconfig('rankings_enable_pvplaststand'), array('mue')),
);

// extra menu links
$extraMenuLinks = getRankingMenuLinks();
if(is_array($extraMenuLinks)) {
foreach($extraMenuLinks as $menuLink) {
$this->_rankingsMenu[] = array($menuLink[0], $menuLink[1], true);
}
}
}
   
public function UpdateRankingCache($type) {
switch($type) {
case 'level':
$this->_levelsRanking();
break;
case 'resets':
$this->_resetsRanking();
break;
case 'killers':
$this->_killersRanking();
break;
case 'grandresets':
$this->_grandresetsRanking();
break;
case 'online':
$this->_onlineRanking();
break;
case 'votes':
$this->_votesRanking();
break;
case 'guilds':
$this->_guildsRanking();
break;
case 'master':
$this->_masterlevelRanking();
break;
case 'pvplaststand':
$this->_pvplaststandRanking();
break;
case 'gens':
$this->_gensRanking();
break;
default:
return;
}
}

private function _levelsRanking() {
switch($this->serverFiles) {
case "mue":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getLevelRankingData(true, false);
} else {
// level only
$result = $this->_getLevelRankingData(false);
}
break;
case "igcn":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (same tables)
$result = $this->_getLevelRankingData(true, true);
} else {
// level only
$result = $this->_getLevelRankingData(false);
}
break;
case "muemu":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getLevelRankingData(true, false);
} else {
// level only
$result = $this->_getLevelRankingData(false);
}
break;
case "louis":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getLevelRankingData(true, false);
} else {
// level only
$result = $this->_getLevelRankingData(false);
}
break;
case "xteam":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getLevelRankingData(true, false);
} else {
// level only
$result = $this->_getLevelRankingData(false);
}
break;
case "custom":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (same tables)
$result = $this->_getLevelRankingData(true, true);
} else {
// level only
$result = $this->_getLevelRankingData(false);
}
break;
default:
return;
}
if(!is_array($result)) return;

$cache = BuildCacheData($result);
UpdateCache('rankings_level.cache', $cache);
}

private function _resetsRanking() {
switch($this->serverFiles) {
case "mue":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getResetRankingData(true, false);
} else {
// level only
$result = $this->_getResetRankingData(false);
}
break;
case "igcn":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (same tables)
$result = $this->_getResetRankingData(true, true);
} else {
// level only
$result = $this->_getResetRankingData(false);
}
break;
case "muemu":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getResetRankingData(true, false);
} else {
// level only
$result = $this->_getResetRankingData(false);
}
break;
case "louis":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getResetRankingData(true, false);
} else {
// level only
$result = $this->_getResetRankingData(false);
}
break;
case "xteam":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getResetRankingData(true, false);
} else {
// level only
$result = $this->_getResetRankingData(false);
}
break;
case "custom":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (same tables)
$result = $this->_getResetRankingData(true, true);
} else {
// level only
$result = $this->_getResetRankingData(false);
}
break;
default:
return;
}
if(!is_array($result)) return;

$cache = BuildCacheData($result);
UpdateCache('rankings_resets.cache',$cache);
}

private function _killersRanking() {
switch($this->serverFiles) {
case "mue":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getKillersRankingData(true, false);
} else {
// level only
$result = $this->_getKillersRankingData(false);
}
break;
case "igcn":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (same tables)
$result = $this->_getKillersRankingData(true, true);
} else {
// level only
$result = $this->_getKillersRankingData(false);
}
break;
case "muemu":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getKillersRankingData(true, false);
} else {
// level only
$result = $this->_getKillersRankingData(false);
}
break;
case "louis":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getKillersRankingData(true, false);
} else {
// level only
$result = $this->_getKillersRankingData(false);
}
break;
case "xteam":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (different tables)
$result = $this->_getKillersRankingData(true, false);
} else {
// level only
$result = $this->_getKillersRankingData(false);
}
break;
case "custom":
if(mconfig('combine_level_masterlevel')) {
// level + master level combined (same tables)
$result = $this->_getKillersRankingData(true, true);
} else {
// level only
$result = $this->_getKillersRankingData(false);
}
break;
default:
return;
}
if(!is_array($result)) return;

$cache = BuildCacheData($result);
UpdateCache('rankings_pk.cache',$cache);
}

private function _grandresetsRanking() {
$this->mu = Connection::Database('MuOnline');

switch($this->serverFiles) {
case "mue":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.", "._CLMN_CHR_GRSTS_.", "._CLMN_CHR_RSTS_.", "._CLMN_CHR_CLASS_.", "._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_GRSTS_." >= 1 AND "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") ORDER BY "._CLMN_CHR_GRSTS_." DESC, "._CLMN_CHR_RSTS_." DESC");
break;
case "muemu":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.", "._CLMN_CHR_GRSTS_.", "._CLMN_CHR_RSTS_.", "._CLMN_CHR_CLASS_.", "._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_GRSTS_." >= 1 AND "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") ORDER BY "._CLMN_CHR_GRSTS_." DESC, "._CLMN_CHR_RSTS_." DESC");
break;
case "louis":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.", "._CLMN_CHR_GRSTS_.", "._CLMN_CHR_RSTS_.", "._CLMN_CHR_CLASS_.", "._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_GRSTS_." >= 1 AND "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") ORDER BY "._CLMN_CHR_GRSTS_." DESC, "._CLMN_CHR_RSTS_." DESC");
break;
case "xteam":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.", "._CLMN_CHR_GRSTS_.", "._CLMN_CHR_RSTS_.", "._CLMN_CHR_CLASS_.", "._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_GRSTS_." >= 1 AND "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") ORDER BY "._CLMN_CHR_GRSTS_." DESC, "._CLMN_CHR_RSTS_." DESC");
break;
default:
return;
}
if(!is_array($result)) return;

$cache = BuildCacheData($result);
UpdateCache('rankings_gr.cache',$cache);
}

private function _guildsRanking() {
$this->mu = Connection::Database('MuOnline');

switch($this->serverFiles) {
default:
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_GUILD_NAME_.","._CLMN_GUILD_MASTER_.","._CLMN_GUILD_SCORE_.",CONVERT(varchar(max), "._CLMN_GUILD_LOGO_.", 2) as "._CLMN_GUILD_LOGO_." FROM "._TBL_GUILD_." ORDER BY "._CLMN_GUILD_SCORE_." DESC");
}
if(!is_array($result)) return;

$cache = BuildCacheData($result);
UpdateCache('rankings_guilds.cache',$cache);
}

private function _masterlevelRanking() {
$this->mu = Connection::Database('MuOnline');

switch($this->serverFiles) {
case "mue":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." t1."._CLMN_ML_NAME_.", t1."._CLMN_ML_LVL_.", t2."._CLMN_CHR_CLASS_.", t2."._CLMN_CHR_LVL_.", t2."._CLMN_CHR_MAP_." FROM "._TBL_MASTERLVL_." AS t1 INNER JOIN "._TBL_CHR_." AS t2 ON t1."._CLMN_ML_NAME_." = t2."._CLMN_CHR_NAME_." WHERE t1."._CLMN_ML_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND t1."._CLMN_ML_LVL_." > 0 ORDER BY t1."._CLMN_ML_LVL_." DESC, t2."._CLMN_CHR_LVL_." DESC");
break;
case "igcn":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.", "._CLMN_ML_LVL_.", "._CLMN_CHR_CLASS_.", "._CLMN_CHR_LVL_.", "._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_ML_LVL_." > 0 ORDER BY "._CLMN_ML_LVL_." DESC");
break;
case "muemu":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." t1."._CLMN_ML_NAME_.", t1."._CLMN_ML_LVL_.", t2."._CLMN_CHR_CLASS_.", t2."._CLMN_CHR_LVL_.", t2."._CLMN_CHR_MAP_." FROM "._TBL_MASTERLVL_." AS t1 INNER JOIN "._TBL_CHR_." AS t2 ON t1."._CLMN_ML_NAME_." = t2."._CLMN_CHR_NAME_." WHERE t1."._CLMN_ML_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND t1."._CLMN_ML_LVL_." > 0 ORDER BY t1."._CLMN_ML_LVL_." DESC, t2."._CLMN_CHR_LVL_." DESC");
break;
case "louis":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." t1."._CLMN_ML_NAME_.", t1."._CLMN_ML_LVL_.", t2."._CLMN_CHR_CLASS_.", t2."._CLMN_CHR_LVL_.", t2."._CLMN_CHR_MAP_." FROM "._TBL_MASTERLVL_." AS t1 INNER JOIN "._TBL_CHR_." AS t2 ON t1."._CLMN_ML_NAME_." = t2."._CLMN_CHR_NAME_." WHERE t1."._CLMN_ML_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND t1."._CLMN_ML_LVL_." > 0 ORDER BY t1."._CLMN_ML_LVL_." DESC, t2."._CLMN_CHR_LVL_." DESC");
break;
case "xteam":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." t1."._CLMN_ML_NAME_.", t1."._CLMN_ML_LVL_.", t2."._CLMN_CHR_CLASS_.", t2."._CLMN_CHR_LVL_.", t2."._CLMN_CHR_MAP_." FROM "._TBL_MASTERLVL_." AS t1 INNER JOIN "._TBL_CHR_." AS t2 ON t1."._CLMN_ML_NAME_." = t2."._CLMN_CHR_NAME_." WHERE t1."._CLMN_ML_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND t1."._CLMN_ML_LVL_." > 0 ORDER BY t1."._CLMN_ML_LVL_." DESC, t2."._CLMN_CHR_LVL_." DESC");
break;
case "custom":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.", "._CLMN_ML_LVL_.", "._CLMN_CHR_CLASS_.", "._CLMN_CHR_LVL_.", "._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_ML_LVL_." > 0 ORDER BY "._CLMN_ML_LVL_." DESC");
break;
default:
return;
}
if(!is_array($result)) return;

$cache = BuildCacheData($result);
UpdateCache('rankings_master.cache',$cache);
}

private function _gensRanking() {
switch($this->serverFiles) {
default:
$duprianData = $this->_generateGensRankingData(1);
if(!is_array($duprianData)) $duprianData = array();

$vanertData = $this->_generateGensRankingData(2);
if(!is_array($vanertData)) $vanertData = array();

$rankingData = array_merge($duprianData,$vanertData);
usort($rankingData, function($a, $b) {
return $b['contribution'] - $a['contribution'];
});
$result = array_slice($rankingData, 0, $this->_results);
}
if(empty($result)) return;
if(!is_array($result)) return;

$cache = BuildCacheData($result);
UpdateCache('rankings_gens.cache',$cache);
}

private function _pvplaststandRanking() {
$this->mu = Connection::Database('MuOnline');

switch($this->serverFiles) {
case "mue":
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.", "._CLMN_CHR_CLASS_.", "._CLMN_CHR_PVPLS_WIN_.", "._CLMN_CHR_MAP_." FROM "._TBL_CHR_." ORDER BY "._CLMN_CHR_PVPLS_WIN_." DESC");
break;
default:
return;
}
if(!is_array($result)) return;

$cache = BuildCacheData($result);
UpdateCache('rankings_pvplaststand.cache',$cache);
}

private function _votesRanking() {
$this->me = Connection::Database('Me_MuOnline');

$voteMonth = date("m/01/Y 00:00");
$voteMonthTimestamp = strtotime($voteMonth);
$accounts = $this->me->query_fetch("SELECT TOP ".$this->_results." user_id,COUNT(*) as count FROM ".WEBENGINE_VOTE_LOGS." WHERE timestamp >= ? GROUP BY user_id ORDER BY count DESC", array($voteMonthTimestamp));
if(!is_array($accounts)) return;

foreach($accounts as $data) {
$common = new common();

$accountInfo = $common->accountInformation($data['user_id']);
if(!is_array($accountInfo)) continue;

$Character = new Character();
$characterName = $Character->AccountCharacterIDC($accountInfo[_CLMN_USERNM_]);
if(!check_value($characterName)) continue;

$characterData = $Character->CharacterData($characterName);
if(!is_array($characterData)) continue;

if(in_array($characterName, $this->_excludedCharacters)) continue;

$result[] = array($characterName, $data['count'], $characterData[_CLMN_CHR_CLASS_], $characterData[_CLMN_CHR_MAP_]);
}
if(!is_array($result)) return;
$cache = BuildCacheData($result);
UpdateCache('rankings_votes.cache',$cache);
}

private function _onlineRanking() {
$this->me = Connection::Database('Me_MuOnline');
$this->mu = Connection::Database('MuOnline');

switch($this->serverFiles) {
case "mue":
if($this->config['SQL_USE_2_DB']) {
$muLogEx = $this->me->query_fetch("SELECT TOP ".$this->_results." "._CLMN_LOGEX_ACCID_.", sum("._CLMN_LOGEX_OD_.") as TotalOnlineTime FROM "._TBL_LOGEX_." GROUP BY "._CLMN_LOGEX_ACCID_." ORDER BY TotalOnlineTime DESC");
if(is_array($muLogEx)) {
$result = array();
$character = new Character();
foreach($muLogEx as $key => $thisUser) {
$characterName = $character->AccountCharacterIDC($thisUser[_CLMN_LOGEX_ACCID_]);
$characterData = $character->CharacterData($characterName);
$result[$key] = array($characterName, $thisUser['TotalOnlineTime'], $characterData[_CLMN_CHR_CLASS_], $characterData[_CLMN_CHR_MAP_]);
}
}
} else {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." tb2."._CLMN_GAMEIDC_.", sum(tb1."._CLMN_LOGEX_OD_.") AS TotalOnlineDuration, tb3."._CLMN_CHR_CLASS_.", tb3."._CLMN_CHR_MAP_." FROM "._TBL_LOGEX_." AS tb1 INNER JOIN "._TBL_AC_." AS tb2 ON tb1."._CLMN_LOGEX_ACCID_." = tb2."._CLMN_AC_ID_." INNER JOIN "._TBL_CHR_." AS tb3 ON tb2."._CLMN_GAMEIDC_." = tb3."._CLMN_CHR_NAME_." WHERE tb3."._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") GROUP BY tb1."._CLMN_LOGEX_ACCID_.", tb2."._CLMN_GAMEIDC_.", tb3."._CLMN_CHR_CLASS_." ORDER BY TotalOnlineDuration DESC");
}
break;
case "muemu":
$result = $this->_getOnlineRankingDataMembStatHours();
break;
case "louis":
$result = $this->_getOnlineRankingDataMembStatHours();
break;
case "xteam":
$result = $this->_getOnlineRankingDataMembStatHours();
break;
default:
return;
}
if(!is_array($result)) return;

$cache = BuildCacheData($result);
UpdateCache('rankings_online.cache',$cache);
}

public function rankingsMenu() {
echo '<div class="rankings_menu">';
foreach($this->_rankingsMenu as $rm_item) {
if(is_array($rm_item[3])) {
if(!in_array($this->serverFiles, $rm_item[3])) continue;
}
if($rm_item[2]) {
if($_REQUEST['subpage'] == $rm_item[1]) {
echo '<a href="'.__PATH_MODULES_RANKINGS__.$rm_item[1].'/" class="active">'.$rm_item[0].'</a>';
} else {
echo '<a href="'.__PATH_MODULES_RANKINGS__.$rm_item[1].'/">'.$rm_item[0].'</a>';
}
}
}
echo '</div>';
}

private function _rankingsExcludeChars() {
if(!is_array($this->_excludedCharacters)) return;
$return = array();
foreach($this->_excludedCharacters as $characterName) {
$return[] = "'".$characterName."'";
}
return implode(",", $return);
}

private function _generateGensRankingData($influence=1) {
$this->mu = Connection::Database('MuOnline');

$result = $this->mu->query_fetch("SELECT * FROM "._TBL_GENS_." WHERE "._CLMN_GENS_TYPE_." = ? ORDER BY "._CLMN_GENS_POINT_." DESC", array($influence));
if(!is_array($result)) return;

$Character = new Character();

foreach($result as $rankPos => $row) {
$characterData = $Character->CharacterData($row[_CLMN_GENS_NAME_]);
if(!is_array($characterData)) continue;

$gensRank = getGensRank($row[_CLMN_GENS_POINT_]);
if($row[_CLMN_GENS_POINT_] >= 10000) {
$gensRank = getGensLeadershipRank($rankPos);
}

$rankingData[] = array(
'name' => $row[_CLMN_GENS_NAME_],
'influence' => $row[_CLMN_GENS_TYPE_],
'contribution' => $row[_CLMN_GENS_POINT_],
'rank' => $gensRank,
'level' => $characterData[_CLMN_CHR_LVL_],
'class' => $characterData[_CLMN_CHR_CLASS_],
'map' => $characterData[_CLMN_CHR_MAP_]
);
}

if(!is_array($rankingData)) return;
return $rankingData;
}

private function _getLevelRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) {
$this->mu = Connection::Database('MuOnline');

// level only (no master level)
if(!$combineMasterLevel) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") ORDER BY "._CLMN_CHR_LVL_." DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (in same table)
if($masterLevelInSameTable) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.",("._CLMN_CHR_LVL_."+"._CLMN_ML_LVL_.") as "._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") ORDER BY "._CLMN_CHR_LVL_." DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (different tables)
$Character = new Character();
$characters = $this->mu->query_fetch("SELECT "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") ORDER BY "._CLMN_CHR_LVL_." DESC");
if(!is_array($characters)) return;
foreach($characters as $row) {
$masterLevelInfo = $Character->getMasterLevelInfo($row[_CLMN_CHR_NAME_]);
$rankingData[] = array(
_CLMN_CHR_NAME_ => $row[_CLMN_CHR_NAME_],
_CLMN_CHR_CLASS_ => $row[_CLMN_CHR_CLASS_],
_CLMN_CHR_LVL_ => $row[_CLMN_CHR_LVL_]+$masterLevelInfo[_CLMN_ML_LVL_],
_CLMN_CHR_MAP_ => $row[_CLMN_CHR_MAP_],
);
}

usort($rankingData, function($a, $b) {
return $b[_CLMN_CHR_LVL_] - $a[_CLMN_CHR_LVL_];
});

$result = array_slice($rankingData, 0, $this->_results);
if(!is_array($result)) return;
return $result;
}

private function _getResetRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) {
$this->mu = Connection::Database('MuOnline');

// level only (no master level)
if(!$combineMasterLevel) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (in same table)
if($masterLevelInSameTable) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.",("._CLMN_CHR_LVL_."+"._CLMN_ML_LVL_.") as "._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (different tables)
$Character = new Character();
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC");
if(!is_array($result)) return;
foreach($result as $key => $row) {
$masterLevelInfo = $Character->getMasterLevelInfo($row[_CLMN_CHR_NAME_]);
if(!is_array($masterLevelInfo)) continue;
$result[$key][_CLMN_CHR_LVL_] = $row[_CLMN_CHR_LVL_]+$masterLevelInfo[_CLMN_ML_LVL_];
}
return $result;
}

private function _getKillersRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) {
$this->mu = Connection::Database('MuOnline');

// level only (no master level)
if(!$combineMasterLevel) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_PK_KILLS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_.","._CLMN_CHR_PK_LEVEL_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_PK_KILLS_." > 0 ORDER BY "._CLMN_CHR_PK_KILLS_." DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (in same table)
if($masterLevelInSameTable) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_PK_KILLS_.",("._CLMN_CHR_LVL_."+"._CLMN_ML_LVL_.") as "._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_.","._CLMN_CHR_PK_LEVEL_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_PK_KILLS_." > 0 ORDER BY "._CLMN_CHR_PK_KILLS_." DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (different tables)
$Character = new Character();
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_PK_KILLS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_.","._CLMN_CHR_PK_LEVEL_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_PK_KILLS_." > 0 ORDER BY "._CLMN_CHR_PK_KILLS_." DESC");
if(!is_array($result)) return;
foreach($result as $key => $row) {
$masterLevelInfo = $Character->getMasterLevelInfo($row[_CLMN_CHR_NAME_]);
if(!is_array($masterLevelInfo)) continue;
$result[$key][_CLMN_CHR_LVL_] = $row[_CLMN_CHR_LVL_]+$masterLevelInfo[_CLMN_ML_LVL_];
}
return $result;
}

private function _getOnlineRankingDataMembStatHours() {
$this->mu = Connection::Database('MuOnline');

$accounts = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_MS_MEMBID_.", "._CLMN_MS_ONLINEHRS_." FROM "._TBL_MS_." WHERE "._CLMN_MS_ONLINEHRS_." > 0 ORDER BY "._CLMN_MS_ONLINEHRS_." DESC");
if(!is_array($accounts)) return;
$Character = new Character();
foreach($accounts as $row) {
$playerIDC = $Character->AccountCharacterIDC($row[_CLMN_MS_MEMBID_]);
if(!check_value($playerIDC)) continue;
$platerData = $Character->CharacterData($playerIDC);
if(!is_array($platerData)) continue;
$result[] = array(
$playerIDC,
$row[_CLMN_MS_ONLINEHRS_]*3600,
$platerData[_CLMN_CHR_CLASS_],
$platerData[_CLMN_CHR_MAP_]
);
}
if(!is_array($result)) return;
return $result;
}

}


Offline Tauro14 #8 Posteado: September 22, 2019, 12:03:45 AM

  • -1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 287
  • Gracias recibida: 3076
  • ar
listo ya lo resolvi muchas gracias loco!!!


Offline yhoon #9 Posteado: September 22, 2019, 12:29:00 AM

  • Diseñador
  • +1 puntos por ventas
  • *
  • *
  • Rank: Puto amo
  • Posts: 920
  • Gracias recibida: 7844
  • ar
Habras remplazado algo mal, por eso no te andaba

Gracias:


Offline piscis007 #10 Posteado: July 14, 2020, 11:14:34 PM

  • Diseñador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 461
  • Gracias recibida: 1711
  • ve
Eso es facil de arreglar.

Vas a -> Includes -> Classes y abris el class.rankings.

Buscas la linea de
Code: [Select]
 private function _getResetRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) 

Y reemplazas toda esa funcion por esta:

Code: [Select]
 private function _getResetRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) {
$this->mu = Connection::Database('MuOnline');

// level only (no master level)
if(!$combineMasterLevel) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (in same table)
if($masterLevelInSameTable) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.",("._CLMN_CHR_LVL_."+"._CLMN_ML_LVL_.") as "._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (different tables)
$Character = new Character();
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
foreach($result as $key => $row) {
$masterLevelInfo = $Character->getMasterLevelInfo($row[_CLMN_CHR_NAME_]);
if(!is_array($masterLevelInfo)) continue;
$result[$key][_CLMN_CHR_LVL_] = $row[_CLMN_CHR_LVL_]+$masterLevelInfo[_CLMN_ML_LVL_];
}
return $result;
}

Si queres saber que se hizo, simplemente le agregue a las query, el parametro de orden de level.

esta query funciona para ordenar el ranking por quien llego primero al ranking de reset o por quien llego en el ultimo reset, ya que uso webengine y quien llego de primero a 400 reset termino siendo el puesto 4 y tendria que ser el numero en el ranking

“No hay que ver para creer, sino creer para ver”

Offline yhoon #11 Posteado: July 15, 2020, 09:48:53 AM

  • Diseñador
  • +1 puntos por ventas
  • *
  • *
  • Rank: Puto amo
  • Posts: 920
  • Gracias recibida: 7844
  • ar
Eso es facil de arreglar.

Vas a -> Includes -> Classes y abris el class.rankings.

Buscas la linea de
Code: [Select]
 private function _getResetRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) 

Y reemplazas toda esa funcion por esta:

Code: [Select]
 private function _getResetRankingData($combineMasterLevel=false, $masterLevelInSameTable=false) {
$this->mu = Connection::Database('MuOnline');

// level only (no master level)
if(!$combineMasterLevel) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (in same table)
if($masterLevelInSameTable) {
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.",("._CLMN_CHR_LVL_."+"._CLMN_ML_LVL_.") as "._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
return $result;
}

// level + master level (different tables)
$Character = new Character();
$result = $this->mu->query_fetch("SELECT TOP ".$this->_results." "._CLMN_CHR_NAME_.","._CLMN_CHR_CLASS_.","._CLMN_CHR_RSTS_.","._CLMN_CHR_LVL_.","._CLMN_CHR_MAP_." FROM "._TBL_CHR_." WHERE "._CLMN_CHR_NAME_." NOT IN(".$this->_rankingsExcludeChars().") AND "._CLMN_CHR_RSTS_." > 0 ORDER BY "._CLMN_CHR_RSTS_." DESC, cLevel DESC");
if(!is_array($result)) return;
foreach($result as $key => $row) {
$masterLevelInfo = $Character->getMasterLevelInfo($row[_CLMN_CHR_NAME_]);
if(!is_array($masterLevelInfo)) continue;
$result[$key][_CLMN_CHR_LVL_] = $row[_CLMN_CHR_LVL_]+$masterLevelInfo[_CLMN_ML_LVL_];
}
return $result;
}

Si queres saber que se hizo, simplemente le agregue a las query, el parametro de orden de level.

esta query funciona para ordenar el ranking por quien llego primero al ranking de reset o por quien llego en el ultimo reset, ya que uso webengine y quien llego de primero a 400 reset termino siendo el puesto 4 y tendria que ser el numero en el ranking

Y creo que no es posible tal cosa, salvo que en la DB se guarde con un numero cada vez que alguien llegue primero, segundo, tercero, etc y poder ordenarlos.

Pero como no se tanto de sql, no se si habra alguna query como que sql lea quien fue el primero en llegar a tal valor en la tabla tal...


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
3 Replies
2039 Views
Last post July 03, 2017, 01:27:24 PM
by Lude
3 Replies
1871 Views
Last post September 21, 2019, 08:37:59 PM
by Tauro14
5 Replies
2948 Views
Last post August 22, 2020, 08:31:07 PM
by DarkBot
11 Replies
2627 Views
Last post July 24, 2020, 06:29:12 PM
by muonlineuy
5 Replies
1363 Views
Last post January 23, 2020, 01:33:41 AM
by MrSoftware