forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: pribl on January 09, 2009, 08:45:32 pm

Title: add link or banner to some galleries
Post by: pribl 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 ?
Title: Re: add link or banner to some galleries
Post by: Gizmo 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 (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_theme) 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 (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm) or do a search. You could also use this same idea for the footer or for both header/footer.

Title: Re: add link or banner to some galleries
Post by: armus 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,... ?
Title: Re: add link or banner to some galleries
Post by: Joachim Müller 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.
Title: Re: add link or banner to some galleries
Post by: armus 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.