Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Eudemons Online > EO PServer Hosting > EO PServer Guides & Releases
You last visited: Today at 00:22

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[GUIDE] Pet ranking - show stars over 1000 (not 0)

Discussion on [GUIDE] Pet ranking - show stars over 1000 (not 0) within the EO PServer Guides & Releases forum part of the EO PServer Hosting category.

Reply
 
Old   #1
 
SoulNecturn's Avatar
 
elite*gold: 100
Join Date: Oct 2008
Posts: 636
Received Thanks: 1,208
[GUIDE] Pet ranking - show stars over 1000 (not 0)

Ok ok today I received request to help in fixing most popular on this forum pet rankings...

problem that is/was appearing under this page rankings was that all pets that went over 1000* was shown under statistic page as a 0*



this is original content of pets.php file


Code:
<?php
    include('definitions.php');


?>
<h2><span></span></h2>
<br /><br /> 
<center><div align="center">
  <form action='index.php?id=pets' method=POST>
      <select name="type" onChange="this.form.submit()">
        <option value="top10">Please choose a catagory</option>
        <?php
            $pKeys = array_keys($eudemon);

            foreach ($pKeys as $pId) {
                $pSelected = "";
                if ($pId == $_POST['type']) { $pSelected = "selected"; };
                echo "<option value='" . $pId . "'" . $pSelected . ">" . $eudemon[$pId] . "</option>";
            }
            unset($pId);
        ?>
      </select>
  
    </form>
  </div>




  <br><p>
  <head>
  <table width="210" height="137" border="0">
    <tr>
      <td><strong>Rank</strong></td>
	  <td><strong>Owner</strong></td>
	  <td><strong>Name</strong></td>
	  <td><strong>Type</strong></td>
	  <td><strong>Level</strong></td>
	  <td><strong>Stars</strong></td>
      <td><strong>Reborns</strong></td>
    </tr>
    <?php


		$pId = $_POST['type'];
        $pId = $pId[0] . $pId[1];
        switch($pId) {
            case "top10":
                $sQuery = mysql_query("SELECT * FROM cq_eudemon WHERE `ori_owner_name` NOT LIKE '%[PM]%' ORDER BY star_lev DESC LIMIT 50");
            default:
                $sQuery = mysql_query("SELECT * FROM cq_eudemon WHERE (`ori_owner_name` NOT LIKE '%[PM]%' AND `item_type` LIKE '1071$pId%' OR `item_type` LIKE '1079$pId%' OR `item_type` LIKE '1081$pId%')  ORDER BY star_lev DESC LIMIT 50");
        }



        $rank = 1;
        while ($pet = mysql_fetch_assoc($sQuery)) {
            $star_lev = $pet['star_lev'];
            $stars = "";

            $item_type = $pet['item_type'];
            $type = "";


            [COLOR="Red"]if (strlen($star_lev) == 4) {
                $stars = $star_lev[0] . $star_lev[1];
            } else if (strlen($star_lev) == 5) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2];
            } else {
                $stars = 0;
            }[/COLOR]

            $type = $eudemon[$item_type[strlen($item_type)-3] . $item_type[strlen($item_type)-2] . "0"];
            $sql = "SELECT * FROM cq_user WHERE id='".$pet['player_id']."'";
					$query = mysql_query($sql) or die(mysql_error());
					$row1 = mysql_fetch_object($query);
					$curowner = htmlspecialchars($row1->name);

            echo "<tr>";
            echo "<td>" . $rank . "</td>";
            echo "<td>" . $curowner . "</td>";
            echo "<td>" . $pet['name'] . "</td>";
            echo "<td>" . $type . "</td>";
            echo "<td>" . $pet['level'] . "</td>";
            echo "<td>" . $stars . "</td>";
            echo "<td>" . $pet['reborn_times'] . "</td>";
            echo "</tr>";
            $rank++;
        }
    ?>
  </table>
this what I pointed is the place where we will have to edit to make possible more ...

ok from:

Code:
            [COLOR="Red"]if (strlen($star_lev) == 4) {
                $stars = $star_lev[0] . $star_lev[1];
            } else if (strlen($star_lev) == 5) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2];
            } else {
                $stars = 0;
            }[/COLOR]
