Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2014, 07:57 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 86,982
Kyttias is on a distinguished road
Arrow Know Gender of New Pets Before Naming

This is what we'll be doing (more or less):


Basically we remove the option to name the pet on the first page, so now we'll name it from the confirmation screen - since the adoptable exists now, we can know its gender!

We'll be modifying two sections in adoptview.php -
First we'll replace the contents inside if($mysidia->input->post("submit")){ ... }.
It WAS this:
PHP Code:
if($mysidia->input->post("submit")){
            
$aid $this->getField("aid")->getValue();
            
$name $this->getField("name")->getValue();
            
$eggImage $this->getField("eggImage")->getValue();
            
$image = new Image($eggImage);
            
$image->setLineBreak(TRUE);    
            
            
$document->setTitle("{$name} adopted successfully");            
            
$document->add($image);
            
$document->addLangvar("Congratulations!  You just adopted {$name}.  You can now manage {$name} on the ");
            
$document->add(new Link("myadopts""Myadopts Page."));
            
$document->add(new Comment(""));
            
$document->add(new Link("myadopts/manage/{$aid}""Click Here to Manage {$name}"));
            
$document->add(new Comment(""));
            
$document->add(new Link("myadopts/bbcode/{$aid}""Click Here to get BBCodes/HTML Codes for {$name}"));
            
$document->add(new Comment(""));
            
$document->addLangvar("Be sure and");
            
$document->add(new Link("levelup/{$aid}""feed "));
            
$document->addLangvar("{$name} with clicks so that they grow!");
            return;
        } 
We'll be changing the entire statement to:

PHP Code:
if($mysidia->input->post("submit")){
            
$aid $this->getField("aid")->getValue();
            
$name $this->getField("name")->getValue();
            
$gender_lookup $mysidia->db->select("owned_adoptables", array("gender"), "aid = '{$aid}'")->fetchColumn();
            if (
$gender_lookup == "m") { $gender "boy"$pronoun "him"; }
            if (
$gender_lookup == "f") { $gender "girl"$pronoun "her"; } 
            
$eggImage $this->getField("eggImage")->getValue();
            
$image = new Image($eggImage);
            
$image->setLineBreak(TRUE);    

            
$document->setTitle("{$name} adopted successfully!");            
            
$document->add($image);
            
$document->addLangvar("Congratulations! The {$name} you just recruited is a ");
            
$document->add(new Comment("<b>{$gender}</b>. Would you like to name {$pronoun}? <br> (Valid names may only contain letters, numbers and spaces.)"FALSE));
        
            
$nameForm = new FormBuilder("renameform""/myadopts/rename/{$aid}""post");
            
$nameForm->buildTextField("adoptname")->buildButton("Name""submit""submit");
            
$document->add($nameForm);    


            
$document->add(new Comment("Or if you'd rather wait until later, you can "FALSE));
            
$document->add(new Link("myadopts/manage/{$aid}""click here to manage your new {$name}!"TRUE));

            
$document->addLangvar("Be sure to");
            
$document->add(new Link("levelup/{$aid}""visit "));
            
$document->addLangvar("{$name} every day so that they grow!");
            return;
        } 
The last block of lines at the bottom looks like this:

PHP Code:
$adoptForm->add($adoptTable);        
        
$adoptSubtitle = new Comment("Adopt");
        
$adoptSubtitle->setHeading(3);
        
$adoptForm->add($adoptSubtitle);
        
$adoptForm->add(new Comment("Adoptable Name: "FALSE));
        
$adoptForm->add(new TextField("name"));
        
$adoptForm->add(new Comment(""));
        
$adoptForm->add(new Button("Adopt Me""submit""submit"));
        
$document->add($adoptForm); 
We're going to reduce it to just this:

PHP Code:
$adoptForm->add($adoptTable);            
        
$adoptForm->add(new Button("Recruit""submit""submit"));
        
$document->add($adoptForm); 


Let me know if there are any issues/questions.

(* Yes, it is getting rid of the BBCode link, but since that can be found from the adopt's page, anyway, I didn't see it as a big deal? Naming is important. )
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 12-07-2014 at 08:01 PM.
Reply With Quote
  #2  
Old 12-07-2014, 08:29 PM
AndromedaKerova's Avatar
AndromedaKerova AndromedaKerova is offline
ChibiFur Queen
 
Join Date: Nov 2014
Location: England
Posts: 83
Gender: Female
Credits: 3,685
AndromedaKerova is on a distinguished road
Default

I've added this mod and tested it, works perfectly for me.

I use 1.3.4
__________________
Failing at being normal since 1990.
Reply With Quote
  #3  
Old 12-08-2014, 07:25 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: 327,541
Hall of Famer is on a distinguished road
Default

I like this a lot Kyttias, I think I may apply it to version 1.4.0 when I am ready to release it. After all, it will make no sense if you give your pet a female name only to realize it is male later on, and vice-versa. Good idea.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #4  
Old 05-12-2015, 01:01 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 111,697
Abronsyth is on a distinguished road
Default

Just added this mod!

It's splendid ^_^ Thank you for sharing <3
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #5  
Old 08-04-2018, 01:13 AM
Star Force Mega Man's Avatar
Star Force Mega Man Star Force Mega Man is offline
Member
 
Join Date: Jul 2018
Location: In the dumpster
Posts: 4
Gender: Unknown/Other
Credits: 1,364
Star Force Mega Man is on a distinguished road
Default

I've tested this and it works! Thanks a lot!
__________________
Don't let people drive crackers in here, OK?


Magnapets: Hatch'em and Raise'em!
Reply With Quote
Reply

Tags
adopting, gender, genders, names, naming

Thread Tools
Display Modes

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
Show Gender while Naming Pet & Name Promo Code Pets Kyttias Questions and Supports 5 07-11-2014 02:12 PM
Curses... Unique naming SilverDragonTears Questions and Supports 8 03-27-2012 06:04 PM
Giving pets a Gender Arianna Mys v1.1.x Mods 64 11-24-2010 01:45 AM
Naming and Changing Help whispwill Suggestions and Feature Requests 10 08-29-2009 02:58 PM


All times are GMT -5. The time now is 04:21 PM.

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