[TYPO3-english] userFunc condition
Sergio Catalá Gil
scatala at iti.upv.es
Tue Sep 8 13:41:23 CEST 2009
Hi,
I've got the next code:
######### TS #########
includeLibs.pf = fileadmin/class.user_functions.php
plugin.tt_news.genericmarkers {
pk = USER
pk {
[userFunc = user_functions->user_compare_dates]
10 = TEXT
10.value = Subscribe
[else]
10 = TEXT
10.value = Closed (can't subscribe)
[end]
}
}
######### TS #########
### fileadmin/class.user_functions.php ###
<?
class user_functions {
function user_compare_dates($content, $conf) {
echo "Function executed";
// Opened course
if
($this->cObj->data['generic_tx_mblnewsevent_inscription_end_date'] >
strtotime(now))
return true;
// Closed course
else
return false;
}
}
?>
### fileadmin/class.user_functions.php ###
It seems: if I put "userFunc" in a condition, the function isn't
executed. Could you tell me why? Instead, if I try the next code
(userFunc without a condition):
plugin.tt_news.genericmarkers {
pk = USER
pk {
userFunc = user_functions->user_compare_dates
}
}
the function gets executed.
What am I doing wrong? :-(
More information about the TYPO3-english
mailing list