To Fix Mucore 1.08 Server Statistics

Results 1 to 6 of 6
  1. #1
    Proficient Member OneManArmy is offline
    MemberRank
    Nov 2008 Join Date
    176Posts

    To Fix Mucore 1.08 Server Statistics

    who know how to fix this?



  2. #2
    ImperiaMuCMS CEO jacubb is offline
    MemberRank
    Jul 2011 Join Date
    SlovakiaLocation
    1,507Posts

    Re: To Fix Mucore 1.08 Server Statistics

    Code:
    X:\xampp\htdocs\MuCore\pages_modules\status
    Here check settings.

    Code:
    <?PHP
    if (eregi("status/servidor.php", $_SERVER['SCRIPT_NAME'])) { die ("Access Denied"); }
    require 'engine/global_config.php';
    
    $onlineoffline = "127.0.0.1";
    if ($check=@fsockopen($onlineoffline,55901,$ERROR_NO,$ERROR_STR,(float)0.5)) 
    	{ 
    	fclose($check); 
    	echo '<img src="template/'.$core['config']['template'].'/images/on.png" alt="Online">'; 
    	}
    else 
    	{ 
    	echo '<img src="template/'.$core['config']['template'].'/images/off.png" alt="Offline">'; 
    	} 
    ?>
    You need to have this images, or dont use images, just remake it for text strings ONLINE/OFFLINE.

    And the second one, I dont have idea whats the problem, I dont have this column in statistics. I have separated module for number of online players on server.

  3. #3
    Proficient Member OneManArmy is offline
    MemberRank
    Nov 2008 Join Date
    176Posts

    Re: To Fix Mucore 1.08 Server Statistics

    Quote Originally Posted by jacubb View Post
    Code:
    X:\xampp\htdocs\MuCore\pages_modules\status
    Here check settings.

    Code:
    <?PHP
    if (eregi("status/servidor.php", $_SERVER['SCRIPT_NAME'])) { die ("Access Denied"); }
    require 'engine/global_config.php';
    
    $onlineoffline = "127.0.0.1";
    if ($check=@fsockopen($onlineoffline,55901,$ERROR_NO,$ERROR_STR,(float)0.5)) 
    	{ 
    	fclose($check); 
    	echo '<img src="template/'.$core['config']['template'].'/images/on.png" alt="Online">'; 
    	}
    else 
    	{ 
    	echo '<img src="template/'.$core['config']['template'].'/images/off.png" alt="Offline">'; 
    	} 
    ?>
    You need to have this images, or dont use images, just remake it for text strings ONLINE/OFFLINE.

    And the second one, I dont have idea whats the problem, I dont have this column in statistics. I have separated module for number of online players on server.

    i always check settings like this before i try to use modules.now as you suggested i have tried one more time to see whats in statistic.php and there is no settings for IP,PORT....i am sure i have different version of it

    from what module is that sript of yours from?original mucore?

    because mine is custom from spanish forums



    EDIT: nevermind,i stole your code and absolutely with no idea what the hell i was doing i somehow managed to edit my bugged module and i am happy with the working end result :

    Last edited by OneManArmy; 13-04-12 at 09:21 PM.

  4. #4
    ImperiaMuCMS CEO jacubb is offline
    MemberRank
    Jul 2011 Join Date
    SlovakiaLocation
    1,507Posts

    Re: To Fix Mucore 1.08 Server Statistics

    Man, code what I add is not statistic.php, it's servidor.php. You need to setup ports and IPs in folder what I write.

    Here is my statistic.php code:

    PHP Code:
    <style type="text/css">
    <!--
    .red {
        color: #800000;
    }
    .grey {
        color: #000000;
    }
    .gold {
        color: #000000;
    }
    .blue {
        color: #0080FF;
    }
    .green {
        color: #00FF40;
    }
    .themain {
    background: #FFFFFF;
    -moz-border-radius: 8px 8px 8px 8px;
    font-family:Georgia, "Times New Roman", Times, serif;
    }

    .topp1 {
    font-size:13px;
    background: #381F12;
    color: darkyellow;
    font-weight: bold;
    -moz-border-radius: 8px 0 0 0;
    }

    .topp2 {
    font-size:13px;
    background: #381F12;
    color: darkyellow;
    font-weight: bold;
    }

    .topp3 {
    font-size:13px;
    background: #381F12;
    color: darkyellow;
    font-weight: bold;
    }
    .trhover {
    background: #381F12;
    color: white;
    }

    .trhover:hover{background: orange; color: black}
    .trhover:active{background: darkorange; color: white}

    -->
    </style>
    <table align="center" cellpadding="0" cellspacing="0" width="70%">

    <tbody><tr align="center">
    <td><img src="template/<?=$core['config']['template'?>/images/statistics.png"></td>

    </tr>

    </tbody></table>

    <br>
    <div align="center">
      

      <table class="themain" align="center" cellpadding="2" cellspacing="0" width="80%"><tbody><tr><td>
        <table border="0" cellpadding="3" cellspacing="1" width="100%">
          <tbody><tr>

            <td width="7%" align="center" class="topp1">#</td>
            <td class="topp2"align="center">Game statistics</td><td class="topp3" align="center">Stav</td>
          </tr>
    <?php

    if ($fp=@fsockopen('YOUR_IP','55901',$ERROR_NO,$ERROR_STR,(float)0.5)) 
        { 
        
    fclose($fp); 
        
    $serstats"<img src='template/".$core['config']['template']."/images/on.png' alt='Online'>"
        }
    else 
        { 
        
    $serstats"<img src='template/".$core['config']['template']."/images/off.png' alt='Offline'>"
        } 
        
        if (
    $fp=@fsockopen('YOUR_IP','55919',$ERROR_NO,$ERROR_STR,(float)0.5)) 
        { 
        
    fclose($fp); 
        
    $serstats1"<img src='template/".$core['config']['template']."/images/on.png' alt='Online'>"
        }
    else 
        { 
        
    $serstats1"<img src='template/".$core['config']['template']."/images/off.png' alt='Offline'>"
        } 
        
            if (
    $fp=@fsockopen('YOUR_IP','55975',$ERROR_NO,$ERROR_STR,(float)0.5)) 
        { 
        
    fclose($fp); 
        
    $serstats2"<img src='template/".$core['config']['template']."/images/on.png' alt='Online'>"
        }
    else 
        { 
        
    $serstats2"<img src='template/".$core['config']['template']."/images/off.png' alt='Offline'>"
        } 
    //Dont Touch Bitch ^^!!
    $characters mssql_query("SELECT count(*) FROM Character");
    $totalchars mssql_fetch_row($characters);
    $accounts mssql_query("SELECT count(*) FROM MEMB_INFO");
    $totalacc mssql_fetch_row($accounts);
    $guild mssql_query("SELECT count(*) FROM Guild");
    $totalguilds mssql_fetch_row($guild);
    $onlinepl mssql_query("SELECT count(*) From MEMB_STAT where Connectstat='1'");
    $online mssql_result($onlinepl00);
    $bannedchar mssql_query("SELECT count(*) FROM Character WHERE CtlCode='1'");
    $bannchar mssql_fetch_row($bannedchar);
    $bannedacc mssql_query("SELECT count(*) FROM MEMB_INFO where bloc_code ='1'");
    $gm mssql_query("SELECT * FROM Character WHERE CtlCode = 32");
    $gms mssql_num_rows($gm);
    $gmon mssql_fetch_array($gm);
    $gmonline mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$gmon[AccountID]' AND ConnectStat=1");
    $gmsonline mssql_num_rows($gmonline);
    $load substr(100 $online 15005);
    //Don Touch Again Bitch ^^!!
    echo "<tr>
    <td class='trhover' align='center'>"
    .++$count."</td>
    <td class='trhover' align='center'>Accounts:</td>        <td class='trhover' align='center'>
    $totalacc[0]</td>
    </tr>
    <tr>
    <td class='trhover' align='center'>"
    .++$count."</td>
    <td class='trhover' align='center'>Characters:</td>    <td class='trhover' align='center'>
    $totalchars[0]</td>
    </tr>
    <tr>
    <td class='trhover' align='center'>"
    .++$count."</td>
    <td class='trhover' align='center'>Guilds:</td>        <td class='trhover' align='center'>
    $totalguilds[0]</td>
    </tr>
    <tr>
    <td class='trhover' align='center'>"
    .++$count."</td>
    <td class='trhover' align='center'>Server online:</td>        <td class='trhover' align='center'>24/7</td>
    <tr>
    <td class='trhover' align='center'>"
    .++$count."</td>
    <td class='trhover' align='center'>Banned characters:</td>    <td class='trhover' align='center'>
    $bannchar[0]</td>
    </tr>
    <tr>
    <td class='trhover' align='center'>"
    .++$count."</td>
    <td class='trhover' align='center'>Online players:</td>    <td class='trhover' align='center'>
    $online /<span style='color:#F00;'>150</span></td>
    </tr>

    "
    ;
    ?>



    </table></table><br>
    <div align="center">
      

      <table class="themain" align="center" cellpadding="2" cellspacing="0" width="80%"><tbody><tr><td>
        <table border="0" cellpadding="3" cellspacing="1" width="100%">
          <tbody><tr>
        <td width="7%" align="center" class="topp1">#</td>
        <td width="23%" align="center" class="topp1">Server</td>
        <td width="10%" align="center" class="topp2">Exp rate</td>
        <td width="12%" align="center" class="topp2">Drop rate</td>
        <td width="32%" align="center" class="topp2">PVP/NON-PVP</td>
        <td width="17%" align="center" class="topp2">Status</td>
        

          </tr>

          <tr>
        <td class='trhover' align='center'>1</td>
        <td class="trhover" align="center">Server-1<?=$core['config']['servername1'];?></td>
        <td class="trhover" align="center">149x<?=$core['config']['exp1'];?></td>
        <td class="trhover" align="center">30%<?=$core['config']['drop1'];?></td>
        <td class="trhover" align="center">PvP<?=$core['config']['typo1'];?></td>
        <td class="trhover" align="center"><? include("status/servidor.php"); ?></td>
        
          </tr>
          <tr>
        <td class='trhover' align='center'>2</td>
        <td class="trhover" align="center">Server-2<?=$core['config']['servername2'];?></td>
        <td class="trhover" align="center">149x<?=$core['config']['exp2'];?></td>
        <td class="trhover" align="center">30%<?=$core['config']['drop2'];?></td>
        <td class="trhover" align="center">PvP<?=$core['config']['typo2'];?></td>
        <td class="trhover" align="center"><? include("status/servidornopvp.php"); ?></td>
        
        </tr>                                                                                                         
          <tr>
         <td class='trhover' align='center'>3</td>
        <td class="trhover" align="center">---<?=$core['config']['servername3'];?></td>
        <td class="trhover" align="center">---<?=$core['config']['exp3'];?></td>
        <td class="trhover" align="center">---<?=$core['config']['drop3'];?></td>
        <td class="trhover" align="center">---<?=$core['config']['typo3'];?></td>
        <td class="trhover" align="center"><? include("status/servidorvip.php"); ?></td>
        
          </tr>
          <tr>
         <td class='trhover' align='center'>4</td>
        <td class="trhover" align="center">Server-Siege<?=$core['config']['servername4'];?></td>
        <td class="trhover" align="center">149x<?=$core['config']['exp4'];?></td>
        <td class="trhover" align="center">30%<?=$core['config']['drop4'];?></td>
        <td class="trhover" align="center">PvP<?=$core['config']['typo4'];?></td>
        <td class="trhover" align="center"><? include("status/statusgscs.php"); ?></td>
        
          </tr>

          </tbody></table>
          

    </table><br>


        
    <table align="center" cellpadding="0" cellspacing="0" width="70%">

    <tr align="center">
    <td><br><span style="font-size: 24px; color: orange; font-weight: bold; font-family: 'Lucida Console;'"><strong>Character statistics</strong></span></td>
    </tr>


    </table><br>





    <?PHP
    //Magos
    $totalsms=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=0"));
    $totalsms1=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=1"));
    $totalsms2=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=3"));
    //Guerreros
    $totalbks=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=16"));
    $totalbks1=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=17"));
    $totalbks2=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=19"));
    //Elfas
    $totalelf=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=32"));
    $totalelf1=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=33"));
    $totalelf2=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=35"));
    //Invocadoras
    $totalsum=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=80"));
    $totalsum1=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=81"));
    $totalsum2=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=83"));
    //Lores
    $totaldl=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=64"));
    $totaldl1=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=66"));
    //Gladiadors
    $totalmg=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=48"));
    $totalmg1=mssql_fetch_row(mssql_query("select count(*) from character where ctlcode<8 and class=50"));
    ?>

    <div align="center">
      

      <table class="themain" align="center" cellpadding="2" cellspacing="0" width="80%"><tbody><tr><td>
        <table border="0" cellpadding="3" cellspacing="1" width="100%">
          <tbody><tr>
        <td width="7%" align="center" class="topp1">#</td>
        <td width="33%" align="center" class="topp1">Evo 1</td>
        <td width="33%" align="center" class="topp2">Evo 2</td>
        <td width="33%" align="center" class="topp2">Evo 3</td>
       
        

          </tr>

          <tr>
        <td class='trhover' align='center'>1</td>
        <td class="trhover" align="center">Dark Wizard = <?=$totalsms[0]?></td>
        <td class="trhover" align="center">Soul Master = <?=$totalsms1[0]?></td>
        <td class="trhover" align="center">Grand Master = <?=$totalsms2[0]?></td>
        
        
          </tr>
          <tr>
        <td class='trhover' align='center'>2</td>
        <td class="trhover" align="center">Dark Knight = <?=$totalbks[0]?></td>
        <td class="trhover" align="center">Blade Knight = <?=$totalbks1[0]?></td>
        <td class="trhover" align="center">Blade Master = <?=$totalbks2[0]?></td>
        
        
          </tr>
          <tr>
         <td class='trhover' align='center'>3</td>
        <td class="trhover" align="center">Fairy Elf = <?=$totalelf[0]?></td>
        <td class="trhover" align="center">Muse Elf = <?=$totalelf1[0]?></td>
        <td class="trhover" align="center">High Elf = <?=$totalelf2[0]?></td>
        
        
          </tr>
          <tr>
         <td class='trhover' align='center'>4</td>
        <td class="trhover" align="center">Summoner = <?=$totalsum[0]?></td>
        <td class="trhover" align="center">Bloody Summoner = <?=$totalsum1[0]?></td>
        <td class="trhover" align="center">Dimension Master = <?=$totalsum2[0]?></td>
        
        
         </tr>

          </tbody></table>
          

    </table>
    <br>
      <div align="center">
      

      <table class="themain" align="center" cellpadding="2" cellspacing="0" width="80%"><tbody><tr><td>
        <table border="0" cellpadding="3" cellspacing="1" width="100%">
          <tbody><tr>
        
        <td width="7%" align="center" class="topp1"></td>
        <td width="47%" align="center" class="topp1">Evo 1</td>
        <td width="47%" align="center" class="topp2">Evo 2</td>
         
          <tr>
         <td class='trhover' align='center'>5</td>
        <td class="trhover" align="center">Dark Lord = <?=$totaldl[0]?></td>
        <td class="trhover" align="center">Lord Emperor = <?=$totaldl1[0]?></td>
          </tr>
         <tr>
         <td class='trhover' align='center'>6</td>
        <td class="trhover" align="center">Magic Gladiator = <?=$totalmg[0]?></td>
        <td class="trhover" align="center">Duel Master = <?=$totalmg1[0]?></td>
         </tr>
         
         
          </tbody></table>





          </td></tr></tbody></table>
          
          

    </div>

    <br><br>



    </body>

    </html>

  5. #5
    Proficient Member OneManArmy is offline
    MemberRank
    Nov 2008 Join Date
    176Posts

    Re: To Fix Mucore 1.08 Server Statistics

    Quote Originally Posted by jacubb View Post
    Man, code what I add is not statistic.php, it's servidor.php. You need to setup ports and IPs in folder what I write.

    there is no Servidor.php or Server.php anywhere in my mucore files, but i don't care.everything works fine now with this mixed module.


    edit: tested your script and it is nice, much more advanced with more server information, but i have noticed a little big longer loading time and it is because it gets server information from many different sql tables and i am very paranoid about
    modules like this.i think they are exploitable
    Last edited by OneManArmy; 13-04-12 at 11:47 PM.

  6. #6
    ImperiaMuCMS CEO jacubb is offline
    MemberRank
    Jul 2011 Join Date
    SlovakiaLocation
    1,507Posts

    Re: To Fix Mucore 1.08 Server Statistics

    Yes, its slower then original, I dont know how to improve speed. But if you dont need some columns or rows, you can easily delete it, then it will be faster.



Advertisement