1 (edited by hoang83vu 2011-12-22 06:47)

Topic: How to add a <stript> into the forum?

Hi, for example I have a link like this:

<script src="http://www.example.com/script.js"></script>

All I want is to add this script to my forum either in header or footer. Usually I look inside the HTML code and put it there; however, I could not find it. I guess because I do not understand the structure. Please help me how to do this the proper way.

Thanks.

Re: How to add a <stript> into the forum?

You can add a .js to the header via an extension....

<extension engine="1.0">
    <id>javascript_caller</id>
    <title>Javascript Caller</title>
    <version>0.0.0</version>
    <description>Calling the javascript</description>
    <author>Author</author>
    <minversion>1.4.1</minversion>
    <maxtestedon>1.4.1</maxtestedon>

    <hooks>
            <hook id="hd_head" priority="4"><![CDATA[
            $forum_head['javascript_caller'] = '<script type="text/javascript" src="'.$ext_info['url'].'/myscript.js"></script>';
 ]]></hook>
    </hooks>
</extension>

Also look at in /include/template/main.tpl

Re: How to add a <stript> into the forum?

Thank you for the response, but can you please be more specific where I should put the code into? Much appreciate.

Re: How to add a <stript> into the forum?

I have found it, but I am not sure if it is the right way of doing it. I go into footer.php and use

$forum_loader->add_js('http://www.example.com/script.js');