21.9.2. Complete Javascript code in modules

You can use the following template to include your complete Javascript code in your PHP-Nuke module:

<?php
if (!eregi("modules.php", $PHP_SELF)) {
  die ("You can't access this file directly...");
}
require_once("mainfile.php");
// 0 : do not show right blocks - 1:show right blocks
$index = 0; 
include("header.php");
?>
// PUT HTML OR JAVASCRIPT CODE HERE, 
// OR GET RID OF THE ?> AND <?php ABOVE AND BELOW THIS LINE 
// AND USE PHP CODE HERE INSTEAD.
<?php
include("footer.php");
?>
Tip Javascript with PHP
 

If you decide to use PHP code ("echo"s) to enter your Javascript code, you should take into account the rules presented in Section 21.9.1.

Tip Javascript codebase
 

You may need to add the following line to your Javascript applet:

codebase="modules/modulename"

Help us make a better PHP-Nuke HOWTO!

Want to contribute to this HOWTO? Have a suggestion or a solution to a problem that was not treated here? Post your comments on my PHP-Nuke Forum!

Chris Karakas, Maintainer PHP-Nuke HOWTO