News:

Wondering if this will always be free?  See why free is better.

Main Menu

Help Adding Java countdown script to index.template

Started by dbrown, January 17, 2006, 07:35:34 PM

Previous topic - Next topic

dbrown

I'm trying to add a JAVA countdown clock to my index.template file, either underneath the search bar, or next to the time, up in the header. Im using the default theme packaged with RC2. I know the code has to go in index.template.php, but I'm not sure where. While playing around with it, I had no luck getting it to work. Here's what I've tried.

I think my problem lies in how to get the script (in HTML) to work in the PHP environment. Here's what I have:

I've added:
<script type="text/javascript" src="/scripts/countdown.js" defer="defer"></script>
just before the </head> in index.template

The code that the author tells you to add for the clock is:
<h1>New Year 2007 Is Coming!</h1>
    <p>
        Counting down to New Year 2007: <span id="countdown1">2007-1-1 00:00:00 GMT+00:00</span>!
    </p>


I've searched and can't find a way to get this to work how I want.

Any help would really be appreciated!
Please do not PM me with support questions.  You will get better and faster responses by contacting someone who has a clue. Thank you.

dbrown

Please do not PM me with support questions.  You will get better and faster responses by contacting someone who has a clue. Thank you.

mastersmurfie

Quote from: dbrown on January 17, 2006, 07:35:34 PM
I'm trying to add a JAVA countdown clock to my index.template file, either underneath the search bar, or next to the time, up in the header. Im using the default theme packaged with RC2. I know the code has to go in index.template.php, but I'm not sure where. While playing around with it, I had no luck getting it to work. Here's what I've tried.

I think my problem lies in how to get the script (in HTML) to work in the PHP environment. Here's what I have:

I've added:
<script type="text/javascript" src="/scripts/countdown.js" defer="defer"></script>
just before the </head> in index.template

The code that the author tells you to add for the clock is:
<h1>New Year 2007 Is Coming!</h1>
    <p>
        Counting down to New Year 2007: <span id="countdown1">2007-1-1 00:00:00 GMT+00:00</span>!
    </p>


I've searched and can't find a way to get this to work how I want.

Any help would really be appreciated!

ok...I was wondering about this as well...in your index.template.php add the <script type="text/javascript" src="/scripts/countdown.js" defer="defer"></script>

exactly where you have it..

then find

// The end of tab section.
echo '
<td class="maintab_' , $last , '">&nbsp;</td>

</table>';


and paste below it:



echo '
<table cellpadding="0" cellspacing="0" border="0" align="right">
New Year 2007 Is Coming!<br>
            Counting down to New Year 2007: <span id="countdown1">2007-1-1 00:00:00 GMT+00:00</span>!

</table>';


the <h1> and <p> will mess up the left side of your forum (more than likely)...take those out, and you should be OK. 

Let me know if this helps...

just a thought

mastersmurfie

www.chrishell.net/forums

dbrown

That worked great! I bow before your superior intellect!...


DB
Please do not PM me with support questions.  You will get better and faster responses by contacting someone who has a clue. Thank you.

mastersmurfie

not superior intellect...but about 20 minutes of "trial and error" (mostly error...) ;D

just a thought

mastersmurfie

www.chrishell.net/forums

Owain

is there anyway to make it countdown from a set event on the calendar and embed it in to a post?

O.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

Advertisement: