You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 64 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Javascript in a block [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Dauthus
Sergeant
Sergeant


Joined: Feb 12, 2003
Posts: 82

Location: USA

PostPosted: Sat May 31, 2003 8:48 pm Reply with quoteBack to top

I have read about 20 posts and answers on this, but for some reason I can't seem to add this javascript into a block. Here is the code I am using:

Code:
$content = <<< _HTMLCODE_

<script src='http://voap.weather.com/weather/oap/62966?template=GENXV&par=1002610984&unit=0&key=004e1ac7cecedbc08164cf593611278a                '></script>

_HTMLCODE_;


What am I missing here? Do I need to add anything else to the block? Just want to show the weather for my area in a block. Don't want to call on any module or anything else.

Whoa...got a chick avatar? What's up with that?

Thanks in advance
Find all posts by DauthusView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Sat May 31, 2003 8:51 pm Reply with quoteBack to top

You have a space after the _HTMLCODE_. That is expressedly forbidden and I emphasize that in my posts. Remove the space and only have a carriage return. Then it should work Wink

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Dauthus
Sergeant
Sergeant


Joined: Feb 12, 2003
Posts: 82

Location: USA

PostPosted: Sat May 31, 2003 9:08 pm Reply with quoteBack to top

Thank you Raven!

Although the code didn't work just by going to the add a new block section in the admin and pasting it there, it did work with me opening up the sample block and adding the code there.

I just uploaded that block to my server changing the name to "block_localweather.php" and Shazam! it works perfectly.

Thanks again.

Now, how about a real challange. Care to try with multiple scripts? Look at the next post.

Gotta get rid of this chick avatar.....
Find all posts by DauthusView user's profileSend private messageVisit poster's website
Dauthus
Sergeant
Sergeant


Joined: Feb 12, 2003
Posts: 82

Location: USA

PostPosted: Sat May 31, 2003 9:15 pm Reply with quoteBack to top

Think I can eventually get this in a block or maybe in the content section?



Code:
  <!-- Start Of Moreover.com News Javascript Code -->
 
   <style type='text/css'>
   
   .morehl {
      font-family: Verdana,Gevena,Arial,sans-serif !important;
      font-size: 11px !important;
      color: #003399 !important;
      font-weight: bold !important;
      font-style: normal !important;
      text-decoration: underline !important;
   }   
   
   A:link.morehl, A:vlink.morehl, A:alink.morehl {
      color: #003399 !important;
   }
   
   .moresrc {
      font-family: Verdana,Gevena,Arial,sans-serif !important;
      font-size: 9px !important;
      color: #6699cc !important;
      font-weight: normal !important;
      font-style: normal !important;
      text-decoration: none !important;
   }
   
   A:link.moresrc, A:vlink.moresrc, A:alink.moresrc {
      color: #6699cc !important;
   }
   
   .moreti {
      font-family: Verdana,Gevena,Arial,sans-serif;
      font-size: 9px;
      color: #6699cc;
      font-weight: normal;
      font-style: normal;
      text-decoration: none;
   }
   
   .morehlt {
      font-family: Verdana,Gevena,Arial,sans-serif;
      font-size: 11px;
      color: #003399 !important;
      font-weight: bold;
      font-style: normal;
      text-decoration: none;
   }   
   </style>
 
  <SCRIPT LANGUAGE="Javascript">
  <!--
  // the array global_article is used to allow multiple categories
  var global_article = new Array();
  var global_article_counter = 0;
  var article = null;
  var early_exit = true;
  var moreover_text = 0;
 
  function load_wizard()
    {
   
    var newwin = window.open("","clone","resizable,scrollbars");
    document.forms.moreover_clone.submit();
    return true;
    }
  // -->
 
  </SCRIPT>
  <SCRIPT LANGUAGE="Javascript" SRC="http://p.moreover.com/cgi-local/page?c=Top%20stories&o=js&n=10">
  </SCRIPT>
  <SCRIPT LANGUAGE="Javascript">
  <!--
  // load global_article array with articles from category
  if (article != null && (article.length > 0))
    {
    early_exit = false;
    for (var article_counter = 0; article_counter < article.length; article_counter++)
      {
      global_article[global_article_counter] = article[article_counter];
      global_article[global_article_counter].url += "&w=2229699";
     
      global_article[global_article_counter].url += "' TARGET='_blank";
      global_article[global_article_counter].document_url += "' TARGET='_blank";
      global_article_counter++;
      }
    }
  // -->
  </SCRIPT>
  <SCRIPT LANGUAGE="Javascript">
  <!--
  if (global_article.length == 0)
      {
      if (early_exit)
        {
        document.write("<CENTER>Please reload this page to view the headlines</CENTER>");
        }
      else
        {
        document.write("<CENTER>Sorry, no articles matched your search criteria</CENTER>");
        early_exit = true;
        }
      }
  // -->
  </SCRIPT>
  <table cellpadding=4 cellspacing=0 border=0 width='400'><tr bgcolor='#FFFFFF'><td>
  <a href='http://www.moreover.com/cgi-local/page?o=portal&c=Top%20stories&o=js' target='_blank' class='morehlt'>Top stories</a><br>&<br>
 
  <SCRIPT LANGUAGE="Javascript">
  <!--
  if (!early_exit)
  {
  var wizard_brand         = "moreover";
  var webfeed_heading          = "Top stories";
  var width             = "400";
  var numberofarticles          =  global_article.length;
  var cluster_border          = "0";
  var time_display          = "Yes";
  var cell_spacing          = "0";
  var cell_padding          = "1";
  var time                =  new Array(global_article.length);
 
 
  // Start loop for articles
  for (var counter=0; counter < numberofarticles; counter++)
    {
   
   if ((counter == (global_article.length - 1)) && moreover_text == 1)
      { 
      time_display = "No";
      }
   
   // Print out the headline
    document.write("<a href='"+global_article[counter].url+"' class='morehl'>");
    document.write(global_article[counter].headline_text+"...</a><br>");
   
   
      // Print out the source
        if ((counter != (global_article.length - 1)) || moreover_text != 1)
        {
      
      document.write("<A HREF='"+global_article[counter].document_url+"' + class='moresrc'>");
        document.write(global_article[counter].source+"</A>");
       
      }
   
   
    // Print out reg/sub/prem if appropriate
    if (global_article[counter].access_status == "sub" || global_article[counter].access_status == "reg" || global_article[counter].access_status == "prem")
      {
      document.write("<span class='moreti'>&</span><A HREF='"+global_article[counter].access_registration+"' class='moresrc'>");
      document.write(global_article[counter].access_status+"</A>");
      }
    
    // Print out the harvest time
    if (time_display == "Yes")
      {
      // Make a new date object
      time[counter] = new Date(global_article[counter].harvest_time);
      time[counter].setHours(time[counter].getHours() - (time[counter].getTimezoneOffset() / 60 ));
     document.write("<span class='moreti'> &"+time[counter].toString()+"<br>&<br></span>");
      }
    else
      {
      document.write("<br>&<br>");
      }

    } // End of article loop
 

  // Start of clone button code //
  // NOTE: DO NOT REMOVE any of the code in this section //
  document.write("<FORM METHOD='POST' ACTION='http://www.moreover.com/cgi-local/wizard_welcome.pl' target='clone' name='moreover_clone'>");
  document.write("<INPUT TYPE='hidden' NAME='parent_code' VALUE='2229699'>");
  document.write("<INPUT TYPE='hidden' NAME='clone_system' VALUE='c'>");
  document.write("<INPUT TYPE='hidden' NAME='system' VALUE='c'>");
  document.write("<INPUT TYPE='hidden' NAME='heading_font_size' VALUE=''><INPUT TYPE='hidden' NAME='headline_bgcolor' VALUE='FFFFFF'>")
  document.write("<INPUT TYPE='hidden' NAME='webfeed_heading' VALUE='Top stories'><INPUT TYPE='hidden' NAME='cluster_width' VALUE='400'>")
  document.write("<INPUT TYPE='hidden' NAME='cluster_name' VALUE='c=Top%20stories&o=js'><INPUT TYPE='hidden' NAME='source_time_underline' VALUE='false'>")
  document.write("<INPUT TYPE='hidden' NAME='time_display' VALUE='Yes'><INPUT TYPE='hidden' NAME='heading_display' VALUE='Yes'>")
  document.write("<INPUT TYPE='hidden' NAME='headline_fgcolor' VALUE='003399'><INPUT TYPE='hidden' NAME='cluster_cellspacing' VALUE='0'>")
  document.write("<INPUT TYPE='hidden' NAME='number_of_headlines' VALUE='10'><INPUT TYPE='hidden' NAME='source_time_fgcolor' VALUE='6699cc'>")
  document.write("<INPUT TYPE='hidden' NAME='headline_font_size' VALUE='11'><INPUT TYPE='hidden' NAME='search_keywords' VALUE=''>")
  document.write("<INPUT TYPE='hidden' NAME='source_time_font_size' VALUE='9'><INPUT TYPE='hidden' NAME='headline_italic' VALUE='false'>")
  document.write("<INPUT TYPE='hidden' NAME='headline_font' VALUE='Verdana,Gevena,Arial,sans-serif'><INPUT TYPE='hidden' NAME='source_time_italic' VALUE='false'>")
  document.write("<INPUT TYPE='hidden' NAME='source_time_font' VALUE='Verdana,Gevena,Arial,sans-serif'><INPUT TYPE='hidden' NAME='wizard_brand' VALUE='moreover'>")
  document.write("<INPUT TYPE='hidden' NAME='cluster_cellpadding' VALUE='1'><INPUT TYPE='hidden' NAME='headline_bold' VALUE='true'>")
  document.write("<INPUT TYPE='hidden' NAME='cluster_border' VALUE='0'><INPUT TYPE='hidden' NAME='source_time_bold' VALUE='false'>")
  document.write("<INPUT TYPE='hidden' NAME='headline_underline' VALUE='true'><INPUT TYPE='hidden' NAME='cluster_layout' VALUE='<BR>'>")

  document.write("</FORM>");
  // End of clone button code //

  // ************************************************************************************
  // This code is subject to the copyright and warranty restrictions detailed at
  // http://www.moreover.com/wizard_copyright.html
  // Copyright 2000 Moreover.com Inc. All rights reserved.
  // *************************************************************************************
  }
  // -->
  </SCRIPT>
<SCRIPT LANGUAGE="Javascript" SRC="http://p.moreover.com/dr/wizard/wizard_text.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
setTimeout("window.location.reload(true)", 900*1000); // refresh time in ms
</SCRIPT>
  </td></tr></table>
  <!-- End Of Moreover.com News Javascript Code -->


Would be nice in a block, but this is way, way out of my league. It pastes nice into html, and reads fine, just kicks me back to the index when I try and use it in Nuke. You would have my eternal thanks for some help on this one. Razz
Find all posts by DauthusView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Sat May 31, 2003 9:21 pm Reply with quoteBack to top

Dauthus wrote:
Thank you Raven!

Although the code didn't work just by going to the add a new block section in the admin and pasting it there, it did work with me opening up the sample block and adding the code there.

I just uploaded that block to my server changing the name to "block_localweather.php" and Shazam! it works perfectly.

Thanks again.

Now, how about a real challange. Care to try with multiple scripts? Look at the next post.

Gotta get rid of this chick avatar.....

That's because by default a block expects HTML. To execute that code in the Admin Block, you have to wrap it in <? ?> tags and then add an echo $content; statement.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Sat May 31, 2003 9:30 pm Reply with quoteBack to top

Do this with you long code. Make a block and call it something like block-jshtml.php. here is all you have to do
Code:

<?
$content = <<<_HTMLCODE_

  <!-- Start Of Moreover.com News Javascript Code -->

   <style type='text/css'>

   .morehl {
      font-family: Verdana,Gevena,Arial,sans-serif !important;
      font-size: 11px !important;
      color: #003399 !important;
      font-weight: bold !important;
      font-style: normal !important;
      text-decoration: underline !important;
   }

   A:link.morehl, A:vlink.morehl, A:alink.morehl {
      color: #003399 !important;
   }

   .moresrc {
      font-family: Verdana,Gevena,Arial,sans-serif !important;
      font-size: 9px !important;
      color: #6699cc !important;
      font-weight: normal !important;
      font-style: normal !important;
      text-decoration: none !important;
   }

   A:link.moresrc, A:vlink.moresrc, A:alink.moresrc {
      color: #6699cc !important;
   }

   .moreti {
      font-family: Verdana,Gevena,Arial,sans-serif;
      font-size: 9px;
      color: #6699cc;
      font-weight: normal;
      font-style: normal;
      text-decoration: none;
   }

   .morehlt {
      font-family: Verdana,Gevena,Arial,sans-serif;
      font-size: 11px;
      color: #003399 !important;
      font-weight: bold;
      font-style: normal;
      text-decoration: none;
   }
   </style>

  <SCRIPT LANGUAGE="Javascript">
  <!--
  // the array global_article is used to allow multiple categories
  var global_article = new Array();
  var global_article_counter = 0;
  var article = null;
  var early_exit = true;
  var moreover_text = 0;

  function load_wizard()
    {

    var newwin = window.open("","clone","resizable,scrollbars");
    document.forms.moreover_clone.submit();
    return true;
    }
  // -->

  </SCRIPT>
  <SCRIPT LANGUAGE="Javascript" SRC="http://p.moreover.com/cgi-local/page?c=Top%20stories&o=js&n=10">
  </SCRIPT>
  <SCRIPT LANGUAGE="Javascript">
  <!--
  // load global_article array with articles from category
  if (article != null && (article.length > 0))
    {
    early_exit = false;
    for (var article_counter = 0; article_counter < article.length; article_counter++)
      {
      global_article[global_article_counter] = article[article_counter];
      global_article[global_article_counter].url += "&w=2229699";

      global_article[global_article_counter].url += "' TARGET='_blank";
      global_article[global_article_counter].document_url += "' TARGET='_blank";
      global_article_counter++;
      }
    }
  // -->
  </SCRIPT>
  <SCRIPT LANGUAGE="Javascript">
  <!--
  if (global_article.length == 0)
      {
      if (early_exit)
        {
        document.write("<CENTER>Please reload this page to view the headlines</CENTER>");
        }
      else
        {
        document.write("<CENTER>Sorry, no articles matched your search criteria</CENTER>");
        early_exit = true;
        }
      }
  // -->
  </SCRIPT>
  <table cellpadding=4 cellspacing=0 border=0 width='400'><tr bgcolor='#FFFFFF'><td>
  <a href='http://www.moreover.com/cgi-local/page?o=portal&c=Top%20stories&o=js' target='_blank' class='morehlt'>Top stories</a><br>&<br>

  <SCRIPT LANGUAGE="Javascript">
  <!--
  if (!early_exit)
  {
  var wizard_brand         = "moreover";
  var webfeed_heading          = "Top stories";
  var width             = "400";
  var numberofarticles          =  global_article.length;
  var cluster_border          = "0";
  var time_display          = "Yes";
  var cell_spacing          = "0";
  var cell_padding          = "1";
  var time                =  new Array(global_article.length);


  // Start loop for articles
  for (var counter=0; counter < numberofarticles; counter++)
    {

   if ((counter == (global_article.length - 1)) && moreover_text == 1)
      {
      time_display = "No";
      }

   // Print out the headline
    document.write("<a href='"+global_article[counter].url+"' class='morehl'>");
    document.write(global_article[counter].headline_text+"...</a><br>");


      // Print out the source
        if ((counter != (global_article.length - 1)) || moreover_text != 1)
        {

      document.write("<A HREF='"+global_article[counter].document_url+"' + class='moresrc'>");
        document.write(global_article[counter].source+"</A>");

      }


    // Print out reg/sub/prem if appropriate
    if (global_article[counter].access_status == "sub" || global_article[counter].access_status == "reg" || global_article[counter].access_status == "prem")
      {
      document.write("<span class='moreti'>&</span><A HREF='"+global_article[counter].access_registration+"' class='moresrc'>");
     document.write(global_article[counter].access_status+"</A>");
      }

    // Print out the harvest time
    if (time_display == "Yes")
      {
      // Make a new date object
      time[counter] = new Date(global_article[counter].harvest_time);
      time[counter].setHours(time[counter].getHours() - (time[counter].getTimezoneOffset() / 60 ));
     document.write("<span class='moreti'> &"+time[counter].toString()+"<br>&<br></span>");
      }
    else
      {
      document.write("<br>&<br>");
      }

    } // End of article loop


  // Start of clone button code //
  // NOTE: DO NOT REMOVE any of the code in this section //
  document.write("<FORM METHOD='POST' ACTION='http://www.moreover.com/cgi-local/wizard_welcome.pl' target='clone' name='moreover_clone'>");
  document.write("<INPUT TYPE='hidden' NAME='parent_code' VALUE='2229699'>");
  document.write("<INPUT TYPE='hidden' NAME='clone_system' VALUE='c'>");
  document.write("<INPUT TYPE='hidden' NAME='system' VALUE='c'>");
  document.write("<INPUT TYPE='hidden' NAME='heading_font_size' VALUE=''><INPUT TYPE='hidden' NAME='headline_bgcolor' VALUE='FFFFFF'>")
  document.write("<INPUT TYPE='hidden' NAME='webfeed_heading' VALUE='Top stories'><INPUT TYPE='hidden' NAME='cluster_width' VALUE='400'>")
  document.write("<INPUT TYPE='hidden' NAME='cluster_name' VALUE='c=Top%20stories&o=js'><INPUT TYPE='hidden' NAME='source_time_underline' VALUE='false'>")
  document.write("<INPUT TYPE='hidden' NAME='time_display' VALUE='Yes'><INPUT TYPE='hidden' NAME='heading_display' VALUE='Yes'>")
  document.write("<INPUT TYPE='hidden' NAME='headline_fgcolor' VALUE='003399'><INPUT TYPE='hidden' NAME='cluster_cellspacing' VALUE='0'>")
  document.write("<INPUT TYPE='hidden' NAME='number_of_headlines' VALUE='10'><INPUT TYPE='hidden' NAME='source_time_fgcolor' VALUE='6699cc'>")
  document.write("<INPUT TYPE='hidden' NAME='headline_font_size' VALUE='11'><INPUT TYPE='hidden' NAME='search_keywords' VALUE=''>")
  document.write("<INPUT TYPE='hidden' NAME='source_time_font_size' VALUE='9'><INPUT TYPE='hidden' NAME='headline_italic' VALUE='false'>")
  document.write("<INPUT TYPE='hidden' NAME='headline_font' VALUE='Verdana,Gevena,Arial,sans-serif'><INPUT TYPE='hidden' NAME='source_time_italic' VALUE='false'>")
  document.write("<INPUT TYPE='hidden' NAME='source_time_font' VALUE='Verdana,Gevena,Arial,sans-serif'><INPUT TYPE='hidden' NAME='wizard_brand' VALUE='moreover'>")
  document.write("<INPUT TYPE='hidden' NAME='cluster_cellpadding' VALUE='1'><INPUT TYPE='hidden' NAME='headline_bold' VALUE='true'>")
  document.write("<INPUT TYPE='hidden' NAME='cluster_border' VALUE='0'><INPUT TYPE='hidden' NAME='source_time_bold' VALUE='false'>")
  document.write("<INPUT TYPE='hidden' NAME='headline_underline' VALUE='true'><INPUT TYPE='hidden' NAME='cluster_layout' VALUE='<BR>'>")

  document.write("</FORM>");
  // End of clone button code //

  // ************************************************************************************
  // This code is subject to the copyright and warranty restrictions detailed at
  // http://www.moreover.com/wizard_copyright.html
  // Copyright 2000 Moreover.com Inc. All rights reserved.
  // *************************************************************************************
  }
  // -->
  </SCRIPT>
<SCRIPT LANGUAGE="Javascript" SRC="http://p.moreover.com/dr/wizard/wizard_text.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
setTimeout("window.location.reload(true)", 900*1000); // refresh time in ms
</SCRIPT>
  </td></tr></table>
  <!-- End Of Moreover.com News Javascript Code -->
_HTMLCODE_;
?>
Then position it in a Center Up block Cool

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Dauthus
Sergeant
Sergeant


Joined: Feb 12, 2003
Posts: 82

Location: USA

PostPosted: Sat May 31, 2003 10:00 pm Reply with quoteBack to top

Keep getting this error message:

Code:
Parse error: parse error, unexpected T_SL in /home/virtual/site30/fst/var/www/html/blocks/block-jshtml.php on line 2


I copied and pasted the code above and put it in a block. Any suggestions? (Using Dreamweaver for edit).
Find all posts by DauthusView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Sat May 31, 2003 10:15 pm Reply with quoteBack to top

It works perfectly here. It could be the copy and paste is messing up because of line wrapping. Download it here http://gaylenandmargie.com/public/downloads/block-jstest.zip

Also, make sure there is no blank line on line #1 in your code. Line #1 must be <?

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Dauthus
Sergeant
Sergeant


Joined: Feb 12, 2003
Posts: 82

Location: USA

PostPosted: Sat May 31, 2003 10:23 pm Reply with quoteBack to top

Thank you, thank you, thank you. The downloaded file works perfect. I am going to look at it on dreamweaver and see what was wrong.

You are a life safer. Thanks again.
Find all posts by DauthusView user's profileSend private messageVisit poster's website
MrPat
Nuke Cadet
Nuke Cadet


Joined: Jul 02, 2003
Posts: 3


PostPosted: Wed Jul 02, 2003 9:04 am Reply with quoteBack to top

I'm bumping this post, coz i have a similar problem !

This is the code i'd like to put in a block, but i'm not really use to that .. can somedy look at it, and tell me if there is something wrong (perhaps yes coz it doesn't work). Thanks a lot.

Code:
<div align="center">
<script language="JavaScript" type="text/JavaScript">

/*
Dynamic countdown Script- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and TOS,
visit http://www.dynamicdrive.com
*/


function setcountdown(theyear,themonth,theday){
yr=theyear;mo=themonth;da=theday
}

//////////CONFIGURE THE COUNTDOWN SCRIPT HERE//////////////////

//STEP 1: Configure the countdown-to date, in the format year, month, day:
setcountdown(2003,7,6)

//STEP 2: Change the two text below to reflect the occasion, and message to display on that occasion, respectively
var occasion=" Le Grand Prix de France."
var message_on_occasion="Aujourd'hui, le Grand Prix de France!"

//STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countdown area
var countdownwidth='600px'
var countdownheight='50px'
var countdownbgcolor='#FFFFFF'
var opentags='<font size="2" face="Verdana" color="#000000"><b>'
var closetags='</b></font>'

//////////DO NOT EDIT PASS THIS LINE//////////////////

var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var crosscount=''

function start_countdown(){
if (document.layers)
document.countdownnsmain.visibility="show"
else if (document.all||document.getElementById)
crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdownie
countdown()
}

if (document.all||document.getElementById)
document.write('<span id="countdownie" style="width:'+countdownwidth+'; background-color:'+countdownbgcolor+'"></span>')

window.onload=start_countdown


function countdown(){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
//if on day of occasion
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+message_on_occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+message_on_occasion+closetags
return
}
//else, if not yet
else{
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+dday+ " jours, "+dhour+" heures, "+dmin+" minutes, et "+dsec+" secondes depuis "+occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+dday+ " jours, "+dhour+" heures, "+dmin+" minutes, et "+dsec+" secondes avant"+occasion+closetags
}
setTimeout("countdown()",1000)
}

</script>
</div>
Find all posts by MrPatView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Wed Jul 02, 2003 11:01 am Reply with quoteBack to top

As I have posted many times, you cannot add it to a block like this. read the first post in this thread as to how to 'wrap' the code.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
MrPat
Nuke Cadet
Nuke Cadet


Joined: Jul 02, 2003
Posts: 3


PostPosted: Wed Jul 02, 2003 11:43 am Reply with quoteBack to top

Understanding how it works, i wouldn't have post here .. but the fact is, i'm french and i have sometimes a lil problem to understand coz i need to translate to myself to understand.

Having a lil help on how-to do it, would help .. not only refering to another post. Coz i can understand way better, if my example works in the end.

Thanks in advance for taking care of my problem.
Find all posts by MrPatView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Wed Jul 02, 2003 11:47 am Reply with quoteBack to top

<?
$content = <<< _CODE_

/** Place all your code here **/

_CODE_;
?>

Make sure there are no spaces after the _CODE_ tags. Only a carriage return. That is all there is to it.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
MrPat
Nuke Cadet
Nuke Cadet


Joined: Jul 02, 2003
Posts: 3


PostPosted: Wed Jul 02, 2003 12:12 pm Reply with quoteBack to top

Thanx a lot Raven ! I know i'm still in the block section.. but if i want to put the same script .. in the middle of a php page already existing !! Is there a way to declare the script ... and ask it, whenever i need it in the same page ??
Find all posts by MrPatView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.309 Seconds - 270 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::