Форумы / Cotonti / Extensions / new jQuery module

jPlayer

ez
#23757 25.03.2010 04:21
Make a simple plugin and parse the JS parts to an TAG with a header hook...

Here is your main PHP code for the plugin


/* ====================
Cotonti - Website engine
http://www.cotonti.com

Plugin: example js (ez)

[BEGIN_SED_EXTPLUGIN]
Code=JSexample
Part=header
File=JSexample
Hooks=header.tags
Tags=header.tpl:{HEADER_JS_EXAMPLE}
Minlevel=0
Order=10
[END_SED_EXTPLUGIN]
==================== */

if (!defined('SED_CODE')) { die('Wrong URL.'); }

$ez_js = "<script type=\"text/javascript\">

// here comes your JS
// Do with it what you want in code

</script>";
	
$t-> assign(array( "HEADER_JS_EXAMPLE" => $ez_js ));
}

ADD {HEADER_JS_EXAMPLE} tag to your header.TPL
==- I say: Keep it EZ -==