General Community > Scripting Help

How To Make Random Header Images


hallo evry one I nead a Code How to make Random Header Background Images?

Like this one: hxxp:";theme=22" [nonactive]

There are many ways to do this but it is more than the code, you will need to implement it in theme properly but in any case you could use PHP to do a random pick between numbers and then put the class in relevant place like:

--- Code: ---$random=rand(1,3);
--- End code ---

Sir Osis of Liver:
Can also do it like this -

--- Code: ---
$pic = rand(1,5);

echo '
<img src="',$settings['images_url'],'/img/topr', $pic ,'.jpg" alt="" />';

--- End code ---

Where images are topr1.jpg, topr2.jpg, etc.


[0] Message Index

Go to full version