View Single Post
  #2  
Old 03-27-2012, 02:53 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,893
Hall of Famer is on a distinguished road
Default

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.";
                     }
                  } 
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote