collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 529
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: [Block] Advanced Unread Posts  (Read 77503 times)

0 Members and 3 Guests are viewing this topic.

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
[Block] Advanced Unread Posts
« on: September 07, 2012, 09:32:43 PM »
[Block] Advanced Unread Posts

Currently for SMF 2.0x only.

Features/specifics:
  • View unread posts/topics
  • Uses javascript pages
  • Option to enable auto refresh & time interval
  • Various settings available at top of block code

Download the attached file and install it via your package manager.

Place the following code in a custom php block:
Custom PHP block (Block Permissions ~ Members:
Code: [Select]
/* Unread Posts Block v1.4 ||  c/o Underdog @ http://askususaquestion.net */
global $settings, $sourcedir;
@require_once($sourcedir . '/PortalUnread.php');

/* Current default settings are for a full display example */
/* Recommended settings for compact display (ie. side block) :           */
/* $parameters['container_style'] = 'font-family:Helvetica;font-size:10px;   */
/* $parameters['display'] = 'compact';              */

/* --------------------------------------------BLOCK SETTINGS-------------------------------------------- */
$seconds = 60;
$auto_refresh = true; /* Change to false to disable auto refresh */

/* Basic settings */
$parameters['type'] = 'Posts'; /* Posts/Topics */
$parameters['rows'] = '5'; /* (int) Amount of posts/topics per page */
$parameters['display'] = 'full'; /* full/compact */
$parameters['show_icon'] = 'yes'; /* yes/no - Show new icon */
$parameters['full_height'] = 35; /* (int) Uniform row height for full display */
$parameters['compact_height'] = 45; /* (int) Uniform row height for compact display */
$parameters['container_class'] = 'mediumtext'; /* Set the css class for the whole container .. */
$parameters['container_style'] = 'font-family:Helvetica;font-size:12px;'; /* Set the css attributes for the whole container */
// $parameters['boards'] = '1|2|3|4'; /* Specific boards to display ... uncomment to use this option! */

/* This is the number of recent topics to select new one's from */ 
$parameters['limit'] = 30; /* (int) Maximum amount of posts/topics to display */

/* Image/Language Text  ...  set $parameters['unread_icons'] = false; to disable images & use text */
/* All images located in directory /Themes/default/images/sp */
$parameters['unread_icons'] = true;
$parameters['prev'] = 'Prev'; 
$parameters['next'] = 'Next';
$parameters['vbar_x'] = '|';
$parameters['vbar_y'] = '|';

/* Starting page */
$_SESSION['sp_current_page'] = 1;

/* --------------------------------------------END BLOCK SETTINGS-------------------------------------------- */

/* Execute & then let jQuery reset the container every xx milliseconds */
sportal_unread($parameters, false, false);

if ($auto_refresh)
echo '<script type="text/javascript" src="'.$settings['default_theme_url'].'/scripts/sp-jquery-1.3.2.min.js"></script>
<script type="text/javascript">
setInterval(function() {       
    $("#sp_content").load(location.href+" #sp_content","");
        event.stopPropagation();                       
}, '.((int)$seconds * 1000).');
</script>';

Enjoy.

[Last Update] -> Version 1.4  Jan.22/2013
« Last Edit: January 27, 2013, 01:20:02 PM by Underdog »

Offline kachan64

  • Semi Newbie
  • *
  • Posts: 16
  • Gender: Male
    • Chat 'n' Go
  • SMF Version: 2.0.1
  • SP Version: 2.3.4
Re: [Block] Unread Posts
« Reply #1 on: September 08, 2012, 03:59:23 AM »
Thanks, Give it a try when I have time...
I stepped on a cornflake, does this make me a serial killer?

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: [Block] Unread Posts
« Reply #2 on: September 12, 2012, 07:49:42 PM »
how to aply for topics?

fthkynr,

  If you look at the beginning of the block code you will see where there are various possible adjustments.
For your request, specifically:
Code: [Select]
$parameters['type'] = 'Posts';  /* Posts/Topics */

Change to:
Code: [Select]
$parameters['type'] = 'Topics';  /* Posts/Topics */

Offline fthkynr

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: [Block] Unread Posts
« Reply #3 on: September 13, 2012, 10:33:28 AM »
thanks

Offline TinMan

  • Semi Newbie
  • *
  • Posts: 43
    • RC Arcade
Re: [Block] Unread Posts
« Reply #4 on: November 14, 2012, 07:06:36 PM »
Is there a way to change the mouse pointer from being the "text select" pointer to the "link select" pointer when someone hovers over the page numbers?

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: [Block] Unread Posts
« Reply #5 on: January 07, 2013, 02:14:49 PM »

[Block] Unread Posts v1.2

Changes:

! fixed css for page numbers



The file in the first post has been updated. Please replace your current file with the newer attachment to apply the above update.

Thank you.

Offline teos

  • Jr. Member
  • **
  • Posts: 57
  • Gender: Male
    • Cultural Heritage photographer
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Unread Posts
« Reply #6 on: January 11, 2013, 02:44:31 AM »
A very nice mod in deed, thanks ...

Is it possible to exclude some categories or even include categories ?
« Last Edit: January 11, 2013, 02:47:35 AM by teos »

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: [Block] Unread Posts
« Reply #7 on: January 12, 2013, 11:33:47 AM »
A very nice mod in deed, thanks ...

Is it possible to exclude some categories or even include categories ?

teos,

You can opt specific boards to display by adding another parameter to the block's basic settings. Board id's are separated by vertical bars.

Code: [Select]
$parameters['boards'] = '1|2|3|4';  /* Specific boards to display */

Offline teos

  • Jr. Member
  • **
  • Posts: 57
  • Gender: Male
    • Cultural Heritage photographer
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Unread Posts
« Reply #8 on: January 12, 2013, 11:42:00 AM »
That is great, thanks. I'll give it a try.

Offline teos

  • Jr. Member
  • **
  • Posts: 57
  • Gender: Male
    • Cultural Heritage photographer
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Unread Posts
« Reply #9 on: January 19, 2013, 08:02:35 AM »
Is it a difficult task to automate this block with a time interval, to be refreshed ?

tried with the solution provided in http://simpleportal.net/index.php?topic=11407.0

used code at the top

Code: [Select]
$page = $_SERVER['PHP_SELF'];
$sec = "30";

and below code at the buttom

Code: [Select]
header("Refresh: $sec; url=$page");

  But this solution refreshed the whole page not inside the block.

Any recommendation ?
« Last Edit: January 19, 2013, 12:20:17 PM by teos »

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: [Block] Unread Posts
« Reply #10 on: January 20, 2013, 01:29:02 AM »
[Block] Unread Posts v1.3

Changes:

+ jquery auto refresh (if opted in block)
+ installer for needed files

teos,

  The new update includes the feature you requested.

Offline teos

  • Jr. Member
  • **
  • Posts: 57
  • Gender: Male
    • Cultural Heritage photographer
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Unread Posts
« Reply #11 on: January 20, 2013, 02:58:20 AM »
Most ever wanted mod, thumbs up !

  A minor issue though ...

  What I've done ..  Since there is no uninstall function of previous mod, I directly downloaded the 1.3 files and put into production.

   $parameters['rows'] = '5'  is set, but it displays the whole unreads in one go.
Sometimes after the third page, sometimes in the first page. ( Tested in different browsers)
Maybe a clear cache is needed.

Am I missing sonething ?

"$parameters['full_height'] = 35;   
$parameters['compact_height'] = 45


Noted that numbers do not have single queotes, is that the issue ?

Seems not,  I coded single codes this time it failed on the fifth try, returned to full display.


Hımm.. Full display happens when the threshold is reached for the refresh.



Hımmm 2   ftp'ed portalunread.php to local disk and seen that it is V1.2

extracted portalunread.php  from 1.3 package and replaced it in the server.

the result is the same.  Full page is displayed after the threshold reached.

nb. I have also shoutbox enabled in the same page for 60secs refresh. Any effect ?

« Last Edit: January 20, 2013, 04:49:21 AM by teos »

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: [Block] Unread Posts
« Reply #12 on: January 20, 2013, 08:09:51 AM »

teos,

  The js pages & refresh must be conflicting somehow. I will have to run some tests & attempt to adjust the js to get it to work properly when time permits.
To have the block function as before until I resolve & update the issue involves editing one variable..
Code: [Select]
$auto_refresh = false;
   

Offline teos

  • Jr. Member
  • **
  • Posts: 57
  • Gender: Male
    • Cultural Heritage photographer
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Unread Posts
« Reply #13 on: January 20, 2013, 08:12:13 AM »
  Thanks for your efforts. I will wait the solution deadly :-)   Everybody want to use it, very handy.

