Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.2.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=38)
-   -   Hall of Famer's Gender Ratio Mod v1.2 (http://www.mysidiaadoptables.com/forum/showthread.php?t=2353)

Hall of Famer 09-13-2011 02:03 AM

I see, do you know which Mod is incompatible with my Gender Ratio script?

RoconzaArt 09-17-2011 11:03 PM

Is there a way to bring back the genderless class? I remember the old mod had it but it's not present here. I have a feeling I know how to do it but I'm afraid to try it.

Hall of Famer 09-18-2011 07:27 AM

Well this is definitely doable. If you have Gender Ratio Mod already, find these lines below:

PHP Code:

$tempgender rand(099);
if(
$tempgender $row['genderratio']) {
$gender "f";
unset(
$tempgender);
}
else {
$gender "m";
unset(
$tempgender);
}
runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('',  '{$row['type']}', '$name','$loggedinname','0','0', '$code',  '','$alts','fortrade','no', '$gender','0')"); 

Replace with:
PHP Code:

$tempgender rand(099);
if(
$tempgender $row['genderratio']) {
$gender "f";
unset(
$tempgender);
}
else {
$gender "m";
unset(
$tempgender);
}
if(
$row['genderratio'] == 101$gender "Genderless";
runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('',  '{$row['type']}', '$name','$loggedinname','0','0', '$code',  '','$alts','fortrade','no', '$gender','0')"); 


keliptis 02-13-2012 11:44 AM

I have an odd issue when I installed this mod now when i create a adopt and add alts it shows it as disabled all the time

All forms in the database for that are blank also I had to manually ad ENABLED to it and it seemed to work but whys it showing blanks and making it disable?

Hall of Famer 02-13-2012 04:29 PM

umm I dont think this script itself messes up with the alternate form generation code, unless you've copied/pasted the script in a wrong way that it overwrote the alternate image generation code. Can you show me what exactly is in your doadopt.php file? I guess this is the way to find a solution to your problem.

keliptis 02-14-2012 08:06 AM

I might have xD

*edited out*

Fangs 02-28-2012 10:54 AM

Works great, thank you!

Hall of Famer 02-28-2012 11:25 AM

Thats a nice attempt Keliptis, I am impressed.

keliptis 02-29-2012 10:36 AM

Im so sorry xD I cant believe i did the wrong one, ive been busy for a few days sgo

PHP Code:

<?php

include("inc/functions.php");

//***************//
//  START SCRIPT //
//***************//

$id $_GET["id"];
$promocode $_GET["promocode"];
$name $_GET["name"];

if(
$isloggedin == "yes"){
    if(
$_SESSION["allow"] != 1){
    
        
$article_title $err_idnoexist;
        
$article_content $err_idnoexist_text;
    }
    elseif(
$_SESSION["allow"] == 1){
    
        
// I guess the first thing to do is see if we have a valid adoptable ID submitted...
        
if($id == "" or !is_numeric($id)){
            
$article_title $err_idnoexist;
            
$article_content $err_idnoexist_text;
        }
        else{
            
// The adoptable ID appears to be valid, so we need to double check that it is valid by pulling up the adoptable in the DB

            
$query "SELECT * FROM {$prefix}adoptables WHERE id={$id}";
            
$result runquery($query);
            
$row mysql_fetch_array($result);

            if(
$id == $row['id']){
                
// The ID submitted matches an existing adoptable type
                
$canadopt canadopt($row['id'], "adopting"$promocode$row);

                
// If we can adopt this creature, do the adoption
                
if($canadopt == "yes") {
                    if (
changecash(-$row['cost'], $GLOBALS['loggedinname'], $GLOBALS['money'])==true) {                
                        
// BEGIN the actual adoption process

                        // First we see if we have a custom name; if not, we use the default name
                        
if($name == ""){
                            
$name $row['type'];
                        }

                        
// Now we determine if we are using alternate images or not

                        
$alts getaltstatus($id00);

                        
// We need a unique code for the adoptable so we can show it to the user when we're done here...

                        
$code rand(120000);
                        
$tempgender rand(099);
if(
$tempgender $row['genderratio']) {
$gender "f";
unset(
$tempgender);
}
else {
$gender "m";
unset(
$tempgender);
}
runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('',  '{$row['type']}', '$name','$loggedinname','0','0', '$code',  '','$alts','fortrade','no', '$gender','0')");

                        
// Adoption complete, show the user a confirmation screen...

                        
$result runquery("SELECT * FROM {$prefix}owned_adoptables WHERE code='{$code}' and owner='{$loggedinname}'") ;
                        
$id=@mysql_result($result,0,"aid"); 

                        
$article_title $name." adopted successfully";
                        
$article_content "<img src='{$row['eggimage']}'><br>{$congrats1} {$name}.  You can now manage {$name} on the 
                        <a href='myadopts.php'>My Adopts</a> page.<br><br><b><a href='myadopts.php?act=manage&id=
{$id}'>Click Here to Manage {$name}</a><br>
                        <a href='myadopts.php?act=bbcode&id=
{$id}'>Click Here to get BBCodes / HTML Codes for {$name}</a></b><br><br>
                        Be sure and <a href='levelup.php?id=
{$id}'>feed</a> {$name} with clicks so that they grow!";
                        unset(
$_SESSION["allow"]);
                        
// END the actual adoption process
                    
}
                    else {
                        
$article_title "Not enough money.";
                        
$article_content "You don't have enough {$GLOBALS['settings']['cost']} to buy this adoptable. Earn some money and then try again.";
                    }
                }
                else {
                    
$article_title $accden;
                    
$article_content $adoptnoper;
                }
            } 
// End the if for if $id == $aid
            
else {
                
// Adoptable does not exist, show an error.

                
$article_title $err_idnoexist;
                
$article_content $err_idnoexist_text;
            } 
// End the else for if $id == $aid
        
// End the valid ID input else test statement (bulk of code goes above here)
    
}
// End the log in check IF
else {
    
// Guests cannot adopt pets, so why bother...
    
$article_title $guesttitleerror;
    
$article_content $guesterror;
// End the log in check ELSE 

//***************//
//  OUTPUT PAGE  //
//***************//

echo showpage($article_title$article_content$date);

?>


kristhasirah 03-29-2012 11:03 PM

Will you make this mod available for the new version?


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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.