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: 276
  • 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]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

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

0 Members and 2 Guests are viewing this topic.

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Shoutbox does not load shouts in SMF 2.0.12
« on: September 27, 2016, 12:47:42 PM »
I just updated my site with 2.0.12 patch and shouts are not visible in my shoutbox, error from log:
Code: [Select]
URL ?action=portal;sa=shoutbox;shoutbox_id=1;time=1474994634;xml
2: Invalid argument supplied for foreach()
File: Subs-Portal.php
Line: 1300

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #1 on: September 27, 2016, 01:21:31 PM »
Can you post your line 1300? Because it appears it doesn't have a foreach() there on a fresh copy of Subs-Portal.php

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #2 on: September 27, 2016, 02:12:20 PM »
Sorry, I forgot that I added something in this file, here is 1300 line and following code:
Code: [Select]
foreach ($shouts as $shout)
{
if (preg_match('~^@(.+?): ~' . ($context['utf8'] ? 'u' : ''), $shout['text'], $target) && $smcFunc['strtolower']($target[1]) !== $smcFunc['strtolower']($user_info['name']) && $shout['author']['id'] != $user_info['id'] && !$user_info['is_admin'])
{
unset($shouts[$shout['id']]);
continue;
}

$shouts[$shout['id']] += array(
'is_me' => preg_match('~^<div\sclass="meaction">\* ' . preg_quote($shout['author']['name'], '~') . '.+</div>$~', $shout['text']) != 0,
'delete_link' => $can_delete ? '<a href="' . $scripturl . '?action=portal;sa=shoutbox;shoutbox_id=' . $shoutbox . ';delete=' . $shout['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . sp_embed_image('delete_small') . '</a> ' : '',
'delete_link_js' => $can_delete ? '<a href="' . $scripturl . '?action=portal;sa=shoutbox;shoutbox_id=' . $shoutbox . ';delete=' . $shout['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="sp_delete_shout(' . $shoutbox . ', ' . $shout['id'] . ', \'' . $context['session_var'] . '\', \'' . $context['session_id'] . '\'); return false;">' . sp_embed_image('delete_small') . '</a> ' : '',
);

$shouts[$shout['id']]['text'] = str_replace(':jade:', '<img src="http://www.simpleportal.net/sp/cheerleader.gif" alt="Jade!" />', $shouts[$shout['id']]['text']);
$shouts[$shout['id']]['time'] = timeformat($shouts[$shout['id']]['time']);
$shouts[$shout['id']]['text'] = preg_replace('~(</?)div([^<]*>)~', '$1span$2', $shouts[$shout['id']]['text']);
$shouts[$shout['id']]['text'] = preg_replace('~<a([^>]+>)([^<]+)</a>~', '<a$1' . $txt['sp_link'] . '</a>', $shouts[$shout['id']]['text']);
$shouts[$shout['id']]['text'] = censorText($shouts[$shout['id']]['text']);

if (!empty($modSettings['enable_buddylist']) && !empty($options['posts_apply_ignore_list']) && in_array($shout['author']['id'], $context['user']['ignoreusers']))
$shouts[$shout['id']]['text'] = '<a href="#toggle" id="ignored_shout_link_' . $shout['id'] . '" onclick="sp_show_ignored_shout(' . $shout['id'] . '); return false;">[' . $txt['sp_shoutbox_show_ignored'] . ']</a><span id="ignored_shout_' . $shout['id'] . '" style="display: none;">' . $shouts[$shout['id']]['text'] . '</span>';
}

it's in function sportal_get_shouts

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #3 on: September 27, 2016, 02:35:56 PM »
I uninstalled the 2.0.12 patch and it's working fine again. I hope this is an easy fix.
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline emanuele

  • Developer
  • *
  • Posts: 293
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #4 on: September 27, 2016, 06:17:58 PM »
No idea what was changed, but at the moment I can't reach sm.org, so I can't even download the package...

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #5 on: September 28, 2016, 06:30:57 AM »
I can get to them so you should try again.

By the way, if you enter anything in the Shoutbox then it repopulates and then disappears again after a page load/reload.
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline emanuele

  • Developer
  • *
  • Posts: 293
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #6 on: September 28, 2016, 08:32:43 AM »
Try two things:
1) disable the cache,
2) clean up the SMF cache (from maintenance IIRC). I feel there is some difference in the handling of the charsets.

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #7 on: September 28, 2016, 09:29:03 AM »
i disabled the SMF cache before applying 2.0.12 and it worked so i enabled it and it worked first time but then failed again on page reload.

