Closed (fixed)
Project:
Shoutbox
Version:
5.x-1.0
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2007 at 02:11 UTC
Updated:
29 Oct 2009 at 17:57 UTC
Where does one get the code that has the auto-refresh functionality in it? I've downloaded the newest version as of a few days ago and have not been able to get the box to refresh. There doesn't appear to be any code that handles that in the version I have. There's a form field on the admin page that takes a number, but I set that to 5 seconds and no auto refreshing is happening. I also have looked at the source and the shoutbox is showing up in a div tag, not an iFrame. Is there some special variable that I need to set in the code to make it show up in an iFrame and auto-refresh? I couldn't see anything on the admin page for it.
Thanks in advance.
Comments
Comment #1
disterics commentedThanks to the magic of ajax there is no need to use an iframe for the auto-refresh.
All you need to do is change the number of seconds on the admin like you did.
Also make sure javascript is enabled.
Comment #2
Daen-1 commentedI have javascript enabled on both IE 7 and Firefox, but have not been able to get the auto refresh to work. I opened the page in two browsers-- IE 7 and Firefox 2, and signed in with different users in each browser window. I posted a message in the box with one user (in the IE window) and waited for the message to show up for the other user in the Firefox window. After 4 minutes it has still not shown up in Firefox with the time for refresh set to 5 seconds. The IE window shows the post just fine, right after it was made by the user. If I manually refresh the page in Firefox, it then shows the new post from the other user, but not until I do that. Any ideas?
Comment #3
Daen-1 commentedAfter a lot of searching and poking, I was able to fix the issue. The load() function called on $(#shoutbox-posts) in shoutbox-form.js was not correctly loading the data retrieved from the server. I'm not sure if it's just me that had this problem, since I haven't seen any other posts with the same issue as I was having. I can send a patch if you want, but it required a decent amount of code modification in various places on the module to make it work, and it seems like not everyone may need it. If you want me to, just let me know how/where to send it.
Comment #4
disterics commentedCan you upload the patch to this issue just in case someone else runs into the same problem. I am also curious about what was wrong since this seems to be a unique case.
Comment #5
(not verified) commentedComment #6
dany.uy commentedI just was installed ShoutBox yesterday, and I find exactly this problem. Can you post the patch? Thank.
(Test site: http://w3.uyserv.com)
Comment #7
dany.uy commentedI just was installed ShoutBox yesterday, and I find exactly this problem. Can you post the patch? Thank.
(Test site: http://w3.uyserv.com)
Comment #8
Axlen commentedIf your base_path(); is anything other than "/", for instance "/drupal/" the shoutbox auto-refresh ajax will not work.
The GET request is always "http://example.domain.com/shoutbox/js/view" even though your sites Drupal install is actually beneath the web root: e.g. /www/drupal. In this case the appropriate GET request should be "http://example.domain.com/drupal/shoubox/js/view".
The fix is to include the variable returned from the Drupal API function base_path() pre-pend it to the appropriate string. To fix the module two files need to be patched.
File shoutbox.module
Function _shoutbox_get_view()
File: shoubox-form.js
Function: Drupal.shoutbox.loadShouts = function(), Drupal.shoutbox.loadShouts = function()
Oops! This should be used in the 5.x-1.1 release. It should work in the 5.x-1.0 release too.
I'll submit a patch against stable release when I get a chance. It will have this update plus a few others.
Comment #9
Daen-1 commentedSorry-- don't have a lot of time these days, and I didn't see the previous request for the code. My version of the code has gone through several different changes since then, so I don't think it's in a compatible state with the current version of this module. At any rate, looking back through it, it looks like one of the main things was that I had to hardcode the address of the shoutbox view on my site. So, what Axlen posted seems to be the correct way to to dynamically fix the problem.
Comment #10
disterics commentedImplemented axlens patch.
Comment #11
3xonline commentedUm, i have no Idea how to implement that (im also using the 6.x nightly build)
Comment #12
disterics commentedYou don't have to implement anything. Its already checked in.
Comment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #14
eddy123 commentedhello daen...i have a myshoutbox.com account aswell and cant seem to have it refresh on its own either...was wondering if you would be able to fix it for me...my email is edjlightning@aol.com...ur response will be greatly appreciated
thanks again