Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Gallery Logo changes when refresh?  (Read 4442 times)

0 Members and 1 Guest are viewing this topic.

Mr.Jamie

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Gallery Logo changes when refresh?
« on: October 15, 2005, 04:56:36 pm »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Gallery Logo changes when refresh?
« Reply #1 on: October 16, 2005, 11:05:15 am »

sure it's possible... here's a simple banner rotator I've written once. You can use it to rotate logos as well
Code: [Select]
<!--
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Gallery Logo changes when refresh?
« Reply #2 on: October 16, 2005, 08:38:55 pm »

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 :-[
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Gallery Logo changes when refresh?
« Reply #3 on: October 16, 2005, 11:10:23 pm »

Where do I put that code
themes/yourtheme/template.html. Anywhere on that page.

where I do put the url for the images I want to rotate?
should be quite obvious:
Code: [Select]
banner="../../pathto/image.jpg";
Logged

Mr.Jamie

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Gallery Logo changes when refresh?
« Reply #4 on: October 16, 2005, 11:51:55 pm »

Got it! Thanks :D
Logged

Mr.Jamie

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Gallery Logo changes when refresh?
« Reply #5 on: October 17, 2005, 12:01:33 am »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Gallery Logo changes when refresh?
« Reply #6 on: October 17, 2005, 12:17:51 am »

http://www.untold-fairytales.org/gallery/themes/classic/template.html doesn't contain the suggested code. What's your actual question?
Logged

Mr.Jamie

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Gallery Logo changes when refresh?
« Reply #7 on: October 17, 2005, 12:20:50 am »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Gallery Logo changes when refresh?
« Reply #8 on: October 17, 2005, 12:23:37 am »

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.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Gallery Logo changes when refresh?
« Reply #9 on: October 17, 2005, 08:56:41 am »

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

Code: [Select]
<script type="text/javascript" src="rotate.js"></script>
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 20 queries.