collapse

* User Info

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

* Who's Online

  • Dot Guests: 65
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • GUSTO PROD: hi all give me creat new forum free
    Yesterday at 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
  • noumankhan: how can i make forum plz tell me
    February 13, 2014, 09:41:03 AM
  • noumankhan: hello
    February 13, 2014, 09:40:47 AM
  • BurkeKnight: Shoutbox is not for support. That also means, not for asking volunteers to hurry to your support topic. All topics will get seen. :)
    February 12, 2014, 03:39:28 PM
  • processor: Can anyone check this out: [link] thanks guys
    February 12, 2014, 05:54:58 AM
  • matixto: Hi all, can a developer see this thread? [link] Thanks!
    February 06, 2014, 02:44:36 PM
  • imamzw: Halo
    February 05, 2014, 08:17:24 PM
  • dj_king: hello
    February 04, 2014, 10:32:47 AM
  • BurkeKnight: Thank you, old friend :)
    January 29, 2014, 07:01:43 AM
  • [SiNaN]: It's just a little piece of custom code: [link]
    January 27, 2014, 12:55:42 PM
  • BurkeKnight: Ok, where you get that, so I can check mine on my sites? LOL
    January 27, 2014, 06:33:21 AM

* Team Blog

* Recent Posts

Re: Boardname instead of poster in Recent topics/posts by Navikiddo
[Today at 12:58:08 AM]


Re: [Plugin] jQuery Navgoco Menus by Navikiddo
[Today at 12:57:24 AM]


Re: SimplePortal article by oNLy1
[Yesterday at 06:47:17 PM]


Re: hi all by mehrtadbir
[Yesterday at 05:28:45 PM]


Re: Popular Tags Block. by AngelinaBelle
[Yesterday at 05:00:30 PM]

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: [Block] Advanced Unread Posts  (Read 11434 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
Re: [Block] Advanced Unread Posts
« Reply #20 on: January 30, 2013, 10:24:14 PM »
teos,

  I have tested this both live & locally to find that it functions as intended.  Atm I am not able to duplicate your issue. Are you using the block from the first post without edits? If you adjusted its settings please post it in a code block (in its entirety). Thanks.



  There is one issue where when the user is logged out due to being idle (or otherwise) the block goes blank. This is because I forgot to put some logic within the container itself that checks if it's a guest.. I will adjust this within the next week & release another version.

 
« Last Edit: January 30, 2013, 10:31:46 PM by Underdog »

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 #21 on: January 31, 2013, 09:23:40 AM »
Again tested with different browsers ( Chrome, Opera, Firefox) , and different users, cleared cache.
The result for refresh is negative.

The code I use is below:

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'] = 'Topics'; /* 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'] = 'Önceki sayfa'; 
$parameters['next'] = 'Sonraki sayfa';
$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>';


My portalblocks.php attached.

shoutbox is enabled and refresh is set to 60sec

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] Advanced Unread Posts
« Reply #22 on: February 01, 2013, 02:15:45 PM »
teos,

  Attaching that file was unnecessary as SP stores its custom block codes in a db table. Let us try to include the main jQuery library.

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'] = 'Topics'; /* 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'] = 'Önceki sayfa'; 
$parameters['next'] = 'Sonraki sayfa';
$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.9.0"></script>
<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>';
« Last Edit: February 01, 2013, 02:18:37 PM by Underdog »

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] Advanced Unread Posts
« Reply #23 on: February 01, 2013, 02:23:10 PM »

teos,

  If that does not work, perhaps the stop.propagation command is causing the issue so you can try removing it..

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'] = 'Topics'; /* 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'] = 'Önceki sayfa'; 
$parameters['next'] = 'Sonraki sayfa';
$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.9.0"></script>
<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","");                             
}, '.((int)$seconds * 1000).');
</script>';

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 #24 on: February 01, 2013, 02:41:44 PM »
Unfortunately the result is negative.  with stop.propogation or without.

Test evnvr.

Chrome use posts ...
Neither opera nor firefox refreshes for the new topic/post

