[TYPO3-dev] Extending news_author_rel: a typo3 and SQL question

Pieter pieter.v at gmx.net
Sat Mar 25 16:16:39 CET 2006


Hello,

the news_author_rel extension enables you to select a news author form a 
list of records (be_users, fe_user, ...).  A very nice enhancement of 
tt_news but... (there is always a 'but'  :-) )

The list of names to select from, is to long on my site.  It shows all 
fe_users. Only a limited number of fe_users will ever be author of a 
news item.

My idea: show only fe_users that are member of a fe_usergroup.  For 
example with typoscript:
plugin.tt_news.authorgroups = 1,7,15
The list in the tt_news flexform should now show only users that are 
member of groups 1,7 or 15

Some extra code in ext_tables.php has to do this trick.  A first 
experiment in "ext_tables.php":

if ($foreign_table == 'fe_users') {
   $fTableWhere = $fTableWhere.' AND FIND_IN_SET( "5", 
fe_users.usergroup )';
}

This works fine, but the usergroup is hardcoded ("5").  And you can only 
use 1 usergroup.

My questions:
1) how can I access the typoscript configuration in ext_tables.php?  I 
need to replace "5" with a typoscript value.

2) I need to look for "1,7,15" in the fe_users.usergroup field and 
FIND_IN_SET will not do that for me.  Is there a SQL command to look for 
items from a comma-separated list in an other comma-separated list?

Regards,
Pieter




More information about the TYPO3-dev mailing list