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 06-17-2014, 09:16 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,011
Hwona is on a distinguished road
Default Making Link Pop up in Iframe?

Hello everyone, I've been trying to get the links of daycare pets to pop up in an iframe on the page when clicked, but I can't seem to find a way to link the php link to a target and when I try to use a html like and replace the id with a variable, the page pops up blank.
Here's the code for the daycare function(v.1.3.3):
PHP Code:
    public function daycare(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        
$document->setTitle($mysidia->lang->daycare_title);
        
$document->addLangvar($mysidia->lang->daycareTRUE);
        
        try{
            
$daycare = new Daycare;
            
$adopts $daycare->getAdopts();
        }
        catch(
DaycareException $dae){
            
$message $dae->getmessage();
            
$document->addLangvar($mysidia->lang->{$message});
            return;
        }
        
        
$daycareTable = new Table("daycare"""FALSE);
        
$daycareTable->setBordered(FALSE);
        
$total $daycare->getTotalAdopts();
        
$index 0;

        for(
$row 0$row $daycare->getTotalRows(); $row++){
            
$daycareRow = new TRow("row{$row}");
            for(
$column 0$column $daycare->getTotalColumns(); $column++){
                
$adopt = new OwnedAdoptable($adopts[$index]);
             
$image = new Link("levelup/click/{$adopt->getAdoptID()}"$adopt->getImage("gui"), TRUE);
                
$stats = new Comment($daycare->getStats($adopt));
                
$daycareCell = new TCell(new ArrayObject(array($image)), "cell{$index}");
                
$message1 "<iframe name='iframe1' src='levelup/click/{$adopt->getAdoptID()}'></iframe>";
                
$daycareCell->setAlign(new Align("center""center"));
                
$daycareRow->add($daycareCell);
                
$index++;
                if(
$index == $total) break;
            }
            
$daycareTable->add($daycareRow);            
        }
        
        
$document->add($daycareTable);
        
$document->addLangvar($message1);
        if(
$pagination $daycare->getPagination()) $document->addLangvar($pagination->showPage());
    }

Thanks! :D
__________________
Reply With Quote
  #2  
Old 06-18-2014, 04:44 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: 344,402
Hall of Famer is on a distinguished road
Default

Have you played with the IFrame class/object? It may do the trick.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 06-18-2014, 08:20 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,011
Hwona is on a distinguished road
Default

Mmm, I tried that, but I don't think I'm using it correctly since it always returns "this is the Iframe class" instead of an iframe... this is used to build an iframe right?
I tried changing the code to this:
PHP Code:
 for($column 0$column $daycare->getTotalColumns(); $column++){
             
$target "iframe";
                
$adopt = new OwnedAdoptable($adopts[$index]);
             
$image = new Link("levelup/click/{$adopt->getAdoptID()}"$adopt->getImage("gui"), TRUE);
             
$image->setTarget($target);
                
$stats = new Comment($daycare->getStats($adopt));
                
$daycareCell = new TCell(new ArrayObject(array($image)), "cell{$index}");
                
$message1 "<iframe name='{$target}' src='levelup/click/{$adopt->getAdoptID()}'></iframe>";
                
$daycareCell->setAlign(new Align("center""center"));
                
$daycareRow->add($daycareCell);
                
$index++;
                if(
$index == $total) break; 
This shows on the page: Welcome to Daycare Center, here you can help with the growth of these cute baby adoptables.
The link target is invalid...
I also tried this and go the same message:
PHP Code:
 for($column 0$column $daycare->getTotalColumns(); $column++){
                
$adopt = new OwnedAdoptable($adopts[$index]);
             
$image = new Link("levelup/click/{$adopt->getAdoptID()}"$adopt->getImage("gui"), TRUE);
             
                
$stats = new Comment($daycare->getStats($adopt));
                
$daycareCell = new TCell(new ArrayObject(array($image)), "cell{$index}");
                
$iframe = new IFrame($name "iframe"$src "levelup/click/{$adopt->getAdoptID()}"$width ""$height ""$event "");
                
$image->setTarget($name);
                
$daycareCell->setAlign(new Align("center""center"));
                
$daycareRow->add($daycareCell);
                
$index++;
                if(
$index == $total) break;
            }
            
$daycareTable->add($daycareRow);            
        } 
__________________

Last edited by Hwona; 06-18-2014 at 11:30 AM.
Reply With Quote
  #4  
Old 06-19-2014, 03:45 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,011
Hwona is on a distinguished road
Default

Am I using the target function correctly on the second code? I have no clue... XP
__________________
Reply With Quote
  #5  
Old 06-20-2014, 10:01 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,425
IntoRain is on a distinguished road
Default

What you want to do is direct each adoptable link to the same Iframe, not create an Iframe for each adoptable.

Inside the for cycle, you just need to add that target to the link, and don't forget to put a / before levelup ( like /levelup/click/{$adopt->getAdoptID())

Outside the cycle, for example, you add the iframe, it can have an empty source

$document->add($daycareTable);
$document->add(new Comment("<iframe name='iframe' src=''></iframe>"));
__________________


asp.net stole my soul.
Reply With Quote
  #6  
Old 06-21-2014, 11:02 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,011
Hwona is on a distinguished road
Default Re

Thank you! Actually, my problem is targetting... I don't know how to set the target to the iframe, the page gives me and error...
__________________
Reply With Quote
  #7  
Old 06-22-2014, 08:14 AM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,425
IntoRain is on a distinguished road
Default

Setting the target to the iframe is putting a target='iframe_name' in your links. Does the setTarget you use exist? Since this is 1.3.3 I can't really test it x.x But in 1.3.4, instead of using the Link object I used HTML in a Comment object. Not sure if this would work in 1.3.3

PHP Code:
for($row 0$row $daycare->getTotalRows(); $row++){
            
$daycareRow = new TRow("row{$row}");
            for(
$column 0$column $daycare->getTotalColumns(); $column++){
                
$adopt = new OwnedAdoptable($adopts[$index]);
                
$cell = new ArrayList;
                
$cell->add(new Comment("<a href='/levelup/click/{$adopt->getAdoptID()}' target='iframe'><img src='{$adopt->getImage()}'></a>"));
                
$cell->add(new Comment($daycare->getStats($adopt)));
                
$daycareCell = new TCell($cell"cell{$index}");
                
$daycareCell->setAlign(new Align("center""center"));
                
$daycareRow->add($daycareCell);
                
$index++;
                if(
$index == $total) break;
            }
            
$daycareTable->add($daycareRow);            
        }
        
        
$document->add($daycareTable);
        
$document->add(new Comment("<iframe name='iframe' src=''></iframe>")); 
__________________


asp.net stole my soul.
Reply With Quote
  #8  
Old 06-22-2014, 09:58 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,011
Hwona is on a distinguished road
Default

I actually tried something similar, but the page would break before. XP
Now, the page shows up with this message:

Welcome to Daycare Center, here you can help with the growth of these cute baby adoptables.
Fatal Error: Class ArrayList either does not exist, or has its include path misconfigured!
__________________
Reply With Quote
  #9  
Old 06-27-2014, 10:52 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,011
Hwona is on a distinguished road
Default

Is there such a function in v.1.3.3? Would you mind telling me where to find it to check if it's there?(class page) :3
__________________
Reply With Quote
  #10  
Old 06-28-2014, 09:11 AM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,425
IntoRain is on a distinguished road
Default

Probably ArrayLists don't exist in that version. Maybe turning the image variable into a Comment object (similar to the Comment I use in my code) instead of a Link object?
__________________


asp.net stole my soul.
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
Link Dots voni Questions and Supports 6 05-13-2014 10:20 AM
Link MaximumRide Questions and Supports 6 04-23-2012 04:52 PM
how change this link ? :( kratosvr Questions and Supports 5 08-24-2011 09:09 AM
PHP in a link? Saphira Questions and Supports 9 01-31-2009 11:30 AM
Forums Link Ashje Questions and Supports 2 01-24-2009 12:28 AM


All times are GMT -5. The time now is 09:11 AM.

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