if I manualy refresh then the new topics/posts come through...

 I have the mod " scrolling buttons" which uses jquery and functions properly, so I assume jquery is on.
Maybe some others as well since it was just a dirty check on jquery.

Maybe some other mod overrides this function ... I'm not sure ...

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] Advanced Unread Posts
« Reply #25 on: February 01, 2013, 02:47:09 PM »

teos,

  Test it with other blocks containing jQuery disabled to see if something is conflicting. Perhaps have the block show on another page of your forum that contains no other blocks for testing purposes.

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 #26 on: February 01, 2013, 03:10:16 PM »
The only test I can do is,  to create a new page with the code in it and no other blocks.

with stop.propagaiton and without -> negative.



I cannot do the other test ( disabling jquery ) from my end since I have so many mods installed.
Most of the time they give errors depending on each other.

Fancybox is also another mod using jquery and works ...

So I'm hopeless, I deadly need this code in fact ...


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 #27 on: February 01, 2013, 03:19:51 PM »
Maybe helps,

  During the execution, I opened java console ...

GET http://123 . com/Themes/default/scripts/sp-jquery-1.9.0 404 (Not Found) page,page1707.html:303
Uncaught TypeError: Cannot call method 'create' of undefined measureIt.js:120
************* startProtect 2datetime: Fri Feb 01 2013 23:16:51 GMT+0200 (xxx Standard Time) Ex.js:1109
3
Uncaught TypeError: Cannot call method 'stopPropagation' of undefined


I dont have sp-jquery-1.9.0 in the themes/default/scripts , how can can I get it?


Hımm...  Seems I only used the code but not installed the new portaladvunread.zip

I'll install it with the package manager but what about the previous one (v1.3) , I dont see the previous one on the package manager installed list. Should I go on without uninstalling the previous one ?
« Last Edit: February 01, 2013, 03:31:42 PM 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] Advanced Unread Posts
« Reply #28 on: February 01, 2013, 03:31:01 PM »

teos,

The package in the first post includes the file & places it in the proper directory.
Uninstall the package & make sure to delete it from your list of packages. Afterward, download the attachment in the first post & use your package manager to install it anew. Ensure you are selecting the proper package from your computer when uploading to the package manager.

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 #29 on: February 01, 2013, 03:33:17 PM »
The question is uninstalling V1.3 now. Since it is not shown in the installed packages list, I dont know what do remove manually.

Silly me, sorry it is SP-unread . I'll uninstall, and feedback accordingly.
Sorry again, keeping you busy.

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 #30 on: February 01, 2013, 03:51:48 PM »
Test results ...

1-) execution from the block at the main page still  gives 404 error for sp-jquery-1.9.0.js


checked the file, js file is there with premissions 666

2-) execution from seperate page gives ...

Uncaught TypeError: Cannot call method 'create' of undefined measureIt.js:120
(anonymous function) measureIt.js:120
************* startProtect 2datetime: Fri Feb 01 2013 23:50:49 GMT+0200 (xxx Standard Time) Ex.js:1109

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 #31 on: February 02, 2013, 02:17:21 AM »
Yesterday, when I was closing chrome, I got a msg on the screen, similiar to  " too much jquery ....." .
envr.  Windows 8  Google Chrome and opera and firefox, for test purposes.

Today, I tested again, and functions properly. Seems there is a limit somewhere for jquery.

Thanks alot for your efforts, It's one of the best blocks I've ever used.   

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] Advanced Unread Posts
« Reply #32 on: February 02, 2013, 12:26:55 PM »

teos,

  Imo use the block code from the first post of this thread (if it works for you) as loading that other js file is not necessary within the block code (it is used in the php file). What you are referring to might be resolved by adding the event.stopPropagation command in your other blocks/mods that use jquery (at the end of their function).

ref. Stop jQuery events from bubbling up the DOM tree

For support regarding those other mods/blocks, you will have to ask their authors, post questions at simplemachines.org support or perhaps on a forum that is specifically for jQuery support.


