[TYPO3-english] userFunc condition

Peter Klein peter at umloud.dk
Wed Sep 9 16:16:05 CEST 2009


Hi Sergio.

I still can't see why you need a userfunc for that comparison.

In Typoscript yopu can do something like this:

if.value.data = date:U
if.isGreaterThan.field = generic_tx_mblnewsevent_inscription_end_date

--
Peter

On Wed, 09 Sep 2009 14:39:39 +0200, Sergio Catalá Gil
<scatala at iti.upv.es> wrote:

>
>What I mean, Peter, is: how would I get the return value (true or false)
>of a function inside my TS?
>
>I've got the next method:
>
><?
>class user_functions {
>  function user_compare_dates($content, $conf) {
>
>    // Opened course
>    if
>($this->cObj->data['generic_tx_mblnewsevent_inscription_end_date'] >
>strtotime(now)) 
>      return true;
>    // Closed course 
>    else
>      return false;
>  }
>}
>?>
>
>and the next TS code:
>
>plugin.tt_news.genericmarkers {
>  	pk = TEXT
>	pk {
>		value = <strong>Closed course</strong>
>		wrap = |</p>
>	}
>}
>
>plugin.tt_news.genericmarkers {
>	pk = USER
>	pk {
>		userFunc = user_functions->user_compare_dates
>		#################################
>		# if (return_value_of_userFunc_is_true) then		
>		#	10 = TEXT
>		# 	10.value = <strong>Opened course</strong>
>		#################################
>	}
>}
>
>I don't know how to solve the code between ### and get the return value
>of the function :-(
>
>Sergio
>


More information about the TYPO3-english mailing list