?
Path : /home/admin/domains/happytokorea.com/public_html_bk/test3/plugins/content/ |
Current File : /home/admin/domains/happytokorea.com/public_html_bk/test3/plugins/content/sekh.php |
<?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); class plgContentSEKH extends JPlugin { function plgContentSEKH( &$subject, $params ) { parent::__construct( $subject, $params ); } function onAfterDisplayContent( &$article, &$params, $limitstart ) { $done=JRequest :: getVar('sekhdone'); if($done){ return ""; } JHTML::script('hilite.js','plugins/content/sekh/',false); JHTML::stylesheet('hilite.css','plugins/content/sekh/',false); $topDiv=$this->param('Elementid'); $seachEngineBox="<script type=\"text/javascript\">\n"; if(false==empty( $topDiv)){ $seachEngineBox.="Hilite.elementid='".$topDiv."';\n"; } //$seachEngineBox.="Hilite.debug_referrer = 'http://www.google.com/search?q=java+open+source';"; $seachEngineBox.="var q = Hilite.debug_referrer ? Hilite.debug_referrer : document.referrer;\n" ."q=Hilite.decodeReferrer(q);\n" ."if (q){ sekhsearch(q);}\n" ."</script>\n" ."<div id=\"search_engine_box\" style=\"display:none;\">\n" ."<h2>You are searching</h2>" ."</div>\n"; JRequest :: setVar('sekhdone','1'); return $seachEngineBox; } function param($name){ static $plugin,$pluginParams; if (!isset( $plugin )){ $plugin =& JPluginHelper::getPlugin('content', 'sekh'); $pluginParams = new JParameter( $plugin->params ); } return $pluginParams->get($name); } }