ZenphotoCMS Forum
nightly build fixes - 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: nightly build fixes (/thread-3046.html)

Pages: 1 2


nightly build fixes - acrylian - 2008-06-10

bill61: You can assign different themes to each top level album, so you could just double the theme you are using and rename it, then change it's album.php to show "videos" instead of "photos".
But Mammlouks recent suggestions are probably the most convenient ones.




nightly build fixes - bill61 - 2008-06-10

hi Mammlouk

ok, so in this case lets say the sub-album name is : "Amazing Things" so it should be : Amazing Things_vid and the same for audio correct??

and this will be apply for all sub and sub-sub albums in the main album in this case " Videos" and so on correct??

if yes i thing the re-code should in the album.php only or in both album.php and image.php??

regards




nightly build fixes - bill61 - 2008-06-10

hi acrylian

i thing so

lets work on Mammlouk suggestion hope i get it right this time




nightly build fixes - Mammlouk - 2008-06-10

bill61:

If I understand you correctly, you have it right. Basically any album that contains actual videos (or audio tracks) will need to have the appropriate naming convention applied.

You should only have to modify album.php

This will take care of handling the checking of albums:

$number = getNumImages();
if ($number > 0) {
if(stristr(getAlbumTitle(), "_vid")){
$multtext = " videos";
$singtext = " video";
}else if(stristr(getAlbumTitle(), "_aud")){
$multtext = " tracks";
$singtext = " track";
}else{
$multtext = " photos";
$singtext = " photo";
}
if (!empty($counters)) { $counters .= ", "; }
if ($number != 1) $number .= gettext($multtext); else $number .= gettext($singtext);
$counters .= $number;
}

If you want to make it so your albums aren't listed with the "_vid" or "aud" being visible then go to all of the places where getAlbumitle() is being printed (NOT WHERE IT IS USED FOR OTHER FUNCTIONS) and replace it with:

str_ireplace("_vid", "", str_ireplace("_aud", "", getAlbumTitle()))

I think that should take car of your problem for now. It's not very elegant, but it gets you by. I was just thinking another option that would avoid the str_ireplace fix for titles would be to put your ivde and audio tags in the album description instead and then change the stristr loop to check in getAlbumDesc() instead of getAlbumTitle().

-Jeremy




nightly build fixes - bill61 - 2008-06-11

hi Mammlouk

i am doing test now but i thing i did not have the code above in the right place

bellow is the full "album.php" file code could u pls re-write it for me according to your code above?

you may find lines like:

i made this lines so i can work out the original from the modifications each time i upgrade.

here is the code:

 | 



nightly build fixes - Mammlouk - 2008-06-11

Yeah, I will post it later tonight.




nightly build fixes - Mammlouk - 2008-06-11

Sorry, didn't have time last night, I will try to get it up today.




nightly build fixes - bill61 - 2008-06-11

hi Mammlouk

it is ok




nightly build fixes - Mammlouk - 2008-06-12

O.k. here is the change to recognize the directories have video/audio/photo based on the name. All of the changes are included within the third "modified" block. I am only posting that portion because the rest of the file you posted has errors due to the forum parsing your a refs. To avoid that in the future surround the code in back tick marks. If you would like me to add the code to strip the vid and aud from being show I will need you to repost the code within bacticks so I can accurately find all applicable portions.

`

`




nightly build fixes - bill61 - 2008-06-13

hi Mammlouk

thanks for the help for the last days

it works perfectly well now.

something else related to this i am not realy sure if it can be done.

i the home page : http://mediabox.alankabout.com/

u will find:

Gallery data

Albums: ## · SubAlbums: ## · Images: ## · Comments: ##

now, how can i get the numbers for : Videos and Audio Tracks ??

in index.php the code is:

            Gallery data

        Albums:  ·
            SubAlbums:  ·
            Images: 

                ·
                Comments: 

regards




nightly build fixes - Mammlouk - 2008-06-13

I had a feeling that would be the next question. I'll respond later today.




nightly build fixes - Mammlouk - 2008-06-15

I'm really not seeing an easy way of doing this since it's not specified video/image in the database. Let me think about it for a few days. Also, maybe someone who know the internals better can suggest a method.




nightly build fixes - acrylian - 2008-06-15

I still think the easiest would be to use albums specificiall for videos and use an album theme for that or a check by name.




nightly build fixes - bill61 - 2008-06-15

hi Mammlouk

it is ok thanks




nightly build fixes - bill61 - 2008-06-15

hi acrylian

i did already changed the names of folders in the directory who contains "videos" to "-vid" in the end of the folder name.

did u mean that i should create a "video.php" in the themes as well ??




nightly build fixes - acrylian - 2008-06-15

I actually meant the renaming of folders (sorry, I don't have the whole thread in mind when I replied. so that might be a nonsens reply at all..:-))