[TYPO3] problem with includeLibs!! (Cannot modify headerinformation)

Peter Klein peter at umloud.dk
Fri Feb 23 09:17:18 CET 2007


Hi John.
Check if your PHP file contains empty lines before/after the <? ?> tags. If 
it does, then remove those..

-- 
Peter Klein/Umloud Untd

"John Kavanagh" <john.kavanagh at roomthree.com> skrev i en meddelelse 
news:mailman.33168.1172173823.21067.typo3-english at lists.netfielders.de...
Hello,

I am trying to run some php script, so I can randomly access css classes
for my header.
I have been trying to get typo3 wizards simple tutorial on userFunc...

http://www.typo3wizard.com/en/snippets/common-problems-and-solutions/sim
ple-userfunc.html

It's a really useful function that I only discovered today and I would
really like to get it work!

I almost have it but my includeLibs statement seems to be causing the
error:

"Warning: Cannot modify header information - headers already sent by
(output started at
/home/sites/coillte/fileadmin/templates/scripts/t3scripts.php:15) in
/home/sites/coillte/typo3/sysext/cms/tslib/class.tslib_fe.php on line
2830"

I have a suspicion that templavoila might be the problem but I don't
know.

This is my typoscript:

(The problem is not that the object ref is called lib.header, as the
same problem persisted when I renamed my object ref to
lib.random_header)

page.includeLibs.co037_t3scripts =
fileadmin/templates/scripts/co037_t3scripts.php

lib.header = COA
lib.header.5  = USER
lib.header.5.userFunc =randomFunctions->randomDivClass
lib.header.5.colour = yellow

lib.header.10 = TEXT
lib.header.10.wrap = <div id="pageName"><h1>|</h1></div>
lib.header.10.data =  leveltitle:1

lib.header.20 = HMENU
lib.header.20.entryLevel = 0
lib.header.20.special = list
lib.header.20.special.value = 134,133,132,131,130,129

lib.header.20.wrap = <a href="/"><img
src="fileadmin/templates/images/logo.gif"></a><div
id="navOne"><ul>|</ul></div>
lib.header.20.1 = TMENU
lib.header.20.1.NO {
allWrap = <li class="one">|</li> |*| <li>|</li>
}

lib.header.20.1.ACT = 1
lib.header.20.1.ACT {
allWrap = <li class="one active">|</li> |*| <li
class="active">|</li>
}

lib.header.100 = TEXT
lib.header.100.value = </div>


This is my php (at this stage all it's gonna do it put a colour border
round the header):

<?
class randomFunctions {
var $cObj;  // The backReference to the mother cObj object set at call
time
/**
* Call it from a USER cObject with 'userFunc =
user_randomImage->main_randomImage'
*/
function randomDivClass($content,$conf) {
//var $classIndex = mt_rand(0,18)
$content ='<div id="header" class="" style="border:1px solid
'.$conf["colour"].';">';
return $content;
}
}
?>

Any help at all would be greatly appreciated!!!

Thanks a mil,

John. 




More information about the TYPO3-english mailing list