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
  #11  
Old 08-22-2013, 07:24 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: 491,297
Hall of Famer is on a distinguished road
Default

Well there is definitely no 'prefix.adoptables' in your database unless your table prefix is 'prefix'. Replace 'prefix' by whatever the table prefix is for your site, and it should work for you. For my demo site the prefix is 'adopts' or sometimes 'mys', yours may be completely different.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #12  
Old 01-19-2014, 02:17 AM
katsunya's Avatar
katsunya katsunya is offline
Adoptables Newbie
 
Join Date: Aug 2011
Posts: 8
Gender: Female
Credits: 1,842
katsunya is on a distinguished road
Default

Does this code work for v1.3.4, too? o 3o

Edit: Or is there a code in the works for this to work in v1.3.4?

Last edited by katsunya; 01-19-2014 at 02:54 PM. Reason: Tried messing around with the v1.3.3 in v1.3.4 and kept getting a blank screen.
Reply With Quote
  #13  
Old 01-19-2014, 05: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: 491,297
Hall of Famer is on a distinguished road
Default

It does not work with Mys v1.3.4, but I can post a solution if anyone is interested. The reason why I havent updated my mods was that the users who used to follow my plugins are no longer requesting old mods update or new mods being made. After all, whether or not will I make a mod/plugin is mostly a matter of demand. When there is no demand, I see no need to make new mods but rather work on the core script instead.

Send me a PM if you want an updated version, I may post a new thread dedicated to Mys v1.3.4's gender ratio mod if there is more than one user who asks.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #14  
Old 01-20-2014, 10:16 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 32,850
kristhasirah
Default

i was going to ask ^^ but i found the solution, and so far is working. At least i don't have any problems. I always try to find a solution myself before asking for help.