Offline NervoServo

  • Newbie
  • Posts: 4
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Internal error when adding custom php block
« Reply #33 on: June 23, 2013, 11:41:00 AM »
Hello all.
I am totally newbish in forum and web designing. Just uploaded my SMF forum with SimplePortal integrated in my host server and works well.
So, i want to add a block in SimplePortal that shows unread messages. I installed the package and followed the instructions from this topic http://simpleportal.net/index.php?topic=11774.0 , but when i trying to add a custom block with the php code provided on the topic i get an error message:

Code: [Select]
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@mystie.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

What can i do to overcome this problem? Thanks

Offline phantomm

  • Translator
  • *
  • Posts: 326
  • Gender: Male
  • Smile, tomorrow will be worse...
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Internal error when adding custom php block
« Reply #34 on: June 23, 2013, 01:05:12 PM »
Do you have enabled safe_mode?

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] Advanced Unread Posts
« Reply #35 on: June 23, 2013, 01:31:43 PM »
NervoServo,

  I merged your topic with the actual block with which you are having an issue as this thread is for its specific support.

  Please ensure you are indeed attempting to create a PHP block and also make sure the necessary file attached to the first post has been put in the appropriate directory prior to adding the block.
« Last Edit: June 23, 2013, 01:34:20 PM by Underdog »

Offline NervoServo

  • Newbie
  • Posts: 4
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: [Block] Advanced Unread Posts
« Reply #36 on: June 23, 2013, 03:25:15 PM »
Ok Underdog thanks for the merge. (thanks also for this useful mod, i hope it gonna work for me also :) ).
So, i try to add php block for sure, but the same error code continuously.
As for the file, i just uploaded via package manager the file in the first post and then installed it.

@phantomm: What is safe mode? I have no enabled any safe mode, i think. Where can i ensure that?

The problem still there anyway.

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] Advanced Unread Posts
« Reply #37 on: June 23, 2013, 08:25:43 PM »
NervoServo,

  The package + block should be working fine as I just tested it. Are you using some sort of free host by any chance? Does any other mod work after you install it via the package manager?

  Using FTP, check to make sure there is the PortalUnread.php file in /Sources .. attempt changing its permission setting to 0755 (do not forget the 0).

  There are also 3 javascript files that this mod puts into /Themes/default/scripts :
  • sp-jquery-1.3.2.min.js
  • sp-jquery-1.9.0.js
  • sp-pager.js

  Ensure all those files are in that directory and attempt changing their permission setting to 0755
If those files are not in those directories you may have to copy them manually via FTP else some sort of permission issue could cause the error you are seeing due to not being able to access those files.

Offline NervoServo

  • Newbie
  • Posts: 4
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: [Block] Advanced Unread Posts
« Reply #38 on: June 24, 2013, 02:45:25 AM »
Thnaks for the reply.
So these files were on the right directories, but permissions were set on 0666. I set them on 0755 now, but the problem and the message error still the same. Kinda strange hehe.
*The host is not providing free services, i pay for it.
*I installed a pack of modifications via package manager (about 3-4 total) after simpleportal mod installation.

edit: I just uninstalled SimplePortal and installed it again, and the same problem exists.
« Last Edit: June 24, 2013, 02:59:14 AM by NervoServo »

Offline BurkeKnight

  • Beta Tester
  • *
  • Posts: 211
  • Gender: Male
  • BurkeKnight Enterprises Founder
    • BurkeKnight Enterprises
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: [Block] Advanced Unread Posts
« Reply #39 on: June 24, 2013, 02:49:06 AM »
Underdog,

At The Star Trek RPG Site, I had to uninstall this due to a conflict with that StarDate I have. It seems they conflict somehow. WHen installed, the page somehow refreshes, instead of the block, and get white page with nothing except the StarDate...LOL

I have never seen such a thing! Now I know the StarDate code can be a pain, but never imagined that happening.

However, that is ok. I don't need this there. I have it running nicely on 3 other sites. Thank you, my friend for such a great addition to SP. :)
Please do not PM me for support issues. - How to flush your DNS.