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: add link or banner to some galleries  (Read 3914 times)

0 Members and 1 Guest are viewing this topic.

pribl

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
add link or banner to some galleries
« on: January 09, 2009, 08:45:32 pm »

I need to add a little text-link or banner to some galleries on my site. is there is a way to do it ? I know how to add banner/text link to the template to see this link on every page & every gallery. But I need add special link to a special gallery. May be thre is a plugin or something to do it ?
Logged

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: add link or banner to some galleries
« Reply #1 on: January 11, 2009, 02:46:40 pm »

Without a link to your gallery or a better description of where you want to put the banner or text, I can only suggest this simple method of putting it at the top of the page for the specified album or category page.

1. Using the custom header include in the Config setup, put a name in for the file (i.e. header.html).

2. Put the {CUSTOM_HEADER} token somewhere in your template.html file where you want it to show.

3. Create an empty plain text document then copy & paste this code into it and save it with the same name and extension as in #1.
Code: [Select]
<?php
if ($_REQUEST["album"] ==10){print 'This album was brought to you by foo bar';}
elseif (
$_REQUEST["album"] ==14){print '<img src="http://www.google.com/intl/en_ALL/images/logo.gif">';}
if (
$_REQUEST["cat"] ==2){print 'This category maintained by BullsEyePhotos.com';}
?>


4. Edit and/or add lines to suit your needs. The first request will print "This album was brought to you by foo bar" at the top of album id=10 page. The second request will display the Google logo at the top of the album id=14 page and the third displays the text at the top of category id=2 page.

If you need help with the custom header, read the documentation or do a search. You could also use this same idea for the footer or for both header/footer.

Logged
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

armus

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
    • glamour galleries
Re: add link or banner to some galleries
« Reply #2 on: November 01, 2009, 04:28:49 pm »

to add many different categeries and albums do we have to repeat as

if ($_REQUEST["cat"] ==2){print 'This category maintained by BullsEyePhotos.com';}
if ($_REQUEST["cat"] ==3){print 'This category maintained by BullsEyePhotos.com';}
if ($_REQUEST["cat"] ==4){print 'This category maintained by BullsEyePhotos.com';}
if ($_REQUEST["cat"] ==5){print 'This category maintained by BullsEyePhotos.com';}
.
.
.

or any shorten available 2,3,4,5,... ?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: add link or banner to some galleries
« Reply #3 on: November 01, 2009, 11:47:30 pm »

There are other language constructs in PHP that allow the code to be a bit more optimized, but none that really would be much easier for you to apply and maintain.
Logged

armus

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
    • glamour galleries
Re: add link or banner to some galleries
« Reply #4 on: November 02, 2009, 12:20:51 pm »

I was hesitating to repeat these lines hundreds of times for hundreds of albums and categories because it will slow down the speed of the page openings but almost no effect at the regular speed.
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 20 queries.