How to display random pictures
... in the header, for example like on http://chregu.freeflux.net/
Open master.xsl and search for <div id="banner">, and replace it with
<div id ="banner" >
<xsl:variable name="rand">
<xsl:value-of select="php:functionString('bx_helpers_int::getRand', '1','14')"/>
</xsl:variable>
<xsl:attribute name="style">background-image: url('/files/header_small/pic<xsl:value-of select="$rand"/>.jpg')</xsl:attribute>
In the example above, you'd now have to upload 14 different pictures into /files/header_small/ with the names pic1.jpg, pic2.jpg, pic3.jpg, etc. Adjust the code accordingly :)
Now, a different (randomly selected) background image should appear for the banner-div. You can of course use the same technique for any other element.
Comments
mich würde eigentlich mehr interessieren wie du die plazer-tags via moblog hingebracht hast..
hast du den mobile-client von plazer benutzt?
Suls: Das sind nicht wirklich Plazer-tags, sondern einfach geotags (der link zu sardinia ist auch sinnlos jeweils).
Wie man das macht, steht hier und ich habe einfache die Koordinaten vom GPS abgelesen :)
add a comment
This blog is gravatar enabled.
Your email adress will never be published.
Comment spam will be deleted!