we will change this to:

Code:
[COLOR="Red"]if (strlen($star_lev) == 4) {
                $stars = $star_lev[0] . $star_lev[1];
            } else if (strlen($star_lev) == 5) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2];
            } else if (strlen($star_lev) == 6) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2] . $star_lev[3];
            }		else {
                $stars = 0;
            }[/COLOR]
and now we will be able to see properly our stats on web

so proper content of pets.php - basing on original will be:

Code:
<?php
    include('definitions.php');


?>
<h2><span></span></h2>
<br /><br /> 
<center><div align="center">
  <form action='index.php?id=pets' method=POST>
      <select name="type" onChange="this.form.submit()">
        <option value="top10">Please choose a catagory</option>
        <?php
            $pKeys = array_keys($eudemon);

            foreach ($pKeys as $pId) {
                $pSelected = "";
                if ($pId == $_POST['type']) { $pSelected = "selected"; };
                echo "<option value='" . $pId . "'" . $pSelected . ">" . $eudemon[$pId] . "</option>";
            }
            unset($pId);
        ?>
      </select>
  
    </form>
  </div>




  <br><p>
  <head>
  <table width="210" height="137" border="0">
    <tr>
      <td><strong>Rank</strong></td>
	  <td><strong>Owner</strong></td>
	  <td><strong>Name</strong></td>
	  <td><strong>Type</strong></td>
	  <td><strong>Level</strong></td>
	  <td><strong>Stars</strong></td>
      <td><strong>Reborns</strong></td>
    </tr>
    <?php


		$pId = $_POST['type'];
        $pId = $pId[0] . $pId[1];
        switch($pId) {
            case "top10":
                $sQuery = mysql_query("SELECT * FROM cq_eudemon WHERE `ori_owner_name` NOT LIKE '%[PM]%' ORDER BY star_lev DESC LIMIT 50");
            default:
                $sQuery = mysql_query("SELECT * FROM cq_eudemon WHERE (`ori_owner_name` NOT LIKE '%[PM]%' AND `item_type` LIKE '1071$pId%' OR `item_type` LIKE '1079$pId%' OR `item_type` LIKE '1081$pId%')  ORDER BY star_lev DESC LIMIT 50");
        }



        $rank = 1;
        while ($pet = mysql_fetch_assoc($sQuery)) {
            $star_lev = $pet['star_lev'];
            $stars = "";

            $item_type = $pet['item_type'];
            $type = "";

if (strlen($star_lev) == 4) {
                $stars = $star_lev[0] . $star_lev[1];
            } else if (strlen($star_lev) == 5) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2];
            } else if (strlen($star_lev) == 6) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2] . $star_lev[3];
            }		else {
                $stars = 0;
            }

            $type = $eudemon[$item_type[strlen($item_type)-3] . $item_type[strlen($item_type)-2] . "0"];
            $sql = "SELECT * FROM cq_user WHERE id='".$pet['player_id']."'";
					$query = mysql_query($sql) or die(mysql_error());
					$row1 = mysql_fetch_object($query);
					$curowner = htmlspecialchars($row1->name);

            echo "<tr>";
            echo "<td>" . $rank . "</td>";
            echo "<td>" . $curowner . "</td>";
            echo "<td>" . $pet['name'] . "</td>";
            echo "<td>" . $type . "</td>";
            echo "<td>" . $pet['level'] . "</td>";
            echo "<td>" . $stars . "</td>";
            echo "<td>" . $pet['reborn_times'] . "</td>";
            echo "</tr>";
            $rank++;
        }
    ?>
  </table>

and of course this file can/should be little more cleared .... this guide is about this specific problem and this solution will help -- as I spoted half servers that are currently online ... LOL :/ hehe

Regards
SoulNecturn is offline  
Thanks
17 Users
Old 10/29/2009, 10:33   #2
 
elite*gold: 0
Join Date: Sep 2009
Posts: 22
Received Thanks: 0
thanks soulermen you so great maybe you can make guide how to add universal 30* in shopping mall and 40new pets in shopping mall too..
thanks
purple21 is offline  
Old 10/29/2009, 12:38   #3
 
funhacker's Avatar
 
elite*gold: 20
Join Date: Sep 2007
Posts: 1,767
Received Thanks: 1,741
Quote:
Originally Posted by purple21 View Post
thanks soulermen you so great maybe you can make guide how to add universal 30* in shopping mall and 40new pets in shopping mall too..
thanks
Shop.dat Editor?.....
funhacker is offline  
Old 02/16/2010, 13:17   #4
 
elite*gold: 0
Join Date: Sep 2009
Posts: 383
Received Thanks: 80
wheres the pets.php file ?
Crazy123456 is offline  
Old 02/16/2010, 13:29   #5
 
elite*gold: 0
Join Date: Jan 2009
Posts: 51
Received Thanks: 1
Quote:
Originally Posted by Soulerman View Post

Code:
<?php
    include('definitions.php');


?>
<h2><span></span></h2>
<br /><br /> 
<center><div align="center">
  <form action='index.php?id=pets' method=POST>
      <select name="type" onChange="this.form.submit()">
        <option value="top10">Please choose a catagory</option>
        <?php
            $pKeys = array_keys($eudemon);

            foreach ($pKeys as $pId) {
                $pSelected = "";
                if ($pId == $_POST['type']) { $pSelected = "selected"; };
                echo "<option value='" . $pId . "'" . $pSelected . ">" . $eudemon[$pId] . "</option>";
            }
            unset($pId);
        ?>
      </select>
  
    </form>
  </div>




  <br><p>
  <head>
  <table width="210" height="137" border="0">
    <tr>
      <td><strong>Rank</strong></td>
	  <td><strong>Owner</strong></td>
	  <td><strong>Name</strong></td>
	  <td><strong>Type</strong></td>
	  <td><strong>Level</strong></td>
	  <td><strong>Stars</strong></td>
      <td><strong>Reborns</strong></td>
    </tr>
    <?php


		$pId = $_POST['type'];
        $pId = $pId[0] . $pId[1];
        switch($pId) {
            case "top10":
                $sQuery = mysql_query("SELECT * FROM cq_eudemon WHERE `ori_owner_name` NOT LIKE '%[PM]%' ORDER BY star_lev DESC LIMIT 50");
            default:
                $sQuery = mysql_query("SELECT * FROM cq_eudemon WHERE (`ori_owner_name` NOT LIKE '%[PM]%' AND `item_type` LIKE '1071$pId%' OR `item_type` LIKE '1079$pId%' OR `item_type` LIKE '1081$pId%')  ORDER BY star_lev DESC LIMIT 50");
        }



        $rank = 1;
        while ($pet = mysql_fetch_assoc($sQuery)) {
            $star_lev = $pet['star_lev'];
            $stars = "";

            $item_type = $pet['item_type'];
            $type = "";

if (strlen($star_lev) == 4) {
                $stars = $star_lev[0] . $star_lev[1];
            } else if (strlen($star_lev) == 5) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2];
            } else if (strlen($star_lev) == 6) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2] . $star_lev[3];
            }		else {
                $stars = 0;
            }

            $type = $eudemon[$item_type[strlen($item_type)-3] . $item_type[strlen($item_type)-2] . "0"];
            $sql = "SELECT * FROM cq_user WHERE id='".$pet['player_id']."'";
					$query = mysql_query($sql) or die(mysql_error());
					$row1 = mysql_fetch_object($query);
					$curowner = htmlspecialchars($row1->name);

            echo "<tr>";
            echo "<td>" . $rank . "</td>";
            echo "<td>" . $curowner . "</td>";
            echo "<td>" . $pet['name'] . "</td>";
            echo "<td>" . $type . "</td>";
            echo "<td>" . $pet['level'] . "</td>";
            echo "<td>" . $stars . "</td>";
            echo "<td>" . $pet['reborn_times'] . "</td>";
            echo "</tr>";
            $rank++;
        }
    ?>
  </table>

Regards
I Put that in my pet. PHP but still not shown over 10k * so what is the proplem here ?
medoimedoi123 is offline  
Old 02/16/2010, 13:52   #6
 
SoulNecturn's Avatar
 
elite*gold: 100
Join Date: Oct 2008
Posts: 636
Received Thanks: 1,208


1) pets.php is where you have your web and only if you use most popular on this forum scripts

