Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
nemesis25gr
New Member
New Member


Joined: Mar 08, 2008
Posts: 2

PostPosted: Sat Mar 08, 2008 6:39 am Reply with quote

Hello from Greece!

I have read the "how to..." articles and some posts about how to insert a javascript into php-nuke block!

But i have problems ladies...
iam not expert in php nuke... iam newbie

in html its working but i cant put it in the block
i have put before every line the $content .= and i have change the "
in the javascript but something i make wrong
sorry about my language!!!

Something is going wrong here is my java s cript:

$content .= "<table border=\"1\" width=\"100\" cellspacing=\"0\" cellpadding=\"3\">\n";
$content .= "<form name=\"where\">\n";
$content .= " <tr>\n";
$content .= " <td width=\"100%\">\n";
$content .= "<select name=\"city\" size=\"1\" onChange=\"updateclock(this);\">\n";
$content .= "<option value=\"\" selected>Local time</option>\n";
$content .= "<option value=\"0\">London GMT</option>\n";
$content .= "<option value=\"1\">Rome</option>\n";
$content .= "<option value=\"7\">Bangkok</option>\n";
$content .= "<option value=\"8\">Hong Kong</option>\n";
$content .= "<option value=\"9\">Tokyo</option>\n";
$content .= "<option value=\"10\">Sydney</option>\n";
$content .= "<option value=\"12\">Fiji</option>\n";
$content .= "<option value=\"-10\">Hawaii</option>\n";
$content .= "<option value=\"-8\">San Francisco</option>\n";
$content .= "<option value=\"-5\">New York</option>\n";
$content .= "<option value=\"-3\">Buenos Aires</option>\n";
$content .= "</select>\n";

$content .= "</td>\n";
$content .= " </tr>\n";
$content .= " <tr>\n";
$content .= " <td width=\"100%\">\n";



(the original javascript code without my changes)

<s cript language="JavaS cript">

if (document.all||document.getElementById)
document.write('<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
//-->
</s cript>

$content .= "&nbsp;</td>\n";
$content .= "</form>\n";
$content .= "</tr>\n";
$content .= "</table>\n";


Last edited by nemesis25gr on Sat Mar 08, 2008 2:52 pm; edited 1 time in total 
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Sat Mar 08, 2008 11:06 am Reply with quote

If all you have is static html and javascript, you can make a file block like this:

Code:


<?php

if ( !defined('BLOCK_FILE') ) {
    Header('Location: ../index.php');
    die();
}

$content = <<<END_CONTENT

(put all your HTML and javascript here)

END_CONTENT;

?>


name it block-Something.php and upload to your blocks directory. Activate it in the admin control panel.

_________________
Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module 
View user's profile Send private message
nemesis25gr
PostPosted: Sat Mar 08, 2008 2:52 pm Reply with quote

Thank you!!!!
ITS WORKING!!!

Will you marry me??? lol Wave
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9453
Location: Arizona

PostPosted: Sat Mar 08, 2008 3:13 pm Reply with quote

oh my... now Gremmie is getting marriage proposals on the net... what will we see next? Laughing

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

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 ©