okay, I fixed it
this is the code for useful gender-swap
PHP Code:
function items_alts1($item, $adopt){
// First lets check if alternative image exists for an adoptable at this level.
$lev = $GLOBALS['adopts']->select("levels", array(), "adoptiename='{$adopt->type}' and thisislevel ='{$adopt->currentlevel}'")->fetchObject();
if($lev->alternateimage == ""){
// The alternate image does not exist, cannot convert adoptable into its alternate form
$note = "It appears that your adoptable could not swap its gender...<br>";
}
else{
// The alternate image exists, conversion between primary and alternate image is possible.
switch($adopt->usealternates){
case "yes":
$GLOBALS['adopts']->update("owned_adoptables", array("usealternates" => 'no', "gender" => 'm'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
$note = "{$adopt->name} is male.";
break;
default:
$GLOBALS['adopts']->update("owned_adoptables", array("usealternates" => 'yes', "gender" => 'f'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
$note = " {$adopt->name} is female";
}
//Update item quantity...
$delitem = $item->removeitem(1, $item->owner);
}
return $note;
}
You only have to modify your text and have alternate images female.
I've the primary image for male and alternates for female.
much fun - I will have fun too - or better : my user