Forums
This topic is locked
Keeping content at the bottom of the page.
Posted 01 Nov 2007 14:27:27
1
has voted
01 Nov 2007 14:27:27 Kieran Pearce posted:
I am teaching myself how to use dreamweaver at the moment and i was wondering if anyone could tell me how to force a layer to remain at the bottom of the page. I need to have some copyright information on everypage and having the information in a layer of its own is proving a problem on pages with a lot of content. If anybody knows of a setting or code to force this copyright to the bottom of the screen i would be very greatful.Many Thanks,
Kieran Pearce
ICT Techncian
Replies
Replied 01 Nov 2007 18:58:15
01 Nov 2007 18:58:15 john newsome replied:
This might help it places the copyright at the bottom of the window what ever the size
get_resolution.php
<pre id=code><font face=courier size=2 id=code> <?
/**************************************************************************************
Originally from www.phpbuddy.com/article.php?id=8
Author: Ranjit Kumar (Cheif Editor phpbuddy.com)
Modified by: Ying Zhang (Dodo) pure-essence.net
Two main modifications:
1. To check currently saved screen resolution cookie
2. To allow inclusion by other php files
In order to use this file in another php file, use:
$callget_res_page_name = $REQUEST_URI;
$GLOBALS[callget_res_page_name] = $callget_res_page_name;
include("get_resolution.php"
echo $screen_width." is your screen width and ".$screen_height." is your screen height.";
*****************************************************************************************/
?>
<script language="javascript">
<!--
function getHight(){
if (window.innerHeight) {
theHeight=window.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight) {
theHeight=document.documentElement.clientHeight;
}
else if (document.body) {
theHeight=document.body.clientHeight;
}
return theHeight;
}
function writeCookie()
{
var today = new Date();
var the_date = new Date("December 31, 2023"
var the_cookie_date = the_date.toGMTString();
var the_cookie = "users_res="+ screen.width +"x"+ getHight();
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie
if (document.cookie){
location = '<?=$GLOBALS[callget_res_page_name]?>';
}
}
function checkRes(width, height) {
if(width != screen.width || height != getHight()) {
writeCookie();
} else {
return true;
}
}
//-->
</script>
<?
if(isset($HTTP_COOKIE_VARS["users_res"])) {
$screen_res = $HTTP_COOKIE_VARS["users_res"];
$screen_res_tmp = explode("x", $screen_res);
$screen_width = $screen_res_tmp[0];
$screen_height = $screen_res_tmp[1];
?>
<script language="javascript">
<!--
checkRes(<?=$screen_width?>, <?=$screen_height?><img src=../images/fwzone/forum/icon_smile_wink.gif border=0 align=middle>;
//-->
</script>
<?
}
else //means cookie is not found set it using Javascript
{
?>
<script language="javascript">
<!--
writeCookie();
//-->
</script>
<?
}
?></font id=code></pre id=code>
HTML
<pre id=code><font face=courier size=2 id=code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Untitled Document</title>
<script language="Javascript">
var sURL = unescape(window.location.pathname);
function refresh()
{
window.location.href = sURL;
}
</script>
<?php
$callget_res_page_name = $REQUEST_URI;
$GLOBALS[callget_res_page_name] = $callget_res_page_name;
include("get_resolution.php"
?>
</head>
<body onResize="refresh()">
<div id="bottom" style="position:absolute; top:<?=$screen_height-20;?>px">© <></div>
</body>
</html> </font id=code></pre id=code>
get_resolution.php
<pre id=code><font face=courier size=2 id=code> <?
/**************************************************************************************
Originally from www.phpbuddy.com/article.php?id=8
Author: Ranjit Kumar (Cheif Editor phpbuddy.com)
Modified by: Ying Zhang (Dodo) pure-essence.net
Two main modifications:
1. To check currently saved screen resolution cookie
2. To allow inclusion by other php files
In order to use this file in another php file, use:
$callget_res_page_name = $REQUEST_URI;
$GLOBALS[callget_res_page_name] = $callget_res_page_name;
include("get_resolution.php"
echo $screen_width." is your screen width and ".$screen_height." is your screen height.";
*****************************************************************************************/
?>
<script language="javascript">
<!--
function getHight(){
if (window.innerHeight) {
theHeight=window.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight) {
theHeight=document.documentElement.clientHeight;
}
else if (document.body) {
theHeight=document.body.clientHeight;
}
return theHeight;
}
function writeCookie()
{
var today = new Date();
var the_date = new Date("December 31, 2023"
var the_cookie_date = the_date.toGMTString();
var the_cookie = "users_res="+ screen.width +"x"+ getHight();
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie
if (document.cookie){
location = '<?=$GLOBALS[callget_res_page_name]?>';
}
}
function checkRes(width, height) {
if(width != screen.width || height != getHight()) {
writeCookie();
} else {
return true;
}
}
//-->
</script>
<?
if(isset($HTTP_COOKIE_VARS["users_res"])) {
$screen_res = $HTTP_COOKIE_VARS["users_res"];
$screen_res_tmp = explode("x", $screen_res);
$screen_width = $screen_res_tmp[0];
$screen_height = $screen_res_tmp[1];
?>
<script language="javascript">
<!--
checkRes(<?=$screen_width?>, <?=$screen_height?><img src=../images/fwzone/forum/icon_smile_wink.gif border=0 align=middle>;
//-->
</script>
<?
}
else //means cookie is not found set it using Javascript
{
?>
<script language="javascript">
<!--
writeCookie();
//-->
</script>
<?
}
?></font id=code></pre id=code>
HTML
<pre id=code><font face=courier size=2 id=code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Untitled Document</title>
<script language="Javascript">
var sURL = unescape(window.location.pathname);
function refresh()
{
window.location.href = sURL;
}
</script>
<?php
$callget_res_page_name = $REQUEST_URI;
$GLOBALS[callget_res_page_name] = $callget_res_page_name;
include("get_resolution.php"
?>
</head>
<body onResize="refresh()">
<div id="bottom" style="position:absolute; top:<?=$screen_height-20;?>px">© <></div>
</body>
</html> </font id=code></pre id=code>
Replied 13 Nov 2007 17:55:33
13 Nov 2007 17:55:33 Kieran Pearce replied:
I tried using this code and apart from producing a layer with "©<>" nothing seemed to happen. Is there anything i need to do to the code to make this layer stay at the bottom of the screen?