this code is just an edited version of the $gender_lookup code posted by kittyas.
and whats it does is to give a specific name to each level, so instead of displaying the numbers it will display a name:
PHP Code:
$level_lookup = $mysidia->db->select("owned_adoptables", array("currentlevel"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
if ($level_lookup == "10") {$levels = "Ancient"; }
if ($level_lookup == "9") {$levels = "Adult";}
if ($level_lookup == "8") {$levels = "Subadult";}
if ($level_lookup == "7") {$levels = "Juvenile";}
if ($level_lookup == "6") {$levels = "Hatchling";}
if ($level_lookup == "5") {$levels = "New Born";}
if ($level_lookup <= "4") {$levels = "Egg";}
my site uses a max of 10 levels for the adopts, just need to remove those that you dont need and change the number to match the levels in your site.
to display the code in your adopt profile you just need to replace {$adopt->getCurrentLevel()} with {$levels}
but if you whant to "properly" display the needed levelup points, this is mostly to "hide" the other levels... the hatched adopt need 40 points divided in 4 levels so to hide the rest of the levels and make them look like is just one level you just need to add this:
PHP Code:
$number = 40 - $adopt->getTotalClicks();
$nextLev = "(Next Stage in ".$number." more Exp)";
replace the number with the needed clicks to make the adopt hatch.
now probably most of you are using also the {$toNext} posted here to display the needed clicks for the next stage, so now we need to add this code after the $nextLev:
PHP Code:
if($adopt->getcurrentlevel() <= "4"){$stages = "{$levels}{$nextLev}";} else {$stages = "{$levels}{$toNext}";}
and to display the info of the adopt just replace {$adopt->getCurrentLevel()} {$toNext} with {$levels}
if you are using KatFennec Public Profile Mod the needed points are displayed at top of the feed button so i did a few changes to the code and this is the edited code:
PHP Code:
public function publicprofile(){
$mysidia = Registry::get("mysidia");
$adopt = $this->getField("adopt");
$adoptcurrentlevel = $adopt->currentlevel;
$document = $this->document;
$document->setTitle("Viewing {$adopt->getName()}'s profile");
if($adopt->hasNextLevel()){
$nextLevel = $adopt->getNextLevel();
#$requiredClicks = $nextLevel->getRequiredClicks();
$thisisauniqueid = new OwnedAdoptable($adopt->getAdoptID());
$gender_lookup = $mysidia->db->select("owned_adoptables", array("gender"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
if ($gender_lookup == "m") { $gender = "Male"; $pronoun = "him"; } else { $gender = "Female"; $pronoun = "her"; }
$alternates_lookup = $mysidia->db->select("owned_adoptables", array("usealternates"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
$level_lookup = $mysidia->db->select("owned_adoptables", array("currentlevel"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
if ($level_lookup == "10") {$levels = "Ancient"; }
if ($level_lookup == "9") {$levels = "Adult";}
if ($level_lookup == "8") {$levels = "Subadult";}
if ($level_lookup == "7") {$levels = "Juvenile";}
if ($level_lookup == "6") {$levels = "Hatchling";}
if ($level_lookup == "5") {$levels = "New Born";}
if ($level_lookup <= "4") {$levels = "egg";}
if ($mysidia->user->username == $adopt->getOwner()){ $manage_btn = "<a class='btn btn-sm btn-info' href='../../myadopts/manage/{$adopt->getAdoptID()}'><i class='fa fa-gear'></i> Manage</a>"; } else { $manage_btn = ""; }
if($adopt->hasNextLevel()){
$level = $adopt->getNextLevel();
$levelupClicks = $adopt->getLevelupClicks();
$toNext = "(Next Stage in ".$levelupClicks." more EXP)"; } else { $toNext = "(MAX)"; }
$number = 40 - $adopt->getTotalClicks();
$nextLev = "(Next Stage in ".$number." more EXP)";
if($adopt->getcurrentlevel() <= "4"){$stages = "{$levels}{$nextLev}";} else {$stages = "{$levels}{$toNext}";}
$document->add(new Comment("{$stages}");
if($adopt->getTradeStatus() == "fortrade") { $tradestatus = "<b>For Trade</b>"; }
else { $tradestatus = "<b>Not For Trade</b>"; }
// If you've already seen the pet today:
if ($adopt->hasVoter($mysidia->user, $date)){
$document->add(new Comment("<a class='btn btn-sm btn-info disabled' href='../../levelup/click/{$adopt->getAdoptID()}'><i class='fa fa-paw'></i> Already Fed</a>"));
}
// If you haven't seen the pet today:
else {
$document->add(new Comment("<a class='btn btn-sm btn-info' href='../../levelup/click/{$adopt->getAdoptID()}'><i class='fa fa-paw'></i> Feed</a>"));
};
}
$document->add(new Comment("{$manage_btn}
<br> <br>
<img src='{$thisisauniqueid->getImage()}'><br>"));
$adoptabletype = $mysidia->db->select("adoptables", array(), "type='{$adopt->getType()}'")->fetchObject();
$diet = $adoptabletype->Diet;
$level = $adopt->getCurrentLevel();
$document->add(new Comment("<ul>
<li>Lives With: <a href='/profile/view/{$adopt->getOwner()}'>{$adopt->getOwner()}</a></li>
<li>Species: {$adopt->getType()}</li>
<li>Gender: {$gender}</li>
<li>LVL: {$levels}</li>
<li>Total EXP: {$adopt->getTotalClicks()}</li>
<li>Trade Status: {$tradestatus}</li>
"));
}
Hope this is useful to some one ^^ the $levels don't need to be names, they can be numbers too or whatever you want