PDA

View Full Version : Substact Two from a Variable



spadez
Jan 16th, 2010, 05:01 PM
Hi.

This is a bit of an odd one for me, and i have no idea how this would be done. This is my code:


<td class="giAlbumCell gcBackground1">
{if isset($child.thumbnail)}
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
{g->image item=$child image=$child.thumbnail class="giThumbnail"}
{$child.title|entitytruncate:25}
{else}
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}"
class="giMissingThumbnail">
<img src="{g->theme url="images/missing.png"}" width="40" height="40"
alt="{g->text text="no thumbnail"}" />
{$child.title|entitytruncate:25}
{/if}

{g->block type="core.ItemInfo" item=$child
showDate=false
showOwner=$theme.params.showAlbumOwner
showSize=false
showViewCount=false
showSummaries=true
class="giInfo"}
</td>

I want to substract 2 from the itemId, currently it reads $child.id. I would like it to be $child-2, so if $child was 5 itemId would be 3.

How would something like this be done? If ive put this in the wrong forum im sorry, i wasnt sure if it was html related or php releated.