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 09-02-2013, 01:35 PM
RandomFrog RandomFrog is offline
Member
 
Join Date: Aug 2013
Posts: 13
Gender: Female
Credits: 1,448
RandomFrog is on a distinguished road
Default Breeding page is blank

I enabled breeding, but it just goes to a white screen whenever I try to go to the breeding page. Help?
Reply With Quote
  #2  
Old 09-02-2013, 02:18 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 20,971
IntoRain is on a distinguished road
Default

Just in case, go to PhPMyAdmin, choose your Databse, and then _breeding_settings and check is system is enabled

Also, Blank page means Syntax error, did you mess around the Breeding files?
__________________


asp.net stole my soul.

Last edited by IntoRain; 09-02-2013 at 02:32 PM.
Reply With Quote
  #3  
Old 09-02-2013, 02:37 PM
RandomFrog RandomFrog is offline
Member
 
Join Date: Aug 2013
Posts: 13
Gender: Female
Credits: 1,448
RandomFrog is on a distinguished road
Default

I didn't mess with any files at all. Yes, system is enabled in value, so I dunno what happened.
Reply With Quote
  #4  
Old 09-02-2013, 02:57 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 20,971
IntoRain is on a distinguished road
Default

That's really weird. Do you have the Breeding.php file? Can you post the code here?
Even if it was disabled, the page would appear anyway with a different content

edit: Was it working when you installed? If so, maybe reinstalling would help
__________________


asp.net stole my soul.

Last edited by IntoRain; 09-02-2013 at 03:11 PM.
Reply With Quote
  #5  
Old 09-02-2013, 03:17 PM
RandomFrog RandomFrog is offline
Member
 
Join Date: Aug 2013
Posts: 13
Gender: Female
Credits: 1,448
RandomFrog is on a distinguished road
Default

Okay, here is the code:

PHP Code:
<?php

class BreedingController extends AppController{

    private 
$view;
    private 
$subController;

    public function 
__construct(){
        
parent::__construct("member");
        
$mysidia Registry::get("mysidia");        
        
$userStatus $mysidia->user->getstatus();
        if(
$userStatus->canbreed == "no") throw new NoPermissionException("It appears that you have been banned for breeding.");        
    }
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        
$settings = new BreedingSetting($mysidia->db);
        if(
$settings->system != "enabled") throw new InvalidActionException($mysidia->lang->system);
        
