Gallery Logo changes when refresh? Gallery Logo changes when refresh?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Gallery Logo changes when refresh?

Started by Mr.Jamie, October 15, 2005, 04:56:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mr.Jamie

Hey guys! I hope you can help. Is there a way to make the small logo picture at the top of my gallery change to a different one when the page is refreshed, I've seen it done on other people's galleries. Mine is: http://www.untold-fairytales.org/gallery

Stramm

sure it's possible... here's a simple banner rotator I've written once. You can use it to rotate logos as well

<!--
var how_many_ads = 2;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt="test text 1";
url="http://google.com";
alt="Google";
banner="../../pathto/image.jpg";
width="480";
height="90";
}
if (ad==2) {
txt="just text here - visit Yahoo";
url="http://yahoo.com";
alt="";
banner="";
width="";
height="";
}

if (banner == "")
{
document.write('<a href=\"' + url + '\" target=\"_top\">' + txt + '</a>');
}
else
{
document.write('<a href=\"' + url + '\" target=\"_top\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('<small>' + txt + '</small></a>');
}
-->


txt= text below banner (remove the document.write... if not needed)
url= on banner click url
banner= img src
width, height, alt .. you know what that is

to add more banners/ images .. adapt var how_many_ads = 2; and add a new if (ad== block

if you only need images then modify the document.write part till you're happy with the result


Mr.Jamie

Aw thanks, but I do have some questions. Where do I put that code, and where I do put the url for the images I want to rotate? I really can't make sense of it :-[

Joachim Müller

Quote from: Mr.Jamie on October 16, 2005, 08:38:55 PM
Where do I put that code
themes/yourtheme/template.html. Anywhere on that page.

Quote from: Mr.Jamie on October 16, 2005, 08:38:55 PMwhere I do put the url for the images I want to rotate?
should be quite obvious:banner="../../pathto/image.jpg";

Mr.Jamie


Mr.Jamie

Actually, I haven't got it. I tried it but it just won't work. :\'(

Joachim Müller


Mr.Jamie

It doesn't contain the code because I took it out after I tried it and it didn't work.

Joachim Müller

How am I suppossed to help then? Put it back in, post that you did so, wait untill a supporter has taken a look at it and suggests possible changes.

Stramm

save this above eg as rotate.js in your themes dir and call it where the banner/ logo should appeare

<script type="text/javascript" src="rotate.js"></script>