PDA

View Full Version : Web design help needed.


Picture North Carolina
23rd of January 2009 (Fri), 09:14
I want to have a banner of pictures at the top randomly displayed. That is, each time a person visits the site of clicks a link to another page, an image from a pool of images is randomly chosen and displayed.

Not a slideshow - static images. I don't want Flash or a java applet. It's a Unix server so a section of javascript would work and the best option would be a configurable Perl script.

Can anybody recommend a script that is easy to install and configure?

Thanks.

karinne
23rd of January 2009 (Fri), 10:04
You could use PHP. Are the images in a db? Or you just want to go through a folder and display which ever image?!

Try this PHP Randomizer (http://www.456bereastreet.com/archive/200701/simple_php_randomizer/)

EOSNewbie
24th of January 2009 (Sat), 15:13
If you can figure out php code, take a look at the code in 4Images gallery. It incorporates a random image on the side bar/menu area. I'm sure it could be adapted to put an image in the banner area. An example is Here (http://www.picturemaine.com).

LEWWY
24th of January 2009 (Sat), 16:02
<?php
$testemonials = 3;
$rand = rand(1, $testemonials);

switch ($rand){
case 1:
echo "<h2>Russell @ <a href=\"http://www.mandrsteelsecurity.co.uk\">\"MandR Steel Security\"</a> said..</h2><br />
The guys at HillDesigns did a fantastic job on the website. They sorted out all the hosting for a year with a domain name of our choosing at no extra charge. We are very pleased with final outcome, and we think the contact page makes it a lot easier for potential clients to get in touch. Thanks guys !";
break;
case 2:
echo "<h2>Ryan said</h2><br />
'I would just like to say thanks to HillDesigns for designing me a website advertising my services as a DJ with the limited funds. Thier communications were excellent and they kept me updated at all times and they took my views on board at all times. Highly recommended.'";
break;
case 3:
echo "<h2>Zara @ <a href=\"http://www.simple-essence.co.uk\">\"A Simple Essence\"</a> said..</h2><br />
'HillDesigns come highly recommended not only are they professional but they know thier stuff and have done a fantastic job of developing and designing my website. They are very helpful and was always on hand if there is a problem or something needed changing. One of the best things about HillDesigns is the speed they get things done, and any changes that need doing were done straight away. I would definitely recommend to all.'";
break;
}
?>

I use the above script to randomize which testemonial the viewer see's.. I could adapt it for images if you like.. Unfortunately you would have to name your images numerically (1.jpg, 2.jpg etc etc)

Let me know if your interested..

Picture North Carolina
26th of January 2009 (Mon), 07:47
Thanks for your help(s). I'm currently looking at some scripts to rotate banners.

j.owen
28th of January 2009 (Wed), 00:04
place in head or script section ...

<SCRIPT LANGUAGE="JavaScript">
<!--

<!-- Begin
// Set up the image files to be used.
var theimages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theimages[0] = 'images/example_01.jpg'
theimages[1] = 'images/example_02.jpg'
theimages[2] = 'images/example_03.jpg'
theimages[3] = 'images/example_04.jpg'

// do not edit anything below this line

var j = 0
var p = theimages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theimages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theimages[whichImage]+'">');
}

// End -->

function MM_preloadimages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadimages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>

Place this section of code where you want the images to appear.

<SCRIPT LANGUAGE="JavaScript">;

<!-- Begin
showImage();
// End -->
</script>

its crude, but it works.

ejicon
28th of January 2009 (Wed), 01:04
/\ nice

Picture North Carolina
28th of January 2009 (Wed), 06:41
I'll give it a try. Thanks!