Advertisement:

Author Topic: Handling unread posts and links  (Read 303 times)

Offline ormuz

  • Full Member
  • ***
  • Posts: 689
Handling unread posts and links
« 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
Code: [Select]
// 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?

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,226
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
    • Study Force
Re: Handling unread posts and links
« Reply #1 on: May 27, 2018, 12:11:11 AM »
Topic solved?

Offline ormuz

  • Full Member
  • ***
  • Posts: 689
Re: Handling unread posts and links
« Reply #2 on: May 27, 2018, 12:55:02 PM »
topic solved..

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

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