MyBB Community Forums

Full Version: Display a random image
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
You have to replace 20 with the number of images you have:
$rand = rand(0,20); 
Did you named a picture 0.jpg ? cause 0 can also be generated by that rand() thing. And how many pictures do you have in that folder ?
MarkusK Wrote:You have to replace 20 with the number of images you have:
$rand = rand(0,20); 
I edited this part -
$rand = rand(1,53); 
If you make sure you have pics named from 1.jpg, 2.jpg, ... , 53.jpg, there always should be a pic shown =/ =P
maybe some are .gif
the files are name 1.jpg ect upto 53.jpg and none are gif files.

EDIT:

Some files were in caps.

Thanks for all your help guys it looks great
Pages: 1 2