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 10-25-2009, 01:46 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 21,293
Arianna will become famous soon enough
Default Gender? [answered]

Being the PHP beginner that I am, I know I messed something up.
I added a new column to the owned_adoptables table, Gender. I had only one pet on the system, and I edited the myadopt action stats so that it showed the gender too.
I manually entered the gender via phpmyadmin, no big deal yet, because I have a problem which I encountered.
It will display the gender, but this seems to totally lock out any new adoptables. xP
How do I get around this? Also, if you know, how can I set it so on adoption it chooses either Female or Male (50/50 chance) and inserts it into the table?
Thanks,
Arianna
[hr]
EDIT: I managed to make it so the default is female, and so it inserts that in - however, I'm stuck on how I can insert a random chance which chooses either 'Male' or 'Female' for the gender field.
Reply With Quote
  #2  
Old 10-25-2009, 02:28 AM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 15,576
Seapyramid
Default RE: Gender?

You would need it to look for gender the same way it does for alts in the functions.. I realize you are new & trying.. but trust me on this one.. look closely at the functions page in the include foler.. find how it looks for alts & you will figure it out. :) I have faith :)

Sea
Reply With Quote
  #3  
Old 10-25-2009, 02:46 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 21,293
Arianna will become famous soon enough
Default RE: Gender?

I found it out now :) My code was this, in the doadopt.php file:
Code:
//my gender mod

$tempgender = rand(0, 1);
if($tempgender == "0") {
$gender = "female";
unset($tempgender);
}
else {
$gender = "male";
unset($tempgender);
}
And then later I used the $gender variable to insert it in the sql query.
Thank goodness my dad knows computer programming, even if he doesn't know PHP. x3
Reply With Quote
  #4  
Old 11-18-2009, 11:35 PM
brisschris brisschris is offline
Member
 
Join Date: Nov 2009
Posts: 3
Credits: 250
brisschris
Default Gender? [answered]

Hello,

I am brisschris.This is my first visit to site.I am new to this site,but I’ve enjoyed posting in your forums.I know the PHP coding.You can use the functions.You can use this code.

$tempgender = rand(0, 1);
if($tempgender == "0")
{
$gender = "female";
unset($tempgender);
}
else
{
$gender = "male";
unset($tempgender);
}
This is the gender code.It is very help[ful to you.This is very best example.

Thank you very much and Stay connected with me.
Reply With Quote
  #5  
Old 11-19-2009, 06:33 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 21,293
Arianna will become famous soon enough
Default RE: Gender? [answered]

I've already solved it, but thanks. :)
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
Mys v1.3.4 Gender Ratio Mod for Mys v1.3.4 Hall of Famer Mys v1.3.x Mods 14 06-17-2020 07:20 PM
Gender superdude44 Questions and Supports 5 07-11-2013 01:17 AM
different images for gender MA 1.3.3 draugluin Questions and Supports 3 06-18-2013 01:30 AM
Mys v1.3.1 Gender Ratio Mod for v1.3.1 Hall of Famer Mys v1.3.x Mods 15 08-17-2012 03:25 AM


All times are GMT -5. The time now is 07:59 AM.

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