Logged Out
Create an Account
Login:
Password:

Forgot your password?
Random Images / Image sets?

Random Images / Image sets?
[Back to Index]  [Bottom of Thread]
Thread Tags
Primary: [Suggestions]
Secondary: None
Suggestion :

Im not sure how you would go about this ... but is there any way we can get random header images?

What I am thinking would likely require something more than just adding a random command, because like on my site, there are essentially 5 Header images ... and for this to work right ... all 5 images would have to be linked to each other somehow ...

I suppose you could do this with file names ...

lrgheader1.gif
smlheader1.gif
handle1.gif
hilt1.gif
blade1.gif

largeheader2.gif
smlheader2.gif
handle2.gif
hilt2.gif
blade2.gif

OR ... you could use file folders like header_images_01, header_images_02...

or you could create some kind of database system that allowed us to create image sets ...

Anyway ... not a huge deal if it can't be done ... I was just thinking of creating some generic images for when I am ready to send in a template, and thought it might be cool.

with your system in mind, adding numbers to the end of image names might be the easiest to deal with ... like

<img src="header<!--System:Random:2-->.gif">

not sure if that would work tho ... or if you could make it :
<!--System:Random:Imagenum--> and tie Imagenum to something we can set in config that would save some editing...

Another weird offshoot could be holiday image sets with date associated to them ... lol ... ok i'll shut up now ^_^




--
Hmmm...I'll have to think about that. That's an interesting idea.

I'd actually do it more like <!--System:Random:X-Y--> where X is the lower bound and Y is the upper bound, but that's a good idea.

--
It's all in the reflexes.
Quote by Chops
Hmmm...I'll have to think about that. That's an interesting idea.

I'd actually do it more like <!--System:Random:X-Y--> where X is the lower bound and Y is the upper bound, but that's a good idea.


Yea, the number generator would definitely be the easiest, but I wonder if, for control sake (and for the sanity of some of the less techy users) it would be possible to have a field in the admin panel to control it?

Im not sure how you would control the option to allow for people to make a rand number between 5 and 12 or something, but .. what I am thinking is, add an Image Set Suffix field, so that we can goto admin and type in xmas ... and an xmas "theme" will appear ... or go in and type rand, and it will randomize it.

I am guessing if you wanted to go this far with it, you could allow us to type in rand:2:5 and pull out the 2 and the 5 with text modifiers (then you would just have to make the format for random numbers in BIG RED TEXT so people wouldnt screw up their site ... not sure how hard it would be to error check it against xmas themes and the like tho ...

If anything I would prefer the random themes over the holiday themes.

EDIT :
Or .. there could be 3 fields : a name field ... which would default to blank ... meaning no suffix would be added ... and the a min and max field ...

EDIT 2: Actually, now that I think about it, no reason to have a field for a name ... we can just make it random from 5 to 5 .. thus ensuring we get the set we want.

--
So, despite being clueless with javascript .. I was able to mod a script I found to work for me. The site now has random header images ... I will work on random swords ... maybe >.>

Here's what I did :


<SCRIPT LANGUAGE="JavaScript">
var img1="http://www.dkpfiles.com/<yoursite>/files/hdr1.gif
var img2="http://www.dkpfiles.com/<yoursite>/files/hdr2.gif
var img3="http://www.dkpfiles.com/<yoursite>/files/hdr3.gif
var img4="http://www.dkpfiles.com/<yoursite>/files/hdr4.gif

var rand1=Math.round(8*Math.random())

if (rand1<=8)
img=img1
if (rand1<=6)
img=img2
if (rand1<=4)
img=img3
if (rand1<=2)
img=img4
</script>


This randomized the images ... Basically 8 is a number equal to 2*<number of images> ... not sure why but the original script had it setup this way ... not sure if it matters if its 4, and you just use 1,2,3, and 4 instead of 2,4,6, and 8 ... prolly doesnt matter...

now, you need to get the image into the place in the layout where you want it :


<td>
<script Language="Javascript">
document.write('<img src="'+img+'">')
</script>
</td>


Alternately, if you need to set a background image to a cell, you need to assign the whole <td> ... I think ... :


<script Language="Javascript">
document.write('<td width=100% background="'+img+'">')
</script>


Enjoy ^_^



--
Clever!

--
It's all in the reflexes.


[Back to Index]  [Top of Thread]