New Module: Album Cover Browser

Lord Beowulf
Lord Beowulf's picture

Joined: 2010-03-31
Posts: 56
Posted: Tue, 2010-07-27 03:19

Hi all,

I wasn't happy with the requirement that album covers had to propagate up from a child album with the target image. That made things pretty inflexible and required a multi-step "assign to parent then to parent's parent, then re-assign parent if that's not what you want there" type of approach. Thus, the Album Cover Browser was born. This is pretty much just a marriage of the move browser with the "set as album cover" code hacked into the save section. It doesn't have any parameters currently, which means you have to have edit priveleges on the source to allow you to browse for an album to assign to. Theoretically I could allow assigning from anything you can view, but decided against it for this round. Seemed odd for visitors to see a menu prompt for that one thing! I could probably address that so that you at least have to be logged in, but we'll see what people think of this as-is.

Let me know what you think!

Thanks,

Beo

** See: http://gallery.menalto.com/node/97132#comment-374157 for the most recent verion **

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2010-07-27 04:31

Thanks for your contribution. I have created a codex page:
http://codex.gallery2.org/Gallery3:Modules:album_cover_browser
Please feel free to add and fix anything you find.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
sddroog

Joined: 2005-02-01
Posts: 132
Posted: Thu, 2010-08-26 07:49

Hi,

Thanks for this module. However, I can't seem to find where I should set the album cover. Am I missing an option somewhere?

What I really would like is to use ANY photo as the album cover, even if it is not in my Gallery already. Like the "album highlite" feature (or was that a module also?) in Gallery2, where you can simply browse for a photo on your local disk.

Thanks again!

 
Lord Beowulf
Lord Beowulf's picture

Joined: 2010-03-31
Posts: 56
Posted: Thu, 2010-08-26 12:44

Hey sddroog,

The browser works a bit backwards from what you might think. The menu item "Browse for an album to cover" appears on the item to be used as the album cover, similar to the "Choose as the album cover" which covers the album containing the item. The difference is that selecting the menu item brings up a folder browser dialog that lets you search for the album you want this image to cover.

While I agree that adding a completely separate image would be a nice feature, it's not really practical with the current design of the gallery architecture. The thumbnail is assigned from the database ID of the source image, so the source image has to be in the database. You'd have to add some sort of hidden folder structure to hold the extra images/thumbs and get them in the database alongside the visible items. Not particularly worth the effort! Before I came up with this module, I'd tried uploading temporary files and then moving/deleting them but that caused the album image to be reset. Thus I had to come up with a different way.

Beo

 
sddroog

Joined: 2005-02-01
Posts: 132
Posted: Thu, 2010-08-26 19:52

I don't understand the Gallery architecture completely, but what I do now is simply create a thumbnail for an album, name it .album.jpg and put it in the correct subdirectory of /var/thumbs. Then I set the thumb_height and thumb_width values in the items table to match the thumbnail and I am done...

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Mon, 2010-10-18 04:46

Hello,

Great module Beowulf, I remember I had made the same comment when testing the beta.
I have installed and activated the modules but I get no "Browse for an album to cover" anywhere in any album, I just get the "Choose as the album cover". I have tried it on Safari, Firefox and Chrome on mac...

-----------------

* Version: 3.0 (Santa Fe)
* Albums: 3
* Photos: 15

remove Platform information

* Operating system: Linux 2.6.18-194.11.3.el5
* Apache: Apache/2.2.3 (Red Hat)
* PHP: 5.2.6
* MySQL: 5.0.77
* Server load: Unavailable
* Graphics toolkit: gd

Database = mysql

 
mr_hyde

Joined: 2009-09-20
Posts: 46
Posted: Tue, 2010-10-19 17:47

Same here and I tried it with several versions of G3 (3.0 RC2, 3.0 official)

 
togeis

Joined: 2010-11-02
Posts: 2
Posted: Wed, 2010-11-03 22:33

