View Single Post
  #2  
Old 02-12-2013, 06:08 PM
Isura Isura is offline
Member
 
Join Date: Jun 2011
Posts: 38
Gender: Female
Credits: 9,141
Isura is on a distinguished road
Default

Yes, that could be possible but be a little bit complicated.

As an example:
When you want that all the adoptables get such a code, you need first change your mysql-database. Search with phpMyAdmin (You can find it over the CP of your serverhost) for the _owned_adoptables table and change the table column 'aid' to no AUTO_INCREMENT. Now we need to set the id manually when a new pet gets adopted.

Now we need to edit every file which gives new pets to the users (breeding.php/ doadopts.php). Before the script insert the new pet in the database we need to give it a unique id:

PHP Code:
$timestamp time();
$id md5($timestamp);

//first we select the current servertime (time()) than we encode it with md5
//I haven't test this script, it's only an example

 
$mysidia->db->insert("owned_adoptables", array("aid" => $id"type" => $row->type"name" => $name"owner" => $mysidia->user->username"currentlevel" => 0"totalclicks" => 0"code" => $code
                                                        
"imageurl" => NULL"usealternates" => $alts"tradestatus" => 'fortrade'"isfrozen" => 'no'"gender" => $genders[$rand], "lastbred" => 0)); 
(Sorry for my bad english. Hope it's understandable)
__________________
Reply With Quote