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 08-24-2013, 02:41 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,392
IntoRain is on a distinguished road
Default Using code instead of ID for pet management

I noticed there's a code generator already and pets do have codes. I was thinking if it was possible to use the already available codes to manage pets instead of the ID. I'm worried about the function generating repeated codes and issues, so I wanted to ask first if it's safe to use it? I can always compare all used codes in all tables (might be easier to just create a new one with all the used codes), but the thought of comparing a lot of entries each time an egg is created makes me sweat
__________________


asp.net stole my soul.

Last edited by IntoRain; 08-24-2013 at 02:50 PM.
Reply With Quote
  #2  
Old 08-24-2013, 09:32 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: 336,121
Hall of Famer is on a distinguished road
Default

Its not safe to use the code unfortunately. The code is a legacy data column that was unused since the day I was working on this script, weird though. The script checks ID for being numeric, thats why the code should not be used for adoptables identity. The field 'code' will be removed in Mys v1.4.0 btw.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 08-24-2013, 10:16 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,392
IntoRain is on a distinguished road
Default

Alright, thank you :) I was planning on removing all those verifications but I see that the ID is used a lot in a lot of different files, it might bring some problems I don't really feel like solving xD I might change to code later on once I finish the important modifications and if I remember some other way to avoid repeated codes

Thank you
__________________


asp.net stole my soul.
Reply With Quote
  #4  
Old 08-26-2013, 09:55 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: 336,121
Hall of Famer is on a distinguished road
Default

You are welcome, in fact I do recall a user called SilverDragonTears used to be able to figure out a way to have a long string of characters as ID rather than simple numbers. It may not be easy with the latest script though.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #5  
Old 08-26-2013, 01:12 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,392
IntoRain is on a distinguished road
Default

The only way I see is to create a random string and compare it with a list of already used codes (to prevent repeated ones), but depending on the site it can be a large quantity of comparisons. Plus changing/removing the is_numeric verifications sounds a bit boring xD I will get to it later on I think, maybe there's a way to do it in SQL
__________________


asp.net stole my soul.
Reply With Quote
  #6  
Old 08-26-2013, 03: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: 336,121
Hall of Famer is on a distinguished road
Default

Well you can always use the replace_all functionality from an editor if you wish to get rid of is_numeric() for string comparison instead, not sure how long it will take though.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #7  
Old 08-26-2013, 10:24 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,392
IntoRain is on a distinguished road
Default

When I use it I usually end up replacing some function that wasn't supposed to be corrected xD But it is useful for finding them with ease, I completely forgot about that, thank you again! It will take a while but it's better than scrolling down the code xD
__________________


asp.net stole my soul.
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
Looking for someone to code for me :) Infernette Staff Central 33 02-03-2014 04:44 PM
Site Management Discussion MikiHeart Adoptables Buzz 9 10-30-2013 09:08 PM
PHP Code. Aasixx Questions and Supports 2 09-17-2012 05:15 PM
Could some one code this..? Abronsyth Questions and Supports 5 04-13-2012 07:27 PM
Invite Code/Alpha Code Shex Questions and Supports 0 03-07-2011 04:08 AM


All times are GMT -5. The time now is 09:35 PM.

Currently Active Users: 9505 (0 members and 9505 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