TinyPortal

General => Chit chat => Topic started by: Skhilled on December 10, 2005, 08:05:44 AM

Title: Adding Javascript Code to TP
Post by: Skhilled on December 10, 2005, 08:05:44 AM
Hi, I'd like to know how to add the following code to TP.

http://www.dynamicdrive.com/dynamicindex3/snow.htm

I thought I had saw a post about this before but couldn't find it. I am using several themes and would like it to show no matter which theme is viewed. Hopefully it is not theme-specific but I'll just have to do more work if it is. I am assuming that it would be added to index.template.php somewhere but I could be wrong.
Title: Re: Adding Javascript Code to TP
Post by: gerrymo on December 10, 2005, 12:05:35 PM
It will be theme specific. Each index.template will have to be edoited.
Title: Re: Adding Javascript Code to TP
Post by: gerrymo on December 10, 2005, 01:16:04 PM
I just installed this one.

http://www.dynamicdrive.com/dynamicindex3/snownoimages.htm

Just follow the instructions. The launch code for the javascript simple goes into index.template as below.

Find

echo '
</body>


Change to

echo '
<script type="text/javascript" src="snow.js"></script>
</body>


(Make sure the path to snow.js is correct for your site).
Title: Re: Adding Javascript Code to TP
Post by: Skhilled on December 10, 2005, 03:34:23 PM
Thanks, gerrymo!
Title: Re: Adding Javascript Code to TP
Post by: gerrymo on December 10, 2005, 03:36:27 PM
They are theme specific. Each copy of index.template will need to be modified.

(It wont show on light backgrounds BTW).
Title: Re: Adding Javascript Code to TP
Post by: IchBin on December 10, 2005, 04:00:07 PM
http://www.tinyportal.net/smf/index.php?topic=1436.0