SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: Pentaxian on December 07, 2009, 02:52:01 AM

Title: Unread posts block
Post by: Pentaxian on December 07, 2009, 02:52:01 AM
Is it possible to have an unread posts block? Set up like the recent posts block but with unread posts instead.
Or causes that too much traffic on your site?
Title: Re: Unread posts block
Post by: Nathaniel on December 07, 2009, 08:10:21 PM
That sounds possible, although it would require loading a different set of topics for each user (meaning that you couldn't use a cache for it), but that shouldn't be too much of an issue.

I will have a look at this when I get some time.
Title: Re: Unread posts block
Post by: willemjan on September 29, 2010, 06:58:39 AM
I know this is old, but what's the status of this? I could use this  :D
Title: Re: Unread posts block
Post by: willemjan on October 02, 2010, 08:22:24 AM
anyone?  :(
Title: Re: Unread posts block
Post by: willemjan on October 04, 2010, 03:23:43 AM
Becouse I am creating an site for lazy people. My front page must be an page where people can see all things new on the site, including the latest unread posts (without clicking).

Could you give me an clue of where to start?
Title: Re: Unread posts block
Post by: willemjan on October 08, 2010, 03:50:31 AM
Anyone, please  :'(
Title: Re: Unread posts block
Post by: BlkKnight on August 29, 2012, 10:45:05 AM
I can't see that this has been done anywhere.

Do we have such a function / code I can throw at my site?

SMF 2.02 SP 2.3.5
Title: Re: Unread posts block
Post by: andy on August 29, 2012, 01:28:38 PM
Im sure you could do this using the SSI functions of SMF. Maybe just copy n paste in a custom php block.

I would try looking for examples over at SMF or even on your site - default setup leaves the SSI examples php file in the root folder which gives many details.

Though a limit would be needed as new members would have everything 'unread'.

Title: Re: Unread posts block
Post by: BlkKnight on August 30, 2012, 08:28:07 AM
Unfortunately my coding skills are limited to copy & paste  :)

Thanks for the reply though  J
Title: Re: Unread posts block
Post by: BlkKnight on September 01, 2012, 08:52:24 PM
Any help would be greatly appreciated.
Title: Re: Unread posts block
Post by: andy on September 02, 2012, 11:38:53 AM
Same here. That was the point though  - try looking at the examples using SSI and copy and paste - see what happens.
Title: Re: Unread posts block
Post by: Chen Zhen on September 06, 2012, 12:16:05 AM

BlkKnight,

  Download the attached file & put it into your sites Sources directory.
/Sources/PortalUnread.php

Create a custom php block & put the following code into it:
Code: [Select]
global $sourcedir;
@require_once($sourcedir . '/PortalUnread.php');

/* Basic settings */
$parameters['type'] = 'Posts';  /* Posts/Topics */
$parameters['limit'] = 50;  /* (int) Maximum amount of posts/topics to display */
$parameters['rows'] = '5'; /* (int) Amount of posts/topics per page */
$parameters['display'] = 'full';  /* full/compact */

/* Language Text */
$parameters['prev'] = 'Prev'; 
$parameters['next'] = 'Next';
$id = false;

sportal_unread($parameters, $id, $return_parameters = false);

I set it at a 50 post limit with 5 posts showing per js page.
The javascript pages will allow your users to browse their unread posts at the integer setting you opt.
Various settings are available at the top of the block code.

Keep an eye out in the Blocks & Modifications (http://simpleportal.net/index.php?board=55.0) board as I will be releasing an improved version when time permits.
Title: Re: Unread posts block
Post by: Chen Zhen on September 07, 2012, 09:42:29 PM

BlkKnight,

  An updated version is now available here: http://simpleportal.net/index.php?topic=11774.0
I may update it at some time to adjust the mysql query to my liking but imo this will work quite nicely.
Title: Re: Unread posts block
Post by: BlkKnight on September 13, 2012, 06:56:15 AM
You're a star thank you.
SimplePortal 2.3.8 © 2008-2024, SimplePortal