collapse

* User Info

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

* Who's Online

  • Dot Guests: 216
  • Dot Hidden: 0
  • Dot Users: 2
  • Dot Users Online:

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • Betty from Glitchtale: Hello?
    April 01, 2017, 09:56:30 am
  • Betty from Glitchtale: Since my topic is taking a while to post, can I show my site off here?
    March 30, 2017, 10:00:45 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
  • [DFg]DJF-1975: 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
  • phantomm: and from what I see only patch is broken, full install package is fine
    October 21, 2016, 03:44:44 pm
  • phantomm: they say it for over 3 weeks now..
    October 21, 2016, 03:43:52 pm
  • aegersz: SMF say that bug fix 2.0.13 is coming soon ...
    October 19, 2016, 06:46:12 pm
  • Chen Zhen: check that thread at a later date as that file is not a final fix
    October 10, 2016, 03:09:18 pm
  • [DFg]DJF-1975: Thanks for the shoutbox fix file!
    October 10, 2016, 09:17:19 am

* Recent Posts

Suggestion for the forum by Betty from Glitchtale
[Yesterday at 11:17:06 am]


Re: Center block title? by Black Tiger
[April 17, 2017, 08:35:05 am]


Re: Center block title? by ♦ Ninja ZX-10RR ♦
[April 16, 2017, 09:52:27 pm]


Re: Center block title? by Black Tiger
[April 16, 2017, 06:37:28 pm]


Re: Center block title? by andy
[April 16, 2017, 06:08:04 pm]

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: Shoutbox does not load shouts in SMF 2.0.12  (Read 43500 times)

0 Members and 1 Guest are viewing this topic.

Offline rentner

  • Semi Newbie
  • *
  • Posts: 13
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #40 on: October 02, 2016, 04:09:04 am »
FYI

I have the same problem with the shoutbox cache after the update 2.0.12, I'm grateful on a buck fixing for this problem.

If I just have disabled the cache for the shoutbox (and it function) but get this message in the error log:


8192: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
Datei: /..../forum/Sources/PortalBlocks.php
Zeile: 2028
PHP 5.6

Offline aegersz

  • Semi Newbie
  • *
  • Posts: 41
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #41 on: October 02, 2016, 06:45:14 am »
I don't have the extra options for Shoutbox on either and I still get the error too.
"mods" fan (SMF 2.0.13) with 125+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline Chen Zhen

  • The Underdog
  • Support
  • *
  • Posts: 1254
  • Gender: Male
  • MOOSE KNUCKLES
    • WebDev
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #42 on: October 02, 2016, 08:36:07 pm »
Oh??
I was testing this last night and it seemed to work without the plugin.
After I installed the plugin the issue occurred.
Perhaps if I had tested it longer using more shouts without the plugin..

« Last Edit: October 02, 2016, 11:40:57 pm by Chen Zhen »

Offline Chen Zhen

  • The Underdog
  • Support
  • *
  • Posts: 1254
  • Gender: Male
  • MOOSE KNUCKLES
    • WebDev
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #43 on: October 02, 2016, 08:42:00 pm »
rentner,

You were given a fix for that some time ago:
http://simpleportal.net/index.php?topic=10356.msg68208#msg68208

... also if that error is recurring then I will assume your Simple Portal version is not up to date on what you are displaying.
Download & use the 2.3.6 version from the download link (stable packages) at the top of the forum.

.. although when I just checked your live forum it shows as sp 2.3.6 ??
is this your live forum that the error is showing on or some sort of local/alternate test site?
« Last Edit: October 02, 2016, 08:45:08 pm by Chen Zhen »

Offline Chen Zhen

  • The Underdog
  • Support
  • *
  • Posts: 1254
  • Gender: Male
  • MOOSE KNUCKLES
    • WebDev
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #44 on: October 03, 2016, 12:13:17 am »

If it is not a bother, please test a default installation of Simple Portal (no plugins) replace the Subs-Portal.php Sources folder attached to this post.
Let me know if it seems to fix the issue.

@aegersz,
Thanks for the quote from Arantor.. spot on about the lengthy array.

