Latest items as thumbnails on member page

Another_Matt

Joined: 2009-08-20
Posts: 40
Posted: Thu, 2009-08-20 18:36

I searched and searched and can not figure this out. On a member profile page (Matrix,2.3), it currently lists the last uploaded images as filenames. I would like to replace the icons (file.gif) with small thumbnails that link to the image. And show more than 5. Here's the code from MembersProfile.tpl

Quote:
<tr class="{cycle values="gbEven,gbOdd"}">
<td valign="top">
{g->text text="Last Items:"}
</td><td>
{if count($MembersProfile.lastItems)}
<table>
{foreach from=$MembersProfile.lastItems item=item}
<tr>
<td>
{if $item.canContainChildren}
<img src="{g->url href="modules/members/data/directory.gif"}"
alt="{g->text text="Album"}" width="16" height="16"/>
{else}
<img src="{g->url href="modules/members/data/file.gif"}"
alt="{g->text text="Item"}" width="16" height="16"/>
{/if}
</td><td>
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$item.id`"}">
{$item.title|default:$item.pathComponent}
</a>
</td>
</tr>
{/foreach}
<tr>
<td colspan="2">
<a href="{g->url arg1="view=members.MembersItems"
arg2="userId=`$MembersProfile.user.id`"}">
{g->text text="List All &raquo;"}
</a>
</td>

I thought I could just drop a {g->image item=$child image=$child.thumbnail} in there but it won't work. Any ideas? Thanks.

 
Another_Matt

Joined: 2009-08-20
Posts: 40
Posted: Mon, 2009-08-24 01:25

No response?

I guess it's not as easy as I thought. Is there a better way to do this? Thanks for any suggestions.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6136
Posted: Mon, 2009-08-24 02:28

You could use mediaBlock
something like:

{php} @readfile('http://www.yoursite.com/gallery2/mediaBlock.php?g2_itemId=`$item.id`&useThumb=1'); {/php}

or imageblock may even work.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Another_Matt

Joined: 2009-08-20
Posts: 40
Posted: Mon, 2009-08-24 19:04

Thanks for the reply suprsidr. Mediablock wouldn't work so I've been trying imageblock. How do I call the item id?

Quote:
{php} @readfile('http://www.asite.com/gallery/main.php?g2_view=imageblock.External&g2_blocks=specificItem&g2_itemId='.$item.id); {/php}

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6136
Posted: Mon, 2009-08-24 22:16
Quote:
{g->image item=$child image=$child.thumbnail} in there but it won't work

it would be more like:

<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$item.id`"}">{g->image item=$item image=$item.thumbnail}</a>

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Another_Matt

Joined: 2009-08-20
Posts: 40
Posted: Tue, 2009-08-25 01:15

I think I found the problem. I need to modify the helper class file as mentioned in http://gallery.menalto.com/node/59372 for this to work. Is Roi's code from the first post correct? Do I just drop that in line 150ish?