SimplePortal

Development => Bugs => Fixed or Bogus Bugs => Topic started by: andy on December 09, 2011, 02:05:17 AM

Title: Shoutbox refresh and page reload discrepancy
Post by: andy on December 09, 2011, 02:05:17 AM
Not sure if this is a bug or odd behaviour (works as designed, not as expected).

When a message is added to the shoutbox it doesn't display with refresh (not within a minute anyway). But is does immediately show if the page is reloaded...

If it shows on page reload immediately why doesn't it show on refresh?
Same thing happens when moderator deletes a message.


Title: Re: Shoutbox refresh and page reload discrepancy
Post by: ccbtimewiz on December 09, 2011, 02:06:30 AM
Can I see a live test?
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on December 09, 2011, 02:14:11 AM
Try it on your site ... 2 user accounts. I would have to register you on my site ...uhmmm  :O

Think it was using chrome and firefox 8 but i wouldnt blame them for it .
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on December 09, 2011, 02:18:00 AM
BTW... i just saw your signature - i was looking for a custom mod - no takers yet.

http://www.simplemachines.org/community/index.php?topic=459028.0 (http://www.simplemachines.org/community/index.php?topic=459028.0)

Would really like to improve smf user search to include custom fields that are not text/textbox.
Even if it were a custom block ok.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on December 09, 2011, 02:28:41 AM
Strange...

Admin using firefox adds to shoutbox - displays to self.

Register user with chrome refreshes - displays.


Register user using chrome adds to shoutbox - displays to self.

Admin using firefox refreshes (manual) - no update (several times). Page reload displays new shout.

Seems like refresh doesnt work after ordinary user shouts.

Im getting the same effect from registered user to registered user (with firefox). Refresh isnt showing new shouts immediately ...until page is reloaded.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: ccbtimewiz on December 09, 2011, 03:34:38 AM
I don't get these problems on my site with Firefox, so it might be the Javascript or other things running on your site, which is why I asked for a link.

About your custom search-- I don't know what you mean by it entirely, but it's possible to just adapt the current search index to include more fields, it's actually easy as long as you follow SMF's way of doing it.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: tomeh on December 12, 2011, 09:04:14 AM
I have the same problem with shoutbox
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on December 12, 2011, 07:03:19 PM
One site giving trouble is on Bluehost shared hosting plan. I cant remember having problems before with the refresh - a month ago or so.
I tested different accounts and different browsers ... there might be something related to firefox 8 but I'm still having problems with Chrome and Opera. It often displays shouts after the first one with refresh, then it doesn't work until the page is reloaded. After a reload the refresh 'usually' works 1 more time before it stops working until another page reload.

I've spent too much time on this already so its a closed topic for me now.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Chen Zhen on December 12, 2011, 09:37:19 PM

Navigate to: Admin -> SimplePortal -> Shoutbox

Modify the shoutbox you are using (wrench).


Test it after adjusting the above settings.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on December 13, 2011, 07:15:28 AM
With all the other scripts running there is no way I would set the refresh to 10 seconds on a shared hosting plan - probably the script would be automatically restricted within hours of doing that... used to be Bluehosts answer to overuse!
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on December 13, 2011, 07:17:37 AM
Cache was already enabled so that isnt the answer ...
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: tomeh on December 13, 2011, 07:17:56 AM
Just as no cache - that does not work well
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on December 13, 2011, 07:21:20 AM
Setting to 10 seconds and testing - same problem ... first 2 shouts came through then nothing after that for the third.
So its doing it on manual refresh most of the time and also an auto refresh.

PS
Not just users - admin also not working properly.

Title: Re: Shoutbox refresh and page reload discrepancy
Post by: tomeh on December 13, 2011, 08:45:47 AM
The key is that it probably works well as an administrator, member is not working - no refresh
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Johny on January 03, 2012, 09:46:28 AM
I have a problem with a shoutbox too. As admin sometimes I can shout sometimes I can`t. Members don`t complain so much, but I see sometimes  shoutbox display same msg 3x in a row.
When I enable auto refresh every 10 sec members sayin it`s working but for me seems like little "refresh circle" is turning all the time (and I can`t shout).  Is there any hope for fix?
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: AngelinaBelle on January 06, 2012, 02:24:10 PM
Here's a crazy idea. Another user reports relief from this problem by changing some seemingly-unrelated settings.  Your case is sufficiently different that this may not help at all. Still -- worth a try:

http://simpleportal.net/index.php?topic=8657.msg54159#msg54159

I have no idea what is causing these shoutbox problems, and I apologize in advance for suggesting crazy-sounding "solutions".
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: tomeh on January 07, 2012, 05:07:58 AM
A similar but different problem is there because I have no mods prety url
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: AngelinaBelle on January 19, 2012, 10:59:40 PM
I'm sorry.  I wish I knew the answer to this problem. But I do not.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: tomeh on May 13, 2012, 03:43:46 AM
Unfortunately, the installation is still the same problem in SimplePortal 2.3.5. Zmianiłem anywhere in the database encoding into the local language, and nothing helped.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on August 11, 2012, 07:54:47 AM
Im still getting this on 2.3.5 and smf 2.0.2.

Just set up a new shoutbox to discuss a dinner party but doesnt show shouts after auto refresh. Even manual refresh doesnt work many times. The only sure way to see new comments is a page reload.

One day I will test it on an unmodified board.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Tricky on August 11, 2012, 09:14:35 AM
Iv set up a new site with 2.3.5 and same thing it dont show shouts a page reload is needed only one mod on it aeva
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on August 11, 2012, 03:47:47 PM
 :P haha ... that's one thing we have in common - Aeva mod. But you never know - could be something completely different. Glad you commented on that!
I think I had these problems before Avea gallery was installed.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Tricky on August 11, 2012, 04:16:07 PM
Yep don't think its any thing to do with Aeva iv removed it and it still don't reload
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: tomeh on October 28, 2012, 07:56:41 AM
I have the same problem


Administrator works fine but the other person does not work - still only refresh

And after all this time, still do not know the pwodów and there is no help
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: AngelinaBelle on November 07, 2012, 09:46:12 AM
These problems with shoutbox are a little tricky.
They are difficult to reproduce.

