Quote:
Originally Posted by Phoeniix
K thanks, but ive run into another issue, when inputting (if num<0) when i insert the code i get a blank breeding.php page. when i take it out the page is normal, is there something off with the code?
|
Does it look like this when you do it?
PHP Code:
if($num > 0){
$offsprings = $breeding->getOffsprings();
$offspringID = $mysidia->db->select("owned_adoptables", array("aid"), "1 ORDER BY aid DESC LIMIT 1")->fetchColumn() - $num + 1;
$links = new LinkedList;
$newbabies = array(); // Kyt: Added line for Descendants Mod!!
foreach($offsprings as $offspring){
$newbabies[] = $offspringID; // Kyt: Added line for Descendants Mod!!
$image = $offspring->getEggImage("gui");
$links->add(new Link("myadopts/manage/{$offspringID}", $image));
$offspringID++;
}
$this->setField("links", $links);
/* Kyt: Descendants Mod!! */
if ($female->descendants != 0){ $mothersOffspring = $female->descendants; } else { $mothersOffspring = ""; }
if ($male->descendants != 0){ $fathersOffspring = $male->descendants; } else { $fathersOffspring = ""; }
for($i = 0; $i < count($newbabies); $i++){
$mothersOffspring .= $newbabies[$i].",";
$fathersOffspring .= $newbabies[$i].",";
}
$updatedMotherOffspring = preg_replace('/^(0,)+/', '', $mothersOffspring);
$updatedFatherOffpsring = preg_replace('/^(0,)+/', '', $fathersOffspring);
$mysidia->db->update("owned_adoptables", array("descendants" => $updatedMotherOffspring), "aid = '{$female->aid}'");
$mysidia->db->update("owned_adoptables", array("descendants" => $updatedFatherOffpsring), "aid = '{$male->aid}'");
/* Descendants Mod End!! */
}