View Single Post
  #7  
Old 04-06-2018, 08:16 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 63,647
Dinocanid is on a distinguished road
Default

Quote:
Originally Posted by Phoeniix View Post
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!! */

__________________
Reply With Quote