The plug in is replacing a reference {rating}<number>{/rating} with a set of images. On the first attempt the code was set to this at the start:
Code:
defined('_JEXEC') or die('Restricted access');
jimport('joomla.event.plugin');
$mainframe->registerEvent('onBeforeDisplayContent', 'getRating');
global $css_added;
function getRating (&$article, &$params, $limitstart=0)
{
/** start of function **/
}
But this just put the rating at the top of the article whereas I need it to be where ever the reference is placed within the article.
Then we changed it thinking you meant us to do this :
Code:
defined('_JEXEC') or die('Restricted access');
jimport('joomla.event.plugin');
$mainframe->registerEvent('onPrepareContent', 'getRating');
global $css_added;
function getRating (&$article, &$params, $limitstart=0)
You then pointed out that the parameters for the function should be
Code:
( &$row, &$params, $page=0 )
so we changed it to this :
Code:
defined('_JEXEC') or die('Restricted access');
jimport('joomla.event.plugin');
$mainframe->registerEvent('onPrepareContent', 'getRating');
global $css_added;
function getRating ( &$row, &$params, $page=0 )
However this just showed the reference e.g. {rating}4{/rating} instead of the images on the page.
So is it a case of actually using the OnPrepareContent function in the plugin and then within that, have the code to find and replace the e.g. {rating}5{/rating} to an image?