PDA

View Full Version : [HELP] Expandable iFrames?



Meti
27-02-2008, 10:26 PM
Hello there,
I just wonder if someone knows the HTML code for the expandable iframe, or the scripts.. (i don't know what it is)
For ex; www.clubhabbo.net (http://www.clubhabbo.net) >> Their content box, it's small, but get's bigger..

PS: I don't mean the expandable content box

If you can help me, you'll get a +rep ;)

:eusa_whis

iUnknown
27-02-2008, 10:34 PM
The answer is more complicated than you think. You have to code a layout in a special way that allows the box(es) to expand, then add a special javascript code to make the iframe expand (if you add it without coding the layout correctly then the layout will just ruin when the iframe expands). Photoshop or anything like that won't code it correctly for expandables. I suggest CSS and DIVs, SS does a good tutorial which will help you get the hang of it here:

http://habboxforum.com/showthread.php?t=453923

Hope that helps.

php.net
27-02-2008, 10:39 PM
If you would search deep enough, you'd notice that there is a tutorial on the forum describing just this!

iUnknown
27-02-2008, 10:43 PM
If you would search deep enough, you'd notice that there is a tutorial on the forum describing just this!

As linked by me :rolleyes:

http://habboxforum.com/showthread.php?t=453923

Meti
27-02-2008, 10:54 PM
The answer is more complicated than you think. You have to code a layout in a special way that allows the box(es) to expand, then add a special javascript code to make the iframe expand (if you add it without coding the layout correctly then the layout will just ruin when the iframe expands). Photoshop or anything like that won't code it correctly for expandables. I suggest CSS and DIVs, SS does a good tutorial which will help you get the hang of it here:

http://habboxforum.com/showthread.php?t=453923

Hope that helps.
Hello,
My layout is coded in div's, and it's expandable.. Where can i find the IFRAME that expands now? Because normal IFRAMES usually just scrolls.

Thanks,

php.net
27-02-2008, 11:02 PM
As linked by me :rolleyes:

http://habboxforum.com/showthread.php?t=453923

Wrong.

Edited by LucasAge (Forum Super Moderator): Please do not post pointlessly.

RedCrisps
27-02-2008, 11:21 PM
just rip there code. its not like they own it. DynamicDrive.com does. they just removed the copyright notice

Agnostic Bear
28-02-2008, 06:29 AM
just rip there code. its not like they own it. DynamicDrive.com does. they just removed the copyright notice

Quoted for truth. I remember putting it in on ch and either being told to remove it or someone else did, not too sure on that.

Meti
28-02-2008, 04:56 PM
But how should i know which code it is? :S

php.net
28-02-2008, 05:02 PM
I shouldn't do this, as if you are wanting to create a website, you should know how to.

To hell, here it is.

Javascript code:

// Expandable Iframe script from DynamicDrive.

var iframeids=["content"]
var iframehide="yes"
var getFFVersion=navigator.userAgent.substring(navigat or.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 47 : 0
/*
Internet explorer seems to think it can make it's own rules about the internet.
*/
function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextr aHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

iFrame code:

<iframe src="PAGE HERE.php" width="100%" id="content" marginwidth="1" marginheight="1" name="content" scrolling="no" border="0" frameborder="0" allowtransparency="yes"></iframe>

Meti
28-02-2008, 05:06 PM
@ php.net
- I don't use PHP.. Can i just make a site with .htm? And insert the codes..?
Will anything change if i do that, or?

THANKS, I would love to +rep you.. But you're Cautioned, so i can't..

php.net
28-02-2008, 05:15 PM
Yeah, it doesn't have to be .php, I just usually save my HTML documents as .php if I'm logging anything. Must be a habit putting in .php!

Meti
28-02-2008, 05:18 PM
@ php.net
- Ok :D

*Off topic* - Do you have a script/code that sends the IP number of someone, when they contact you? Like IP script.. ex. like clubhabbo.net > Contact Form, "You're IP Number Will Be Sent With This Form"

Rockstar
28-02-2008, 05:24 PM
@ php.net
- Ok :D

*Off topic* - Do you have a script/code that sends the IP number of someone, when they contact you? Like IP script.. ex. like clubhabbo.net > Contact Form, "You're IP Number Will Be Sent With This Form"

Thats in their Panels eg Admins in DJ Panel can send alerts I think housekeeping has it www.habboring.com

Meti
28-02-2008, 05:33 PM
But i had a html code before, that showed people's IP number, when they contact me through me fansite.. But i can't find it anymore.

iUnknown
28-02-2008, 05:50 PM
If the form is being sent by e-mail, put this bit of code in:



<?
if($_SERVER['REQUEST_METHOD'] != "GET")
{
$ip = $_SERVER['REMOTE_ADDR'];
//Turns the IP to a variable.
}

$msg = "
Their IP Address:
$ip
";
// Sends the IP as a variable in the message.
?>
If you need help with making the actual form PHP then let me know.

php.net
28-02-2008, 05:53 PM
Thats in their Panels eg Admins in DJ Panel can send alerts I think housekeeping has it www.habboring.com (http://www.habboring.com)

You're on the wrong track.

Big-Muscle, a brilliant one has been written by Jamie Cassedy (not sure on his HxF forum username). ClubHabbo use this one too.

http://www.clubhabboforum.net/showthread.php?t=55921

Meti
28-02-2008, 06:51 PM
If the form is being sent by e-mail, put this bit of code in:



<?
if($_SERVER['REQUEST_METHOD'] != "GET")
{
$ip = $_SERVER['REMOTE_ADDR'];
//Turns the IP to a variable.
}

$msg = "
Their IP Address:
$ip
";
// Sends the IP as a variable in the message.
?>
If you need help with making the actual form PHP then let me know.
Sorry, but i want people to see their IP number too.. Like, your IP Number is: 207.0.0.1 or something-..
But it should come on the mail too.

iUnknown
28-02-2008, 06:55 PM
Sure, make the page they are viewing .php and put this code where you want their IP to show:



<?
// Below line will get the IP address from their browser
$ip = getenv("REMOTE_ADDR") ;
echo "Your IP was logged for security:" . $ip;
?>



If that doesn't work let me know - but it should.

Invent
28-02-2008, 06:56 PM
At above, never use php shortags unless the coding's for your own server.

Meti
28-02-2008, 07:02 PM
What do you mean with that, Invent?

And.. Thanks - Guy (iUnknown)

iUnknown
28-02-2008, 07:08 PM
At above, never use php shortags unless the coding's for your own server.

Thanks for the tip.


What do you mean with that, Invent?

And.. Thanks - Guy (iUnknown)

I think it's just a tip in style, but I know with old PHP versions using <? instead of <?php would result in it not working.

php.net
28-02-2008, 07:53 PM
Thanks for the tip.



I think it's just a tip in style, but I know with old PHP versions using <? instead of <?php would result in it not working.

It's not a 'tip in style'.

Ivake
28-02-2008, 08:08 PM
Quoted for truth above.

Meti
29-02-2008, 11:21 AM
Anyone got a working one, which shows their IP Number, when they go on the contact page?

Want to hide these adverts? Register an account for free!