Hi Sebastian,
Yes, that's actually true: I'm stuck in my home-office. I can't go anywhere on the moment.....
Anyway, here's a little hack, that only shows you the authors that have authored F2C Articles:
In the file /components/com_form2contentsearch/lib/Form2ContentSearch/Fields/FieldAuthor.php there's this function:
private function getAuthorList()
{
$db = Factory::getDBO();
$query = $db->getQuery(true);
if($this->searchFieldSettings->get('aut_display_name', 0))
{
$query->select('id as value, username as text');
$query->order('username ASC');
}
else
{
$query->select('id as value, name as text');
$query->order('name ASC');
}
$query->from('#__users');
switch((int)$this->searchFieldSettings->get('aut_filter'))
{
case 0:
// show all authors
break;
case 1:
// exclude selected authors
$query->where('id NOT IN ('. implode(',', $this->searchFieldSettings->get('aut_ids')) .')');
break;
case 2:
// only show selected authors
$query->where('id IN ('. implode(',', $this->searchFieldSettings->get('aut_ids')) .')');
break;
}
$db->setQuery($query);
return $db->loadRowList();
}
And here's the function with the hack:
private function getAuthorList()
{
$db = Factory::getDBO();
$query = $db->getQuery(true);
if($this->searchFieldSettings->get('aut_display_name', 0))
{
$query->select('distinct u.id as value, u.username as text');
$query->order('u.username ASC');
}
else
{
$query->select('distinct u.id as value, u.name as text');
$query->order('u.name ASC');
}
$query->from('#__users u');
$query->innerJoin('#__f2c_form f ON u.id = f.created_by');
switch((int)$this->searchFieldSettings->get('aut_filter'))
{
case 0:
// show all authors
break;
case 1:
// exclude selected authors
$query->where('u.id NOT IN ('. implode(',', $this->searchFieldSettings->get('aut_ids')) .')');
break;
case 2:
// only show selected authors
$query->where('u.id IN ('. implode(',', $this->searchFieldSettings->get('aut_ids')) .')');
break;
}
$db->setQuery($query);
return $db->loadRowList();
}
Hope this helps!
Best,
Julien