1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Modification [IGC] Ranking Queries

Discussion in 'Customizations & Modules' started by Netzo, Feb 23, 2014.

  1. Netzo

    Netzo Customer Customer

    Hello,

    Due to request and WebEngine incompatibility with IGC server files, I have decided to release IGC Ranking Queries.

    Live example: click here

    Files modified:
    • \webroot\includes\classes\class.rankings.php
    • \webroot\includes\webengine.php
    • \webroot\includes\custom.php

    Level rankings:
    Level + Master Level (for ex. 400 Level and 159 Master Level will be shown in one number as 559)
    PHP:
                case 'level':
                    
    $dbDATA $dB->query_fetch("SELECT TOP ".mconfig('rankings_results')." Name,Class,(cLevel+mLevel) as Level FROM Character ORDER BY Level DESC");
                    
    $cacheDATA BuildCacheData($dbDATA);
                    
    UpdateCache('rankings_level.cache',$cacheDATA);
                break;
    Killer rankings:
    PHP:
                case 'killers':
                    
    $dbDATA $this->GetResults(mconfig('rankings_results'),'PkCount','DESC','Name,Class,PkCount');
                    
    $cacheDATA BuildCacheData($dbDATA);
                    
    UpdateCache('rankings_pk.cache',$cacheDATA);
                break;
    Guild rankings:
    Needs tweaking
    PHP:
          case 'guilds':
            
    $dbDATA $dB->query_fetch("SELECT TOP ".mconfig('rankings_results')." G_Name, G_Master, G_Score, G_Mark FROM Guild ORDER BY G_Count DESC");
            if(
    is_array($dbDATA)) {
              foreach(
    $dbDATA as $key => $row) {
                
    $dbDATA[$key]['G_Mark'] = bin2hex($row['G_Mark']);
              }
              
    $cacheDATA BuildCacheData($dbDATA);
              
    UpdateCache('rankings_guilds.cache',$cacheDATA);
            }
          break;
    Online rankings:
    PHP:
                case 'online':
                    
    $dbDATA $dB->query_fetch("SELECT TOP ".mconfig('rankings_results')." tb2."._CLMN_GAMEIDC_.", sum(tb1."._CLMN_LOGEX_OD_.") AS TotalOnlineDuration, tb3."._CLMN_CHR_CLASS_." 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_." GROUP BY tb1."._CLMN_LOGEX_ACCID_.", tb2."._CLMN_GAMEIDC_.", tb3."._CLMN_CHR_CLASS_." ORDER BY TotalOnlineDuration DESC");          
                    
    $cacheDATA BuildCacheData($dbDATA);
                    
    UpdateCache('rankings_online.cache',$cacheDATA);
                break;
    Gens ranking:
    PHP:
                case 'gens':
                    
    $dbDATA $dB->query_fetch("SELECT TOP ".mconfig('rankings_results')." IGC_Gens.Name, IGC_Gens.Points, IGC_Gens.Influence, IGC_Gens.Rank, Character.Class FROM IGC_Gens INNER JOIN Character ON IGC_Gens.Name = Character.Name ORDER BY IGC_Gens.Points DESC");
                    
    $cacheDATA BuildCacheData($dbDATA);
                    
    UpdateCache('rankings_gens.cache',$cacheDATA);
                break;
    And you might want to replace some lines in webengine.php in order to adapt online rankings querie:
    PHP:
    define('_TBL_LOGEX_''MEMB_STAT');
        
    define('_CLMN_LOGEX_ACCID_''memb___id');
        
    define('_CLMN_LOGEX_IP_''IP');
        
    define('_CLMN_LOGEX_TIN_''ConnectTM');
        
    define('_CLMN_LOGEX_TOUT_''DisConnectTM');
        
    define('_CLMN_LOGEX_OD_''MinutesOnline');
        
    define('_CLMN_LOGEX_SRV_''ServerName');
    Replace your custom.php file to fix the character classes:
    PHP:
    <?php
    /* --------------------------------------------------------------------

      WebEngine
      http://lautaroangelico.com/webengine/

      @version    1.0.0
      @author    Lautaro Angélico <http://lautaroangelico.com/>
                <angelico.lautaro@gmail.com>

      Copyright (C) 2012 Lautaro Angélico All rights reserved.

      --------------------------------------------------------------------- */

    /*
    * custom: character_class
    */
    $custom['character_class'] = array(
      
    0=> array('Dark Wizard','DW','dw.jpg'),
      
    1=> array('Soul Master','SM','dw.jpg'),
      
    2=> array('Grand Master','GM','dw.jpg'),
      
    16=> array('Dark Knight','DK','dk.jpg'),
      
    17=> array('Blade Knight','BK','dk.jpg'),
      
    18=> array('Blade Master','BM','dk.jpg'),
      
    32=> array('Elf','ELF','elf.jpg'),
      
    33=> array('Muse Elf','ME','elf.jpg'),
      
    34=> array('High Elf','HE','elf.jpg'),
      
    48=> array('Magic Gladiator','MG','mg.jpg'),
      
    50=> array('Duel Master','DM','mg.jpg'),
      
    64=> array('Dark Lord','DL','dl.jpg'),
      
    66=> array('Lord Emperor','LE','dl.jpg'),
      
    80=> array('Summoner','SUM','sum.jpg'),
      
    81=> array('Bloody Summoner','BS','sum.jpg'),
      
    82=> array('Dimension Master','DM','sum.jpg'),
      
    96=> array('Rage Fighter','RF','rf.jpg'),
      
    98=> array('Fist Master','FM','rf.jpg')
    );

    ?>
    Enjoy!

    Big thanks to Lautaro for his help with the queries!
     
    Last edited: Mar 16, 2014
    Lautaro and A$$kicker like this.
  2. A$$kicker

    A$$kicker Customer Customer

    still not work, its doesnt show any thing at all even already setup cron system.
     
  3. Netzo

    Netzo Customer Customer

    Check time of the latest ranking update :)
     
  4. A$$kicker

    A$$kicker Customer Customer

    Last Updated @ 01/01/1970 - 01:00 AM
     
  5. Netzo

    Netzo Customer Customer

    Guess your answer answers your own question, it means that the queries were never executed. Make sure you set up the cron jobs. Lautaro has provided a link on how to use Windows to run a cron job.
     
  6. A$$kicker

    A$$kicker Customer Customer

    Hi
    Netzo can you upload /show custom.php file please
    every thing when i try to edit those class code , the page always goes blank , and need to replace original to get page back.
     
  7. Netzo

    Netzo Customer Customer

    Hey, I don't have such file as custom.php :?
     
  8. Lautaro

    Lautaro Administrator Developer

    It should be in your includes folder
     
  9. Netzo

    Netzo Customer Customer

    Thanks Lautaro, I've completely forgotten about this file :)
    PHP:
    <?php
    /* --------------------------------------------------------------------

      WebEngine
      http://lautaroangelico.com/webengine/

      @version    1.0.0
      @author    Lautaro Angélico <http://lautaroangelico.com/>
                <angelico.lautaro@gmail.com>

      Copyright (C) 2012 Lautaro Angélico All rights reserved.

      --------------------------------------------------------------------- */

    /*
    * custom: character_class
    */
    $custom['character_class'] = array(
      
    0=> array('Dark Wizard','DW','dw.jpg'),
      
    1=> array('Soul Master','SM','dw.jpg'),
      
    2=> array('Grand Master','GM','dw.jpg'),
      
    16=> array('Dark Knight','DK','dk.jpg'),
      
    17=> array('Blade Knight','BK','dk.jpg'),
      
    18=> array('Blade Master','BM','dk.jpg'),
      
    32=> array('Elf','ELF','elf.jpg'),
      
    33=> array('Muse Elf','ME','elf.jpg'),
      
    34=> array('High Elf','HE','elf.jpg'),
      
    48=> array('Magic Gladiator','MG','mg.jpg'),
      
    50=> array('Duel Master','DM','mg.jpg'),
      
    64=> array('Dark Lord','DL','dl.jpg'),
      
    66=> array('Lord Emperor','LE','dl.jpg'),
      
    80=> array('Summoner','SUM','sum.jpg'),
      
    81=> array('Bloody Summoner','BS','sum.jpg'),
      
    82=> array('Dimension Master','DM','sum.jpg'),
      
    96=> array('Rage Fighter','RF','rf.jpg'),
      
    98=> array('Fist Master','FM','rf.jpg')
    );

    ?>
     

Share This Page