[TYPO3-UG Dutch] php script includen

Rudy Gnodde gnodde.rudy at wag.nl
Wed Mar 21 11:13:19 CET 2007


Sorry, die laatste ?> moet dus niet. En zo te zien zijn de enters ook
niet helemaal goed gegaan, maar volgens mij is het nog wel duidelijk. 

> -----Oorspronkelijk bericht-----
> Van: typo3-ug-dutch-bounces at lists.netfielders.de 
> [mailto:typo3-ug-dutch-bounces at lists.netfielders.de] Namens 
> Rudy Gnodde
> Verzonden: woensdag 21 maart 2007 11:12
> Aan: TYPO3 Usergroup Dutch
> Onderwerp: Re: [TYPO3-UG Dutch] php script includen
> 
> Beste Bas,
> 
> Ik zou als ik jou was een stylesheet genereren met PHP, niet 
> de bestandsnaam van een statische CSS file. Dit kan met het 
> volgende stukje
> code:
> 
> <?php
> /*
>  Generates stylesheet for random header images */
> header('Content-type: text/css');
> 
> $path = 'random_images/';
> 
> $files = array();
> $dir = dir($path);
> while (false !== ($entry = $dir->read())) {
>     if ($entry != '.' && $entry != '..' && substr($entry, -3) 
> == 'jpg') {
>         $files[] = $entry;
>     }
> }
> srand((float) microtime() * 10000000);
> $random = array_rand($files, 1);
> ?>
> div#random_image {
>     background-image: url("<?php echo($path . 
> $files[$random]); ?>"); } ?>
> 
> Dit haalt een random image uit een directory en zet die als 
> achtergrond op een div met id random_image. Deze PHP file 
> moet je dus als stylesheet aan je template toevoegen.
> 
> Met vriendelijke groet,
> 
> Rudy Gnodde
> WIND Internet
> http://www.windinternet.nl
> http://typo3.famouswolf.com
>  
> 
> > -----Oorspronkelijk bericht-----
> > Van: typo3-ug-dutch-bounces at lists.netfielders.de
> > [mailto:typo3-ug-dutch-bounces at lists.netfielders.de] Namens Bas 
> > Heutink
> > Verzonden: woensdag 21 maart 2007 10:55
> > Aan: typo3-ug-dutch at lists.netfielders.de
> > Onderwerp: [TYPO3-UG Dutch] php script includen
> > 
> > Hallo lijst,
> > 
> > Ik wil graag at random een css file in de header plaatsen, om 
> > verschillende images te laten zien via css.
> > 
> > Ik had daarvoor de volgende code bedacht:
> > page.headerData.30 = PHP_SCRIPT
> > page.headerData.30.value =
> > fileadmin/templates/xyz/php/random_header.php
> > 
> > In het php bestand echo je vervolgens het css bestand.
> > Dit werkt alleen niet.
> > 
> > Weet iemand hoe je dit moet aanpakken?
> > 
> > Bas
> > _______________________________________________
> > TYPO3-UG-dutch mailing list
> > TYPO3-UG-dutch at lists.netfielders.de
> > http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-ug-dutch
> > 
> _______________________________________________
> TYPO3-UG-dutch mailing list
> TYPO3-UG-dutch at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-ug-dutch
> 


More information about the TYPO3-UG-dutch mailing list