Where Clause in Content Plugin

automan25

Member
I've read the instructions on filtering in the Content Plugin available HERE but still do not quite get how to make it work in my situation. Here's what I've got so far:

{fabrik view=element list=42 rowid=intake_coordinators___id WHERE juser_id = {$my->id} element=intake_coordinators___photo}

Now I know I cannot use the actual word WHERE which is the main reason the above statement won't work. As I said though I don't really know how this should read. Any help here would be great.
 
You'd probably have to do that with a little custom code embedded in the article, to look up the rowid for that user, using something like Regular Lab's Sourcerer.

Code:
{source}
<?php
$myUserId = JFactory::getuser()->get('id');
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery->select('id')->from('intake_coordinators')->where('juser_id = ' . $myDb->quote($myUserId));
$myDb->setQuery($myQuery);
$myRowid = $myDb->loadResult();
if (!empty($myRowId)) {
   echo "{fabrik view=element list=42 rowid=$myUserId element=intake_coordinators___photo}";
}
?>
{/source}

-- hugh[/code]
 
PS, if you do this, I suggest you "toggle editor" so you enter the code NOT in WYSIWYG mode, as J!'s WYSIWYG editors tend to insert formatting into the embedded code.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top