2) medoimedoi123 this is an example of fix for seeing pets till 9999* ...

now IF you wish to see till 99999* then just you need to provide one more line to this

example:


original

Code:
            if (strlen($star_lev) == 4) {
                $stars = $star_lev[0] . $star_lev[1];
            } else if (strlen($star_lev) == 5) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2];
            } else {
                $stars = 0;
            }

tweaked to max 9999*

Code:
if (strlen($star_lev) == 4) {
                $stars = $star_lev[0] . $star_lev[1];
            } else if (strlen($star_lev) == 5) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2];
            } else if (strlen($star_lev) == 6) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2] . $star_lev[3];
            }		else {
                $stars = 0;
            }

and now example of tweak to 99999* max


Code:
if (strlen($star_lev) == 4) {
                $stars = $star_lev[0] . $star_lev[1];
            } else if (strlen($star_lev) == 5) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2];
            } else if (strlen($star_lev) == 6) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2] . $star_lev[3];
            }		else if (strlen($star_lev) == 7) {
                $stars = $star_lev[0] . $star_lev[1] . $star_lev[2] . $star_lev[3] . $star_lev[4];
            }		else {
                $stars = 0;
            }

I hope you and all see the schema ??

Regards
SoulNecturn is offline  
Thanks
3 Users
Old 02/16/2010, 14:28   #7
 
elite*gold: 0
Join Date: Jan 2009
Posts: 51
Received Thanks: 1
woot get it! Thanks ++
medoimedoi123 is offline  
Old 02/17/2010, 12:48   #8
 
elite*gold: 0
Join Date: Sep 2009
Posts: 383
Received Thanks: 80
oh well this guide isint for me then
Crazy123456 is offline  
Old 01/18/2011, 22:42   #9
 
elite*gold: 0
Join Date: Oct 2008
Posts: 726
Received Thanks: 330
thank you soul
stedabest321 is offline  
Old 01/19/2011, 01:28   #10
 
elite*gold: 0
Join Date: Mar 2010
Posts: 399
Received Thanks: 514
Quote:
Originally Posted by stedabest321 View Post
thank you soul
dont just post just want to say "thank you soulerman" .enough with thanks button .OP would be appreciated it .
AziQ is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[GUIDE] How to fix ur Msg server to make it so pets above get 110 stars get rank
06/20/2010 - EO PServer Guides & Releases - 12 Replies
Ok Hello everyone this is my first guide so please dont hate me if its a little hard to understand. Programs you need 1. VMUnpacker - credit goes to forcer i got it off his guide. 2. Ollydbg Ok first you will need to unpack your Msg if you downloaded VMUnpacker it easy extract the file. Then a folder named VMUnpacker will appear open it then you will see the program named VMUnpacker. See easy ok now you will click on that. A window will open click on the ... button it will have three dots...
Big Booty Bitches!!! Stars von morgen`?/Stars of Tomorrow?
05/19/2010 - Music - 2 Replies
Könnten das Stars von Morgen Sein Could This two guys are Stars of tomorrow (sorry for bad english) YouTube - Big Booty Bitches (the Official Video) @ALostPeople Hier das richtige Lied: Here the real song: Big Booty Bitches | A Lost People
i need character pvp ranking/emblem/insignia guide
06/02/2009 - Grand Chase Philippines - 3 Replies
can someone post here the individual character ranking/emblem/insignia in pvp. i mean the total wins required to achieve a certain ranking/emblem/insignia. i have now my elesis w/ bronze shield and i achieve it w/ 331 wins for that character. i want to know how many wins before i get silver shield, gold... tnx in advance.
[GUIDE] 1 to 5 star ranking
05/12/2009 - Soldier Front - 7 Replies
these are the exp needed to achieve these ranks... http://i110.photobucket.com/albums/n107/mrdejavu2 03/starranking.jpg credits to:
[GUIDE] 1 to 5 star ranking
05/11/2009 - Soldier Front Philippines - 5 Replies
these are the exp needed to achieve these ranks... http://i110.photobucket.com/albums/n107/mrdejavu2 03/starranking.jpg credits to: ak0nalangbfm0



All times are GMT +1. The time now is 00:22.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.