i also cleared the SMF cache and it looked good until i reloaded the page.

Usually i see 2 errors stating "Invalid argument supplied for foreach()" in /var/www/html/Sources/Subs-Portal.php

BUT disabling the SMF cache fixes the problem ! but i don't want to do that.
« Last Edit: September 28, 2016, 10:45:04 AM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline obcy

  • Newbie
  • Posts: 4
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #8 on: September 28, 2016, 09:42:43 AM »
If the cache is turned off completely it works. If enabled, the cache is only one works.

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #9 on: September 28, 2016, 09:46:58 AM »
If i turn OFF the Shoutbox cache then it also works with SMF's cache set to 1.

I tried to Delete all shouts and it worked for a while until my window filled up but the problem came back.

the one thing that fixes it is turning the Shoutbox cache off so maybe there is a logic error in how the Shoutbox caches ?

... and does it really matter if i turn off the Shoutbox cache ?
« Last Edit: September 28, 2016, 10:21:08 AM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline emanuele

  • Developer
  • *
  • Posts: 293
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #10 on: September 28, 2016, 11:01:44 AM »
The logic is that the new function introduce to unserialize strings messes with the charsets.
Most likely, the serialize function uses a certain charset, while the unserialize another.

Try this, in Load.php, find:
Code: [Select]
$value = $value === null ? null : serialize($value);replace with:
Code: [Select]
$value = $value === null ? null : safe_serialize($value);and enable the cache.

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #11 on: September 28, 2016, 12:08:26 PM »
sorry to say but that made no difference. i had the Shoutbox cache enabled prior to making the change to Load.php but when i logged on, i still get "There aren't any shouts yet!"

I have now undone the change to Load.php
« Last Edit: September 28, 2016, 12:15:49 PM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ 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
  • Elkarte Version: 1.0.5
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #12 on: September 28, 2016, 01:05:05 PM »
I can only confirm that this fix does not help with this issue and Shoutbox works only when cache is disabled - sometimes it works even with forum cache level 1 but eventually it will crash anyway


Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #13 on: September 28, 2016, 02:22:51 PM »
any more thoughts on this matter ? ... here is the Changelog, FYI

SMF 2.0.12 Changelog                                              July 7, 2016
===============================================================================
 ! Fixed word censor injection by disallowing an empty 'proper word'
 ! Fixed vulnerable unserialize() code by converting all instances to safe_unserialize()
 ! Added a more thorough safe_unserialize() function to prevent object injection
 ! Fixed a bug where leaving a custom profile field blank on registration that has an email mask would throw an error
 ! Fixed PayPal integration to comply with the new forced SSL
 ! Fixed a bug where notifications were sent for messages in inaccessible boards
 ! Fixed editor to make the editor work with Microsoft Edge
 ! Fixed issue where smiley popup is blank on iOS 9 devices
 ! Fixed WYSIWYG editor in mobile devices
 ! Fixed an undefined $_POST['icon'] in Sources/Post.php
 ! Fixed a minor bug in Login2()
 ! Fixed an issue where SMF doesn't recognize new domain names and considers these as invalid
 ! Fixed an issue where SMF would allow empty BBC
 ! Fixed an issue where theme variants could not be selected
 ! Fixed an issue where the file version of Subs-Post.php could have been 2.0.8 or 2.0.11. It will be updated to 2.0.12 in either case.
 ! Updated copyright year to 2016
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline emanuele

  • Developer
  • *
  • Posts: 293
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #14 on: September 28, 2016, 02:53:30 PM »
Let's do another thing:
1) enable the cache,
2) write a couple of messages in the shout,
3) identify the shoutbox cache file,
4) download it, zip it and attach it here.

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #15 on: September 28, 2016, 03:00:01 PM »
but with 2.0.11?

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #16 on: September 28, 2016, 03:02:37 PM »
Let's do another thing:
1) enable the cache,
2) write a couple of messages in the shout,
3) identify the shoutbox cache file,
4) download it, zip it and attach it here.