I have never seen the problem on this site, for example.
And I have never been able to reproduce the problem on any site I have set up.

In many cases, some javascript error leads to a problem. Does your page throw any javascript errors? If so, eliminate them first.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: tomeh on November 16, 2012, 12:48:29 PM
no logo bugs - everything works fine on the shoutbox on the forum - it works well only for the administrator - for others just constantly refresh
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: hadesflames on December 09, 2012, 08:19:49 AM
I've noticed this on my forum as well.

http://i.imgur.com/3keEH.png

Notice how the second shoutbox does not have the new post. It does not happen for every post. Furthermore, when I refreshed the page, there was another shout by the other person that I did not see. I'm running all the latest versions of stuff, I do have some javascript running in the background to modify information on another custom block that's under the shoutbox, but I don't see how it should affect anything. My forum is running on a powerful dedicated server, not a shared host. Currently, I have caching disabled, and auto refresh set to 2 seconds. I have plenty of resources to spare, and this is how I want the settings to be.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: AngelinaBelle on January 16, 2013, 01:58:11 PM
So far, nobody is sure why shoutbox sometimes runs into these problems.  They are difficult to reproduce.
Some testing would be required, to capture the xml documents sent and received and analyze them.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on January 22, 2013, 01:24:20 AM
Its a pity... I tried using the SP one again but ran into the same trouble. There are a few shoutbox mods on the SMF site that work - I was using this one I think.
http://custom.simplemachines.org/mods/index.php?mod=1295
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: AngelinaBelle on January 23, 2013, 12:41:48 PM
customizers -- would you be willing to add some "shoutbox testing code".  It would capture information such as
* Record of the "send shout" request, and the URL used.
* The contents of the sent document.
* Record of the request for the refresh document, including the URL
* The contents of the received document

After that, it would be a matter of chasing down the processing of the documents.
If you can confirm that "send shout" is working OK, this comes down to then analyzing the processing of the refresh step.

So, either it is not always sending the request for the refresh properly, or it is not processing it properly.

Who can do this?

Title: Re: Shoutbox refresh and page reload discrepancy
Post by: tomeh on March 19, 2013, 06:13:48 AM
I'd love to help but my knowledge is too small in this area
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Chen Zhen on March 06, 2014, 06:49:15 PM

  I realize this topic is rather old but this issue may still be pending as SP 2.3.5 was released in March of 2012.

  Is there anyone still having this issue? If so, would someone be willing to apply a manual edit that may fix the problem?

Regards.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on March 12, 2014, 06:14:26 AM
I gave up using it with all the trouble back then. I might try it again as I just moved to a new host - see if that makes a difference.  I'm hoping smf subscription call back will finally work for me after leaving Bluehost.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Chen Zhen on March 12, 2014, 09:11:43 PM

If you still have trouble with the SP shoutbox, I have some code to apply and test that may fix it.
Please let me know if you decide to use it and would like to test it out.

Regards.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on March 16, 2014, 04:41:49 AM
Yes I will have a go with that.

Will be a few days before ready - bad pollen allergy and flu here so Im not so good.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Chen Zhen on March 17, 2014, 06:36:43 PM
andy,

  Well I hope you get better soon. Imo drink lots of hot lemon tea, soup & water.  :ill:
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: AngelinaBelle on March 26, 2014, 05:20:21 PM
Underdog -- I think it is great that you have an AJAX chat analyzer.
AJAX stuff can be so mysterious, and SMF's XML routines are not really designed for it.
Once user even had a "code collision" with a game mod that led to shouts getting into a game somehow -- or was it tank positioning output getting into the shoutbox?  I can't remember....
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: w1ck3d on April 14, 2014, 04:54:18 AM
Решение проблемы можете озвучить?
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: w1ck3d on April 17, 2014, 09:57:47 AM
UP!
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: AngelinaBelle on April 17, 2014, 11:45:07 AM
Welcome to SimplePortal, w1ck3d,

I do not think we have found a solution.
Underdog is working on how to test what is bothering the shoutbox


Are you having the same problem?
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: w1ck3d on April 18, 2014, 05:13:00 AM
Yes, the problem is, but you do the same on simpleportal.net chat works fine, can PHP version?
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: w1ck3d on April 18, 2014, 05:14:17 AM
Да, проблема есть, но у вас же работает на simpleportal.net нормально, может сменить версию php?
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: AngelinaBelle on April 19, 2014, 08:03:17 AM
wick3d,

Please do not post the same twice.  Use "modify" link to edit/add to original post.

If you have a shoutbox problem, please start new topic in a support board.
Please make a description of your own shoutbox problem.

I apologize.  I do not speak Russian, and I do not know of anyone on staff who speaks russian.
We are having difficulty understanding your post.  Google Translate is not very helpful.

We will try.  Please forgive us if we ask the same question many times in order to understand you.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on April 21, 2014, 09:34:38 AM
Let me know what to do, I can test again. Will be away now and then as its kind of Easter holidays here from the weekend (Golden Week). But post me directions and a link to files ans when time I will look at my site.

Im on a new host so interesting to see if the same problem is there.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Chen Zhen on May 10, 2014, 11:06:57 PM
andy,

  We won't be able to tell if the edit works unless you still have the issue on your newer host environment.  Even with the edit I had in mind the same issue was occurring after some more testing although that was on a setup that included a mod I made that edited the shoutbox function.  If you still have the issue we can try it or I can look at the shoutbox coding and attempt to alter the javascript for it. 
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on May 14, 2014, 11:15:03 AM
Hello everybody,

My shoutbox has working very well until I update the PHP version from the webserver so version 5.5.10

Now I got the same problem.
After posting in the shoutbox the refresh icon is working continuous and just after refresh the page I see the posting.

May that is a new point of view!
Which PHP version is in use on the forum who have the refresh probems?
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on June 01, 2014, 08:12:54 AM
Push

I realise that is related to the PHP version from the Web Host.

Is there plant a fix for it?


EDIT:

I have tested it with PHP version 5.3.28 - No problems
If I go up to version 5.4.26 or 5.5.10 I get the problem again.

I is definitely a problem with the PHP version.


