collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 37
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • BurkeKnight: Well, sometimes that error does show, like I said, when don't even get to the server. I have yet to figure out why...lol... However, there are times that you will see a msg about server stress here, but I have yet to get a 500 error, myself. And I'm here about 30 times a day, checking for new posts. :P
    Today at 05:18:38 am
  • SeeingBlue: I was under the impressions that 500 Internal Server Error are only produced by the server(aka your site). Plus sanb below said he was having the same issue. Anyways just trying to help, not arguing.
    Yesterday at 06:59:40 pm
  • BurkeKnight: SeeingBlue, it may not be this end. There may be an issue in the connection from you to the SP site, that shows that. I know things like that can happen, due to the fact I had issues on my own site before, yet no one else did, nor were there any logs on it.
    Yesterday at 02:46:05 pm
  • ♦ Ninja ZX-10RR ♦: I'm not admin nor a staff member... I tried connecting with a different IP and via proxy. No errors...
    December 18, 2014, 01:15:06 pm
  • SeeingBlue: You've just been lucky, Ninja. There is a problem. Check your stats and see how many 500 error hits you've been getting.
    December 18, 2014, 08:08:56 am
  • ♦ Ninja ZX-10RR ♦: The server might be have a high load but it still works here...
    December 17, 2014, 03:13:51 pm
  • sanb: i cant post a reply(
    December 17, 2014, 01:36:59 pm
  • SeeingBlue: It's intermittent. I bet if the admin logs into the cpanel they'll find either CPU or Ram hitting it's limit.
    December 17, 2014, 09:11:07 am
  • ♦ Ninja ZX-10RR ♦: The site works fine here...
    December 16, 2014, 11:01:27 am
  • SeeingBlue: I was finally able to make 1 post, but I can't edit it or make another. I'm frustrated, I give up.
    December 16, 2014, 08:49:37 am
  • SeeingBlue: I even tried a different browser. I'm just getting a 500 Internal Server Error.
    December 16, 2014, 08:30:15 am
  • SeeingBlue: When I "hit" post, sorry.
    December 16, 2014, 08:26:04 am
  • SeeingBlue: I'm trying to reply to my thread "Loading custom JS files" and when I get post it just loads a blank page.
    December 16, 2014, 08:25:43 am
  • Eliana Tamerin: Let's kick this over to his support topic, folks.
    December 03, 2014, 10:16:21 pm
  • Underdog: what is the issue with it? the naviagtion links? look here: [link]
    December 03, 2014, 09:54:07 pm
  • [SiNaN]: Oh! I didn't even see that. The author seems to have posted some instructions at the theme support topic at sm.org: [link]
    December 03, 2014, 02:11:58 pm
  • WhiteEagle: No the menu on top... the one that comes down when you mouse over it. ;)
    December 03, 2014, 02:02:35 pm
  • [SiNaN]: I already posted it!
    December 03, 2014, 01:51:11 pm
  • WhiteEagle: Any idea what I can do with the menu on top in that theme [SiNaN]?
    December 03, 2014, 01:28:25 pm
  • [SiNaN]: It's a pity that the theme author did that unusual thing for a rare good looking theme.
    December 03, 2014, 12:37:47 pm
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 17014 times)

0 Members and 1 Guest are viewing this topic.

Offline Underdog

  • Support
  • *
  • Posts: 917
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
[Block] Advanced Unread Posts
« on: September 07, 2012, 07: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, 12: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, 01: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 Underdog

  • Support
  • *
  • Posts: 917
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: [Block] Unread Posts
« Reply #2 on: September 12, 2012, 05: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, 08:33:28 am »
thanks

Offline TinMan

  • Semi Newbie
  • *
  • Posts: 43
    • RC Arcade
Re: [Block] Unread Posts
« Reply #4 on: November 14, 2012, 06: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 Underdog

  • Support
  • *
  • Posts: 917
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: [Block] Unread Posts
« Reply #5 on: January 07, 2013, 01: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, 01: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, 01:47:35 am by teos »

Offline Underdog

  • Support
  • *
  • Posts: 917
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: [Block] Unread Posts
« Reply #7 on: January 12, 2013, 10: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, 10: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, 07: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, 11:20:17 am by teos »

Offline Underdog

  • Support
  • *
  • Posts: 917
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: [Block] Unread Posts
« Reply #10 on: January 20, 2013, 12: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, 01: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, 03:49:21 am by teos »

Offline Underdog

  • Support
  • *
  • Posts: 917
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: [Block] Unread Posts
« Reply #12 on: January 20, 2013, 07: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, 07: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, 07:49:03 am »
Another minor issue, maybe related with utf8 ,  image attached. (undefined characters before "prev" end after "next" )






Offline Underdog

  • Support
  • *
  • Posts: 917
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: [Block] Unread Posts
« Reply #15 on: January 22, 2013, 10: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, 08:23:31 am »
Dumb question likely... but do we install BOTH files from the first page or just the larger one (ADV)?

Offline phantomm

  • Support
  • *
  • Posts: 390
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Unread Posts
« Reply #17 on: January 23, 2013, 12:00:35 pm »
There are two versions 1.3 and 1.4 - install one of them.

Offline Underdog

  • Support
  • *
  • Posts: 917
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: [Block] Unread Posts
« Reply #18 on: January 23, 2013, 01: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, 03: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