[TYPO3] "Connecting" comments extension to fe_users

Dmitry Dulepov [typo3] dmitry at typo3.org
Thu Jun 12 14:12:48 CEST 2008


Hi!

Søren Malling wrote:
> When i read my question i can see that I messed up the meaning of it all :-)
> 
> Will it be possible to extend the table for the extension "comment" (
> http://typo3.org/extensions/repository/view/comments/1.4.1/) with a field,
> containing the user id for the fe_user writing the comment and call the
> information for the specific fe_user with a hook(?) when outputting the
> written comment, if yes, how do I call the fe_user's id? And what about the
> FE user information based on its user id?

Oh, I see what you mean :) Sorry for misunderstanding :)

Yes, it is possible. There is a hook named "processSubmission". It can alter prepared record (add fields, for example). There you can put fe_user id into your own field. For example:

function processSubmission($params, &$pObj) {
	$params['record']['tx_myext_feuser_id'] = $GLOBALS['TSFE']->fe_user->user['uid'];
	return $params['record'];
}

And you define a hook in ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['comments']['processSubmission'] = 'EXT:myext/class.tx_myext_hookclass.php:tx_myext_hookclass->processSubmission';

You need to defined your field as "group" type and set option "prepend_tname" as false for this field. Field itself can be int.

-- 
Dmitry Dulepov
E-mail: dmitry at typo3.org
Skype: callto:liels_bugs
TYPO3 technical: http://typo3bloke.net/


More information about the TYPO3-english mailing list