Please advice.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on June 02, 2014, 08:04:16 AM
I'm still getting odd behavior on my new host (PHP version    5.4.28).

Some comments are not being loaded when it auto refreshes. It worked several times perfectly then the problem started.
When forum page is reloaded they appear and also after a shout is entered the delayed ones from other users appear.
I was using latest versions of Chrome, Firefox, Opera.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Chen Zhen on June 02, 2014, 04:29:17 PM
Alright, let us try using some jQuery to refresh the container id. With this test I am not bothering to remove Sinan's refresh routine and just adding in some basic jQuery. If it works then we can take it further.

jQuery reference: http://api.jquery.com/load#loading-page-fragments

There are 2 necessary file edits...



File:
../Themes/default/PortalShoutbox.template.php

find:
Code: [Select]
function template_shoutbox_embed($shoutbox)
{
global $context, $scripturl, $settings, $txt;

Add after above code:
Code: [Select]
if (!empty($shoutbox['refresh']))
echo '
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$(\'#result\').load(\'', currentPageShoutbox($shoutbox['id']) ,'\').fadeIn("slow");
}, ', ($shoutbox['refresh'] * 1000), ');
</script>';



file: ../Sources/Subs-Portal.php

find:
Code: [Select]
?>

Add before code shown above (prior to end PHP tag of file):
Code: [Select]
/* Current shoutbox url & container */
function currentPageShoutbox($shoutid, $pageURL = 'http://')
{
if (!empty($_SERVER["HTTPS"]))
$pageURL = "https://";

if ($_SERVER["SERVER_PORT"] != "80")
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
else
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];

return $pageURL . '#shoutbox_load_' . $shoutid;
}



Let me know if that corrects the issue. Btw - set the refresh seconds within the shoutbox settings to something other than 0 since that disables the refresh.

Regards.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on June 04, 2014, 04:46:04 AM
Tried those edits and cleaned out the cache but...

Often the first shout does not show during automatic refresh in another (user) browser. If a second shout is made then both are loaded at the next refresh.
If people make one comment and wait for a reply then its still not going to work well.

Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on June 04, 2014, 08:12:19 AM
I get a PN from a forum user here.


Quote
I fixed mine this morning. i went to the root directory, and found a file called .htacess

I edited this file to force the server to run the same version of php my old server ran which was 5.3

the code looks like this pick except mine was set to 5.3

http://i.imgur.com/mCk292r.png


Hope that is OK that I post it "open".
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on June 04, 2014, 10:39:44 AM
I can't see php 5.3 version fixing it - this is an old problem and back when I reported it I bet my server was on php 5.2 then.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Chen Zhen on June 04, 2014, 07:23:30 PM
andy,

  I do not seem to witness that behavior as it appears to function properly for me.
Can you confirm the refresh has a int value such as ie. 10 ??

Perhaps I will try testing this on a live setup as it has only been tested locally.
I believe someone else has reported in another thread something about changing the cache behavior for their forum to fix this issue which I will investigate.

Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on June 05, 2014, 12:30:30 AM
Yes it was set on 10 second refresh.

I can give you an account on my site ig you want to see it yourself there.

I will post a PM with password to log in.

Username: Underdog

Password:

http://outdoorclubjapan.com/

Shoutbox is visible on the forum page after login.

Andy
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on June 05, 2014, 09:14:58 PM
I just tested again with Firefox and Opera and seemed ok on 10 seconds with over 10 shouts. Before I did set the refresh higher at times.

Anyway, I set refresh to 15, cleaned the cache and tried it - ok.
Set refresh to 20, cleaned the cache and tried it - then a shout missed.


Actually only 1 this time didnt show up (using the original code).
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Chen Zhen on June 05, 2014, 11:09:40 PM

Interesting.
Would you also be able to test in the default theme to rule out that possibility?
I will also suggest disabling blocks containing other js.

A good way to test this may be to set up a duplicate forum from a sub-directory using a copy of the same db and mods/files.
Then you can adjust its environment for testing without affecting your actual forum.
 
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on June 06, 2014, 02:12:35 AM
I can set up a copy on another domain I have. Its the same as the old one I used so should have trouble with it on that too.

Will test as advised.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Yazar8 on July 28, 2014, 08:13:15 AM
I'm also facing this issue. The symptoms are completely same.
Title: shoutbox spins
Post by: Ron-KK4HGY on August 05, 2014, 09:39:03 AM
I have used SMF and tiny portal for a couple of years but decided to try Simple Portal on my latest web site.  I like it pretty well but I have noticed that when I post a shout in the shout box sometimes I get a spinning icon that just never goes away.  How can I fix this?  Using SMF 2.08 and sp 2.35
Title: Re: shoutbox spins
Post by: Kryzen on August 08, 2014, 06:13:40 AM
What browser and theme are you using? Have you installed any other mods?
Title: Re: shoutbox spins
Post by: Ron-KK4HGY on August 08, 2014, 09:08:22 AM
Browse Packages

Modification Packages
Mod Name   Version   
1.   SMF Gallery Lite   3.7     [ Uninstall ] [ List Files ] [ Delete ]
2.   Remove SMF Logo   1.4     [ Uninstall ] [ List Files ] [ Delete ]
3.   SimplePortal   2.3.5     [ Uninstall ] [ List Files ] [ Delete ]
4.   Menu Editor Lite   1.0.5   [ Install Mod ] [ List Files ] [ Delete ]
5.   Board-color-and-icons   1.1     [ Uninstall ] [ List Files ] [ Delete ]

Using Final BR theme but it does it on other themes as well.
I have been using Chrome - I just tried IE 9 and it worked for the first shout, but I got the spinning circle when I tried a second shout.   Also, don't know if it is related, but when I go to the admin panel and it asked for the pw, it gives me, "Unable to verify referring url. Please go back and try again."  the first time and then works the second time.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on August 12, 2014, 11:07:19 AM
If anyone who can reproduce the issue on their online installations and is willing to cooperate, please send me a personal message. I'm hoping to fix this long standing issue once for all and I'd be really grateful for any help debugging the issue.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on August 13, 2014, 02:19:16 AM
Im not using it at the moment but can enable it on my site if you want to take a look.

