$alts = getaltstatus($id, 0, 0);
// We need a unique code for the adoptable so we can show it to the user when we're done here...
$code = rand(1, 20000);
$genders = array('f', 'm');
$rand = rand(0,1);
runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('', '{$row['type']}', '$name','$loggedinname','0','0', '$code', '','$alts','fortrade','no', '$genders[$rand]','0')");
// Adoption complete, show the user a confirmation screen...
// We need a unique code for the adoptable so we can show it to the user when we're done here...
$code = rand(1, 20000);
$genders = array('f', 'm');
$rand = rand(0,1);
$petgender = $genders[$rand];
switch($petgender){
case "m":
$alts = "yes";
break;
default:
$alts = "no";
}
runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('', '{$row['type']}', '$name','$loggedinname','0','0', '$code', '','$alts','fortrade','no', '$petgender','0')");
// Adoption complete, show the user a confirmation screen...
$alts = getaltstatus($id, 0, 0);
Glad it helped you SDT, it seems that I havent released a Mys public mod for a while already. The work of itemshop and other Mys v1.3.0 programming do take much time off me. I am considering making Mys v1.2.3 available as a security release, which will strengthen password encryption protection, enable registration question/answer(prevent bots registration) and fix script flaws. I may update my old mods for Mys v1.1.x to Mys v1.2.x afterwards.
Here is a possible way to have alternates set by gender:
Find these lines in doadopt.php:
Replace with something like this(the code may be different depending on the structure of your table prefix_owned_adoptables):PHP:$alts = getaltstatus($id, 0, 0); // We need a unique code for the adoptable so we can show it to the user when we're done here... $code = rand(1, 20000); $genders = array('f', 'm'); $rand = rand(0,1); runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('', '{$row['type']}', '$name','$loggedinname','0','0', '$code', '','$alts','fortrade','no', '$genders[$rand]','0')"); // Adoption complete, show the user a confirmation screen...
This will set female sprite to be primary and male sprite to be alternate. Lemme know if this code wont work for you, and take a screenshot of your prefix_owned_adoptables so I can assist you further.PHP:// We need a unique code for the adoptable so we can show it to the user when we're done here... $code = rand(1, 20000); $genders = array('f', 'm'); $rand = rand(0,1); $petgender = $genders[$rand]; switch($petgender){ case "m": $alts = "yes"; break; default: $alts = "no"; } runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('', '{$row['type']}', '$name','$loggedinname','0','0', '$code', '','$alts','fortrade','no', '$petgender','0')"); // Adoption complete, show the user a confirmation screen...
Fatal error: Call to undefined function runquery() in /var/www/clients/client161/web331/web/adopties/doadopt.php on line 67
runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('', '{$row['type']}', '$name', '$owner', '0', '0', '$code', '','$usealternates','fortrade','no', '$gender','0')");