I was wondering how I could add a specifc chat (not chat room) embedded in a block.
Essentially I am trying to have a chat in the bottom of my Main Page..sort of a support.I have seen such in other websites but am not sure how to get this going
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | screenshot.jpg | 64.68 KB | afrazer |
Comments
Comment #1
yngens commentedI am also looking for a way to include a chat window to another page, node, view or front page.
Comment #2
avatar123 commentedIs there a way to this, or should I assume it is not possible.Please advice
Comment #3
JonGirard-1 commentedSame with myself, I'm also looking for a way to do just this.
Jon.
Comment #4
afrazer commentedI did this successfully, with the following steps:
Create a new block.
Provide the block's body as
where 2 is the id number of the chat you want to open there.
Be sure you set the input type as php.
If you want the user list displayed with it, you can use the included Chat Room Online List block that comes with the module and should be listed among your blocks when the module is installed.
But it won't understand which chat you are in, the quickest way to fix it if you just have 1 chat room and don't care about coding "form" is to just replace the code starting around line 887 in chatroom.module with
(where 2 is the id number of the chat you want).
This will have the side effect of making the title of all your pages include "live chat", and showing the chatroom in your breadcrumbs - if you don't like that, comment out the following lines in chatroom.module, starting around 1147:
DON'T archive this chat, or you'll screw everything up real bad. If you want to archive it, get rid of all the blocks first.
You could do this in a more thorough way, but this was enough for my needs. It should really be a block that the module furnishes.
Works for me, so far at least.
-Aharon Frazer
Comment #5
JonGirard-1 commentedVery nice.. thank you so much for posting this..
Jon.
Comment #6
keanu007 commentedI tried the
<? print chatroom_chat(2);?>
but this does not work for me Any ideas ?
Comment #7
yamill commentedit worked for me. thanks!
Keanu007 you need to enable to php code in the filter text for it to work.
Comment #8
darclex commentedfollowed the directions and it totally works i'm on drupal 5.10
afrazer totally rules for sharing this and making it work for the rest of us
check it out at
yourboyvic.com
Comment #9
hankpalan.com commentedI get Fatal error: Call to undefined function chatroom_chat() in /includes/common.inc(1648) : eval()'d code on line 1
when I try the code:
I'm using the php filter.
Comment #10
hankpalan.com commentedNvmind, I was using the 6.x version. I'm using the insert node module instead of printing it in a block.
Comment #11
rschwab commentedI'm trying to do this as well, and in the block none of the chat features show up. Here's what I've done:
- Install both modules
- Set up a new input format with only the Node Insert filter used.
- Set up a block using the new input format and with a content of "[node:59]" (59 is the nid of my chatroom)
- Place the block in a region
What shows is:
No chat messages, no user list, no message submission form. I checked the chatroom content type to see if I needed to manually add those fields in the Node insert statement, but no fields are listed.
Has anyone used Node Insert to successfully get a chatroom in a block using 6.x? If so, mind sharing how you accomplished this?
- Ryan
Comment #12
truyenle commentedWhat is the function in Drupal 6, I mean:
D5: chatroom_chat($nid);
D6:? I don't see chatroom_chat() in D6?
Please help
Truyenle
Comment #13
marta_yo commentedI'm too interested in show a chat in a block in drupal 6, please...
Comment #14
truyenle commentedwell, I got it work by this code
Where $nid is the node id of chat content.
Comment #15
dmuth commentedHi folks,
I expanded on the previously posted idea here, and wrote a full-blown PHP script to display a chat in a block, and filter out author and taxonomy information. Here it is:
http://gist.github.com/546688
Permission is granted to use this code in the project and/or documentation as you see fit.
If anyone wants to see this code in action, I'm running on the site http://www.pa-furry.org/. You'll need to be a valid user, but the site supports creating an account from an OpenID (Or Twitter/Facebook/etc.). I run the site, so feel free to create an account there to see the chat system.
-- Doug
Comment #16
greenreaperThanks, Doug! Here's a few additions I found useful; I figured others might as well:
Comment #17
glitz commentedi would like to do this. where would I place the above code, Within the block body and changing the input filter? Or, Would I need to file this file in another location?
Comment #18
glitz commentednm got it THANKS! :)
Comment #19
glitz commentedi was able to get the block working, but i would like to disable the actual chat page view so it is in-accessible (as an entire page).
any way to do this without deleting the block?
Comment #20
glitz commentedalso, I was wondering if there was anyway to clear the chat history in the window after a certain amount of time. So if no one is using the chat room overnight, you wont see the chat history from the night before...
I thought I had this set up in the chatroom global settings but it is not the case for the block view
(this also is the same for the time stamp format)
Comment #21
glitz commentedany suggestions?
Comment #22
StudioARE commentedTried a combo of the two latest scripts, but it makes the breadcrumb think it's on the chat for every page.
Like.. "Home » Forums » Chat"
Anyone know how to fix that?