The one thing I havent tested is just using the default curve theme (suggested by Underdog).
For that I would have to fins a quiet site I have and set up a clean install.

Andy
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on August 13, 2014, 03:19:34 AM
Are you able to reproduce the issue, all the time? If that's the case, it would really help if you could let me see it on your site.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on August 13, 2014, 09:03:18 AM
It was every time before. Recently variable as I mentioned above.

I will set up and get back to you with login.
Title: Re: shoutbox spins
Post by: [SiNaN] on August 13, 2014, 11:35:11 AM
I'm trying to debug a similar issue reported by other users. Is there any chance you could provide me with temporary access to your forum to test it myself? You can send me a personal message if you would like to cooperate, which would be greatly appreciated.
Title: Re: shoutbox spins
Post by: Ron-KK4HGY on August 13, 2014, 01:43:56 PM
I am happy to help.  I sent you a PM.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on August 16, 2014, 03:21:54 PM
I have (hopefully) come up with a fix to the issues described in this topic. Here are the changes required for those who would like to test: (would be very much appreciated)

Themes/default/scripts/portal.js (There are 3 instances. You should replace them all!)

Code: (Find) [Select]
smf_scripturl
Code: (Replace) [Select]
sp_script_url
Code: (Find and Delete) [Select]
var sp_date = new Date;
eval("last_refresh_" + shoutbox_id + " = " + Math.round(sp_date.getTime() / 1000, 0) + ";");

Themes/default/PortalShoutbox.template.php

Code: (Find) [Select]
sp_refresh_shout(', $shoutbox['id'], ', last_refresh_', $shoutbox['id'], ');
Code: (Replace) [Select]
sp_refresh_shout(', $shoutbox['id'], ', last_refresh_', $shoutbox['id'], ');
last_refresh_', $shoutbox['id'], ' += ', $shoutbox['refresh'], ';

Sources/Subs-Portal.php

Code: (Find) [Select]
global $context, $settings, $modSettings;
static $initialized;

if (!empty($initialized))
return;

$context['html_headers'] .= '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/portal.js?235"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var sp_images_url = "' . $settings['sp_images_url'] . '";

Code: (Replace) [Select]
global $context, $scripturl, $settings, $modSettings;
static $initialized;

if (!empty($initialized))
return;

$safe_scripturl = $scripturl;
$current_request = empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];

if (strpos($scripturl, 'www.') !== false && strpos($current_request, 'www.') === false)
$safe_scripturl = str_replace('://www.', '://', $scripturl);
elseif (strpos($scripturl, 'www.') === false && strpos($current_request, 'www.') !== false)
$safe_scripturl = str_replace('://', '://www.', $scripturl);

$context['html_headers'] .= '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/portal.js?235"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var sp_images_url = "' . $settings['sp_images_url'] . '";
var sp_script_url = "' . $safe_scripturl . '";

It is very important that you clear your browser cache after you make the changes and before starting the testing.

For those who are interested, the same changes have been committed to our upcoming version repository at GitHub. So you could grab the latest package from there for testing as well.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Ron-KK4HGY on August 16, 2014, 07:48:59 PM
How do I grab the latest package from GitHub?
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on August 16, 2014, 11:54:57 PM
I'll attach it here for you, as SMF usually has problems with GitHub generated packages.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Ron-KK4HGY on August 17, 2014, 12:00:55 AM
Thanks.  I'll let you know how it works.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Ron-KK4HGY on August 17, 2014, 12:33:25 AM
When I tried to upload the package I got this: The file you are uploading already exists on the server. Please delete it first then try again.

I thought I should check here before I delete anything.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on August 17, 2014, 01:34:57 AM
You'll have to uninstall the old SimplePortal package. (make sure you don't remove the database changes - that is if you don't want to erase all the portal data) Then just delete the package from your server. After that you can upload this new package and install it to test.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Ron-KK4HGY on August 17, 2014, 09:58:30 AM
I followed your instructions and now have the new update installed.  So far, so good.  The shoutbox is updating fine now and you have made me a happy camper.  Thanks for all the effort you and the Simple Portal Team put into fixing this problem.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on August 17, 2014, 10:41:09 AM
Set up 2 accounts for you on our active site - will PM the details in a moment.

Within 24 hours I will hopefully put a clean install of smf and simple portal on another domain I have.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on August 17, 2014, 01:34:17 PM
I set up a clean install of SMF and Simple Portal on a quiet account I have. Its on a pretty standard cheap end host - Bluehost.

http://ichikawa-eikaiwa.com/smf/index.php

Most things are disabled so not a problem for a short time if people want to test the shoutbox.

Sinan has an admin account (same password I PM-ed before).

There are 2 registered accounts:

test1
test2

With the password: testsimpleportal

I will delete in a few days when not needed. Message system and posting is disabled - just for testing the shoutbox.


I installed smf changing only 1 default setting - install for utf-8.
Shoutbox is set to autorefresh every 15 seconds.


I tried and mostly ok but had 1 shout not shown in first few tests.
Andy


Anyone who wants to register on the board can do that and test it...
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on August 17, 2014, 05:46:40 PM
I followed your instructions and now have the new update installed.  So far, so good.  The shoutbox is updating fine now and you have made me a happy camper.  Thanks for all the effort you and the Simple Portal Team put into fixing this problem.

I'm glad that our little mod makes people around the world happy. You're welcome. And thank you too, for helping with debugging and testing!

Set up 2 accounts for you on our active site - will PM the details in a moment.

Within 24 hours I will hopefully put a clean install of smf and simple portal on another domain I have.

I got them, thank you! (and spammed the shoutboxes at both, a little bit) From my understanding there are two issues:

First; if the request URL is not exactly the same as the forum URL, shoutbox fails all the time due to HTTP access control. Example: your site URL http://somsite.com/index.php however the user requests http://www.somesite.com/index.php (or the other way around) (note the www. part). I could reproduce this on both of the sites you linked.

Second; there is a "update shoutbox only when there is some update to shoutbox" mechanism implemented to the shoutbox. I think Nathaniel changed my original code because it kind of didn't work at all and updated shoutbox all the time. What he implemented seems to be failing in certain cases as well - I couldn't pinpoint those though. I could reproduce this only on the second site you linked. (debugging this is a hit and miss)