Same here too, with the latest G3

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Mon, 2010-11-22 18:05

Echo: I can't find the new option anywhere.

@Lord Beowulf: Can you confirm that the module still works for you if you uninstall and reinstall it (using the link above)? I'm not sure if the module itself is broken or if it's conflicting with some specific setups/themes.

Anyone else get it working?

 
splitti

Joined: 2007-02-27
Posts: 5
Posted: Thu, 2010-11-25 15:04

I can't find the new option anywhere, too.

 
clicks

Joined: 2006-12-20
Posts: 1
Posted: Thu, 2010-11-25 16:04

It seems like the context_menu event doesn't find the event class of the album cover browser. It searches for album_cover_browser_event instead of cover_browser_event. I changed the file name from cover_browser_event.php to album_cover_browser_event.php inside the modules helper folder. Appropriately the class name in side has to be album_cover_browser_event_Core! Now the menu item appears for me.

 
milliondollar

Joined: 2010-12-09
Posts: 18
Posted: Sat, 2010-12-11 20:47

clicks,

It doesn't work for me. If I rename it, my whole website cannot be loaded properly.
Any solutions?
_____________________________________________________
Cheers!
Visit my Travel Photo Gallery!

 
lightxx

Joined: 2010-12-02
Posts: 28
Posted: Sun, 2010-12-12 21:28

same here. it simply won't work with the final version of gallery3. renaming the file crashes the entire gallery.

this plugin should be removed until its fixed and confirmed to really work.

 
mr_hyde

Joined: 2009-09-20
Posts: 46
Posted: Sun, 2010-12-12 21:40

clicks fix worked at least for me.

Feel free to test the attached modified plugin

 
lightxx

Joined: 2010-12-02
Posts: 28
Posted: Mon, 2010-12-13 06:50

@mr_hyde
thanks for sharing. your / clicks version works. dunno what went wrong when i renamed it myself.

on a side note, after successfully setting the album cover the popup with the JSON success message won't close itself automatically.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2011-05-12 07:39

Does anyone know the status of this module? It doesn't seem to work in 3.0.1 even with clicks' rename solution. Perhaps its because the change to the organise module affected the move code and now this doesn't work.

Would be really great to have this working as an adjunct to the new Tags Album module, as then you wouldn't need to put an image in a virtual album just to get thumb for the album.

U-G

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Thu, 2011-05-12 14:56

It works with 3.0.1 for me.
Did you try the zip file posted by @mr_hyde (about 3 posts above)?

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2011-05-13 00:39

Well that's encouraging. But I can't open albumcoverbr.tar_.gz in any of my s/w. There's a file in the .gz part but I open the .tar_ inside. Perhaps I should try my Ubuntu VM. But if someone could repost as a .zip that would help greatly.

There surely must be more of a change in clicks' file than just the helper php, or a name change would work on its own.

U-G

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2011-05-13 01:25

Ok, I think I've got it sorted. I'm embarrassed to admit that I didn't read clicks' post carefully enough to see that in addition to renaming that helper file a corresponding change need to be made inside it. [embarrassed smiley] Now it works. Thanks.

But I'm still puzzled about this tar_.gz thing. Some searching indicates that that this is a Drupal bug/feature. Even so, that doesn't explain why I can't open the download whereas clearly some of you can. Sounds like one of those eternal mysteries.

U-G

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2011-05-13 02:36

If the docs http://codex.gallery2.org/Gallery3:Modules:album_cover_browser ) are not right please help the community by making corrections/enhancements.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2011-05-13 03:26

The problem is not with the codex per se, although I am not sure if the comment Also, if you put a picture in a gallery temporarily to assign it as an album cover and then remove it, the album cover is removed as well is correct.

The main problem is with the file in the first post - which has an easy-to-fix bug. I've attached my working version in the more usual zip form and at your invitation have made some minor changes to the codex page. Perhaps also someone who knows whether the above quote is correct could either fix that quote on the codex page or remove my query.

