View Single Post
  #6  
Old 05-04-2017, 07:25 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 96,584
Dinocanid is on a distinguished road
Default

Oh! Okay, then you would first get the species of the user's adopt with this:
Quote:
$aid = $this->getField("aid")->getValue();
$adopt = new OwnedAdoptable($aid);
$type = $adopt->getType();
If you're using the manage function in myadoptsview.php. Then from there it depends on how the traits are stored. If they have their own separate columns in the database then you could do something like:
Quote:
if($type = "insertspecieshere"){
$trait1 = $mysidia->db->select("adoptables", array("yourtrait"), "type = '{$type}'")->fetchColumn();
}
This is assuming that, in the prefix_adoptables table, each trait is a seperate column and not all bunched into one column. Then, depending on the species, the first trait will be changed accordingly. Then to show the trait to the user you could do this:
Quote:
$document->add(new Comment("Traits: {$trait1}, {$trait2}, etc..."));
__________________
Reply With Quote