I chose to "cat data_c304fca73aa82b36cce172d762edd34b-SMF-shoutbox_shouts-1.php" instead. Here is the output whilst the problem persists:

Code: [Select]
<?php if (!defined('SMF')) die; if (1475089568 time()) $expired true; else{$expired false$value 'a:17:{i:3507;a:4:{s:2:"id";s:4:"3507";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 02:04:53 PM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475078693";s:4:"text";s:372:"x<script type="text/javascript">function spSound(){var beep = document.getElementById("beep");beep.play(1);}</script><object id="beep" type="application/x-shockwave-flash" data="Themes/default/images/sp/shout_sounds.swf" width="0" height="0"><param name="movie" value="Themes/default/images/sp/shout_sounds.swf" /><param name="FlashVars" value="onLoad=spSound" /></object>";}i:3506;a:4:{s:2:"id";s:4:"3506";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 12:05:48 PM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475071548";s:4:"text";s:1:"x";}i:3505;a:4:{s:2:"id";s:4:"3505";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 12:05:14 PM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475071514";s:4:"text";s:2:"44";}i:3504;a:4:{s:2:"id";s:4:"3504";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 12:05:11 PM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475071511";s:4:"text";s:2:"33";}i:3503;a:4:{s:2:"id";s:4:"3503";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 12:05:07 PM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475071507";s:4:"text";s:2:"22";}i:3502;a:4:{s:2:"id";s:4:"3502";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 12:05:01 PM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475071501";s:4:"text";s:2:"11";}i:3501;a:4:{s:2:"id";s:4:"3501";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:55:00 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070900";s:4:"text";s:2:"10";}i:3500;a:4:{s:2:"id";s:4:"3500";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:54:57 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070897";s:4:"text";s:1:"9";}i:3499;a:4:{s:2:"id";s:4:"3499";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:54:22 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070862";s:4:"text";s:69:"<span style="background-color: yellow;" class="bbc_color">test</span>";}i:3498;a:4:{s:2:"id";s:4:"3498";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:52:56 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070776";s:4:"text";s:1:"8";}i:3497;a:4:{s:2:"id";s:4:"3497";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:52:53 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070773";s:4:"text";s:1:"7";}i:3496;a:4:{s:2:"id";s:4:"3496";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:52:50 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070770";s:4:"text";s:1:"6";}i:3495;a:4:{s:2:"id";s:4:"3495";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:52:47 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070767";s:4:"text";s:1:"5";}i:3494;a:4:{s:2:"id";s:4:"3494";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:52:44 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070764";s:4:"text";s:1:"4";}i:3493;a:4:{s:2:"id";s:4:"3493";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:49:29 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070569";s:4:"text";s:1:"3";}i:3492;a:4:{s:2:"id";s:4:"3492";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:49:24 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070564";s:4:"text";s:1:"2";}i:3491;a:4:{s:2:"id";s:4:"3491";s:6:"author";a:4:{s:2:"id";s:1:"2";s:4:"name";s:7:"chipper";s:4:"link";s:126:"<a href="http://192.168.0.180/index.php?action=profile;u=2" title="on Today at 11:49:20 AM" style="color: purple;">chipper</a>";s:5:"color";s:6:"purple";}s:4:"time";s:10:"1475070560";s:4:"text";s:1:"1";}}';}?>
« Last Edit: September 28, 2016, 03:12:45 PM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ 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
  • Elkarte Version: 1.0.5
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #17 on: September 28, 2016, 03:06:04 PM »
here is file from 2.0.12 when I enabled Shoutbox cache and shouts are not visible

