We don't use these stylesheets and scripts where jcomments is not used.
You need a setting which allow to select for which components to load these css and scripts, smth like:
instead of
}
else {
include_once (JCOMMENTS_BASE . DS . 'jcomments.class.php');
include_once (JCOMMENTS_BASE . DS . 'jcomments.config.php');
include_once (JCOMMENTS_HELPERS . DS . 'system.php');
Use:
}
else if (in_array($components, JRequest::getCmd('option')) {
include_once (JCOMMENTS_BASE . DS . 'jcomments.class.php');
include_once (JCOMMENTS_BASE . DS . 'jcomments.config.php');
include_once (JCOMMENTS_HELPERS . DS . 'system.php');
For now we use these scripts for com_content only:
else if (JRequest::getCmd('option') == 'com_content') {
include_once (JCOMMENTS_BASE . DS . 'jcomments.class.php');
include_once (JCOMMENTS_BASE . DS . 'jcomments.config.php');
include_once (JCOMMENTS_HELPERS . DS . 'system.php');
Besides onAfterRender() event enormously uses regular expressions, what is the purpose of removing scripts here?
I think this event should be completely removed.