In chatroom.module around line 1152 the function grabs three variables:

chatroom_msg_date_format - I'm guessing should be chatroom_chat_date_format that is set in the admin form
chatroom_msg_private_class - doesn't exist
chatroom_msg_public_class - doesn't exist

CommentFileSizeAuthor
#2 date-variable.patch1.31 KBrschwab
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rschwab’s picture

chatroom_msg_date_format also appears in chatroom_get_message_time_string

rschwab’s picture

Status: Active » Needs review
FileSize
1.31 KB

Here is a patch to fix the chatroom_chat_date_format variable in chatroom.module. I'm not sure what the authors intentions are with the css class variables, so those are ignored here.

Anonymous’s picture

rschwab: have a look at chatroomread.php, specifically the function chatroom_theme_cached_message().

because the message that's grabbed from cache may need to be themed differently depending on the user who is viewing it, specifically timezone and link to user profile), we have to stick values into the cached message object and user object, and use those values.

its a hack, but its somewhat better than the alternatives, which are to a) don't support any per-user settings or b) don't use the cache, and eat the server.

does this make any sense? can i add some data to the cached objects?

can you see that if you set the classes in your config, you can over-ride at least bits of the theming?

rschwab’s picture

I'm not sure about the caching thing. Sorry.

I know that chatroom_msg_date_format is not set by the module and doesn't appear in the variables table, but chatroom_chat_date_format does, and appears to be doing what it should be.

calmforce’s picture

I found that the variable actually used is 'chatroom_msg_date_format', but the module form uses different one: 'chatroom_chat_date_format'. So whatever you specify on the form will be saved to the variable and never used. This is very easy fix - just modify lines 195 and 196 in chatroom.forms.inc to use correct variable name.

In the mean time I have added the following line to my settings.php file:
$conf['chatroom_msg_date_format'] = ...