[Typo3] Conditions by using user functioons

Jean-David Gadina macmade at gadlab.net
Tue Aug 9 14:22:33 CEST 2005


Hello Tapio,

For you PHP functions, you should create a PHP file, and include it  
in localconf.php. This will keep localconf clean.

Then, you need to prefix your functions. By default, the prefix is  
user_ (this can be changed in the installTool).

So, for example:

function user_checkMonday() {
     if (date('w',time()) == 1) {
         return true;
     } else {
         return false;
     }
}

This will check if the current day is Monday...

In your TS setup:

[userFunc = user_checkMonday]
     page.headerData.10 = TEXT
     page.headerData.10.value = <link rel="stylesheet" type="text/ 
css" media="screen" href="fileadmin/css/monday.css"
[GLOBAL]

--
Jean-David Gadina (macmade)
www.gadlab.net - Multimedia Network


On Aug 9, 2005, at 1:50 PM, tapio wrote:

> Hi
>
> I read this page
> http://typo3.org/documentation/document-library/doc_core_tsref/ 
> userFunc/
>
> But I didn't fully understood everything.
>
> I woud like to create
> [userFunc = be_user(ID)]
>
> and
>
>
> [userFunc = be_user_group(ID)]
>
> the result, which I would like to get would be like
>
> [userFunc = be_user_group(1)]
> page.headerData.22 = TEXT
> page.headerData.22.value =<link rel="stylesheet" type="text/css"
> href="fileadmin/template/main/css/fe-buttons_user_group_1.css"
> media="screen,projection,handheld" />
> [global]
>
> BUT the code should put to localconf.
> Does TS work at all?
> _______________________________________________
> 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