Well it isnt really difficult, just find this part in your script:
PHP Code:
else{
// We are renaming the adoptable
// The adoptable exists, so now we can rename it...
$adopts->query("UPDATE {$prefix}owned_adoptables SET name='{$more}' WHERE aid='{$id}' and owner='{$loggedinname}'");
$article_title = $lang_rename_success_title;
$article_content = "<img src='{$image}'><br />{$lang_rename_success}{$more}.
You can now manage {$more} on the <a href='myadopts.php?act=manage&id={$id}'>My Adopts</a> page";
}
And replace with:
PHP Code:
else{
$stmt = $adopts->query("SELECT * FROM {$prefix}owned_adoptables WHERE name='{$more}' and aid='{$id}'");
$row = $stmt->fetchObject();
if(!is_object($row)){
// The name has not yet been used, we are good to go!
$adopts->query("UPDATE {$prefix}owned_adoptables SET name='{$more}' WHERE aid='{$id}' and owner='{$loggedinname}'");
$article_title = $lang_rename_success_title;
$article_content = "<img src='{$image}'><br />{$lang_rename_success}{$more}.
You can now manage {$more} on the <a href='myadopts.php?act=manage&id={$id}'>My Adopts</a> page";
}
else{
// The name is being used by someone else, so display an error message...
$article_title = "An error has occurred";
$article_content = "It appears that the name {$more} is taken already.";
}
}