[SOLVED] Members Module - Show thumbnails instead of plain item titles

Roi Danton

Joined: 2006-06-15
Posts: 46
Posted: Sun, 2007-01-14 13:54

I want to replace the line

{$item.title|default:$item.pathComponent}

in MembersProfile.tpl & MembersItems.tpl with a line that shows the thumbnails of each item.

{g->image item=$item image=$item.thumbnail class="giThumbnail"}

doesn't work as $item.thumnail doesn't exist.

What I have to add (in GalleryMembersHelper.class around line 150?) to create an image link to each item? (like it's done in the album view and imageblock etc.) I assume something like this

list ($ret, $item_thumb) = GalleryCoreApi::fetchThumbnailsByItemIds($itemIds); //$itemIds already defined as array in GalleryMembersHelper.class
if ($ret) {
    return array($ret, null);
}

But how to attach the thumbnails to the correct $itemIds?

Or is the image thumbnail link already part of the entity $items? <- EDIT: no, it's not in the SQL Query of fetchLastUserItems

 
Roi Danton

Joined: 2006-06-15
Posts: 46
Posted: Sun, 2007-01-14 15:51

Hehe, using the Debug mode revealed the issue. The entity itself contained the neccessary information already, so I only needed to change the template of the members module.

 
The Webmistress

Joined: 2007-03-20
Posts: 97
Posted: Fri, 2008-02-22 17:30

I'm interested in the same thing.. I wanna show thumbnails for each photo listed in the MembersItems.tpl page in addition to the type, date, time and name.

So.. can you give me details? What do I put in the tpl file as far as the thumbnail goes?

Thanks!

Annie
Gallery WIP: http://www.evlrocks.com

 
Roi Danton

Joined: 2006-06-15
Posts: 46
Posted: Fri, 2008-02-22 21:36

Oh well, long time ago - currently I mostly work with Drupal and haven't used this for ages (well, months ;) ).

I had a look in my old MembersItems.tpl, but I only could find the lines without the thumbnail, so only the big pictures appeared: this looks crap like you can see here -> http://galerie.takera.net/index.php?q=gallery&g2_view=members.MembersItems&g2_userId=6

I can't remember how I fixed this without adding the fetchThumbnail class to the Members module, because I couldn't find the array for the thumbnail inside the items array (what is part e.g. in the albums view). I'm sorry for that. :/

 
The Webmistress

Joined: 2007-03-20
Posts: 97
Posted: Sat, 2008-03-01 05:41

Rio, thank you. Good lead, I'm gonna work with that and let you know.

Annie
Gallery WIP: http://www.evlrocks.com

 
The Webmistress

Joined: 2007-03-20
Posts: 97
Posted: Sun, 2008-03-02 03:27

I don't think I know what I'm doing.

I added {g->image item=$item image=$item.thumbnail class="giThumbnail"} under the title and I got:

Notice: Undefined index: thumbnail in /hermes/bosweb/web074/b749/ipw.ishotitt/public_html/evl/rocks/smarty/templates_c/%%4047509462/%%5C^5C5^5C5873DA%%MembersProfile.tpl.php on line 150
[Render error]

I didn't edit GalleryMembersHelper.class, I'm thinking that it wasn't needed, your 2nd post said you only needed to edit the tpl file. And I'd only follow your direction and add what you posted above (again, I haven't a clue).

Thanks :)

Annie
Gallery WIP: http://www.evlrocks.com

 
Roi Danton

Joined: 2006-06-15
Posts: 46
Posted: Sun, 2008-03-02 22:58

Yeah, thats the reason I wrote the following sentence in my recent post:

Roi Danton wrote:
I can't remember how I fixed this without adding the fetchThumbnail class to the Members module, because I couldn't find the array for the thumbnail inside the items array (what is part e.g. in the albums view). I'm sorry for that. :/

$item.thumbnail doesn't exist in Members Module (activate debug mode and have a look into the $item array - no thumbnail array is there) so I believe I'd used a modified version of members module. I can't remember exactly but with default members module it isn't enough to just change the tpl files - so from this point of view, post #2 is wrong.

So there are two options: Add the thumbnail array to the item entity in GalleryMembersHelper.class (with GalleryCoreApi::fetchThumbnailsByItemIds($itemIds)) or create a separate thumbnail array with the help of the $lastItems array in MembersItems.inc (get the itemIds from $lastItems). I can't say now how to do it in detail but it should work.

 
Another_Matt

Joined: 2009-08-20
Posts: 40
Posted: Tue, 2009-08-25 13:29

I keep getting the same index type error as Annie. I tried adding the code from 1st post into the GalleryMembersHelper.class and got nowhere.

Could someone take a look at Roi's code above and tell me where he went wrong? I'd really like to add this feature to my member's pages.

Thank you.

Matt

 
Another_Matt

Joined: 2009-08-20
Posts: 40
Posted: Wed, 2009-09-02 19:26

Ok, finally figured this out using imageblock. No need to rewrite the helperfile. Just add this line in MembersProfile.tpl & MembersItems.tpl

Quote:
{g->block type="imageblock.ImageBlock" blocks="specificImage" itemId=$item.id maxSize=100 itemFrame=none}

There are options in image block to add title, date, etc if you like. Cheers.