Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

[helios smf20gold] Need to modify recent post list

Aloittaja bud01100, kesäkuu 22, 2011, 10:43:03 IP

« edellinen - seuraava »

bud01100

Im trying to take this section that outputs the recent posts;
echo '
<dt><strong>', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
<dd>', $post['time'], '</dd>';


And put the post['board']['link'] first, post link second, poster thrid and post time last.

I cant figure out the correct syntax and keep getting an error.

thanks




// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<strong><a href="', $scripturl, '?action=recent">', $txt['recent_posts'], '</a></strong>
<p id="infocenter_onepost" class="middletext" style="padding: 8px;">
', $txt['recent_view'], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
</p>';
}
// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<dl id="ic_recentposts" class="middletext">';

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '
<dt><strong>', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
<dd>', $post['time'], '</dd>';

echo '
</dl>';
}
echo '
</div>';
}

bud01100

Bloc replied elsewhere.. Here is is solution...



<dt><strong>', $post['board']['link'], ' - ', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' </dt> <dd style="text-align: right;">', $post['time'], '</dd>';



Thank You Bloc.

Advertisement: