Pages (3):    1 2 3   
Administrator
Administrator
acrylian   2013-11-21, 11:37
#21

Also you can modify your theme's search.php to not search within albums. This is what our own site does.

Member
Member
haroon   2013-11-21, 13:00
#22

thanks a lot for the help.

just started php recently so i guess it'll take me some time to modify the functions which I find a bit confusing.

regards

Administrator
Administrator
acrylian   2013-11-21, 13:13
#23

Yes, it takes some time to get into this. Sadly not avoidable. Especially since the search.php page is a bit more complicated than others.

You can look however at the e.g Zenpage theme and our site theme. Both are on GitHub in separate repos.

Member
Member
haroon   2013-11-21, 15:28
#24

ok thanks, in any case my next task in line is a request feature on github

Member
Member
sbillard   2013-11-21, 18:35
#25

The feature you wish does already exist, you just have to modify your theme to invoke it.

Member
Member
haroon   2013-11-22, 04:29
#26

No not this feature. Its a totally new one i.e. the header.jpg image is selected automatically when a particular album is selected e.g. when viewing scuba diving album the header image is something related to water and not mountains.

thanks

Member
Member
sbillard   2013-11-22, 17:59
#27

You can do this if you want. It is not a new feature. Just something you have to code.

Administrator
Administrator
fretzl   2013-11-23, 11:05
#28

You could try something like this in the `ofalbum.php

header {


background-image: url(/images/some_image.ext);
}

`

Member
Member
haroon   2013-11-24, 06:23
#29

Oh Thanks a lot. love it when some one sends a code

Member
Member
haroon   2013-11-24, 07:24
#30

ok great its working fine except that there was an extra > before the image ext which i have removed. However it only works uptil this stage:

http://www.outzeal.com/index.php?album=scuba-diving

After this it reverts to the original setting. Can you please send me some code to rectify this. I am sorry I've taken up lot of your time.

Thanks

Administrator
Administrator
fretzl   2013-11-24, 09:37
#31

Of course you have to do some coding for every album ;-)

A bit different but easy to modify. Just copy and paste extra lines for more albums.
A note: the code uses the album [b]name[/b] and not its
[b]title[/b] (the name is the name of the album folder)

`

header {


background-image: url(
/images/some_image.ext
/images/another_image.ext
/images/yet_another_image.ext
);
}

`

Administrator
Administrator
acrylian   2013-11-24, 10:23
#32

If you want to tie the image to the top level parent in the album tree only you can also use this helper function:
http://www.zenphoto.org/documentation/core/_functions.php.html#functiongetUrAlbum

But besides that fretzl's way is the right one.

[i]he name is the name of the album folder)[/i]
Actually it is the folder name including the parent album names if a sub album (topevel/sublevel1/sublevel2…).

Member
Member
haroon   2013-11-24, 12:22
#33

Just for scuba the structure is parent scuba album - 4 sub albums - 1 subalbum has further 9 subs - each 9 has images.

That will be too much coding. Perhaps no problem for the first time but every time a new album is added the coding will need to be done. e.g. just or 1 scuba album there will be three segments:

if ($_zp_current_album->name == "scuba-diving")

if ($_zp_current_album->name == "scuba-diving/photos")

if ($_zp_current_album->name == "scuba-diving/photos/spain")

  • some code when the image is displayed

I am not yet familiar with functions yet. If it has to be through functions then I guess I'll have to wait before I understand that, unless Fretzl posts some ready made stuff for me to paste

Thanks

Administrator
Administrator
acrylian   2013-11-24, 13:07
#34

If you need a different image for each album/subalbum there is no way to do it differently. Except you could use either the random images functions or just use the album thumb of each album. There are functions for that.

If you ony want always the same for all "scuba" subalbums as a "section" then use the uralbum function I linked.

In any case you need to get a bit into it as we cannot post examples for everything as you might understand.

Administrator
Administrator
fretzl   2013-11-24, 15:51
#35

I'm in a good mood ;-)

Maybe a different approach is easier once set up.

The idea is to use de backend (admin) where you only have to fill in the filename of the image you want as header.

This approach assumes that

[list]
[]You want to be able to set a specific header image for every album and/or subalbum.
[
]The images are present in the [b]images[/b] folder of the theme.
[/list]
[i] [/i]
On the backend all albums have a [b]Codeblocks[/b] field.

Go to admin -> albums -> scuba-diving and copy the image filename for the header (for example: scuba.jpg) in Codeblock#1
Hit "Apply".
Repeat this for every album and sub-album. Just pick the image you want.

On album.php change
` to

Member
Member
haroon   2013-11-25, 05:49
#36

@acrylian: "Always the same for all "scuba" subalbums as a "section" then use the uralbum function I linked."

Thats exactly what I want i.e.

if (url contains scuba-diving)

{show scuba.jpg as the top header image for parent album and all downpath subalbums right till the image is displayed}

else {header.jpg}

but I dont know how to use the function you linked. I understand the concept of function but since just started php cant write the codes yet. Anyway I understand you cant write codes here for all visitors so its ok. I really appreciate the help I've got in the last few days.

@fretzl: really appreciate your effort, thanks a lot. May you always be in a good mood Regarding the codeblock, it works fine for all the albums and sub-albums however the image code does not work. When you click on the thumbnail to open the image then only a black screen is displayed.

Can you please include the option in the code that if there is nothing in the codeblock then the default header.jpg is displayed, since a new user might not know about the code block.

I am really sorry I am asking too much from you guys but hopefully this is my last design issue.

Regards

Administrator
Administrator
acrylian   2013-11-25, 10:44
#37

The usage is actually quite simple. You pass the current album object to it. That is stored in $_zp_current_album on album.php and image.php. The function will now return the album object of the oldest ancestor (the top level parent of it) or if it is itself the toplevel the album itself.

So all you need to do is basically:
$obj = getUrAlbum($_zp_current_album); If($obj->name == 'scuba-diving') { … }

Administrator
Administrator
fretzl   2013-11-26, 19:23
#38

Just to satisfy my own curiosity here's how to use the codeblocks. (tested this time)

Make sure you have a header.jpg image in your images folder to serve as a default header image.

In Codeblock#1 of the toplevel album paste/write the filename of the image to use as header (for example: scuba.jpg)

On album.php and image.php replace

``

with

`

Member
Member
haroon   2013-11-27, 15:08
#39

Sorry again for coming in late (out on my flight again).

Cant thank you guys enough. Everything is working fine. The codeblock thing is great as you dont have to mess around with the code everytime a new album is added.

Much appreciated

p.s. where r u guys based. cant find it on the website.

Administrator
Administrator
acrylian   2013-11-27, 15:15
#40

You get an idea where we are based looking here :-):
http://www.zenphoto.org/pages/zenphoto-team

Pages (3):    1 2 3   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.