www.webdeveloper.com
Results 1 to 10 of 10

Thread: Simple i-frame not showing up correctly

  1. #1
    Join Date
    May 2014
    Posts
    4

    Simple i-frame not showing up correctly

    Hey there. Can someone help me place this i-frame in the photos.html page correctly? I am wanting the i-frame pics to show up right underneath the pictures already there. Any help would be greatly appreciated.

    Here is the website page - http://thezobrists.com/photos.html


    here is the i-frame -

    Code:
    <iframe src="http://snapwidget.com/in/?u=dGhlem9icmlzdHN8aW58MTI1fDR8MTR8fHllc3w1fGZhZGVPdXR8b25TdGFydHx5ZXM=&v=25514" title="Instagram Widget" allowTransparency="true" frameborder="0" scrolling="no" style="border:none; overflow:hidden; width:560px; height:1960px"></iframe>
    Here is the photos.html code:

    Code:
    <? 
    $page = "Photos";
    $stylesheet = array("photos");
    
    require realpath($_SERVER['DOCUMENT_ROOT'].'/incs/header.php');
    
    
    
    $album=$_GET['album'];
    $ref=$_SERVER["PHP_SELF"];
    $imgDir=realpath($_SERVER['DOCUMENT_ROOT'].'/images/gallery/photos/');
    
    $bkLnk="<a href='/photos.html' class='back'>Back to Albums</a>\n";
    
    
    if(!$album){
    	echo "<h2>Photos</h2>";
    	$g=new gallery('album','album','clear','');
    		$dirArray=$g->scanThis($imgDir);
    		$len=count($dirArray);
    		for($i=0;$i<$len;$i++){$g->album($ref,$imgDir,$dirArray[$i]);}
    	$g->draw();
    
    }else{
    	$albumDir=$imgDir."/".$album;
    	echo($bkLnk);
    	$g=new gallery('album','photos','clear','pp[1]');
    		echo "<h3>".$g->addSpaces($album)."</h3>\n".
    			"<div class='clear'></div>";
    		$imgArray=$g->scanThis($albumDir);
    		$len=count($imgArray);
    		for($i=0;$i<$len;$i++){$g->photo($albumDir,$imgArray[$i]);}
    	$g->draw();
    	echo($bkLnk);
    	
    
    
    }
    
    
    require realpath($_SERVER['DOCUMENT_ROOT'].'/incs/footer.php'); ?>

  2. #2
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    1,843
    The iframe should be placed inside div#album (e.g. <div id='album'></div>) I think...
    Also, you have a LOT of markup errors that you should fix. http://validator.w3.org/check?uri=ht...Inline&group=0
    Last edited by ShrineDesigns; 05-25-2014 at 04:00 PM.

  3. #3
    Join Date
    May 2014
    Posts
    4
    thanks for responding. i'm not really a coder, just know how to edit kinda.

    so like this?

    <div id='album'><iframe src="http://snapwidget.com/in/?u=dGhlem9icmlzdHN8aW58MTI1fDR8MTR8fHllc3w1fGZhZGVPdXR8b25TdGFydHx5ZXM=&v=25514" title="Instagram Widget" allowTransparency="true" frameborder="0" scrolling="no" style="border:none; overflow:hidden; width:560px; height:1960px"></iframe></div>

    but where in that photos.html code would I put it?

  4. #4
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    1,843
    The XHTML 1.0 DTD does not support iframe elements. use
    Code:
    <object data="http://snapwidget.com/in/?u=dGhlem9icmlzdHN8aW58MTI1fDR8MTR8fHllc3w1fGZhZGVPdXR8b25TdGFydHx5ZXM=&amp;v=25514" codetype="text/html" style="border:none; width:560px; height:1960px"></object>
    You will need to copy and paste the iframe INTO the div#album. You want it AFTER the existing images so you will need to place it before the </div> for <div id='album'>.
    Last edited by ShrineDesigns; 05-25-2014 at 05:21 PM.

  5. #5
    Join Date
    May 2014
    Posts
    1,026
    This is 2014, why are you trying to use a tag that was deprecated 15 years ago? I know, I know... it's some crappy poorly written plugin for yet another social site I've never heard of and would never use...

    That said, are you sure PHP has shorttags enabled so that <? is actually doing something? You might want to get extra parenthesis on that require since PHP 4/earlier style use of functions is soon to be deprecated... if you stopped using double quotes for PHP strings they'd execute faster and you wouldn't have your quotes backwards in your output... Why are you using clearing DIV like it's still 2001? Why are you declaring style in the markup? Why do you seem to think you need an extra DIV around the iFrame when it's a perfectly good block level container unto itself?
    Java is to JavaScript as Ham is to Hamburger.

  6. #6
    Join Date
    May 2014
    Posts
    4
    Quote Originally Posted by deathshadow View Post
    This is 2014, why are you trying to use a tag that was deprecated 15 years ago? I know, I know... it's some crappy poorly written plugin for yet another social site I've never heard of and would never use...

    That said, are you sure PHP has shorttags enabled so that <? is actually doing something? You might want to get extra parenthesis on that require since PHP 4/earlier style use of functions is soon to be deprecated... if you stopped using double quotes for PHP strings they'd execute faster and you wouldn't have your quotes backwards in your output... Why are you using clearing DIV like it's still 2001? Why are you declaring style in the markup? Why do you seem to think you need an extra DIV around the iFrame when it's a perfectly good block level container unto itself?

    lol. no idea what you're asking. I didn't build the site, just trying to edit it.

  7. #7
    Join Date
    May 2014
    Posts
    1,026
    Quote Originally Posted by imbondz View Post
    lol. no idea what you're asking. I didn't build the site, just trying to edit it.
    Is that ALL you are asking? If so nobody here grasped your question.

    Right before:

    require realpath($_SERVER['DOCUMENT_ROOT'].'/incs/footer.php'); ?>

    Insert:

    Code:
    ?>
    
    <iframe src="http://snapwidget.com/in/?u=dGhlem9icmlzdHN8aW58MTI1fDR8MTR8fHllc3w1fGZhZGVPdXR8b25TdGFydHx5ZXM=&v=25514" title="Instagram Widget" allowTransparency="true" frameborder="0" scrolling="no" style="border:none; overflow:hidden; width:560px; height:1960px"></iframe>
    
    <?php
    OR:

    Code:
    echo '<iframe src="http://snapwidget.com/in/?u=dGhlem9icmlzdHN8aW58MTI1fDR8MTR8fHllc3w1fGZhZGVPdXR8b25TdGFydHx5ZXM=&v=25514" title="Instagram Widget" allowTransparency="true" frameborder="0" scrolling="no" style="border:none; overflow:hidden; width:560px; height:1960px"></iframe>';
    So that iframe is output in the code at that point. Either of the above code-blocks will work if inserted right before that 'require realpath' line.

    Your question was so simple, nobody thought it was the question.
    Java is to JavaScript as Ham is to Hamburger.

  8. #8
    Join Date
    May 2014
    Posts
    4
    yep, that's all I was asking. Many thanks!

  9. #9
    Join Date
    May 2014
    Posts
    3
    I have the same issue as well

  10. #10
    Join Date
    May 2014
    Posts
    3
    Problem solve is to uncheck "Enable third-Party browser extensions

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles