New Module: favourites

alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2009-06-17 18:02

Try file FavouritesAlbum.inc line 85:

	    $module->translate(array('text' => 'Favorites: %s', 'arg1' => $targetUserName)),
 
siteqwester

Joined: 2008-04-26
Posts: 9
Posted: Fri, 2009-08-07 02:40

I am trying to implement "Favorites" but the favorites link takes me to the last added image's album, not the dynamic album. Also tried through Site Admin; although hovering shows the dynamic album path, when clicked it redirects to the original album...
In Site Admin, 'Thumbnail links in dynamic albums' is set to 'Browse Dynamic Album'...

Any ideas... ???

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2009-08-07 03:10

try it on a fresh install of G2.3 somewhere, see if it's something screwy with your existing installation or a real bug. It's not behaviour that I recognise at present.

 
siteqwester

Joined: 2008-04-26
Posts: 9
Posted: Sat, 2009-08-08 00:51

Fresh install works fine (in both Matrix and Xtreme themes). Activated and made Matrix theme 'default', that works fine. Made Xtreme theme default again, same problem... Next I'll try to uninstall Xtreme and install a fresh Xtreme theme. (maybe some of my customizations are to blame).

 
siteqwester

Joined: 2008-04-26
Posts: 9
Posted: Sat, 2009-08-08 06:51

1- Installed fresh X_treme theme = works fine.
2- Configured it the way I want in Site Admin = broken
(minus customizations)
3- Re-installed fresh X_treme theme = works fine.

4- ...narrowed it down - made Matrix default theme (Favorites: Matrix theme), root gallery:chose X_treme theme, copied to sub-albums = seems to work! :)
5- Added all customizations back in = still works :):)

I'll continue investigating later (hope this helps someone else too).

 
dranium

Joined: 2008-11-22
Posts: 18
Posted: Sat, 2009-08-29 20:04

Great module! What I am trying to accomplish is to remove the security where a user cannot view a other users favorites. Is this possible to do? I noticed this line in the FavouritesAlbum.inc file /* only admins can ask for others' favourites */ $ret = GalleryCoreApi::assertUserIsSiteAdministrator();. IS there a way to modify this so everyone can view others favourites?

Thank you in advanced!

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2009-08-30 16:02

Just remove (or comment out) that line.

 
dranium

Joined: 2008-11-22
Posts: 18
Posted: Wed, 2009-09-02 23:01

I tried removing that line last time but it didn't work. I probably forgot to clear my Smarty cache lol. Thank you very much !!

 
arendzen

Joined: 2010-03-09
Posts: 13
Posted: Sat, 2010-03-13 12:09

Favourites is a great module and I am using it as a lightbox, having changed all the text to suit this purpose.

In an earlier post, there was a question about how to remove the 'add to favourites' link from the albums page. A reply suggested that some code should be added to the module.inc file at around line 120 but I can't find the post that contained this code.

I also want to remove the 'add to favourites' link from under the thumbnails on my albums page - so if you have this code, do you think you could repost please?

Also, the thumbs_up png file that precedes the 'remove from favourites' line forces the words into two lines because the thumbnail cell width can't accomodate both the text and png in one line. As I'm not too bothered about the png image, is there a way of simply removing it, thereby creating extra space for the words so that they can go into one line - I think it looks cleaner?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2010-03-13 18:31

The png is part of your icon pack, nothing to do with the module. Itemlinks get a CSS style added automatically as part of the regular rendering of whichever theme/template you're using so look at the html for the page, and make sure that your style sheet is overriden such that no background image or whatever is applied to the style given to the link.

 
arendzen

Joined: 2010-03-09
Posts: 13
Posted: Sat, 2010-03-13 21:15

Alec - thanks for getting back to me. I see what you're saying - I'll look into that. I had assumed that it was the module that called for that particular icon to be used, rather than the icon adding itself to the module's link.

On the other question regarding code to remove the link on the albums page - do you have any suggestions? I have tried various ways of stopping it from showing - like adding 'display: none;' in CSS but the command also affects the link on the picture pages.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2010-03-13 21:36
Quote:
I had assumed that...

Everyone does...

Regarding removing the link: in module.inc look for the getItemLinks (?) function. Make adding the menu item conditional on what type of GalleryItem is being examined at the time.

 
arendzen

Joined: 2010-03-09
Posts: 13
Posted: Sat, 2010-03-13 23:08

Found the function in module.inc...though I suspect writing the code is beyond my abilities...but I'll have a go.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2010-03-13 23:17

Have a look at the checkout module for an example of how to test if an item is an album or a photo/other.

 
kdji123

Joined: 2009-05-05
Posts: 24
Posted: Wed, 2010-03-17 19:53

is it possible to add this module to show in tpl file without using itemactions,

 
arendzen

Joined: 2010-03-09
Posts: 13
Posted: Sat, 2010-04-17 14:30
alecmyers wrote:
Have a look at the checkout module for an example of how to test if an item is an album or a photo/other.

Alec, thanks for your advice. I spent considerable time on this and got nowhere, so gave it a rest and came back to it but have to conclude it's beyond my abilities. The problem is that I don't really want to have people add whole albums to their favourites - just individual photos. However, it's not a big deal and I can live with it for the time being until I can work out what to do.

One problem that is more pressing is that, when doing a search, the page that displays the results does not have an 'add to favourites' option under the thumbs. Is this how the module is intended to function? The 'add to favourites' link shows up on the other pages ok - just not on search results.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2010-04-17 14:37
Quote:
but have to conclude it's beyond my abilities.

What could possibly be beyond your abilities? The code to test whether an item is an album or not is in the checkout/module.inc, where the itemactions are added. Just basically copy and paste the relevant bit of code into favourites/module.inc, making the obvious and necessary changes.

@search results: I don't know - it depends on the interactions between a dynamic album and the itemactions stuff. If it doesn't appear - then yes, I guess that's how it's supposed to be.

 
arendzen

Joined: 2010-03-09
Posts: 13
Posted: Sat, 2010-04-17 21:51
alecmyers wrote:
What could possibly be beyond your abilities?

Well, perhaps writing in this strange foreign language, which is rather like the first time I got drunk...two steps forward, one back, then a rather devastating crash from time to time.

Anyway, to the problem at hand. I'll have a look at the code again, following your suggestions. In the words of Oates "I am just going outside and may be some time."

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Sun, 2010-07-11 18:16
Carpcatcher wrote:
serbanc wrote:
...
also developed a small block that can be added on the photo/album pages, that displays the list of users that added that item to their favourites.
new files attached in a zip; does not require modification to existing module files.

Hi this is a cool add-on,
but is it also possible to view instate of the useralbum the users favourites ?

i had the same problem today. i have resolved by tricking callbacks to return userid instead albumid, then i modified the template

in Callbacks.inc replace 'albumId' => $albumId); with 'albumId' => $row[0]);
in FavoritesAlbum.inc comment line "$ret = GalleryCoreApi::assertUserIsSiteAdministrator();" to allow all users access to favorites
in FavouritedBy.tpl add or replace with this <a href="{g->url arg1="view=favourites.FavouritesAlbum" arg2="targetUserId=`$d.albumId`" }">{$d.userName}</a>