New Module: favourites
serbanc
Joined: 2006-05-19
Posts: 314 |
![]() |
cool! serbanc - www.e-poze.ro |
|
reusta
Joined: 2008-02-11
Posts: 14 |
![]() |
Thanks Alec for the favorites module. It brings a very usefull feature that many Gallery users were missing. Quote:
I can only remove the first photo (the rest don't show the link). If I delete that one then I can delete the next one and so on, but there is no way for me to delete the others out of order. If I click on a photo from the favourites folder to goto it's individual page I can remove the photo, but not from the album view. For version 2.2.4, could you please release a new "module.inc" that prevents "Add to Favorites" from appearing on Album pages? Thank you, Alec! |
|
reusta
Joined: 2008-02-11
Posts: 14 |
![]() |
Thank you Alec for your quick reply. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
I think you're asking for something similar to ckawalek was for the flashnifitiessource module I wrote, which, after a bit of discussion we decided was outside the simple scope of the gallery structure: in this case the "add/remove to favourites" is declared as an "itemLink", in module.inc - starting around line 120 - so it appears alongside all the other itemlinks wherever they appear. As far as I know there's no simple way to determine the context for the link at the time it is required to be declared by the gallery API, and so no basis exists for a decision on whether to withold its declaration. Sorry! (love the heart icon btw) |
|
reusta
Joined: 2008-02-11
Posts: 14 |
![]() |
Alec, thank you very much for your assistance. 1) Duplicated my matrix theme to create a new one I called matrixfavs Voila. There still is something I'd like to change in your module. Maybe you Alec, or someone else could help: |
|
puwtest
Joined: 2007-11-15
Posts: 30 |
![]() |
Alec: 1. Is it possible to show just 4 items next to oneself in Fav. album? This is just because my website have got the strict width and if the fav album shows more than 4 items in one row, it's going to be disorder. 2. I can't see the new "top10 favourites block". Actually I don't understand what's going on. Can you explain me, where I can find this option? Thanks 3. I agree with reusta's questions and I think it could be good to have it: Quote:
There still is something I'd like to change in your module. Maybe you Alec, or someone else could help: Thank you Alec for your support! I really appreciate it. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Hi puwtest 1 - the display is up to your theme - you should be able to set the theme settings for the favourites album in the admin page. So if your theme allows you to restrict, say to three items in a row then you should be able to do just that, but it's not something that is or can be controlled by the plugin 2 - It's a piece of private code that I use on one of my sites, and probably shouldn't have been included in a public release. It scrolls the logged-in user's first 10 marked favourites across the page, using a javascript library for the animation. I have an $isItRoot set somewhere in the album view, so I can display it on the front page of the album by including this: {if $isItRoot} {g->block type="favourites.ShowTop10"} {/if} You might be able to get it to do something interesting on your site, depending on your theme, but if not, just ignore it. 3 - (1) Edit the AddFavourite.inc file, round about line 68, where it declares the (delegated) next view for the AddFavourite controller. Try changing the declared view to favourites.FavouritesAlbum 3 - (2) ditto - if you want different behaviours for add and remove favourites (or if the favourites album is empty) then extend the php round line 68 to test for your desired conditions and set the 'view' element in the $results['delegate'] array appropriately. Ajax is beyond me, I'm afraid - the Gallery framework doesn't support it very easily. Let me know how you get on. |
|
Guevara666
Joined: 2008-04-03
Posts: 1 |
![]() |
Hello, I need your help: I want to add a link for add (remove) to favourites in the photo.tpl. I used this code: The link should be below the microthumbs, above the additional blocks like exif, viewcomments, addcomment. But when I add the link, the blocks below aren´t shown any more...? What´s wrong with my code for favourites? Thanks, |
|
bentr7040
Joined: 2004-08-02
Posts: 61 |
![]() |
alecmeyers, Hey many many thanks for great work on this module. been waiting for this for soo long!! Thanks much |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Guevara666: I'm sorry, I'm not really sure what you're trying to do, or what the problem is. Maybe a screenshot would help? You haven't said what theme you're using, either. |
|
bentr7040
Joined: 2004-08-02
Posts: 61 |
![]() |
Alec, |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Probably... try changing the AddFavourite.inc file at line 72 from: to
|
|
bentr7040
Joined: 2004-08-02
Posts: 61 |
![]() |
alecmyers wrote:
Probably... Alec, thanks. It works! |
|
hogalot
Joined: 2005-10-06
Posts: 13 |
![]() |
Hey, Thanks for the module, I've been looking for something like this for a long time. I have a feature suggestion. It would be cool if a user could optionally share their favorites with other users (perhaps a configurable list of users)? |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
hogalot wrote:
Hey, Interesting idea. Could you perhaps mock up a screen shot for how you'd want the extra pages/options to look? |
|
gatorjim
Joined: 2008-05-16
Posts: 3 |
![]() |
Thanks for your efforts in developing this module...it's what I was looking for (the cart features, although useful, don't address this as easily as your module). One feature that would be desirable is the ability to remove all the photos in favorites with one operation. As it is now (but I might have missed it) you have to delete each photo one-by-one. This would be useful if someone has built a gallery of favorites for a specific set of photos. When they are ready to move on to a different set of photos, all the current images in favorites need to be removed. Thanks for considering this. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Good idea. Let me work on it. OK - I've looked into it. I need an answer to this question (http://gallery.menalto.com/node/77724) before I can implement it. |
|
gatorjim
Joined: 2008-05-16
Posts: 3 |
![]() |
Sounds a bit complicated, but hopefully someone will come up with a solution. Thanks again for your efforts. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
The reason I want an answer is because I'd like to have "empty my favourites" (or whatever it's called) as an itemLink, one that appears in the favourites album view only (i.e. you only see it when you're looking at the favourites collection). I don't want it to appear under every single item in every single view alongside "add to favourites", and I don't want it as a systemLink in the header either. But I can't see a way to make this happen. I could create a block that you can add to your pages manually just for that one command but that's really clumsy and ugly. Do you have any bright ideas as to where else I could have the it appear? |
|
gatorjim
Joined: 2008-05-16
Posts: 3 |
![]() |
Agree it should only show when viewing the favorites album. I would think placing it at the right end of the row just above the thumbs (i.e., the one that starts with "Favorites:username") would make the most sense. I don't know much about the code behind Gallery...can you put a conditional block (or whatever its called) in that row? I assume trying to do that is what led to your question above. The other location would be placing a "clumsy, ugly" block in the sidebar, but I've noticed that item actions don't show up there when you are viewing a keyword album, or the favorites album, so that might not work either. If it did, it would then show up when viewing keyword albums as well. Wish I knew more about the coding so as to offer better suggestions. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
This module is now in the community repository, so you can/should download it from the more plugins page. I've added a 'clear favourites' command, too - visible from the favourites album. |
|
nicdj
Joined: 2008-06-09
Posts: 1 |
![]() |
Hi, Note: I commented out the redirect on line 83 and added the two new lines shown. /** $results['redirect'] = array ('view' => 'favourites.AddFavourite', 'itemId' => $itemId); */ |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Good idea... you omitted to mention that should be in file addFavourite.inc, though! |
|
bentr7040
Joined: 2004-08-02
Posts: 61 |
![]() |
Hi everybody, This favorite module is great, However, one issue I can't figure how: If I'm on the favorite view, I can not go back to the album through the breadcrumb line, maybe I overlooked, but I don't find any info in the discussion? anyone can give me suggestion? Thanks |
|
bentr7040
Joined: 2004-08-02
Posts: 61 |
![]() |
I think I need to edit FavouritesAlbum.inc , but just don't know what to change..... |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Hi I'm not sure how you can expect to go back to anywhere on the breadcrumb line except the Root as the favourites album is not a sub-album of any other album. Therefore I believe the correct breadcrumb to display is <<Root Album Name>> / Favourites: <<user Name>> which is what is displayed. |
|
bentr7040
Joined: 2004-08-02
Posts: 61 |
![]() |
he correct breadcrumb to display is <<Root Album Name>> / Favourites: <<user Name>> which is what is displayed. Quote:
|
|
bentr7040
Joined: 2004-08-02
Posts: 61 |
![]() |
Sorry, wrong quote marks on the last post. Ben |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Hi Ben, I'm not sure why that should be. It works ok out-of-the-box for both the Matrix and Siriux themes, the two with which I have some experience. Try switching to one of those first, to see if it works. I suspect it's a function of how your theme is written and therefore not something that can be altered from within the favourites module. Try also the Dynamic Albums module that has three further dynamic albums (updates/random/popular) from which the Favourites module was derived and see if they behave the same way. Dynamic Albums module was written by one of the core developers and is pretty much canonical for this kind of dynamic album. |
|
hogalot
Joined: 2005-10-06
Posts: 13 |
![]() |
Alec, Sorry for the delay in responding. I was thinking of having a shared favorites link. When you press on the link it would allow you to maintain a list of user names (to share your favorites) and a list of user favorites that have been shared with you. Would you want a mock up as an image? Also, a silly question...how do you remove an album from your favorites? On my server the link stays as add album to favorites and there doesn't seem to be any way to remove the album from favorites as either a user or administrator. The images work fine. Or as an alternative...how do you prevent users from adding albums to their favorites? |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Interesting... add/remove seems to work fine for albums for me! Want to send me a link to your site so I can try it? Shared favourites: would need a considerable extension to the module, I'm not sure I have time for it at the moment. Send me a mockup by all means though. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
OK, just for the benefit of anyone following, it was a caching issue that was solved by reducing the Gallery acceleration level from partial to none. |
|
tlmothy
Joined: 2005-11-10
Posts: 41 |
![]() |
Great module, but I think you should be able to see other users favorites. Maybe add a link within a users main album? Or a drop down menu somewhere. What do you guys think? |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
I'm unlikely to add this feature because it's not one I want to use - but feel free to add it yourself and send me the modifications, and I'll have a look. |
|
giorgos
![]()
Joined: 2002-08-19
Posts: 115 |
![]() |
It uses high CPU utilization (apache 80-100%) and takes more than 10 seconds to respond. That behavior is noticed only in favorites module. Gallery version = 2.2.5 core 1.2.0.7 |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
It uses high CPU utilization (apache 80-100%) and takes more than 10 seconds to respond. That behavior is noticed only in favorites module. Sorry - no clue. If you narrow it down a bit more (doing what, exactly, causes the load? What do you mean by "in favorites module"? how many favourite images are you displaying? how many people?) that would help. |
|
giorgos
![]()
Joined: 2002-08-19
Posts: 115 |
![]() |
I know the information is insufficient for troubleshooting. I just thought that might be a clue or a tip for such a behavior when I click on favorites link as logged in user(my favorites)it takes long time to load. As a guest there is no issue. For displaying dynamic albums for example there is no much delay. Sorry but I can’t think of anything else for the moment that can helps. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
It's a pretty basic db query to fetch the favourites list, and the table is correctly keyed, so I don't think I can be of much help. MySQL has a facility for logging slow queries that you could investigate. |
|
giorgos
![]()
Joined: 2002-08-19
Posts: 115 |
![]() |
Thanks alecmyers. I will check. |
|
lerone
Joined: 2008-09-22
Posts: 16 |
![]() |
hey, great feature! especially along with the blocks like the "top 10"! after installing I can chose "add to favorites" and "favorites" appears in the admin-menu. but then trying to access the dynamic album via the "favorites"-link there I get an "internal server error". are there any inconsistencies known? do I need url-rewrite to be activated? or is it a bug? I use favorites 0.2.4 and Gallery version = 2.2.6 core 1.2.0.8 thanks already for hints! |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
No bugs or inconsistencies that I know of, no. And no, no need for url-rewrites. The block isn't what you think - it was a bit of private code that snuck in when it shouldn't have. But apart from that, it should be fine. |
|
lerone
Joined: 2008-09-22
Posts: 16 |
![]() |
thanks for reply! – by now i assume the problem originally stems from a server with "safe mode" and outdated system features. I will check soon on an appropriate server. in case this really was the root-cause, sorry for the stir. |
|
Carpcatcher
Joined: 2004-02-02
Posts: 92 |
![]() |
is it possible to show ALL pictures from multiple users ? |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
is it possible to show ALL pictures from multiple users ? The usual answer for "is it possible..." type queries for Gallery: No, unless you rewrite the code, in which case anything is possible. |
|
Jigoro
Joined: 2005-09-12
Posts: 14 |
![]() |
Hello, I love this module, but I have a stupid question... How can you specify the order in which the pictures are displayed in the favourites album? I would like to see them sorted by date, but I can't find a place where to specify it... If not possible, what is the default sorting order? Thanks! |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Not a stupid question. There's no specific order, I think it probably works out to the order they were picked in, latest first. To sort by date you will need to modify function fetchFavourites(...) in modules/favourites/classes/FavouritesMapHelper.class. At present that function uses GalleryCoreApi::getMapEntry(...). To sort by date you'd need to rewrite that as a SQL query (see further down the same file, eg function fetchUsersWithFavourites() and fetchUsernamesWithFavouritesLike(...) for inspiration) because you'll need to JOIN the relevant table in the db that has the date and use an ORDER BY clause. You can put an ORDER BY clause in a call to getMapEntry but you can't join a second table - hence the need to build the query manually. |
|
Jigoro
Joined: 2005-09-12
Posts: 14 |
![]() |
Great, thank you for the answer. I will try this and post the query here if I am successful |
|
Jigoro
Joined: 2005-09-12
Posts: 14 |
![]() |
Here is the mod, if other people are interested: --- FavouritesMapHelper.class.ori 2009-01-28 03:35:29.000000000 +0100 - list ($ret, $searchResults) = GalleryCoreApi::getMapEntry('FavouritesMap', |
|
Carpcatcher
Joined: 2004-02-02
Posts: 92 |
![]() |
serbanc wrote:
installed yesterday... great module! Hi this is a cool add-on, |
|
stark1974
Joined: 2009-06-17
Posts: 1 |
![]() |
Great module - thanks! A really minor thing... How can I remove the colon after the word 'Favorites' in the breadcrumb trail (ie. it shows up as "Favorites:")? I've tried looking at module.inc and can't find it anywhere there, unless I'm missing something. Help appreciated |
|