You need to check the album title or ID and then print the specific banner with an IF statement. Use something like this on album.php: `if(getAlbumTitle() === "") { }`
You need to do that for all albums you wish a specific banner to be shown.
Hi acrylian! Thanks for help me. I need to make 500 albums with 10 different banners, your code will use a lot of time and server resources? Maybe I can arrange in subcategories and show banners for categories.
You would invent a "tag" for each of the 10 different banners. In Admin you would edit each of the albums and assign the tag of the banner you want displayed. Then on your album page you would include code to check that the tag of the album and display the appropriate banner. If you are careful to assign only the tag for the banner, then the code to test is fairly simple: ` switch (getTags() {
Now I have another question, I can get the tags from album in image page? I need show the same banner in album page and image page. Assign tags for all images will take a lot of time.
Hello - This post almost answers my question... I am new and I need to know where exactly to edit the code - if(getAlbumTitle() === "<the-album-title-you-wand>") { }. There are a lot of files, and I'm not sure which one does the trick. Seems that there is no way to do this via the zenphoto administration area, so I assume (??) that it's done from my hosting control panel file manager?
Any assistance would be appreciated. Thank you. Also, why can I not access the "Option", "Theme Options" tab? Shows nothing and says error on page down in the corner. ?? WEIRD
You would have to edit your theme file if you wish to have a specific banner. You of course need some html and css knowledge for that. It is not possible to do that via the admin options.
The theme files you would have to alter are index.php, album.php, image.php, search.php and archive.php (if you don't use the last one, you of course don't need to alter it).
The code for a banner should be right below the <head></head>-section of these files. Where exactly depends on the theme design you want to use.
So I can alter the html code directly, right in those files you mentioned? Is it that easy? Right now I'm just using the defalt theme. I basically want to add my logo banner jpg file to the top of each page. Please clarify that for me so I don't go and do something stupid... ha ha. Thanks
So I can alter the html code directly, right in those files you mentioned? Is it that easy? Right now I'm just using the defalt theme. You would have to change the html code and probably the css files, too. I can't answer if that is easy for. You would need to have some knowledge about html and css of course.
Today I upgraded to 1.1.6 and banners hack stop working. Some tags function was changed in 1.1.6?
This is the code: <?php switch (getTags()) { case "banner1": $bannerimage = 'Banner1'; break; case "banner2": $bannerimage = 'Banner2'; break; } echo $bannerimage; ; ?>
Thanks for reply, I only need one tag to show banners for each image provider, please can you help me with the new code? I'm a little confused. Thanks Again.
Comments
`if(getAlbumTitle() === "") { }`
You need to do that for all albums you wish a specific banner to be shown.
Thanks again.
` switch (getTags() {
case "banner1":
$bannerimage = ;
break;
case "banner2":
$bannerimage =
break;
.....
}`
`
<?php<br />
switch (getTags()) {
case "banner1":
$bannerimage = 'Banner1';
break;
case "banner2":
$bannerimage = 'Banner2';
break;
}
echo $bannerimage;
; ?>
`
Now I have another question, I can get the tags from album in image page? I need show the same banner in album page and image page. Assign tags for all images will take a lot of time.
Thanks again.
Seems that there is no way to do this via the zenphoto administration area, so I assume (??) that it's done from my hosting control panel file manager?
Any assistance would be appreciated. Thank you.
Also, why can I not access the "Option", "Theme Options" tab? Shows nothing and says error on page down in the corner. ?? WEIRD
The theme files you would have to alter are index.php, album.php, image.php, search.php and archive.php (if you don't use the last one, you of course don't need to alter it).
The code for a banner should be right below the <head></head>-section of these files. Where exactly depends on the theme design you want to use.
I basically want to add my logo banner jpg file to the top of each page.
Please clarify that for me so I don't go and do something stupid... ha ha. Thanks
You would have to change the html code and probably the css files, too. I can't answer if that is easy for. You would need to have some knowledge about html and css of course.
This is the code:
<?php
switch (getTags()) {
case "banner1":
$bannerimage = 'Banner1';
break;
case "banner2":
$bannerimage = 'Banner2';
break;
}
echo $bannerimage;
; ?>
Thanks.
The hack really did not work even before this change if there were more than one tag set since it would return `'tag1,banner1,....`
@sbillard
Thanks for reply, I only need one tag to show banners for each image provider, please can you help me with the new code? I'm a little confused. Thanks Again.
Regards.
switch ($tags[0]) {`
will do.
<?php
$tags = getTags();
switch ($tags[0]) {
case "BANNER1":
$bannerimage = 'PROMOTION CODE 1';
break;
case "BANNER2":
$bannerimage = 'PROMOTION CODE 2';
break;
}
echo $bannerimage;
; ?>