Offline emanuele

  • Developer
  • *
  • Posts: 293
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #18 on: September 28, 2016, 05:02:16 PM »
I chose to "cat data_c304fca73aa82b36cce172d762edd34b-SMF-shoutbox_shouts-1.php" instead.
The problem is that pasting it I'm cannot be sure what SMF did to the characters, I cannot trust that output to investigate if the variable is properly serialized or not.
I'll check anyway and maybe I'm lucky, but phantomm's zip is much more reliable in that respect. ;)

Offline emanuele

  • Developer
  • *
  • Posts: 293
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #19 on: September 28, 2016, 05:10:32 PM »
Would you mind check the XML response when the shoutbox is refreshed? (I mean with the browser's developer tool.)

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #20 on: September 28, 2016, 06:52:11 PM »
I chose to "cat data_c304fca73aa82b36cce172d762edd34b-SMF-shoutbox_shouts-1.php" instead.
The problem is that pasting it I'm cannot be sure what SMF did to the characters, I cannot trust that output to investigate if the variable is properly serialized or not.
I'll check anyway and maybe I'm lucky, but phantomm's zip is much more reliable in that respect. ;)

I see. It just looked like the human-readable text of a block of php code to my untrained eye. Sorry about that.
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #21 on: September 28, 2016, 09:34:57 PM »
Deleted the other thread as requested, you can continue here with info and stuff.
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline emanuele

  • Developer
  • *
  • Posts: 293
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #22 on: September 29, 2016, 07:54:44 AM »
Just to be sure it was read:
Would you mind check the XML response when the shoutbox is refreshed? (I mean with the browser's developer tool.)

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #23 on: September 29, 2016, 11:13:26 AM »
I wonder why it's only 2 of us that have reported this ?

Could it be our unique configuration of mods ?

Have you tried to recreate it on one of your test systems ?
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #24 on: September 29, 2016, 03:40:31 PM »
Please reply to emanuele's question, the poor guy asked it twice already, don't make him mad ;D (jk)

Would you mind check the XML response when the shoutbox is refreshed? (I mean with the browser's developer tool.)
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #25 on: September 29, 2016, 08:33:37 PM »
I'm not sure how to do this ?

Do you want us to view the returned page's source HTML and if so, what do I look for ?

Forgive me but I am relatively new to all this.
"mods" fan (SMF 2.0.15) with 140+ 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
  • Elkarte Version: 1.0.5
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #26 on: September 30, 2016, 12:23:27 AM »
@Emanuele I'll do it today after work, somehow I didn't noticed first message

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #27 on: September 30, 2016, 02:08:08 AM »
if anyone can tell me how to do this, then i'd be grateful. i can access the Dev tools in Chrome but need specific instructions.

What am i looking for ? or is it going to take too long to step me through ?

i've Google searched on "XML response" but i still can't figure out what emmanual wants to know other than "some return code" from when the shouts cache file (that is the result of serialization?) isn't processed correctly.
« Last Edit: September 30, 2016, 03:07:20 AM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline FLHS

  • Newbie
  • Posts: 2
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #28 on: September 30, 2016, 02:55:29 AM »
I wonder why it's only 2 of us that have reported this ?

I've the same issue on my test- and my livesystem.
So I follow this thread very closely.

And also with me it's a cache issue.
If I switch off caching (APC installed), everything runs fine.

Jens

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #29 on: September 30, 2016, 03:03:05 AM »
* another symptom:

i tried again by deleting all the shouts via "prune" and it works perfectly well UNTIL the window fills up and that alone triggers the problem, too.

is that an issue with scrolling, (also?) perhaps ?

Hey, I saw this:

Seems to be a bug with the new serialise method and the length. as mentioned by somebody on the SMF site about 2.0.12. see http://www.simplemachines.org/community/index.php?topic=548902.msg3893084#msg3893084

it may be SMF's problem so keep an eye on the SMF Support Board too before you start getting frustrated.

i added a post to the above SMF thread so they can see that it's affecting SimplePortal, also.
« Last Edit: September 30, 2016, 03:41:10 AM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ 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
  • Elkarte Version: 1.0.5
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #30 on: September 30, 2016, 12:56:56 PM »
every time XML response is:
Code: [Select]
<smf>
<shoutbox>
1
</shoutbox>
<updated>
0
</updated>
</smf>

it's with and without cache


/edit:

this tip from vbgamer45 seems to fix it for me:
http://www.simplemachines.org/community/index.php?topic=548944.msg3893213#msg3893213

but would it be permanent fix for issue?
« Last Edit: September 30, 2016, 01:42:50 PM by phantomm »

Offline Sages

  • Semi Newbie
  • *
  • Posts: 21
  • Gender: Male
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #31 on: September 30, 2016, 02:12:09 PM »
Dear phantomm,

Where this piece of code is?
Since i am experiencing the same bug on my forum, i would like to test it.

Thank You

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #32 on: September 30, 2016, 02:40:33 PM »
Subs.php

Offline Sages

  • Semi Newbie
  • *
  • Posts: 21
  • Gender: Male
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #33 on: September 30, 2016, 03:20:34 PM »
I can confirm it works for me as well... But i would say it's only a workaround..

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #34 on: September 30, 2016, 06:37:25 PM »
the fix does NOT work for me at all as i made a change to Subs.php, as requested but the page reload loses the data again.

i double checked Subs.php and i have definitely commented out the length test.
« Last Edit: September 30, 2016, 06:49:03 PM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #35 on: October 01, 2016, 02:17:42 AM »
I also tried it on my QAT (Quality Assurance) system which only has a few critical mods like Simple Portal, made the change to Subs.php and that worked but only until i refreshed the database only and then it failed.

So perhaps it's another mod that's causing this somehow ?

If there is anything that you want me to do to debug this (trace ? the XML response (stop me through)) then i will I would be very happy to oblige - this is the only thing stopping me from moving to 2.0.12 and it's really bugging me.

I know that i can just turn off the SP Shoutbox cache but i'm keen to understand exactly why this doesn't work for just me ... however, i don't want you to waste too much of your unpaid your time on me either so if you think i should just turn off the cache then i will do do so.

Sorry to be such a headache !
« Last Edit: October 01, 2016, 02:32:32 AM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #36 on: October 01, 2016, 11:50:06 AM »
Don't worry aegersz, you're not an headache, you're giving us useful information that may help emanuele to figure out what goes wrong :) If you were an headache, we'd have let you know :P
I am not good enough to figure out what the problem is, so I can just hope emanuele will.
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #37 on: October 01, 2016, 05:21:52 PM »
thanks. i now don't think that he has to as Arantor from SMF said this:

Quote
if you have no compatible accelerator, it will fall back to the file cache. Which is where the problem is due to the serialise routine used by the cache and specifically the (new) unserialise routine deciding that there's too much data and just dropping it.

the interesting this is sometimes it works after you make a change like taking off a Shoutbox mod or refreshing the files and database (test system) then fails again. I am now convinced that it's not a Simple Portal problem so we should wait for SMF Support.
« Last Edit: October 01, 2016, 05:26:28 PM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #38 on: October 02, 2016, 12:43:54 AM »
It's a glitch in my "Extra Shoutbox Permissions/Options" SP plugin.

I will fix the issue and post a newer version.
In the mean time just disable the cache on the shoutbox as you described.

Regards.
« Last Edit: October 02, 2016, 12:51:48 AM by Chen Zhen »

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Shoutbox does not load shouts in SMF 2.0.12
« Reply #39 on: October 02, 2016, 03:56:29 AM »
I don't have this mod installed on my forum (extra sb permissions) and still have this issue

Offline rentner

  • Semi Newbie
  • *
  • Posts: 14
  • SMF Version: 2.0.14
  • 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

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • 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.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
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
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
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
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
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: 14
  • SMF Version: 2.0.14
  • 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
  • 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
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
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
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
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: 861
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
  • 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: 293
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
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
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 ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal 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: 293
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

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • 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.15) with 140+ 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
  • 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 »