SimplePortal
Customization => Blocks and Modifications => Block Requests => Topic started 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?
-
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.
-
I know this is old, but what's the status of this? I could use this :D
-
anyone? :(
-
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?
-
Anyone, please :'(
-
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
-
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'.
-
Unfortunately my coding skills are limited to copy & paste :)
Thanks for the reply though J
-
Any help would be greatly appreciated.
-
Same here. That was the point though - try looking at the examples using SSI and copy and paste - see what happens.
-
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:
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.
-
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.
-
You're a star thank you.