Hi I'm trying to write a content plugin that will only show articles written by the currently logged in user in the category view.
Using the onContentPrepare and onContentBeforeDisplay triggers I can Identify the currently logged in user and whether the article belongs to them quite simply.
The next step Not displaying the article is much trickier and I have not been able to figure it out.
So, is there a way to easily NOT show an article using these plugin triggers?
Sure, here's the code:
function onContentBeforeDisplay($context, &$article, &$params, $limit=0)
{
$name = JFactory::getUser()->name;
$author = $article->author;
if ($author != $name) {
/* ? */
}
// var_dump($article);
// var_dump($params);
// var_dump($context);
return "";
}
if > else
statement in this sort of scenario