first commit

This commit is contained in:
2017-08-14 15:09:47 +00:00
commit ecf16d4ba3
3 changed files with 59 additions and 0 deletions

34
shortcode.php Normal file
View File

@@ -0,0 +1,34 @@
<?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"> &neArr; OctoPart.com</a>', $article->text);
return true;
}
}
?>