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 07-05-2011, 11:12 AM
Slix's Avatar
Slix Slix is offline
Member
 
Join Date: Jun 2010
Posts: 14
Credits: 2,246
Slix
Default Adding new adoptables?

Hey there.

I've made a system that pulls the available adoptables from the database and creates an egg every hour. Users can then adopt the eggs. However, since I made this, I haven't seen any alternate status eggs being made. Is there something wrong with my code or is it just bad luck?

Code:
$id = $_GET["id"];
$id = preg_replace("/[^a-zA-Z0-9s]/", "", $id);
$id = secure($id);

$genderratio = $_GET["genderratio"];
$genderratio = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $genderratio);
$genderratio = secure($genderratio);

$query = "SELECT * FROM ".$prefix."adoptables WHERE whenisavail='always' ORDER BY RAND() LIMIT 2";
$result = mysql_query($query);
$num = mysql_num_rows($result);


$i=0;
while ($i < $num) {

$type=@mysql_result($result,$i,"type");

$genderratio=@mysql_result($result,$i,"genderratio"); 

$i++;

}


if($name == ""){
$name = $type;
}

//The gender mod
if($genderratio >= 0 and $genderratio < 101) {
$tempgender = rand(0, 100);
if($tempgender >= 0 and $tempgender < $genderratio) {
$gender = "Female";
unset($tempgender);
}
else {
$gender = "Male";
unset($tempgender);
}
}
else {
$gender = "Genderless";
}

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

$alts = getaltstatus($id, 0, 0);

// Now we actually process the adoption and add it to the database...
// 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);

//ADDING NEW ADOPTABLES HERE

mysql_query("INSERT INTO ".$prefix."lab_adoptables VALUES ('', '$type', '$name','Username','0','0', '$code', '','$alts','notfortrade','no','$gender')");
I have a line in there for grabbing the alternate chances, but I don't know if there's something else wrong that I just don't see.

Any help would be greatly appreciated!
__________________
Poliwager ~ Pokémon Forums ~ Adopt a Pokémon

Reply With Quote
Reply

Tags
alternates, eggs


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
Adding Forum directly to the Adoptables site Ozeuth Questions and Supports 2 02-24-2015 09:28 AM
Adding Databases Kesstryl Questions and Supports 4 06-08-2012 06:47 AM
adding adoptables and changing theme superdude44 Questions and Supports 1 11-27-2011 10:44 PM
Adding levels lady jive Questions and Supports 3 03-29-2009 06:18 AM
Adding adoptables directly to a user LilPixie Questions and Supports 2 03-26-2009 04:49 PM


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

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