Anyway, I think I have fixed both with the changes I gave above. SimplePortal_2.3.6_Alpha.zip package I attached above contains the fixes and should be working fine. Maybe you could install that package on your second site (not the active once) so that we can test the fixes to see if they actually fix the issues.

Again, I appreciate the effort you guys put into debugging and testing this issue. Thank you!
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on August 18, 2014, 01:50:47 AM
Ok, I installed the SP 2.3.6 alpha package for testing here:

http://ichikawa-eikaiwa.com/smf/
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on August 18, 2014, 02:03:13 AM
I tested with Firefox, Opera, Chrome and this is the first time ever none failed... looks like its fixed.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on August 18, 2014, 11:59:55 PM
That is great to hear. Thank you guys for the help!
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: i8088 on October 23, 2014, 06:44:24 PM
I've been following this thread for some time with the same refresh issue.

Figured 2.3.6 would solve the issue, and it appeared to do so for a week after updating (removed 2.3.5 and applied 2.3.6) but I am now experiencing the same issue where the refresh animation shows indefinitely, and the text is only posted once the page is refreshed, basically the same issue. The issue did go away as soon as I upgraded to 2.3.6, but it now is appearing again.

I noticed this issue with 2.3.5 begun once I upgraded my shared hosting from PHP 5.2 to 5.4 which is their default/current version. It generally won't occur with an empty shoutbox but will begin some time later. It may not be the only or exclusive condition but I am definitely having the same issue as claimed fixed with 2.3.6 on my website currently.

Any input would be appreciated...
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on October 27, 2014, 08:26:41 AM
Agreed... shocked Im seeing this again.

I tested on another webhost and  pre-2.3.6 and it seemed fixed. Now on my main website using a clean install of smf 2.0.9 and sp2.3.6 and there are shouts not being shown until page reload.

Latest Firefox to Chrome browser (Admin to user) and the other way.

I do have a lot of mods installed though (30 or so).



Title: Re: Shoutbox refresh and page reload discrepancy
Post by: ♦ Ninja ZX-10RR ♦ on December 09, 2014, 05:49:48 PM
It could be related to this: http://simpleportal.net/index.php?topic=13734.msg67892#msg67892 and the following replies, especially #13 and #14. It's a very old topic but also that mod is very old, it can be that one having the bug since its first release.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on January 04, 2015, 10:27:33 AM
I get this problem again if a update the PHP version from 5.2 to 5.5.

Also the PHP version 5.4 makes the same problem with the refresh.

Any new how I get fixed this problem?

Many thanks.

PS: see attached error log
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: ♦ Ninja ZX-10RR ♦ on January 04, 2015, 12:59:10 PM
I am running PHP 5.5 and never experienced it so it must be something else. Neither I have those errors...
Did you install the... "Guest Registration Notification" mod perhaps? I had to file a security report about it since it was breaking the shoutbox --> ref http://simpleportal.net/index.php?topic=13734.msg67760#msg67760
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on January 05, 2015, 03:33:10 AM
No this mod I doesn't know.

I cannot find any other hint as the error message in my attachment.

Hope I fit this problem because no other shoutbox is so comfortable as this one form SimplePortal.

Is there any funtional shoutbox that I can use as long as I sruch the fault? Please advice.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: ♦ Ninja ZX-10RR ♦ on January 05, 2015, 08:06:50 AM
Well I guess someone can convert that function into the preg_replace_callback, personally I can't do it because the syntax changes and I'm not a php coder.
It is still strange that it doesn't happen on my forum even though the php version I am using is the 5.5 one...
Probably Underdog or SiNaN or any other coder will be converting those strings to fix it for you...

However in the meantime I let you know that I personally tried any other existing shoutbox for smf and they all suck bananas compared to this one... The one that looks barely decent (smfpacks one) has a terrific number of bugs and issues that discourage me from suggesting it, really. Neonneo's one is full of undefined indexes and bugs, moreover bad coding since its css is called even though the shoutbox is disabled... Any other one is really bad IMHO. SiNaN did an awesome job with this one, it's missing just a few features that I requested (for instance the permission to edit messages) but except that it rocks.

EDIT: P.s.: Underdog=Chen Zhen I mistakenly used the previous username...
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Chen Zhen on January 05, 2015, 08:33:11 PM

rentner,

Perform this edit...

file: ../Sources/PortalBlocks.php

find:
Code: [Select]
$data = preg_replace('~<\!\[CDATA\[(.+?)\]\]>~e' . ($context['utf8'] ? 'u' : ''), '\'#cdata_escape_encode#\' . $smcFunc[\'htmlspecialchars\'](\'$1\')', $data);

replace with:
Code: [Select]
        $data = preg_replace_callback('~<\!\[CDATA\[(.+?)\]\]>~' . ($context['utf8'] ? 'u' : ''), function($m) {return "#cdata_escape_encode#" . htmlspecialchars($m[1]);}, $data);

Regards.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on January 06, 2015, 04:10:57 AM
@ Ninja ZX-10RR - I'm absulutely agree with you.

@ Chen Zhen - Thank you so much - now the errors are away from the log file.

But the problem that the shoutbox do not refresh automatily, only if the page is loaded new, is still there. 
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Chen Zhen on January 06, 2015, 05:13:20 PM
rentner,

Edit the shoutbox settings (not the block) and set the refresh time to approx. 10 or 12 seconds.