        if(
$mysidia->input->post("submit")){
            if(
$mysidia->input->post("female") == "none" or $mysidia->input->post("male") == "none"){
                  throw new 
InvalidIDException("You haven't selected a male or female adoptable.");
            }
            
            try{
                
$female = new OwnedAdoptable($mysidia->input->post("female"), $mysidia->user->username);
                
$male = new OwnedAdoptable($mysidia->input->post("male"), $mysidia->user->username);
                
$breeding = new Breeding($female$male$settings); 
                
$validator $breeding->getValidator("all");
                
$validator->validate();
            }
            catch(
AdoptNotfoundException $ane){
                throw new 
InvalidIDException("There is no adoptable that has that ID!");
            }
            catch(
BreedingException $bre){                
                
$status $bre->getmessage();
                
$validator->setStatus($status);
                throw new 
InvalidActionException($mysidia->lang->{$status});
            }
            
            if(
$settings->method == "advanced"$species $breeding->getBabySpecies();
            
$breeding->getBabyAdopts($species);
            
$breeding->breed($adopts);
            
$num $breeding->countOffsprings();

            if(
$num 0){
                
$document->setTitle("Breeding is Successful!");
                
$document->add(new Comment("Congratulations! Breeding is successful, you have acquired {$breeding->countOffsprings()} baby adoptables from the breeding center."));
                
$document->add(new Comment("Click on one of the links to see them!"));
                
$offsprings $breeding->getOffsprings();
                
$offspringID $mysidia->db->select("owned_adoptables", array("aid"), "1 ORDER BY aid DESC LIMIT 1")->fetchColumn() - $num 1;
                foreach(
$offsprings as $offspring){
                    
$image $offspring->getEggImage("gui");
                    
$link = new Link("myadopts/manage/{$offspringID}"$image);
                    
$document->add($link);
                    
$offspringID++;
                }
            }
            else{
                
$document->setTitle("Breeding has failed...");
                
$document->addLangvar(It did not workMaybe you can try again!");
            }            
            return;
        }
        
        
$document->setTitle($mysidia->lang->title);
        
$document->addLangvar($mysidia->lang->default.$mysidia->lang->money);
        
$document->addLangvar("{$settings->cost} {$mysidia->settings->cost}");
        
$document->addLangvar($mysidia->lang->warning.$mysidia->lang->select);
        
$breedingForm = new Form("breedingform", "breeding", "post");
        
$current = new DateTime;
        
$lasttime = $current->getTimestamp() - (($settings->interval) * 24 * 60 * 60);
        
        
$stmt = $mysidia->db->select("owned_adoptables", array("aid"), "owner '{$mysidia->user->username}' AND gender 'f' AND currentlevel >= {$settings->level} AND lastbred <= '{$lasttime}'");
        if(
$stmt->rowcount() == 0) $document->addLangvar($mysidia->lang->female);
        else{ 
            
$female = new DropdownList("female");
            
$femaleIDs = $stmt->fetchAll(PDO::FETCH_COLUMN);    
            
$femaleNames = $mysidia->db->select("owned_adoptables", array("name"), "owner '{$mysidia->user->username}' AND gender 'f' AND currentlevel >= {$settings->level} AND lastbred <= '{$lasttime}'")->fetchAll(PDO::FETCH_COLUMN);
            
$female->add(new Option("None Selected", "none"));
            
$female->fill($femaleNames$femaleIDs);
            
$breedingForm->add(new Comment("Female", FALSE));
            
$breedingForm->add($female);
        }    
  
        
$stmt = $mysidia->db->select("owned_adoptables", array(), "owner '{$mysidia->user->username}' AND gender 'm' AND currentlevel >= {$settings->level} AND lastbred <= '{$lasttime}'");
        if(
$stmt->rowcount() == 0) $document->addLangvar($mysidia->lang->male);
        else{
            
$male = new DropdownList("male");
            
$maleIDs = $stmt->fetchAll(PDO::FETCH_COLUMN);    
            
$maleNames = $mysidia->db->select("owned_adoptables", array("name"), "owner '{$mysidia->user->username}' AND gender 'm' AND currentlevel >= {$settings->level} AND lastbred <= '{$lasttime}'")->fetchAll(PDO::FETCH_COLUMN);
            
$male->add(new Option("None Selected", "none"));
            
$male->fill($maleNames$maleIDs);
            
$breedingForm->add(new Comment("Male", FALSE));
            
$breedingForm->add($male);
        }
        
        
$breedingForm->add(new PasswordField("hidden", "breed", "yes"));
        
$breedingForm->add(new Button("Let's breed!", "submit", "submit"));
        $document->add($breedingForm);    
    }
}
?>
It also WAS working when I installed it.
Reply With Quote
  #6  
Old 09-02-2013, 03:33 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 20,971
IntoRain is on a distinguished road
Default

This part:

else{
$document->setTitle("Breeding has failed...");
$document->addLangvar(It did not work. Maybe you can try again!");
}


addLangvar is missing a "
$document->addLangvar("It did not work. Maybe you can try again!");
__________________


asp.net stole my soul.
Reply With Quote
  #7  
Old 09-02-2013, 03:47 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: 493,888
Hall of Famer is on a distinguished road
Default

Well I am 100% sure you've modified the script at some point, 'cause this was what the line used to look like when you downloaded the files:

PHP Code:
$document->setTitle("Breeding has failed...");
$document->addLangvar("This is too bad. Breeding is attempted but none of the baby adoptables have survived."); 
Anyway just be careful next time, if you use an editor like notepad++ or an IDE like Netbeans, they should be able to tell you that you have messed up the syntax. A string needs to start and end with double/single quote, keep this in mind.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #8  
Old 09-02-2013, 10:35 PM
RandomFrog RandomFrog is offline
Member
 
Join Date: Aug 2013
Posts: 13
Gender: Female
Credits: 1,448
RandomFrog is on a distinguished road
Default

ahhh thank you so much! it works now.
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
Blank page with x10Hosting bisexuowl Questions and Supports 0 09-22-2015 10:42 PM
No errors, just a blank page? FounderSim Questions and Supports 5 10-04-2014 05:15 PM
Blank Inventory Page ilrak Questions and Supports 5 09-23-2014 10:03 PM
Blank Page Samuel hunter Questions and Supports 8 01-01-2013 05:08 PM
Blank page LilPixie Questions and Supports 2 02-20-2009 10:59 PM


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

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