.. I did not test this with various scenarios as of yet.
ie. multiple shoutboxes on the same page and such.


Offline rentner

  • Semi Newbie
  • *
  • Posts: 13
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #45 on: October 03, 2016, 05:42:36 am »
rentner,

You were given a fix for that some time ago:
http://simpleportal.net/index.php?topic=10356.msg68208#msg68208

... also if that error is recurring then I will assume your Simple Portal version is not up to date on what you are displaying.
Download & use the 2.3.6 version from the download link (stable packages) at the top of the forum.

.. although when I just checked your live forum it shows as sp 2.3.6 ??
is this your live forum that the error is showing on or some sort of local/alternate test site?

Yes of course, sorry you be right, this fixed this problem. I had reinstalled the SP 2.3.6 after the cache problems with SF 2.0.12 and the PortalBlocks.PHP was overwritten again. Now this error message is fix again.

Thanks

PS: Are there any problems expected after disable cache of the shouldbox?
PHP 5.6

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • SP Version: 2.4 (Elkarte)
  • Elkarte Version: 1.0.5
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #46 on: October 04, 2016, 04:06:27 pm »
I can't test this file, because forum is too active right now (I'm using it for few domains with Split Forum Mod), but I did noticed that issue affects shoutbox with lots of messages - new shoutbox is not affected, only problem is with shoutbox with over 169331 messages

and I think that SMF team is aware that there is bug in latest release:
Quote from: nend
As far as the issue, there was a problem with the release and an older revision got released instead of the actual 2.0.12 we had planned. Rest assure we are working on getting the correct revision out soon.

http://www.simplemachines.org/community/index.php?topic=548944.msg3893693#msg3893693
« Last Edit: October 04, 2016, 04:08:36 pm by phantomm »

Offline Chen Zhen

  • The Underdog
  • Support
  • *
  • Posts: 1254
  • Gender: Male
  • MOOSE KNUCKLES
    • WebDev
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #47 on: October 04, 2016, 04:23:25 pm »
The file I posted does not correct the issue.
I was testing it yesterday and its not using the cache properly.
The right idea is there but I did not code it correctly as of yet.
Hopefully a corrected release of SMF will fix the issue else I will mess with it some more to get it working properly.
All one has to do is split up the $shouts array prior to storing it in the cache.. decreasing the length of what is being stored at one time.
Imo in theory it should work.
 

Offline Chen Zhen

  • The Underdog
  • Support
  • *
  • Posts: 1254
  • Gender: Male
  • MOOSE KNUCKLES
    • WebDev
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #48 on: October 05, 2016, 10:29:55 pm »

Here is a new file to test on a default Simple Portal 2.3.6 installation.
Please test this for SP 2.3.6 & SMF 2.0.12
Let me know of any issues.

 

Offline andy

  • On Leave
  • *
  • Posts: 854
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #49 on: October 06, 2016, 05:46:14 am »
So far, with limited testing, this file works for me.

Hope a new update of SP will be released to make it easier for people.
Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


Offline emanuele

  • Developer
  • *
  • Posts: 268
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #50 on: October 08, 2016, 05:44:10 pm »
I have the feeling what you are doing is worse than disable the cache entirely.

Storing each and every shout in its own file means that for each and every shout you are opening a file on the disk.
I would be surprised if this scenario has any benefit when using the file-based cache (probably 95% of SMF/SP install-base).

Offline Chen Zhen

  • The Underdog
  • Support
  • *
  • Posts: 1254
  • Gender: Male
  • MOOSE KNUCKLES
    • WebDev
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #51 on: October 09, 2016, 05:29:27 pm »

Yes you're right; it makes way too many files doing it that way.
Imo the only other alternative to no cache (using the db) is to create a temporary txt file which is essentially a custom cache.
If SMF 2.0.13 behaves the same can you think of another alternative other than that?

Offline raffo

  • Jr. Member
  • **
  • Posts: 70
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #52 on: November 06, 2016, 03:04:21 pm »
How is possible to disable the cache just for the shoutbox?

Offline Sayaka

  • Hero Member
  • *****
  • Posts: 2164
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #53 on: November 11, 2016, 12:09:22 am »
The solution to this is to completely ignore SMF's internal caching system. SP shouldn't even be using it for the shoutbox.

