35 lines
433 B
PHP
35 lines
433 B
PHP
<?php
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
|
|
class PlgContentShortcode extends JPlugin {
|
|
|
|
|
|
|
|
protected $autoloadLanguage = true;
|
|
|
|
|
|
function onContentPrepare ($context, $article, $params, $limitstart )
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
$article->text = str_replace('[[::', '<a href="https://octopart.com/search?q=', $article->text);
|
|
$article->text = str_replace('::]]','" target="_blank"> ⇗ OctoPart.com</a>', $article->text);
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|