Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: ormuz on May 21, 2018, 09:33:06 AM

Title: Handling unread posts and links
Post by: ormuz on May 21, 2018, 09:33:06 AM
I've a custom template.

All my #new anchors, get assigned to the last post (see attach).

This is my display.template code
// Get all the messages...
while ($message = $context['get_message']())
{
$ignoring = false;
$alternate = !$alternate;
if ($message['can_remove'])
$removableMessageIDs[] = $message['id'];

// Are we ignoring this message?
if (!empty($message['is_ignored']))
{
$ignoring = true;
$ignoredMsgs[] = $message['id'];
}

// Show the message anchor and a "new" anchor if this message is new.
if ($message['id'] != $context['first_message'])
echo '
<a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : '';

echo '
<div class="home-feed windowbg24">
<div class="post_wrapper">';

// Show information about the poster of this message.
echo '


Any ideas on where to start debugging this?
Title: Re: Handling unread posts and links
Post by: Biology Forums on May 27, 2018, 12:11:11 AM
Topic solved?
Title: Re: Handling unread posts and links
Post by: ormuz on May 27, 2018, 12:55:02 PM
topic solved..

For anyone wonder, this is the correct peace of code.

$scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['new_from'] . ';topicseen#new',