Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: SilverKnight on August 25, 2014, 10:09:22 PM

Title: [HELP] Href image issue
Post by: SilverKnight on August 25, 2014, 10:09:22 PM
I want to add a link to the image however it does not appear around the avatar, i am not sure why, image appears fine, link is not applied. I have put the code at issue in bold.


if (!$modSettings['disable_avatar'])
[b]echo '<div style="float: right; border: 1px solid silver; padding: 1px; margin-right: 0px;">', !empty($board['last_post']['member']['avatar']) ? $board['last_post']['member']['avatar'] : '<a href="'. $board['last_post']['member']['link'] . '"><img src="'. $modSettings['avatar_url']. '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width']. '" align="middle" border="0" /> </a>', '</div>';[/b]

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $board['last_post']['link'], '</strong>  ', '<br />
<span class="smalltext">', ' ', $board['last_post']['time'],'</span>
</p>';
echo '
</td>
</tr>';
Title: [HELP] Href image issue
Post by: SilverKnight on August 26, 2014, 12:23:06 PM
Anyone?
Title: Re: [HELP] Href image issue
Post by: margarett on August 26, 2014, 12:43:39 PM
I'm looking at this on the phone, but it seems that your logic only adds the link when the last post has no avatar.