Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Other
Author Message
hicuxunicorniobestbuildpc
Life Cycles Becoming CPU Cycles


Joined: Aug 13, 2009
Posts: 967
Location: Netherland

PostPosted: Tue Nov 04, 2014 4:15 am Reply with quote

Actually I couldn't find any example on internet about this old tag. I do know it has to be with CSS but I don't know how. I am trying to fix this line:

Code:
$content.='<ilayer id="worldclockns" width="100%" height="35"><layer id="worldclockns2" width="100%" height="35" left="0" top="0" style="font:bold 12px Arial;"></ilayer></layer></td>';


If it is possible to use it without css it will be ok.
 
View user's profile Send private message Visit poster's website
neralex
The Mouse Is Extension Of Arm


Joined: Aug 22, 2007
Posts: 1318
Location: Germany

PostPosted: Tue Nov 04, 2014 7:04 am Reply with quote

position:absolute ?
 
View user's profile Send private message
djmaze
Subject Matter Expert


Joined: May 15, 2004
Posts: 719
Location: http://tinyurl.com/5z8dmv

PostPosted: Tue Nov 04, 2014 8:08 am Reply with quote

<div id="worldclockns2" style="height:35px; font:bold 12px Arial">
 
View user's profile Send private message Visit poster's website
hicuxunicorniobestbuildpc
PostPosted: Tue Nov 04, 2014 10:29 am Reply with quote

None of that is helping to get rid of that. Incredible!

Code:
Error: line 1275 column 10 - Warning: <ilayer> is not approved by W3C

line 1275 column 10 - Warning: missing </ilayer> before <div>
line 1275 column 123 - Warning: inserting implicit <ilayer>
line 1275 column 129 - Warning: discarding unexpected </ilayer>
line 1275 column 123 - Warning: <ilayer> anchor "worldclockns" already defined




This is the simple block is able to show local time and some other countries time.

Code:
<?php


if (!defined('BLOCK_FILE')) {Header('Location: ../index.php');  die();}
if (!defined('PHP_EOL')) define('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");

global $prefix, $db;

$content.='<table border="0" cellspacing="0" cellpadding="0" align="center" width="100%"><tr>' . PHP_EOL;
$content.='<td width="100%"><table border="0" cellspacing="0" cellpadding="2" align="center"><tr>' . PHP_EOL;
$content .= '<td><select name="city" size="1" onchange="updateclock(this);">' . PHP_EOL
          . '<option value="" selected>Local time</option>' . PHP_EOL
          . '<option value="0">London GMT</option>' . PHP_EOL
          . '<option value="1">Rome</option>' . PHP_EOL
          . '<option value="7">Bangkok</option>' . PHP_EOL
          . '<option value="8">Hong Kong</option>' . PHP_EOL
          . '<option value="9">Tokyo</option> ' . PHP_EOL
          . '<option value="10">Sydney</option>' . PHP_EOL
          . '<option value="12">Fiji</option>' . PHP_EOL
          . '<option value="-10">Hawaii</option>' . PHP_EOL
          . '<option value="-8">San Francisco</option>' . PHP_EOL
          . '<option value="-5">New York</option>' . PHP_EOL
          . '<option value="-3">Buenos Aires</option></select></td>' . PHP_EOL;
$content.='</tr><tr><td width="100%" align="center">' . PHP_EOL;
$content.="<script type=\"text/javascript\">
if (document.all||document.getElementById)
document.write('<img height=16 src=\"images/time.gif\" alt=\"\" width=16>&nbsp;&nbsp;&nbsp;<span id=\"worldclock\" style=\"font:bold 12px Arial;\"><\/span><br>')
zone=0;
isitlocal=true;
ampm='';
function updateclock(z){
zone=z.options[z.selectedIndex].value;
isitlocal=(z.options[0].selected)?true:false;
}
function WorldClock(){
now=new Date();
ofst=now.getTimezoneOffset()/60;
secs=now.getSeconds();
sec=-1.57+Math.PI*secs/30;
mins=now.getMinutes();
min=-1.57+Math.PI*mins/30;
hr=(isitlocal)?now.getHours():(now.getHours() + parseInt(ofst)) + parseInt(zone);
hrs=-1.575+Math.PI*hr/6+Math.PI*parseInt(now.getMinutes())/360;
if (hr < 0) hr+=24;
if (hr > 23) hr-=24;
ampm = (hr > 11)?\"PM\":\"AM\";
statusampm = ampm.toLowerCase();
hr2 = hr;
if (hr2 == 0) hr2=12;
(hr2 < 13)?hr2:hr2 %= 12;
if (hr2<10) hr2=\"0\"+hr2
var finaltime=hr2+':'+((mins < 10)?\"0\"+mins:mins)+':'+((secs < 10)?\"0\"+secs:secs)+' '+statusampm;
if (document.all)
worldclock.innerHTML=finaltime
else if (document.getElementById)
document.getElementById(\"worldclock\").innerHTML=finaltime
else if (document.layers){
document.worldclockns.document.worldclockns2.document.write(finaltime)
document.worldclockns.document.worldclockns2.document.close()
}
setTimeout('WorldClock()',1000);
}
window.onload=WorldClock
//-->
</script>";
$content.='<ilayer id="worldclockns" width=100% height=35><div id="worldclockns2" style="height:35px; font:bold 12px Arial"></div></ilayer></td>';
$content.='</tr></table></td></tr></table>';
 
neralex
PostPosted: Tue Nov 04, 2014 3:43 pm Reply with quote

Hicux, sometimes i believe really you have lost all your clear moments without a chance to get a hope for better times. Every time you're your solution so near and then you ruin it for yourself again.

1. If you know that the both tags are outdated why you are trying to use it instead to remove it completely?

2. You know that table-in-table constructions like this are totally unnecessary for simple select-options and a id-based replacement. Why you are using it instead to reduce it to minimum like one or two div containers?

You should really go deeper in yourself, re-read the codelines and the error-messages. Maybe you should use a search engine to understand it that the error returns. And if all will not help and someone serve it for you on a silver tablet like djmaze it does, so you should start at the point again with the deeper thinking, compare it again and with a little bit of luck you should find your solution in your own question.
 
hicuxunicorniobestbuildpc
PostPosted: Tue Nov 04, 2014 5:40 pm Reply with quote

Thanks neralex and djmaze: I figured it out myself. It is working fine now. Very Happy I guess I had a problem with cache. So for other people if u have ilayer or layer u should replace them with div and use some CSS. This website help me to understand more:
Only registered users can see links on this board! Get registered or login!



Code:
<?php


if (!defined('BLOCK_FILE')) {Header('Location: ../index.php');  die();}
if (!defined('PHP_EOL')) define('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");

global $prefix, $db;

$content.='<table border="0" cellspacing="0" cellpadding="0" align="center" width="100%"><tr>' . PHP_EOL;
$content.='<td width="100%"><table border="0" cellspacing="0" cellpadding="2" align="center"><tr>' . PHP_EOL;
$content .= '<td><select name="city" size="1" onchange="updateclock(this);">' . PHP_EOL
          . '<option value="" selected>Local time</option>' . PHP_EOL
          . '<option value="0">London GMT</option>' . PHP_EOL
          . '<option value="1">Rome</option>' . PHP_EOL
          . '<option value="7">Bangkok</option>' . PHP_EOL
          . '<option value="8">Hong Kong</option>' . PHP_EOL
          . '<option value="9">Tokyo</option> ' . PHP_EOL
          . '<option value="10">Sydney</option>' . PHP_EOL
          . '<option value="12">Fiji</option>' . PHP_EOL
          . '<option value="-10">Hawaii</option>' . PHP_EOL
          . '<option value="-8">San Francisco</option>' . PHP_EOL
          . '<option value="-5">New York</option>' . PHP_EOL
          . '<option value="-3">Buenos Aires</option></select></td>' . PHP_EOL;
$content.='</tr><tr><td width="100%" align="center">' . PHP_EOL;
$content.="<script type=\"text/javascript\">
if (document.all||document.getElementById)
document.write('<img height=16 src=\"images/time.gif\" alt=\"\" width=16>&nbsp;&nbsp;&nbsp;<span id=\"worldclock\" style=\"font:bold 12px Arial;\"><\/span><br>')
zone=0;
isitlocal=true;
ampm='';
function updateclock(z){
zone=z.options[z.selectedIndex].value;
isitlocal=(z.options[0].selected)?true:false;
}
function WorldClock(){
now=new Date();
ofst=now.getTimezoneOffset()/60;
secs=now.getSeconds();
sec=-1.57+Math.PI*secs/30;
mins=now.getMinutes();
min=-1.57+Math.PI*mins/30;
hr=(isitlocal)?now.getHours():(now.getHours() + parseInt(ofst)) + parseInt(zone);
hrs=-1.575+Math.PI*hr/6+Math.PI*parseInt(now.getMinutes())/360;
if (hr < 0) hr+=24;
if (hr > 23) hr-=24;
ampm = (hr > 11)?\"PM\":\"AM\";
statusampm = ampm.toLowerCase();
hr2 = hr;
if (hr2 == 0) hr2=12;
(hr2 < 13)?hr2:hr2 %= 12;
if (hr2<10) hr2=\"0\"+hr2
var finaltime=hr2+':'+((mins < 10)?\"0\"+mins:mins)+':'+((secs < 10)?\"0\"+secs:secs)+' '+statusampm;
if (document.all)
worldclock.innerHTML=finaltime
else if (document.getElementById)
document.getElementById(\"worldclock\").innerHTML=finaltime
else if (document.layers){
document.worldclockns.document.worldclockns2.document.write(finaltime)
document.worldclockns.document.worldclockns2.document.close()
}
setTimeout('WorldClock()',1000);
}
window.onload=WorldClock
//-->
</script>";
$content.='<div class="layer-name" id="worldclockns" style="width:100%; height:35px;"><div class="layer-name" id="worldclockns2" style="height:35px; font:bold 12px Arial"></div></div>' . PHP_EOL;
$content.='</tr></table></td></tr></table>' . PHP_EOL;


This question is for you only neralex. Is it possible to use ' . PHP_EOL; in the whole script? I tried to do it but I guess it was too much and I brought everything back again. Maybe a little help from you I will get it done. lol
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Other

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©