Jump to content

Highlight first unread post in topic


KVentz

Recommended Posts

Just imagine we have a forum with many large images posted in topics. We have some new posts in the topic and we are clicking on the get last post link. Browser loads the page with anchor (#msg_id) and focuses on this anchor. What will happen if we have many images before this post? They are going to load and the focus starts to move quickly because there are no width and height set in the posted images. If there are 10 or more images loaded before last unread post we are totally loosing the post we need, it moved somewhere down and we must find it manually. But IP.Board does not help us to do it. Some other forum software highlights unread posts:

%7Boption%7D
vBulletin

%7Boption%7D
phpBB

But not IP.Board. I found a simple solution on my IP.Board 2:

<script type="text/javascript">

	sURLt = location + '';

	if (sURLt.split('#entry') != sURLt)

	{

		firstnewpid = sURLt.split('#entry')[1] * 1;

		ispid = 429628 * 1;


		if (ispid < firstnewpid) document.write ("<img src='http://forum.nash-transport.ru/style_images/1/to_post_off.gif' alt='сообщение' border='0' style='padding-bottom:2px' />");

		else document.write ("<img src='http://forum.nash-transport.ru/style_images/1/to_post.gif' alt='сообщение' border='0' style='padding-bottom:2px' />");

	}

	else

	{

		document.write ("<img src='http://forum.nash-transport.ru/style_images/1/to_post_off.gif' alt='сообщение' border='0' style='padding-bottom:2px' />");

	}

</script>



We get the number after # in the URL and compare it to the post ID. If it matches, this post and all posts below marks with to_post.gif image instead of to_post_off.gif. This does not show unread posts themselves but helps find the anchored message if we clicked on 'last unread post' link or 'link to post' link.

It would be nice if IPS adds highlighting anchored posts this or some other way in the future versions.

Link to comment
Share on other sites

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...