ZenphotoCMS Forum
How to add banners? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: How to add banners? (/thread-2275.html)

Pages: 1 2


How to add banners? - warlock - 2008-02-24

Hello, please, I need some help to add a custom banner for each gallery. Someone can help me?

Thank in advance.




How to add banners? - acrylian - 2008-02-24

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.




How to add banners? - warlock - 2008-02-26

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.

Thanks again.




How to add banners? - acrylian - 2008-02-26

Ok, 500 albums is a lot, maybe you could use tags for that.




How to add banners? - warlock - 2008-02-27

How I can do that?




How to add banners? - sbillard - 2008-02-27

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() {

case "banner1":

$bannerimage = ;

break;

case "banner2":

$bannerimage =

break;

.....

}`




How to add banners? - warlock - 2008-02-27

Hello, sbillard! Thanks lot for your help. This is the full working code:

`

`

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.




How to add banners? - sbillard - 2008-02-27

$_zp_current_album->getTags() will do it.




How to add banners? - warlock - 2008-02-28

Thanks sbillard! Working like a charm




How to add banners? - dunker - 2008-04-09

Hello - This post almost answers my question... I am new and I need to know where exactly to edit the code - if(getAlbumTitle() === "") { }. 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




How to add banners? - acrylian - 2008-04-09

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 -section of these files. Where exactly depends on the theme design you want to use.




How to add banners? - dunker - 2008-04-16

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




How to add banners? - acrylian - 2008-04-16

[i]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]
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.




How to add banners? - dunker - 2008-04-16

I think I can handle this one! Thanks!




How to add banners? - warlock - 2008-05-22

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:

Thanks.




How to add banners? - acrylian - 2008-05-22

I don't think we changed anything with that function: http://www.zenphoto.org/documentation-official/zenphoto/_template-functions.php.html#functiongetTags




How to add banners? - sbillard - 2008-05-22

Tags are stored as an array now, not a string of comma separated values. You can always refer to the function guide for things like getTags().

The hack really did not work even before this change if there were more than one tag set since it would return 'tag1,banner1,....




How to add banners? - warlock - 2008-05-22

@acrylian
@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.




How to add banners? - sbillard - 2008-05-22

$tags = getTags();
switch ($tags[0]) {`

will do.




How to add banners? - warlock - 2008-05-22

Thanks mate! Here is the full code, maybe someone will need it: