New Module: Album Cover Browser
Lord Beowulf
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 ** |
|
Posts: 27300
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
Posts: 132
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!
Posts: 56
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
Posts: 132
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...
Posts: 253
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
Posts: 46
Same here and I tried it with several versions of G3 (3.0 RC2, 3.0 official)
Posts: 2
Same here too, with the latest G3
Posts: 1857
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?
Posts: 5
I can't find the new option anywhere, too.
Posts: 1
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.
Posts: 18
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!
Posts: 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.
Posts: 46
clicks fix worked at least for me.
Feel free to test the attached modified plugin
Posts: 28
@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.
Posts: 693
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
Posts: 1857
It works with 3.0.1 for me.
Did you try the zip file posted by @mr_hyde (about 3 posts above)?
Posts: 693
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
Posts: 693
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
Posts: 27300
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
Posts: 693
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
Posts: 20
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.
Posts: 20
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.
Posts: 27300
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.
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
Posts: 20
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?
Posts: 27300
@magicka, got your PM.
Edit themes/clean_canvas/css/dark/screen_colors.css
add:
other dialogs you might have to check.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 20
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?
Posts: 27300
Use red then, both should work.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 20
I'm not crazy about red, so I set it to a light blue color. That works for me.