So this is what i did to make the mod work with the new script: instead of editing 2 files, I had to edit 3 files:
/admincp/view/adoptview.php (You find the $adoptform code.)
/admincp/adopt.php (where you find the: sql insertion.)
And the:
/classes/class_adoptable.php (which you just follow the instructions posted by HoF ^^ that's all you need to do.)

That's what i did. not sure if is the correct solution, but is working.
__________________
Reply With Quote
  #15  
Old 01-21-2014, 04:52 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: 491,297
Hall of Famer is on a distinguished road
Default

Yeah thats the correct steps to take Kristhasirah. If you get it to work, maybe you want to share it with other users? I wont urge you to do this though since mods/plugins are all voluntary work so its up for the users to decide whether to share or not(although there's one restriction, which I havent seen anyone reaching it yet).
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #16  
Old 01-24-2014, 08:22 PM
katsunya's Avatar
katsunya katsunya is offline
Adoptables Newbie
 
Join Date: Aug 2011
Posts: 8
Gender: Female
Credits: 1,842
katsunya is on a distinguished road
Default

Oh I see. The codes I tried using and editing kept giving me blank pages when I tried so thanks for posting your fix! I'll try it out that way.
Reply With Quote
  #17  
Old 05-20-2019, 07:31 PM
GenStar1990 GenStar1990 is offline
Member
 
Join Date: Nov 2016
Posts: 2
Gender: Female
Credits: 954
GenStar1990 is on a distinguished road
Default

Does it work with Mysidia 1.3.4?
Reply With Quote
  #18  
Old 05-23-2019, 04:34 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 32,850
kristhasirah
Default

it works you just make sure you have inserted the correct info to your table prefix.adoptables.: http://www.mysidiaadoptables.com/for...57&postcount=1
and how it shoud look: http://www.mysidiaadoptables.com/for...40&postcount=5
if you have a new install here is the page of the mod for the Mys v1.3.4: http://www.mysidiaadoptables.com/for...15&postcount=1
that have all the files needed for a fresh install.
the rest of the code you need to separate it in parts:
in /admincp/view/adoptview.php find:
PHP Code:
        $adoptForm->add($basicInfo);
        
$adoptForm->add($shopSettings);
        
$adoptForm->add($conditions);
        
$adoptForm->add($miscellaneous);
        
$adoptForm->add(new Button("Create this Adoptable""submit""submit"));
        
$document->add($adoptForm); 
after that paste:
PHP Code:
        $miscellaneous->add(new Comment("The Gender Ratio of your adoptable is "FALSE));
        
$miscellaneous->add(new TextField("genderratio"50)); 
then in /admincp/adopt.php find:
PHP Code:
            $mysidia->db->insert("adoptables", array("id" => NULL"type" => $mysidia->input->post("type"), "class" => $mysidia->input->post("class"), "description" => $mysidia->input->post("description"), "eggimage" => $eggimage"whenisavail" => $mysidia->input->post("cba"),
                                                     
"alternates" => $mysidia->input->post("alternates"), "altoutlevel" => $mysidia->input->post("altoutlevel"), "altchance" => $mysidia->input->post("altchance"), "shop" => $mysidia->input->post("shop"), "cost" => $mysidia->input->post("cost"))); 
and replace with this one:
PHP Code:
            $mysidia->db->insert("adoptables", array("id" => NULL"type" => $mysidia->input->post("type"), "class" => $mysidia->input->post("class"), "description" => $mysidia->input->post("description"), "eggimage" => $eggimage"whenisavail" => $mysidia->input->post("cba"),
                                                     
"alternates" => $mysidia->input->post("alternates"), "altoutlevel" => $mysidia->input->post("altoutlevel"), "altchance" => $mysidia->input->post("altchance"), "shop" => $mysidia->input->post("shop"), "cost" => $mysidia->input->post("cost"), "genderratio" => $mysidia->input->post("genderratio"))); 
if you have already edited that part of the code and added some other things then you just need to add this part to the code you have:
PHP Code:
"genderratio" => $mysidia->input->post("genderratio"
then in classes/class_adoptable.php find this:
PHP Code:
    protected $id;
    protected 
$type;
    protected 
$class;
    protected 
$description;
    protected 
$eggimage;
    protected 
$whenisavail;
    protected 
$alternates;
    protected 
$altoutlevel;
    protected 
$altchance;
    protected 
$shop;
    protected 
$cost;  
    protected 
$conditions;
    protected 
$levels
and add this:
PHP Code:
    protected $genderratio
then search for this code:
PHP Code:
    public function getGender(){
        
$genders = array('f''m');
        
$rand rand(0,1);
        return 
$genders[$rand];
    } 
and replace with:
PHP Code:
    public function getGenderRatio(){
        return 
$this->genderratio;
    }
    
    public function 
getGender(){        
        
$genderNumber rand(099);
        if(
$genderNumber $this->genderratio$gender "f";
        else 
$gender "m";
        return 
$gender;        
    } 
save the file, now go to classes/class_stockadopt.php
after
PHP Code:
  public $owner
add:
PHP Code:
  public $genderratio
then search for:
PHP Code:
public function append($owner ""){
      
// This method adds items to user inventory
  
      
$mysidia Registry::get("mysidia");
      
$this->owner = (!empty($owner))?$owner:$this->owner;
      
$alts $this->getaltstatus(0);
      
$code codegen(100);
      
$genders = array('f''m'); 
replace $genders = array('f','m'); with:
PHP Code:
      $genderNumber rand(099);
if(
$genderNumber $this->genderratio$gender "f";
else 
$gender "m"
then in
PHP Code:
      $mysidia->db->insert("owned_adoptables", array("aid" => NULL"type" => $this->type"name" => $this->type"owner" => $this->owner,
                                                     
"currentlevel" => 0"totalclicks" => 0"code" => $code"imageurl" => """usealternates" => $alts
                                                     
"tradestatus" => "fortrade""isfrozen" => "no""gender" => $genders[$rand],
                                                     
"offsprings" => 0"lastbred" => 0)); 
replace : "gender" => $genders[$rand], with:
PHP Code:
"gender" => $gender 
and you should have a working mod =)
__________________

Last edited by kristhasirah; 05-23-2019 at 04:40 PM.
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 08:20 PM
Mys v1.3.2 Gender Ratio Mod for Mys v1.3.2 Hall of Famer Mys v1.3.x Mods 6 01-08-2013 03:02 PM
Mys v1.3.1 Gender Ratio Mod for v1.3.1 Hall of Famer Mys v1.3.x Mods 15 08-17-2012 04:25 AM
Hall of Famer's Gender Ratio Mod v1.2 Hall of Famer Mys v1.2.x Mods 45 04-02-2012 01:42 PM
gender ratio script maximillion Questions and Supports 16 06-27-2011 12:59 PM


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

Currently Active Users: 738 (0 members and 738 guests)
Threads: 4,081, Posts: 32,032, 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