Top Left Text cha

Web & App Development

It took me a while to figure out why I had modules disappearing and appearing multiple times in random positions. It was caused by a combination of Flexi Custom Code and an ISP caching issue. Replacing Flexi Custom Code with Custom HTML Advanced corrected the issue.

Custom HTML Advanced unfortunately doesn't allow you to mix HTML & PHP. There are separate boxes for each of those languages. So, for example, if you want to put a dynamic copyright in the module, you would need to put it in the PHP box like so...

?>
<div class="copyRight">
&copy; 2010-<?php echo date('Y'); ?> TJohns.co
</div>
<?php

Also, you might want to get rid of the pointless HTML comments placed around the module in /modules/mod_custom_advanced/mod_custom_advanced.php (if you like very clean code like me)...

<!-- BEGIN: Custom advanced (www.pluginaria.com) -->
<?php
$customHtml = $params->get('customHtml');
if (strlen($customHtml) > 0) {

    if ($params->def('prepare_content', 0))
    {
    	JPluginHelper::importPlugin('content');
    	$customHtml = JHtml::_('content.prepare', $customHtml);
    }

    echo $customHtml;
}

$evalPhp = $params->get('evalPhp');

if (substr($evalPhp, 0, 5) === '<?php') {
    $evalPhp = substr($evalPhp, 5);
}

if (substr($evalPhp, -2) === '?>') {
    $evalPhp = substr($evalPhp, 0, -2);
}

if (strlen($evalPhp))
    eval($evalPhp);
?>
<!-- END: Custom advanced (www.pluginaria.com) -->

Add comment


Security code
Refresh

  • No comments found

Leave your comments

Post comment as a guest

0
Your comments are subjected to administrator's moderation.
X