Regards.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on January 07, 2015, 02:50:59 AM
I have done this and I see the the circuit is running after the time but the shout do not appear. :(
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on January 07, 2015, 11:14:10 PM
This is a never ending topic...

I did do a short test for SP 2.3.6 release and it was working fine. This was with a clean install of SMF with no mods and no custom theme.

Perhaps some themes or mods are making trouble. It is best to test a clean install of SMF and S.Portal on your server (new database - not your site one, no mods, no custom theme). See if that works.

Then we know if its server related or mod/theme problem.

Title: Re: Shoutbox refresh and page reload discrepancy
Post by: ♦ Ninja ZX-10RR ♦ on January 08, 2015, 02:31:59 AM
Good point... If the theme is using AJAX calls or javascript it may break the shoutbox refresh, too.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on January 08, 2015, 03:09:39 AM
Thanks for the answers.

I just make a new installation on a second domain with the SMF 2.1 Beta for testing.

I will install the SP on this domain too, maybe it function with this version also.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on January 08, 2015, 04:04:28 AM
Just I installed the SP 2.3.6 on the quit new SMF 2.1 Beta software and unfortunately the same problem with no automatic refresh.

Seem that it is the web space (server) software.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: ♦ Ninja ZX-10RR ♦ on January 08, 2015, 06:47:56 AM
Such a bad version IMHO... Besides I don't know how much the Portal is compatible with the newest 2.1...
It could be useful if you could duplicate your forum onto another server by another host, possibly with the same php version... You don't need to import the database ;)
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: SeeingBlue on January 14, 2015, 09:43:30 AM
I am also having this issue. It used to work fine then something changed. The circle just churns and doesn't update until you refresh the page. Doesn't matter the browser. My auto-fresh is set to 12, and doesn't matter whether cache is on or off.

I did install a fresh copy of SMF 2.0.9 and SP 2.3.6. This worked fine, so it's not hosting related.

While monitoring the console I do see this error ever 12 seconds:
Quote
junk after document element
index.php:5
TypeError: XMLDoc.getElementsByTagName(...)[0] is undefined
portal.js:104

Installed Mods include:
Code: [Select]
Downloads System 2.1a
Treasury 2.12
Say Thanks 1.1.2
Event Registration Mod 0.177 BETA
Breeze 1.0.7
RSS Feed Poster 4.1
Country Flags 2.1
Simple Audio Video Embedder 3.0.2
SimplePortal 2.3.6
Add Social Media Icons To Profiles 1.2.0
SMF Staff Page 1.7

I hope this was helpful.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on January 16, 2015, 05:06:50 AM
I can't believe it but I have fixed this problem.  ;D ;D ;D ;D

The problem was the font set.

I have transfered the font set to UTF-8 and now the box is refreshing automaticly again.

I'am very happy to had have solved this problem now.  8)
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on January 17, 2015, 04:43:36 AM
The theme font?

Title: Re: Shoutbox refresh and page reload discrepancy
Post by: rentner on January 17, 2015, 06:17:18 AM
The language font set.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on January 19, 2015, 12:33:23 AM
Can you be specific - where did you change those details?

The Simple Portal shoutbox php script? Or some other place like SMF, theme etc.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: ataru on January 27, 2015, 07:14:15 AM
ok. i didn't notice that.

sorry i opened a new topic on that:

I own a forum, http://www.biancocelesti.org, just upgraded from 2.0RC3 to 2.0.9.

I also upgraded SP from 2.3.2 to 2.3.6.

now my shoutboxes can't refresh. shouts are stored in db, can be seen refreshing the whole page (F5), but can't refresh only shoutbox.

Trying to debug js code, i encounter an error:
Code: [Select]
Uncaught TypeError: Cannot read property 'nodeValue' of undefined - portal.js?236:127
onShoutReceived - portal.js?236:127
oMyDoc.onreadystatechange - script.js?rc3:88


this is the portal.js part of the error:
Code: [Select]
for (var i = 0; i < shouts.length; i++)
{
shout = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("shout")[i];
id = shout.getElementsByTagName("id")[0].childNodes[0].nodeValue;
---> author = shout.getElementsByTagName("author")[0].childNodes[0].nodeValue;<---
time = shout.getElementsByTagName("time")[0].childNodes[0].nodeValue;
timeclean = shout.getElementsByTagName("timeclean")[0].childNodes[0].nodeValue;
delete_link = shout.getElementsByTagName("delete")[0].childNodes[0].nodeValue;
content = shout.getElementsByTagName("content")[0].childNodes[0].nodeValue;
is_me = shout.getElementsByTagName("is_me")[0].childNodes[0].nodeValue;

new_body += '<li class="smalltext">' + (is_me == 0 ? '<strong>' + author + ':</strong> ' : '') + content + '<br />' + (delete_link != 0 ? ('<span class="shoutbox_delete">' + delete_link + '</span>') : '') + '<span class="smalltext shoutbox_time">' + time + '</span></li>';
}

and this is the script.js part:
Code: [Select]
if (bAsync)
{
oMyDoc.onreadystatechange = function () {
if (oMyDoc.readyState != 4)
return;

if (oMyDoc.responseXML != null && oMyDoc.status == 200)
{
if (funcCallback.call)
{
---> funcCallback.call(oCaller, oMyDoc.responseXML);<---
}
// A primitive substitute for the call method to support IE 5.0.
else
{
oCaller.tmpMethod = funcCallback;
oCaller.tmpMethod(oMyDoc.responseXML);
delete oCaller.tmpMethod;
}
}
};
}
oMyDoc.open('GET', sUrl, bAsync);
oMyDoc.send(null);


no errors in error.log, only client side.
can anyone help me?
i tried to see the xml generated by myurl/index.php?action=portal;sa=shoutbox;shoutbox_id=1;xml and i see:
Code: [Select]
<smf>
<shoutbox>1</shoutbox>
<updated>1</updated>
<error>0</error>
<warning>0</warning>
<reverse>0</reverse>
<shout>
<id>167015</id>
<author/>
<time/>
<timeclean/>
<delete>
<a href="myurl/index.php?action=portal;sa=shoutbox;shoutbox_id=1;delete=167015;ed3d3dff0=b6e1b2b659ad6f39f96b2b0c33928ef4" onclick="sp_delete_shout(1, 167015, 'ed3d3dff0', 'b6e1b2b659ad6f39f96b2b0c33928ef4'); return false;"><img src="myurl/Themes/mytheme/images/sp/delete_small.png" alt="Elimina" title="Elimina" /></a>
</delete>
<content/>
<is_me>0</is_me>
</shout>
<shout>
<id>166299</id>
<author/>
<time/>
<timeclean/>
<delete>
<a href="myurl/index.php?action=portal;sa=shoutbox;shoutbox_id=1;delete=166299;ed3d3dff0=b6e1b2b659ad6f39f96b2b0c33928ef4" onclick="sp_delete_shout(1, 166299, 'ed3d3dff0', 'b6e1b2b659ad6f39f96b2b0c33928ef4'); return false;"><img src="myurl/Themes/mytheme/images/sp/delete_small.png" alt="Elimina" title="Elimina" /></a>
</delete>
<content/>
<is_me>0</is_me>
</shout>

it seems like it couldn't get nothing but id from xml

there's something in generating xml for shoutboxes. xml for posts is ok.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: ataru on February 02, 2015, 11:09:35 AM
ok. solved adding $smcFunc and using $smcFunc['htmlspecialchars'] instead of php htmlspecialchars


Code: [Select]
function template_shoutbox_xml()
{
global $context, $txt, $smcFunc;

echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<shoutbox>', $context['SPortal']['shoutbox']['id'], '</shoutbox>';

if ($context['SPortal']['updated'])
{
echo '
<updated>1</updated>
<error>', empty($context['SPortal']['shouts']) ? $txt['sp_shoutbox_no_shout'] : 0, '</error>
<warning>', !empty($context['SPortal']['shoutbox']['warning']) ? $smcFunc['htmlspecialchars']($context['SPortal']['shoutbox']['warning']) : 0, '</warning>
<reverse>', !empty($context['SPortal']['shoutbox']['reverse']) ? 1 : 0, '</reverse>';

foreach ($context['SPortal']['shouts'] as $shout)
echo '
<shout>
<id>', $shout['id'], '</id>
<author>', $smcFunc['htmlspecialchars']($shout['author']['link']), '</author>
<time>', $smcFunc['htmlspecialchars']($shout['time']), '</time>
<timeclean>', $smcFunc['htmlspecialchars'](strip_tags($shout['time'])), '</timeclean>
<delete>', !empty($shout['delete_link_js']) ? $smcFunc['htmlspecialchars']($shout['delete_link_js']) : 0, '</delete>
<content>', $smcFunc['htmlspecialchars']($shout['text']), '</content>
<is_me>', $shout['is_me'] ? 1 : 0, '</is_me>
</shout>';


/* old code
<shout>
<id>', $shout['id'], '</id>
<author>', htmlspecialchars($shout['author']['link']), '</author>
<time>', htmlspecialchars($shout['time']), '</time>
<timeclean>', htmlspecialchars(strip_tags($shout['time'])), '</timeclean>
<delete>', !empty($shout['delete_link_js']) ? htmlspecialchars($shout['delete_link_js']) : 0, '</delete>
<content>', htmlspecialchars($shout['text']), '</content>
<is_me>', $shout['is_me'] ? 1 : 0, '</is_me>
</shout>';*/



}
else
echo '
<updated>0</updated>';

echo '
</smf>';


could it be fixed on next releases?
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: velorooms on April 26, 2015, 08:50:53 PM
Just upgraded from 2.3.5 (working shoutbox) to 2.3.6 (no refreshing).

the above  htmlspecialchars edit appears to have fixed it.
Title: Simple Portal Shoutbox not refreshing
Post by: vovik on May 11, 2015, 08:23:43 AM
If any of you are having a problem with the shoutbox not refreshing, it is because the php version you are using is not yet supported and you need to downgrade.
Title: Re: Simple Portal Shoutbox not refreshing
Post by: ♦ Ninja ZX-10RR ♦ on May 11, 2015, 08:57:30 AM
Hi and welcome to SimplePortal.

What you say could be an issue somehow but in most cases it's not the actual cause, the forum contains many threads about this, too. A lot of time ago I had this issue, myself, but the cause was a faulty mod: http://simpleportal.net/index.php?topic=13734.0

Regards
Title: Re: Simple Portal Shoutbox not refreshing
Post by: ataru on May 13, 2015, 03:24:18 AM
it could be a php issue in non utf-8 forums:

http://simpleportal.net/index.php?topic=13865.0

it can be solved replacing every htmlspecialchars() funciton with $smcFunc['htmlspecialchars']() in Portalshoutbox.template.php
Title: Re: Simple Portal Shoutbox not refreshing
Post by: ♦ Ninja ZX-10RR ♦ on May 13, 2015, 07:52:49 AM
Yes, like I said in special cases it can be an issue, but thanks for posting the link :)
Title: Shoutbox refreshing error
Post by: Raji on July 04, 2015, 11:58:02 AM
Hi there,

Since I have upgraded SMF from SMF 2.0.9 to SMF 2.0.10 shoutbox is not auto refreshing. Although I have gone through previous posts related to the same issues but couldn't get clear idea how to fix it.
In error log I am getting this error:
Quote
http://sitename/smf/index.php?action=portal;sa=shoutbox;shoutbox_id=1;time=1436025373;xmlApply Filter: Only show the errors with the same message2: require_once(/home/sitename/public_html/smf/Sources/PortalShoutbox.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directoryApply Filter: Only show the errors from this file File: /home/sitename/public_html/smf/Sources/PortalMain.php
Line: 52


My forum is here:
http://baask.com/diwwan/index.php?action=forum

Thanks in advance for your prompt response

Regards,
Baloch
Title: Re: Shoutbox refreshing error
Post by: ♦ Ninja ZX-10RR ♦ on July 04, 2015, 01:33:39 PM
Sorry but this is definitely the wrong section... It's 100% related to your forum, but there are many reasons that can cause this, that's why there are many topics about it. It happened on my own as well (http://simpleportal.net/index.php?topic=13734), for another faulty mod that was breaking it.

From the looks of it it would seem as if your SimplePortal didn't install correctly. Mods list? Actions taken? Just upgrading from 2.0.9 to 2.0.10... Well I can't see how it could cause such an issue :(
Title: Re: Shoutbox refreshing error
Post by: andy on July 05, 2015, 11:14:25 AM
Quote
It's 100% related to your forum, but there are many reasons that can cause this,

In this sense I can agree it is as bad as a bug. If there are several other mods affecting the shoutbox (the shoutbox code isnt modified) then the code needs writing in a way so that there shouldn't be interference.

I would like to use the SP shoutbox but it is too unreliable. Most people use mods and there seems to be a problem with languages.

I did use an SMF chat/shoutbox but its big and a bit resource heavy. However, it works properly for most people. I'm sure SP shoutbox can be made to work as well as that.

I have used this when I needed people online for live discussion. It worked perfectly every time.
http://custom.simplemachines.org/mods/?mod=1295

Its a bit overkill compared to the SP shoutbox which I would prefer to use.

Title: Re: Shoutbox refreshing error
Post by: ♦ Ninja ZX-10RR ♦ on July 05, 2015, 01:12:25 PM
I hate to disagree andy but please don't suggest such an horrible mod. It's incredibly poorly coded and completely full of bugs (some examples, in italian, so you might need a translator: http://www.italiansmf.net/forum/index.php?topic=1206.msg7168#msg7168), no idea at all on how it got reinstated on the site.

As regards SP shoutbox... I have well over 140 mods and it works fine as it always did (except for the topic I linked, lol), and it's a lot better coded than any other shoutbox I have seen. Also, it can be modded to have more features :)

The issue might be people not using utf-8 characters and sticking to ISO in the first place, or a theme js clashing with the shoutbox itself, php version, prettyURLs and more... So we need more info I guess :/
Title: Re: Shoutbox refreshing error
Post by: Burke Knight on July 05, 2015, 03:31:38 PM
no idea at all on how it got reinstated on the site.

It got reinstated, due to SMF team's double standards + a little brown nosing.
The team would not reinstate mods of people, (Not just me, I found out) that removed them due to SMF's former attitude about saying support was preferred at the maker's site, yet they reinstated his mods, when he repeatedly cussed people out, and out flat said he'd not give support, especially for his free mods.

I for one, think the SMF team needs to start to stay true to their own policy and for all, not for whom they select.
Title: Re: Shoutbox refreshing error
Post by: andy on July 05, 2015, 09:04:16 PM
I think I originally posted this back in 2011:
http://simpleportal.net/index.php?topic=10356.0

It is supposed to work correctly in the last release ( but maybe not the language problem). I have always had trouble with the refresh so cannot use it. I have about 20-30 mods. Its hard to accept as mods do not affect the php of the shoutbox.. So if it is javascript maybe it can be written to avoid clashes...
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Elliott on July 30, 2015, 01:55:06 AM
¿Could someone tell me how to Solve this problem?
 The shoutbox is not update!

Title: Re: Shoutbox refresh and page reload discrepancy
Post by: ♦ Ninja ZX-10RR ♦ on July 30, 2015, 09:28:45 AM
No need to quote everyone who posted before you ;)

Open /Themes/default/PortalShoutbox.template.php

Code: (find) [Select]
<shout>
<id>', $shout['id'], '</id>
<author>', htmlspecialchars($shout['author']['link']), '</author>
<time>', htmlspecialchars($shout['time']), '</time>
<timeclean>', htmlspecialchars(strip_tags($shout['time'])), '</timeclean>
<delete>', !empty($shout['delete_link_js']) ? htmlspecialchars($shout['delete_link_js']) : 0, '</delete>
<content>', htmlspecialchars($shout['text']), '</content>
<is_me>', $shout['is_me'] ? 1 : 0, '</is_me>
</shout>';

Code: (replace with) [Select]
<shout>
<id>', $shout['id'], '</id>
<author>', $smcFunc['htmlspecialchars']($shout['author']['link']), '</author>
<time>', $smcFunc['htmlspecialchars']($shout['time']), '</time>
<timeclean>', $smcFunc['htmlspecialchars'](strip_tags($shout['time'])), '</timeclean>
<delete>', !empty($shout['delete_link_js']) ? $smcFunc['htmlspecialchars']($shout['delete_link_js']) : 0, '</delete>
<content>', $smcFunc['htmlspecialchars']($shout['text']), '</content>
<is_me>', $shout['is_me'] ? 1 : 0, '</is_me>
</shout>';

Regards
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Elliott on July 30, 2015, 10:01:33 AM
Well I made the changes but did not effect !!
  Anything else I can do ??
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on July 30, 2015, 10:04:53 AM
The issue may not be the same for everyone. I've seen other mods that affected our AJAX actions badly. It would be difficult to debug it unless we have the access. Can you provide us with a link to your forum and temporary test account details? You can send the information to me through the personal messaging system if you want me to take a look at it.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on July 30, 2015, 02:43:52 PM
This is the error that I see on shoutbox update on your site:

Code: [Select]
<b>Fatal error</b>:  Function name must be a string in <b>/home/accounts/carding1/public_html/Sources/Load.php(2179) : eval()'d code</b> on line <b>271</b><br />
It's not very informative but it's probably because of the latest change you've made. You need to make this following change in addition to that one:

Themes/default/PortalShoutbox.template.php

Code: (Find) [Select]
global $context, $txt;
Code: (Replace) [Select]
global $context, $txt, $smcFunc;
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Elliott on July 30, 2015, 03:39:18 PM
This is the error that I see on shoutbox update on your site:

Code: [Select]
<b>Fatal error</b>:  Function name must be a string in <b>/home/accounts/carding1/public_html/Sources/Load.php(2179) : eval()'d code</b> on line <b>271</b><br />
It's not very informative but it's probably because of the latest change you've made. You need to make this following change in addition to that one:

Themes/default/PortalShoutbox.template.php

Code: (Find) [Select]
global $context, $txt;
Code: (Replace) [Select]
global $context, $txt, $smcFunc;
Well I made the changes but did not effect !!
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on July 30, 2015, 03:46:39 PM
Can you attach your Themes/default/PortalShoutbox.template.php file here?
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Elliott on July 30, 2015, 03:50:31 PM
Can you attach your Themes/default/PortalShoutbox.template.php file here?
Yes, check please!
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on July 30, 2015, 03:54:44 PM
Try replacing the file with the attached one.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: Elliott on July 30, 2015, 04:29:38 PM
Try replacing the file with the attached one.
Thanks bro now if it works!
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: [SiNaN] on August 01, 2015, 06:15:31 AM
Good to hear that. I just applied the fix suggested by ataru; the edits were incomplete previously.
Title: Re: Shoutbox refresh and page reload discrepancy
Post by: andy on September 03, 2015, 02:16:12 AM
Oh, this sounds good. Will this likely fix all cases... different templates and mods being used?