defined('_JEXEC') or die;
jimport( 'joomla.plugin.plugin' );
class plgContentHelloworld extends JPlugin
{
function onAfterRender() // for replacing any body tag
{
$app = JFactory::getApplication();
if( $app->isAdmin()) {
return false;
}
$type = JFactory::getDocument()->getType();
if( $type != 'html' ) {
return false;
}
$response = JResponse::getBody();
$replace = "{replace it}";
$response = str_replace($replace, '<div style="margin:2px;">scripts/codes
here</div>', $response);
JResponse::setBody($response);
return true;
}
}
{replace it} text will be replaced by the scripts/codes you
enter in the above str_replace method.
Hope that helped you very much,don't forget to share and like
this joomla post