Нow to display the chat window in popout or in block???
Very thanks for any answers.

Comments

TrevorBradley’s picture

I'm trying the same thing today, without much luck. I've managed to get the node to render using:

  print drupal_render(node_view(node_load(1)));

(where 1 is the nid of the chat node) but that just displays the node without the chat area...

TrevorBradley’s picture

OK, I've figured it out, but it will require editing the module... It looks as if it's hard coded to refuse chat functionality unless it's loaded on its own node page...

On line 696 of chatroom.module, comment out this line:
//if ($view_mode == 'full' && node_is_page($node)) {

and replace it with this one...

if ($view_mode == 'full') {

Then enable PHP Filter, and use:

print drupal_render(node_view(node_load(1)));

Within the block you want to display.

It would be awesome if there was some way to call chatroom_chat_view function to display chat windows in other contexts.

TrevorBradley’s picture

Status: Needs work » Active

Just fixed this again after the update (though I got confused that there were two calls to node_is_page within chatroom.module)...

I think this was incorrectly flagged as "needs work" when created. I don't see why this one line fix would hurt anything in the module. Any chance this might make it in? Chat works great in blocks and there's no reason to exclude it from them!

Anonymous’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

moving to 7.x-2.x.

7.x-1.x is dead to me.

TrevorBradley’s picture

Version: 7.x-2.x-dev » 7.x-2.0-alpha1

Ugh... Not fun.

I kept getting bizzare error messages trying to update, and then assuming there was no possible upgrade path I simply deleted all chatroom database tables, the entry from the system table, and tried to install from scratch.

When accessing the chat node I now get a white screen of death and the following error in my logs:

PHP Fatal error: Call to a member function get() on a non-object in .../sites/all/modules/chatroom/chatroom.module on line 388

I'll keep poking it to see if I get a different response.

Also, I'm assuming the README is out of date - it still makes reference to chatroomread.php.

EDIT... Looks like this might be a nodejs issue, hold on..

EDIT2: Nope, I thought it was because nodejs wasn't properly installed... but I'm still getting this error. Investigating.

EDIT3: My fault (Due to attempting to add chat as a block on the sidebar) - though I still can't get it to work. I'll investigate and report back.

TrevorBradley’s picture

Having a new issue, starting a new thread...

TrevorBradley’s picture

Title: Output chtatroom in block or in popout? » /chatroom/message/post/2 403 Forbidden

Nope, I give up, going back to 7.x-1.x. Nodejs is too hard for me this weekend.

I keep getting a 403 Forbidden error message when the javascript attempts to POST to [mysite]/chatroom/message/post/2.. when I go to that page manually I'm getting the following error messages.

Warning: Missing argument 2 for chatroom_user_has_access() in chatroom_user_has_access() (line 424 of [...]/sites/all/modules/chatroom/chatroom.module).
Notice: Undefined variable: account in chatroom_user_has_access() (line 425 of [...]/sites/all/modules/chatroom/chatroom.module).
Notice: Trying to get property of non-object in Chatroom->userHasAccess() (line 117 of[...]/sites/all/modules/chatroom/chatroom.chatroom.inc).

Any ideas?

TrevorBradley’s picture

Title: /chatroom/message/post/2 403 Forbidden » Output chtatroom in block or in popout?

Issue title changed back, not my thread to hijack...

langworthy’s picture

I placed a chatroom in a block by using Views.

Re: #7. I get 403 errors if the chat is not public. i'll see if there is an issue for that.

TrevorBradley’s picture

@langworthy: I can confirm the chat I was getting errors on was private - only accesible to authenticated users.

Thanks for the tips on Views... I'll have to give that a try if I ever get brave enough to try 7.x-2.x out again...

langworthy’s picture

@TrevorBradley: the 7.x-2.x branch of chatroom has been update so I'm no longer getting the errors on private chats.

If you want to quickly test out the current state of chatroom you can take a look at a simple distro I've created. http://github.com/sprice/chat

fenda’s picture

So we would need to display a single Drupal field HTML (the chatroom field) by itself in a menu page callback. This would allow us to make chat popups etc. (Would also making use chat on smart phones easier)

Anonymous’s picture

Component: Code » Documentation
Category: feature » support

this is possible now via some simple site config. so i guess this boils down to a documentation issue. i'm happy to review a doc page if someone creates one explaining how to create a content type with a chatroom field.