add link or banner to some galleries add link or banner to some galleries
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

add link or banner to some galleries

Started by pribl, January 09, 2009, 08:45:32 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

pribl

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 ?

Gizmo

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.

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

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

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,... ?

Joachim Müller

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.

armus

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.