U-G

 
magicka

Joined: 2007-11-19
Posts: 20
Posted: Wed, 2013-06-05 19:57

I was looking for a way to set thumbnails on my virtual albums and found this module which is supposed to do just that. However, when I installed it, the album list is not appearing correctly. All I see is this:

[img]http://www.magickwolf.com/Image1.jpg[/img]

After changing the theme back to the default theme, I think I know what is going on. I need to change the background color of the popup box. The color of the album labels and the background color are both white, so I can't see anything.

I've been looking at the different PHP files and can't figure out which one I'm supposed to edit to change this. I need to either change the background color of the popup box or the color of the album labels. I don't care which one changes, as long as I can see the album labels. Maybe change album labels to black. That would help.

.... or, even better, as part of the module, add configuration options to change the colors of the background and label colors. This way it is customizable and people can change the look accordingly with whatever theme they choose to use on their gallery site, without having to mess with the PHP code at all. Now that would be really cool.

 
magicka

Joined: 2007-11-19
Posts: 20
Posted: Wed, 2013-06-05 20:05
undagiga wrote:
The problem is not with the codex per se, although I am not sure if the comment Also, if you put a picture in a gallery temporarily to assign it as an album cover and then remove it, the album cover is removed as well is correct.

That statement is actually incorrect. The behavior of Gallery 3.0.6 is as follows:

I had an album where I had two videos in it. It automatically chose a thumbnail from one of them and assigned it as a cover for the album. I later decided that neither of the videos belonged in the album and moved them to another album. This album was empty and retained the thumbnail it had pulled from the video it no longer contained.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2013-06-05 20:53

Behavior for album covers did change in 3.05 or 3.06. A default image is chosen as well if non exist. So if you have better wording for the codex please make the necessary changes to reflect your findings ( docs is a community effort ( you just need to login ) ) or suggest the necessary working to be changed and I can make the changes for you and the community.

Quote:
I've been looking at the different PHP files and can't figure out which one I'm supposed to edit to change this.

It would be a CSS not a php file chnage. Got FireFox and the dev tool to make live css edits? If not, create a test album and test longin info and send it my way via a Private Message (write to author link), and I can try to help.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
magicka

Joined: 2007-11-19
Posts: 20
Posted: Wed, 2013-06-05 21:13
floridave wrote:
It would be a CSS not a php file chnage. Got FireFox and the dev tool to make live css edits? If not, create a test album and test longin info and send it my way via a Private Message (write to author link), and I can try to help.

Well, I have FireFox, but I don't have the dev tool. I didn't see any CSS files in the module at all, which is strange..... Makes me think it's using default values perhaps?

In the default theme that Gallery 3 installs, this looks ok. It's when I have the Clean Canvas theme on with the dark mode option that it doesn't look right. (I'm thinking out loud while I'm typing...) Maybe there's a CSS file in the Clean Canvas theme that needs to be edited that controls what the popup boxes look like.

What is your opinion on that thought?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2013-06-06 18:53

@magicka, got your PM.
Edit themes/clean_canvas/css/dark/screen_colors.css
add:

#g-dialog {
background-color: black;
}

other dialogs you might have to check.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
magicka

Joined: 2007-11-19
Posts: 20
Posted: Fri, 2013-06-07 01:28
floridave wrote:
@magicka, got your PM.
Edit themes/clean_canvas/css/dark/screen_colors.css
add:

#g-dialog {
background-color: black;
}

other dialogs you might have to check.

Dave

OK. I made this change and it also changed the background color for editing movie information. The label text color on these dialog boxes is a dark gray color and with a black background, the text doesn't show up. I swear I can't win here. Is there a code for changing the text color that I can try?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2013-06-07 02:34

Use red then, both should work.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
magicka

Joined: 2007-11-19
Posts: 20
Posted: Fri, 2013-06-07 04:22

I'm not crazy about red, so I set it to a light blue color. That works for me.