1
sipiatti
Random picture in theme
  • 2007/12/28 23:09

  • sipiatti

  • Just popping in

  • Posts: 22

  • Since: 2007/1/23


Hi,

I am currently designing a theme but have some difficulties with putting random image into the header.

I wanted to use a simple php command to make the <img> tag's src value but it failed. Guess it somehow related to smarty but now I am stucked.

I tried to insert my command into the theme.html as follows:
<script type="text/php">
        <!--
        print (
'<img src="<{$xoops_imageurl}>images/bg'.rand(1,6).'.jpg >"');
        
//-->
        
</script>

and like this
<?php print ('<img src="<{$xoops_imageurl}>images/bg'.rand(1,6).'.jpg >"'); ?>

but none of them worked

If I check the source of the page what XOOPS generated I see the php command in it, so it is wrong.
Does anybody know how to solve this?
Any idea should be appreciated, thx in advance.

2
stefan88
Re: Random picture in theme
  • 2007/12/28 23:12

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,

smarty:

<{php}>

...

<{/php}>

:)
..

3
sipiatti
Re: Random picture in theme
  • 2007/12/28 23:26

  • sipiatti

  • Just popping in

  • Posts: 22

  • Since: 2007/1/23


yep thx :)
it works

Login

Who's Online

171 user(s) are online (98 user(s) are browsing Support Forums)


Members: 0


Guests: 171


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits