<script type="text/javascript"> if(tipcount){ tipcount = tipcount + 1; } else { var tipcount = 1 } document.write("<span id=\"tip-"+tipcount+"\"></span>"); sendRequest("{TEXT}", "tip-"+tipcount, "en"); </script><noscript>[{TEXT}]</noscript>
<?php
defined('_JEXEC') or die( "Direct Access Is Not Allowed" );
jimport('joomla.event.plugin');
class plgContentWoWItemstats extends JPlugin {
function plgContentWoWItemstats( &$subject ) {
parent::__construct( $subject );
}
function onPrepareContent(&$article, &$params, $limitstart) {
$regex = "#{wow}(.*?){/wow}#s";
$article->text = preg_replace_callback($regex,array($this,"itemstats"), $article->text);
return true;
}
function itemstats($matches) {
$html = '';
$html .= "<script type=\"text/javascript\">";
$html .= "if(tipcount) { ";
$html .= "tipcount = tipcount + 1}";
$html .= "else {";
$html .= "var tipcount = 1}";
$html .= "document.write(\"<span id=\\\"tip-\"+tipcount+\"\\\"></span>\");";
$html .= "sendRequest(\"". $matches[1] . "\", \"tip-\"+tipcount, \"en\");";
$html .= "</script>";
return $html;
}
}
Time to create page: 0.063 seconds