Offline teos

  • Jr. Member
  • **
  • Posts: 57
  • Gender: Male
    • Cultural Heritage photographer
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Unread Posts
« Reply #14 on: January 20, 2013, 08:49:03 AM »
Another minor issue, maybe related with utf8 ,  image attached. (undefined characters before "prev" end after "next" )






Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: [Block] Unread Posts
« Reply #15 on: January 22, 2013, 11:40:15 PM »
[Block] Unread Posts v1.4

Changes:

! fixed block height (calculated by number of rows)
! js page controller in different container (id)
+ added images for previous, next & vertical bar
+ mouseover effect for new images/buttons

teos,

  Please try out v1.4 & let me know if it functions properly.



General notes:
  • I attempted to apply many different jQuery commands to render the table as needed without success  :ill:
  • However after messing with the css, html & javascript I was able to have it display the desired effect.
  • The jQuery used for reloading just the container works fairly well (perfectly for php.. not 100% expected behavior for javascript within the loaded container).
  • Next update: replace javascript pagination with php routine that uses jQuery to control a container id. url & $_REQUEST should be able to pass starting key of array (page#) or use jQuery to force it in url (on partial reload)

Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 114
  • SMF Version: 2.0.5
  • SP Version: 2.3.5
Re: [Block] Unread Posts
« Reply #16 on: January 23, 2013, 09:23:31 AM »
Dumb question likely... but do we install BOTH files from the first page or just the larger one (ADV)?

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: [Block] Unread Posts
« Reply #17 on: January 23, 2013, 01:00:35 PM »
There are two versions 1.3 and 1.4 - install one of them.

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: [Block] Unread Posts
« Reply #18 on: January 23, 2013, 02:52:41 PM »

FrizzleFried,

  I omitted v1.3 to thwart confusion as v1.4 appears to work correctly for the top 5 browsers.



Forum admins may need to tweak the block's settings due to the css for specific themes as I only tested this with the default theme & 2011 theme.  The first post has had the block code updated with clearer comments to help with adjusting its settings for those that are less savvy.

Offline teos

  • Jr. Member
  • **
  • Posts: 57
  • Gender: Male
    • Cultural Heritage photographer
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Advanced Unread Posts
« Reply #19 on: January 30, 2013, 04:59:50 AM »
   Tested for several days, unfortunately refresh is not taking place. Tried with different browsers ( chrome, opera, firefox ).

  The rest is functioning properly, paging etc but refresh is still an issue, from my end.

smf 2.0.3  default theme curve simple portal 2.3.5