Shoutbox Blues

Permalink 1 user found helpful
Hi all!

I am working on a local-hosted site and I need a shoutbox on it. I am trying to use the Shoutbox Addon, which installed successfully. I added it to my site. It looks good.

My problem is this: I tested it by typing Hello World in it and sent that. It successfully sent it, but if I try to send another message, it acts like it is sending it, but it never actually shows up. I know that this addon is no longer supported, but it should still work, right? I am trying to do this without buying a add on, since it is just for local purposes.

I tried to search for a HTML code for a shoutbox, but I would have to either pay or give information I would rather not part with in order to get the code.

Any help is greatly appreciated!

Blenderite
 
Blenderite replied on at Permalink Reply
Blenderite
Any ideas about this?
mhawke replied on at Permalink Reply
mhawke
If an add-on is unsupported then it's very possible that it has stopped working because as time moves on, changes to the core functions can kill an add-on.

All the PHP code for the block is available for you to inspect so you will have to dig through that code to see if you can get it working.
mhawke replied on at Permalink Reply
mhawke
1) Open [root]/packages/shoutbox/db.xml
2) Change the <auto /> to <autoincrement />
3) Uninstall/reinstall Shoutbox
Blenderite replied on at Permalink Reply
Blenderite
That was helpful. Thanks.

Now, I tried it using two browsers and it worked, but it didn't update on one browser when I send a message on the other browser.
mhawke replied on at Permalink Reply
mhawke
I might be wrong but I can't seem to find any functions that poll for new messages so I added my own.

In the view.php add the following just below the //functions comment:

window.setInterval(updateSilentShoutbox<?php    echo $sbIdentity; ?>, 10000);
function updateSilentShoutbox<?php    echo $sbIdentity; ?>(){
$.ajax({
type: "POST", url: "<?php    echo $path; ?>", data: "action=update&av=<?php    if($controller->showAvatars) { echo 'y'; } else { echo 'n'; } ?>&msgs=<?php    echo $controller->messageCount; ?>&time=<?php    if($controller->showTimestamp) { echo 'y'; } else { echo 'n'; } ?>&lnk=<?php    if($controller->showProfileLink) { echo 'y'; } else { echo 'n'; } ?>&sbIdentity=<?php    echo $sbIdentity; ?>",
complete: function(data){
messageList.html(data.responseText);
}
});
}


This gives a 10 second 'silent' ajax refresh (i.e. without the fade in and fade out stuff).
Blenderite replied on at Permalink Reply
Blenderite
I get a error:

Parse error: syntax error, unexpected '?' in C:\xampp\htdocs\C\packages\shoutbox\blocks\shoutbox\view.php on line 4
mhawke replied on at Permalink Best Answer Reply 1 Attachment
mhawke
Save the attached file and rename it 'view.php' and upload it to '[root]/packages/shoutbox/blocks/shoutbox'
Blenderite replied on at Permalink Reply
Blenderite
Thanks so much!!! You are brilliant!
mhawke replied on at Permalink Reply
mhawke
No problem. Now I can use it too!
Blenderite replied on at Permalink Reply
Blenderite
How could I add a feature that can play a sound when a new message arrives?
mhawke replied on at Permalink Reply
mhawke
Learn php.

Just Kidding... I'll see what I can do.
Blenderite replied on at Permalink Reply
Blenderite
I know. I do need to learn PHP. So far I have not had much success.
Blenderite replied on at Permalink Reply
Blenderite
How is it going?
mhawke replied on at Permalink Reply 1 Attachment
mhawke
It's not perfect but try this.

1) Download the attached zip file and expand to your local computer.
2) Upload the contents to '[root]/packages/shoutbox/blocks/shoutbox/'
3) Uninstall/Reinstall Shoutbox.

These files just replace the block files not the whole package.

It now allows you to choose a sound file from the File Manager if you want to but has a default sound. For compatibility, .ogg files should be used for all browsers. IE, on the other hand, gets a very Win3.1 sounding 'ding.mp3'. IE users are stuck with this sound just because they've chosen to use IE. All other browsers will use the included 'blop.ogg' sound file or any other .ogg file you assign through the File Manager.

Quirks: The sound fires even after you shout something which I wish I could stop. It also fires the sound when your computer comes out of hibernation/sleep. Oh well... you get what you pay for!
mhawke replied on at Permalink Reply
mhawke
Have you tried this yet?
Blenderite replied on at Permalink Reply
Blenderite
Oh, yes and it is great! Thanks!
kaplan replied on at Permalink Reply
Thank you for this mhawke! Worked perfectly.
kaplan replied on at Permalink Reply
Sorry for hijacking, but realize there aren't many threads on this Shoutbox addon. I'm trying to enable the shoutbox so that only users can 'shout', but guest can only view. When I edit the block, and uncheck Allow Guest Posting, the guest will not see the input fields nor any buttons, but Administrators also canno't see these fields. Is this a bug? Any ideas on a fix? Thanks!
mhawke replied on at Permalink Reply
mhawke
The original Shoutbox was not a concrete5 creation so I don't believe the original code understands the 'roles' and permissions that live within concrete5. By saying 'Allow Guest Posts', I think the original authors meant any guest that landed on the page. By turning it off, you 'close' the conversation. It would take some re-working to make it 'concrete5-aware'.
kaplan replied on at Permalink Reply
Well gee, that makes total sense! Oh wells, Thanks!
kaplan replied on at Permalink Reply
mhawke,

Do ya know how to increase the font size for the shoutbox messages? Not the 'title'. Thanks!
mhawke replied on at Permalink Reply
mhawke
Sure. If your talking about the size of the message as you type it in, that's on line 37 of [root]/packages/shoutbox/blocks/shoutbox/css/general.css

Any CSS can be found by right-clicking the element of interest and choosing 'Inspect Element'. Have a close look in the right pane and you can see location of the css file and the line number that controls that element. You can even change those values in the right pane to experiment with different styles and when you're happy, make the same change(s) to the underlying stylesheet.
kaplan replied on at Permalink Reply
mhawke. You rule.

Is there a way to limit the history of the shout box? I know I can change the 'thread' in options but wanted to see if there was a better way. TIA
mhawke replied on at Permalink Reply
mhawke
I'm not sure what you mean by changing the value of the 'thread'. I can adjust the number to messages showing and the height of the message's container. What exactly do you need to adjust?
kaplan replied on at Permalink Reply
Sorry for being so vague. The way we're using it is for live updates, but want to limit the amount of... lines that are visible (because the messages may be old).

Can you tell me how I can do both that you are suggesting? TY!
kaplan replied on at Permalink Reply
mhawke, can you tell me how I can make the shoutbox height, static? I'd like it to only show a few lines only and scroll bar the rest rather than have the shoutbox increase in size (eventually taking over the entire screen!) Thanks!
mhawke replied on at Permalink Reply 1 Attachment
mhawke
Can't you already do that by just setting the 'Messages Height' in add/edit dialog? See attached screenshot.
designserve replied on at Permalink Reply
designserve
I really appreciate the work you guys have done here as I'm just trying to implement shoutbox myself. Your ears are probably burning because I'm talking about you over here:

http://www.concrete5.org/community/forums/chat/marketplace-extreme-...