manage to make the reverting code work ^^
here is the finished one:
functions/functions_items.php
PHP Code:
function items_originalS($item, $adopt){
$mysidia = Registry:: get("mysidia");
$imageurl = $adopt->imageurl;
$currentLevel = $adopt->currentlevel;
//Let's check if the adoptable is using his/her original color.
if($imageurl == NULL) {
//The adoptable is already using his/her original color
$note = "Your adoptable is using his/her original color.";
}
//Let's check if the adoptable is below level 10.
else if($currentLevel < 10){
$note = "Your adoptable is not at level 10 yet.";
}
//Adoptable has all the requirements, let's update it
else{
$mysidia -> db -> update("owned_adoptables", array("imageurl" => NULL),"aid='{$adopt->aid}' and owner ='{$item->owner}'");
$note = "Your adoptable {$adopt->name} is now using his/her original color.";
//Update item quantity...
$delitem = $item->remove();
}
return $note;
}
class/class_privateitem.php
case
PHP Code:
case "itemsoriginalS":
$message = items_originalS($this, $owned_adoptable);
break;
it was so simple... i just had to remove the cotes '' from NULL to make it work o_O it was the only change i made to the code, this will revert back the adopt to his/her original image or alternate image depending which one was using before the change of skin.
by the way you can change what it says in the $note= to anything you want or you think it will go with your site =)