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
Posts: 46
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.
Posts: 97
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
Posts: 46
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. :/
Posts: 97
Rio, thank you. Good lead, I'm gonna work with that and let you know.
Annie
Gallery WIP: http://www.evlrocks.com
Posts: 97
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
Posts: 46
Yeah, thats the reason I wrote the following sentence in my recent post:
$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.
Posts: 40
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
Posts: 40
Ok, finally figured this out using imageblock. No need to rewrite the helperfile. Just add this line in MembersProfile.tpl & MembersItems.tpl
There are options in image block to add title, date, etc if you like. Cheers.