collapse

* User Info

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

* Who's Online

  • Dot Guests: 54
  • Dot Hidden: 0
  • Dot Users: 1
  • Dot Users Online:

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • AngelinaBelle: For Documentation navigation, I really like to use the "<<" icon to turn that menu into a "navigation left panel", because I can read it better that way.
    April 21, 2014, 04:12:13 PM
  • oNLy1: Nakroma, please use the forum for support - ask all the questions (dumb or not) they will get answered
    April 18, 2014, 08:03:49 PM
  • Nakroma: i know this is just another question but im too dumb for it, where can I actualy get into the GENERAL SETTINGS page? im dumb sorry ;-;
    April 18, 2014, 04:27:39 PM
  • Nakroma: ahh okey, i get it. thanks
    April 18, 2014, 04:16:18 PM
  • [SiNaN]: Please don't get me wrong; I didn't mean that. You need to use the navigation menu right above the yellow Documentation bar you describe to navigate through different sections of documentation.
    April 18, 2014, 04:12:37 PM
  • Nakroma: okey I am dumb, could someone point out where at the top of the site it is? with a screenshot or something? if you mean the yellow Documention bar, thats not clickable for  me :|
    April 18, 2014, 03:57:34 PM
  • [SiNaN]: I wouldn't say it's hidden, lol. And it's extensive enough, thanks to Angelina.
    April 18, 2014, 02:28:55 PM
  • oNLy1: Documentation [link] (hidden at top of site)
    April 18, 2014, 12:48:01 PM
  • Nakroma: am I dumb or is there actually no tutorial? [link]
    April 18, 2014, 08:29:41 AM
  • AngelinaBelle: Welcome Gusto Prod.  Please visit [link] for info on creating an SMF forum
    April 17, 2014, 12:04:00 PM
  • GUSTO PROD: hi all give me creat new forum free
    April 16, 2014, 12:21:54 PM
  • AngelinaBelle: Hello w1ck3d! Welcome to Simple Portal. Unfortunately, there are not Russian speakers here very often.  Aplogies
    April 14, 2014, 07:49:26 AM
  • w1ck3d: тест
    April 14, 2014, 02:50:12 AM
  • Underdog: How to use Simple Portal for SMF: [link]
    April 02, 2014, 07:52:45 PM
  • Underdog: Thariq, please post questions in the forum. thank you.
    April 02, 2014, 07:51:40 PM
  • Thariq: how to create portal/site
    April 02, 2014, 06:30:42 AM
  • Ali çelen: forum nasıl oluştırıcam
    March 30, 2014, 10:59:08 PM
  • Ali çelen: sa
    March 30, 2014, 10:58:54 PM
  • AngelinaBelle: processor -- I think your customization will probably be just fine.
    February 14, 2014, 07:18:41 PM
  • AngelinaBelle: noumankhan: Welcome to SimplePortal.  Please read the documentation above. If you have questions about how to make a forum, please seek help at [link]
    February 14, 2014, 07:16:45 PM

* Team Blog

* Recent Posts

Re: Youtube Block - 1.0 by USFA
[Today at 12:38:51 AM]


Re: Youtube Block - 1.0 by USFA
[Today at 12:20:58 AM]


Re: Youtube Block - 1.0 by cy8erpunk
[Yesterday at 06:24:00 PM]


Re: Aeva Media Block by USFA
[Yesterday at 11:51:37 AM]


RSS Blocks not updating. by USFA
[Yesterday at 11:47:35 AM]

Join us on IRC! Come on in to #simpleportal on the irc.villageirc.net server.

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

0 Members and 1 Guest are viewing this topic.

Offline Underdog

  • Support
  • *
  • Posts: 721
  • Gender: Male
  • On Hiatus
    • Underdog-01 GitHub Repositories
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
[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: 721
  • Gender: Male
  • On Hiatus
    • Underdog-01 GitHub Repositories
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
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: 721
  • Gender: Male
  • On Hiatus
    • Underdog-01 GitHub Repositories
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
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: 721
  • Gender: Male
  • On Hiatus
    • Underdog-01 GitHub Repositories
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
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: 721
  • Gender: Male
  • On Hiatus
    • Underdog-01 GitHub Repositories
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
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: 721
  • Gender: Male
  • On Hiatus
    • Underdog-01 GitHub Repositories
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
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: 721
  • Gender: Male
  • On Hiatus
    • Underdog-01 GitHub Repositories
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
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

  • Translator
  • *
  • Posts: 326
  • Gender: Male
  • Smile, tomorrow will be worse...
  • 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: 721
  • Gender: Male
  • On Hiatus
    • Underdog-01 GitHub Repositories
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
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