Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Help with last post icon global tag

Quote Reply
Help with last post icon global tag
I have made a global to display the last post icon (if selected in post) to be displayed before the last post title in the category list.

Code:
TAG: last_icon

GLOBAL:

sub {
my $post_id = $_[0];
my $post_icon = $DB->table('Post')->select( ['post_icon'], { post_id => $post_id } )->fetchrow;
return $post_icon;
}

CALLED WITH: <img src="<%image_url%>/<%last_icon($forum_last_id)%>">

As there is no default icon the posts without icons show a "red X" box. I need help with an <%if .... statement.

Most that I have tried just ignore the icon and inserts blank.gif

Can anyone tell me what the missing XXXXX should be?

Code:
<%if XXXXX%><img src="<%image_url%>/<%last_icon($forum_last_id)%>">
<%else%>
<img src="<%image_url%>/blank.gif"><%endif%>

( Alternatively could I force a default icon to override "none"? )

Thanks
Subject Author Views Date
Thread Help with last post icon global tag MJB 3085 Apr 3, 2006, 1:11 PM
Thread Re: [MJB] Help with last post icon global tag
MJB 2959 Jun 27, 2006, 12:56 PM
Thread Re: [MJB] Help with last post icon global tag
brewt 2959 Jun 27, 2006, 1:05 PM
Post Re: [brewt] Help with last post icon global tag
MJB 2958 Jun 27, 2006, 2:20 PM