[TYPO3] "Connecting" comments extension to fe_users

Søren Malling soren.malling at gmail.com
Sat Jun 14 01:32:13 CEST 2008


Hej Dmitry,

Thanks for the great answer, I'm glad to hear about the hook.

I've found the function processSubmission() in
EXT:comments/pi1/class.tx_comments_pi1.php, but if i understand your reply
(and the whole conecpt of hooks) that's not the file for me to edit? Instead
i should turn my head to the ext_localconf.php file in the root of the
specific extenstions folder (EXT:comments/)(?). Right now I've inserted a
line like this


if (t3lib_extMgm::isLoaded('tt_news')) {

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['extraItemMarkerHook'][$_EXTKEY]
= 'EXT:comments/class.tx_comments_ttnews.php'
}

But how do I declare the extra field "group". Will I have to extend the
table through "kickstarter" (or maybe directly thorugh phpMyAdmin) and how
to I add the specific value to the field, from this hook?

This is my first try on using the hook function, and unfortuantely
http://typo3.org/development/articles/how-to-use-existing-hooks/page/4/didn't
give me much help.

Thanks very much for your help on this one!

Best regards

Søren


On Thu, Jun 12, 2008 at 2:12 PM, Dmitry Dulepov [typo3] <dmitry at typo3.org>
wrote:

> 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/
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>


More information about the TYPO3-english mailing list