In Subs-Portal.php, you should add two new functions:

sp_shout_cache_put()
sp_shout_cache_get()

Both would have $shout, $time, $type. I thought about having a $duration or something, but both should be hard coded to 60 minutes. Could pass it to SMF itself and have it as an option in the SP admin settings (cache duration) in minutes.

$shout would be the shout itself, serialized of course and stripped of special characters. Probably could use $smcFunc for it.

$time would be the time the shout was made, preferably in server time. Not sure if SMF has a server_time() function or if its in $smcFunc, could just use time() I guess.

$type is not very important to have. "0" would be standard shout, "1" could be an important message that always appears first or something, if you ever have plans on expanding the shoutbox. "2" could be a moderator shout that persists for an amount of time, or you could even make it so $type is either "allowed" or "banned", or something.

I'm a fan of both a database-based cache and a harddisk file based cache. You can have it output a .php file and put a die() or something if its accessed directly. And then have the entire PHP file just be like a text file. This way people who know the software won't have access to a ton of SP shoutbox caches.

File could be something like sp_shout_cache.php and it could look something like;

Code: [Select]
<?php

/*
Simple Portal Shoutbox Cache
THIS FILE IS AUTOMATICALLY GENERATED
*/


if (!
defined('SMF'))
die('Hacking attempt...');

function 
sp_cached_shouts()
{
// this array stores all the shouts used for the cache
$shouts = array();

// each shout increments the array
$shout[] = array(1'Sayaka''This is a shout!''11102016115933');
$shout[] = array(1'Sayaka''I love talking to myself''11102016115937');
$shout[] = array(1'Sayaka''Yeah it\'s pretty interesting''11102016115939');
$shout[] = array(1'Sayaka''You don\'t say?''11102016115953');

// if there are no shouts, it will always return empty
return $shouts;
}

?>

sp_shout_cache_put() would write shouts with the proper information to this file. It would use fwrite() and write to the file locally. For the pointer, it would look for the comment "// each shout increments the array" and then it increments from there since the array is being appended each time.

sp_shout_cache_get() would be a bit easier because we wrote the cache file to php and it already returns an array. So you can call the file and then use sp_cached_shouts. The reason we just don't call it directly via an include is so we can do some work beforehand, like checking times or cleaning the shouts.

Offline raffo

  • Jr. Member
  • **
  • Posts: 70
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #54 on: November 13, 2016, 06:23:31 am »
To make a resume: what is a friendly solution for a common user who doesn't know and manage the php code very well (I can insert code and modify, but low profile)?

Offline emanuele

  • Developer
  • *
  • Posts: 268
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #55 on: November 13, 2016, 07:36:15 am »
Disable the caching.
That anyway is mostly pointless unless you have a **very** busy forum (I wouldn't even consider the "very crappy host" position, because in that case you'll likely use a file-based cache, and that would be even detrimental in comparison to the no-cache option).

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #56 on: November 25, 2016, 04:25:09 pm »
I uninstalled the 2.0.12 patch and it's working fine again. I hope this is an easy fix.

Just got this from SMF.

Go back to 2.0.11
They are working on a patch for this in 2.0.13
SMF 2.0 Gold
SP 2.3.3

Offline aegersz

  • Semi Newbie
  • *
  • Posts: 41
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #57 on: January 12, 2017, 01:39:09 am »
2.0.13 patch is out now.

I did try it on my test system but I see to have the same problem as documented here.

BUT if i prune my Shoutbox then it all works. Cool, i i sacrifice my chat log if need be.

Note: clearing the forum cache (as mentioned below) did not work for me.
« Last Edit: January 19, 2017, 11:33:47 am by aegersz »
"mods" fan (SMF 2.0.13) with 125+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • SP Version: 2.4 (Elkarte)
  • Elkarte Version: 1.0.5
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #58 on: January 14, 2017, 08:06:15 pm »
for everyone else - after update to 2.0.13 clear your forum cache and shoutbox will work just fine :)
« Last Edit: January 14, 2017, 08:08:55 pm by phantomm »