Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   One adoptable per name? (http://www.mysidiaadoptables.com/forum/showthread.php?t=962)

Xius 07-03-2009 10:10 PM

One adoptable per name?
 
Is there a way to only allow one name to be used and then never used again unless changed?

Bloodrun 07-04-2009 11:31 AM

RE: One adoptable per name?
 
Yes you want something like this:

PHP Code:


    
//Next check that the petname does not already exist...

    
$flag 0;
    
$query "SELECT * FROM ".$prefix."adopts WHERE petname = '$petname'";
    
$result = @mysql_query($query);
    
$num = @mysql_numrows($result);

    if(
$num 0){
    
$flag 1;
    }

    if(
$flag 0){

    
//petname already exists
    
$article_title "Your petname already exists";
    
$article_content "Your name exists currently in our database. Please try again and choose a different name.";    

    } 

Of course just change username, and the directory your calling from.

Xius 07-04-2009 12:18 PM

RE: One adoptable per name?
 
Where do I put that? XD

Bloodrun 07-04-2009 01:40 PM

RE: One adoptable per name?
 
Quote:

Originally Posted by Xius
Where do I put that? XD


Wait, did you mean for pets or for usernames?

Because if you meant for usernames, thats already there. In the registration form, if the username already exists in the database, it wont allow someone to create the same username.

If you meant for pets, just put it in the adopt file. I think its, either doadopt.php or myadopts.php that allows you to adopt, i cant remember.

Xius 07-04-2009 06:03 PM

RE: One adoptable per name?
 
Yeah, I meant for pets.
Does it matter where I put it? x]

Bloodrun 07-07-2009 11:29 AM

RE: One adoptable per name?
 
Lol well obviously it does, but to an extent.. well yes, yes it does.
To give you a up to date answer, I would need to see your adopting script, just in case you have made any changes, or just in case your script is in a different set up to mine.
It is most likely set up differently then mine, because I have made some changes.


All times are GMT -5. The time now is 03:38 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.