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
  #11  
Old 01-02-2012, 02:56 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 117,481
SilverDragonTears is on a distinguished road
Default

I tried HoF, but I'm not good with those. Can you tell me what and where I should put it?
__________________

Check out SilvaTales
Reply With Quote
  #12  
Old 01-05-2012, 11:54 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: 634,951
Hall of Famer is on a distinguished road
Default

Well you may try registering the global variable $_SESSION['breeding'] and play with it. Id recommend you to look at the example from adopt.php and doadopt.php, note the two script files are linked together in a way that a session variable is assigned in adopt.php for each new session and destroyed at the end of doadopt.php row insertion.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #13  
Old 01-05-2012, 06:41 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 117,481
SilverDragonTears is on a distinguished road
Default

That completely loses me ._.
__________________

Check out SilvaTales
Reply With Quote
  #14  
Old 01-05-2012, 08:57 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 117,481
SilverDragonTears is on a distinguished road
Default

This is what I tried and it's not working. I'm sure I'm not even close.

PHP Code:
else if($act == "breed"){
    
$_SESSION["breeding"] = 1;

if(
is_numeric($id)){


$breedinglevel grabanysetting('breedinglevel');

$article_title "Breeding System"
$article_content "<p>You may breed your adoptables here. They must be at least a level {$breedinglevel} to be able to breed.</p>"

$femaleid $_POST['female'];
$maleid $_POST['male'];
$breed $_POST['breed'];
$date date("M j, Y");

// $date = "March 23, 2010";

if ($isloggedin == "yes"){

    if(
$_SESSION["breeding"] != 1){
    
        
$article_title $err_idnoexist;
        
$article_content $err_idnoexist_text;
    }
    elseif(
$_SESSION["breeding"] == 1){

$query "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='".$loggedinname."' AND currentlevel<='3' AND isfrozen='no'";
$result mysql_query($query);
$num mysql_num_rows($result);

if(
$num >= 5){
$breed 'no';
$article_title "Too many eggs to breed!";
$article_content "You already have too many eggs to take care of!";
}
   else if (
$breed != 'yes'){ // if they have not chosen which pets to breed yet, we let them choose
        
$article_content .= "<p>Select the two adoptables that you'd like to breed:</p><form method='post'>"
        
$lastweek time() - ((grabanysetting('breedinginterval')) * 24 60 60);
        
        
// show all available female adoptables
        
$result runquery("SELECT * FROM ".$prefix."owned_adoptables WHERE owner = '$loggedinname' and aid='$id' AND gender = 'f' AND canbreed = 'yes' AND currentlevel >= {$breedinglevel} AND lastbred <= '$lastweek'") ;
        
$num mysql_num_rows($result);
        if (
$num!=0) {
            
$article_content .= "<p>Female: <select name='female'>";
            while (
$row mysql_fetch_array($resultMYSQL_ASSOC)) {
                
$article_content .= "<option value='{$row['aid']}'>{$row['aid']} {$row['name']} ({$row['type']})</option>";
            }
            
$article_content .= "</select></p>";
        }
        else {
            
$article_content .= "<p>Your female can't breed at this time.</p>";
        }
        
        
// show all available male adoptables
  
        
$result runquery("SELECT * FROM ".$prefix."owned_adoptables WHERE owner = '$loggedinname' AND gender = 'm'  AND canbreed = 'yes' AND currentlevel >= {$breedinglevel} AND lastbred <= '$lastweek'") ;
      
$num mysql_num_rows($result);

            if (
$num!=0) {
            
$article_content .= "<p>Male: <select name='male'>";
            while (
$row mysql_fetch_array($resultMYSQL_ASSOC)) {
                
$article_content .= "<option value='{$row['aid']}'>{$row['aid']} {$row['name']} ({$row['type']})</option><br>";
            }

            
$article_content .= "</select></p>";
        }
        else {
            
$article_content .= "<p>None of your male adoptables can breed at the time.</p>";
        }
        
$article_content .= "<input type='hidden' name='breed' value='yes'><input type='submit' value='Breed It'></form>";
    } 
    else {
        
$result runquery("SELECT * FROM ".$prefix."owned_adoptables WHERE aid = '$femaleid'") ;
        
$female mysql_fetch_array($result);

        
$female_type = @mysql_result($result,0,'type'); 
        
$female_name = @mysql_result($result,0,'name');

        
$result2 runquery("SELECT * FROM ".$prefix."adoptables WHERE type = '$female_type'") ;
        
$female_species mysql_fetch_array($result2);
        
$female_class = @mysql_result($result2,0,'class');
                
$bredchance = @mysql_result($result2,0,'bredchance'); 
        
        
$result runquery("SELECT * FROM ".$prefix."owned_adoptables WHERE aid = '$maleid'") ;
        
$male mysql_fetch_array($result);

        
$male_type = @mysql_result($result,0,'type'); 
        
$male_name = @mysql_result($result,0,'name');

        
$result2 runquery("SELECT * FROM ".$prefix."adoptables WHERE type = '$male_type'") ;
        
$male_species mysql_fetch_array($result2);
        
$male_class = @mysql_result($result2,0,'class'); 


        
// let's check the requirements first.
        
if($female_class != $male_class){//check if the male and female belong to the same breeding class
            
$article_content "Sorry, it seems that your two adoptables do not belong to the same breeding class.";
        }
        else if ((
$female['currentlevel'] < (grabanysetting('breedinglevel'))) OR ($male['currentlevel'] < (grabanysetting('breedinglevel')))){ // check the adoptables' levels
            
$article_content .= "Sorry, one of your adoptables don't have the minimum level to breed. Keep getting clicks for them so they can grow.";    
        } 

        
// the below codes check if the user has modified the form using firebug or inspect element...
        
elseif($female['owner'] != $loggedinname or $male['owner'] != $loggedinname){
           
// The adoptables do not belong to the owner... This user has apparently modified the content of drop-down form, and thus deserves his/her punishment
           
runquery("UPDATE {$prefix}users SET usergroup=5 WHERE username='{$loggedinname}'");
           
$article_title "An error has occurred";    
           
$article_content "It appears that at least one of the adoptables selected do not belong to yours. You have been banned for this action, please contact site administrator for more info.";
        }
        elseif(
$female['gender'] != "f" or $male['gender'] != "m"){
           
// The female's gender is male or male's gender is female? This user has apparently modified the content of drop-down form, and thus deserves his/her punishment
           
runquery("UPDATE {$prefix}users SET usergroup=5 WHERE username='{$loggedinname}'");
           
$article_title "An error has occurred";    
           
$article_content "It appears that the female and/or male adoptables gender's have been modified. You have been banned for this action, please contact site administrator for more info.";              
        }
        else {
            
// we choose the type!

            
if ($female_type == 'Noctis Silvfox Beta' && $male_type == 'Noctis Silvfox Beta'){
            
$female_type 'Noctis Silvfox' && $male_type 'Noctis Silvfox';}
            
$types = array($female_type$male_type);
            if (
$female_type == 'Red Stitch Silvfox Beta' && $male_type == 'Red Stitch Silvfox Beta'){
            
$female_type 'Red Stitch Silvfox' && $male_type 'Red Stitch Silvfox';}
            
$types = array($female_type$male_type);
            if (
$female_type == 'White Stitch Silvfox Beta' && $male_type == 'White Stitch Silvfox Beta'){
            
$female_type 'White Stitch Silvfox' && $male_type 'White Stitch Silvfox';}
            
$types = array($female_type$male_type);

            if (
$female_type == 'White Silvfox Beta' && $male_type == 'Red Stitch Silvfox Beta'){
            
$female_type 'White Stitch Silvfox' && $male_type 'Red Stitch Silvfox';}
            
$types = array($female_type$male_type);
            if (
$female_type == 'Noctis Silvfox Beta' && $male_type == 'Red Stitch Silvfox Beta'){
            
$female_type 'Noctis Silvfox' && $male_type 'Red Stitch Silvfox';}
            
$types = array($female_type$male_type);
            if (
$female_type == 'Noctis Silvfox Beta' && $male_type == 'White Stitch Silvfox Beta'){
            
$female_type 'Noctis Silvfox' && $male_type 'White Stitch Silvfox';}
            
$types = array($female_type$male_type);


            if (
$female_type == 'Noctis Silvfox Beta' && $male_type != '$male_type'){
            
$female_type 'Noctis Silvfox';
            
$types = array($female_type$male_type);}
            if (
$female_type == 'Red Stitch Silvfox Beta' && $male_type != '$male_type'){
            
$female_type 'Red Stitch Silvfox';
            
$types = array($female_type$male_type);}
            if (
$female_type == 'White Stitch Silvfox Beta' && $male_type != '$male_type'){
            
$female_type 'White Stitch Silvfox';
            
$types = array($female_type$male_type);}


            if (
$female_type != '$female_type' && $male_type == 'Noctis Silvfox Beta'){
            
$male_type 'Noctis Silvfox';
            
$types = array($female_type$male_type);}
            if (
$female_type != '$female_type' && $male_type == 'Red Stitch Silvfox Beta'){
            
$male_type 'Red Stitch Silvfox';
            
$types = array($female_type$male_type);}
            if (
$female_type != '$female_type' && $male_type == 'White Stitch Silvfox Beta'){
            
$male_type 'White Stitch Silvfox';
            
$types = array($female_type$male_type);}
            
            if (
$female_type == 'Autumn Silvfox' && $male_type == 'Autumn Silvfox'){
            
$female_type 'Winter Silvfox' && $male_type 'Winter Silvfox';}
            
$types = array($female_type$male_type);
            if (
$female_type == 'Autumn Silvfox' && $male_type != '$male_type'){
            
$female_type 'Winter Silvfox';
            
$types = array($female_type$male_type);}
            if (
$female_type != '$female_type' && $male_type == 'Autumn Silvfox'){
            
$male_type 'Winter Silvfox';
            
$types = array($female_type$male_type);}

            
$types = array($female_type$male_type);
            
$typerand rand(0,1); 
       
            
            
// we choose the gender
            
$genders = array('f''m');
            
$genderrand rand(0,1);                
                  
$code rand(120000); 

            
// MESSY - I'm blanking out on how to find the actual alt status stuff right now, any help would be lovely.

            
$alts getaltstatus($aid00);
            if(
$genders[$genderrand] == 'f') { $alts 'yes';}

            
$time time();
            
$bredtemp rand(0,100);
if(
$bredtemp <= $bredchance){
$article_content "These two don't seem very interested in each other right now. Try again in a week."
 
}    
else{
$newquery "INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$types[$typerand]', 'Unnamed', '$loggedinname', '0', '0', '$code', '', '$alts', 'notfortrade', 'no', '$genders[$genderrand]', '$lastbred', '$lastinfluence', '$lastbite', 'sort', '$maleid', '$femaleid', '$desc', '$date', '','yes', '$biterid', 'no')";
            
runquery($newquery);
                        unset(
$_SESSION["breeding"]);
                        
// END the actual adoption process
                    
}    
            
$article_content "Congratulations! Breeding is successful,  you have acquired a baby ".$types[$typerand]." from breeding center.
            <br><a href='myadopts.php'>Manage your new 
{$types[$typerand]} now!</a></p>";
                
     
}
            
runquery("UPDATE ".$prefix."owned_adoptables SET lastbred = '$time' WHERE aid = '$femaleid'");
            
runquery("UPDATE ".$prefix."owned_adoptables SET lastbred = '$time' WHERE aid = '$maleid'");
        } 
// we end the place where it goes on if the levels are ok
    
//this bracket ends the else where we find the male/female id's
}// this is the end of if($isloggedin == "yes")
else {
    
$article_content .= "You are not logged in. Please log in to use this feature.";
}


__________________

Check out SilvaTales
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
Another CSS Issue Abronsyth Questions and Supports 4 12-12-2012 05:06 PM
Random breeding outcome/ rare breeding SilverDragonTears Questions and Supports 0 03-25-2012 02:33 AM
Major Issue..... SilverDragonTears Questions and Supports 0 08-18-2011 08:22 PM
Prevent Refresh PTGigi Suggestions and Feature Requests 9 01-28-2011 04:12 PM
Ads Issue Tequila Questions and Supports 12 04-05-2009 10:10 AM


All times are GMT -5. The time now is 07:52 PM.

Currently Active Users: 2867 (0 members and 2867 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636