Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2013, 05:35 PM
Empress_Swanbottom's Avatar
Empress_Swanbottom Empress_Swanbottom is offline
Member
 
Join Date: Feb 2013
Posts: 48
Gender: Female
Credits: 7,460
Empress_Swanbottom is on a distinguished road
Default Making IDs be codes?

(*shrinks away* Sorry about all the questions.)

I was wondering if there is a way to make the system change IDs to codes. Like instead of 1, it be something like Ag3dv2?
Reply With Quote
  #2  
Old 02-12-2013, 06:08 PM
Isura Isura is offline
Member
 
Join Date: Jun 2011
Posts: 38
Gender: Female
Credits: 8,130
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
  #3  
Old 02-12-2013, 09:02 PM
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: 334,574
Hall of Famer is on a distinguished road
Default

Well silverdragontears did this before, you may ask her how it is done. Just a quick note though, it is an irreversible change and you wont be able to use the upgrader when a new version is released. Be careful with your decision.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #4  
Old 02-13-2013, 04:51 AM
Empress_Swanbottom's Avatar
Empress_Swanbottom Empress_Swanbottom is offline
Member
 
Join Date: Feb 2013
Posts: 48
Gender: Female
Credits: 7,460
Empress_Swanbottom is on a distinguished road
Default

^_^ Okay, thanks. :)
Also, couldn't I put $ as the values instead? I read somewhere that $ are counted as variables, so if I've got, for say, five $ in the values area then it'd just put out codes like Af3tx, hgeWb, 8ebab, etc. right?

Last edited by Empress_Swanbottom; 02-13-2013 at 05:09 AM.
Reply With Quote
  #5  
Old 02-13-2013, 07:17 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,430
SilverDragonTears is on a distinguished road
Default

Quote:
Originally Posted by Hall of Famer View Post
Well silverdragontears did this before, you may ask her how it is done. Just a quick note though, it is an irreversible change and you wont be able to use the upgrader when a new version is released. Be careful with your decision.
^This. ANY modifications you make, you won't be able to use the upgrader or you lost them all. And each time Mys is updated, most likely you'll have to recode your modifications because of the difference in the Mys coding.

I do know how to do it, but right now I just don't have the time as I'm running two sites and am in the process of updating SA.

You have to generate the codes and then put that piece of script in every single file that assigns ids to the adopts.
__________________

Check out SilvaTales
Reply With Quote
  #6  
Old 02-13-2013, 01:49 PM
Empress_Swanbottom's Avatar
Empress_Swanbottom Empress_Swanbottom is offline
Member
 
Join Date: Feb 2013
Posts: 48
Gender: Female
Credits: 7,460
Empress_Swanbottom is on a distinguished road
Default

Okay, thank you Silver. And I completely understand. ^_^ What you're doing for ToD and SA is awesome.


I thought I found a way in functions_rand, but it didn't work. :(

Last edited by Empress_Swanbottom; 02-13-2013 at 05:25 PM.
Reply With Quote
  #7  
Old 02-16-2013, 01:24 PM
Empress_Swanbottom's Avatar
Empress_Swanbottom Empress_Swanbottom is offline
Member
 
Join Date: Feb 2013
Posts: 48
Gender: Female
Credits: 7,460
Empress_Swanbottom is on a distinguished road
Default

I found out how to manually make the number IDs be codes, but that could get kinda crazy and hectic as we get more people on my site... o.o
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making Link Pop up in Iframe? Hwona Questions and Supports 11 07-02-2014 12:22 PM
Making an auto installer Nemesis Feedback and Suggestions 9 12-23-2013 08:55 AM
Are there ani guides for making a theme here? Rovick Questions and Supports 13 11-22-2013 04:47 PM
Making an RSS Feed! PTGigi Tutorials and Tips 1 06-01-2012 03:31 AM
Making a map... help! dulop Questions and Supports 5 05-23-2012 08:14 PM


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

Currently Active Users: 9749 (0 members and 9749 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636