Show Date/Time

acdtrp - January 2, 2008 - 11:27
Project:Chatblock
Version:5.x-1.0.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:dwees
Status:active
Description

It would be nice if there was an option in the settings page of the module to insert a date/time stamp on each chat line.

#1

dwees - January 2, 2008 - 12:44
Assigned to:Anonymous» dwees

Yeah I see that as a useful feature. If I have any free time, I'll add this as an option.

Dave

#2

rschaa - January 31, 2008 - 16:43

hi,

see this:

in chatblock.module chatblock_logs_page_view() replace:

        $output .= '<div style="width: 160px"><span style="color: red">'.$row['username'].': </span> '. $message .'</div>';

width:
        $output .= '<div style="width: 90%">';
        $output .= '<span style="color: blue">'.chatblock_timestamp_to_string($timestamp).' </span> ';
        $output .= '<span style="color: red">'.$row['username'].': </span> ';
        $output .= $message;
        $output .= '</div>';

and insert this function:

function chatblock_timestamp_to_string($timestamp) {
        return(gmdate( 'y-m-d H:i', intval($timestamp/100)+60*60));
}

greetings

rainer

#3

dtabach - May 22, 2008 - 00:10

Hi rschaa,

Your hack almost did the trick.

The times are correctly printed in the chat logs page, but not int the chat block itself.

I tried to replace the output in function chatblock_messages() (around line 300 of 5.x-1.0-dev) the same way your did in chatblock_logs_page_view(), and now the timestamps also appear in chatblock, but they all show "70-01-01 1:00". And they show only after a page refresh, not when a message is added.

Any further tip?

#4

dwees - August 31, 2008 - 02:34

The trick to using these on the chatblock messages themselves is to include some similar code in the JS. That should be relatively easy to do.

#5

ottos - October 20, 2008 - 18:19

+1
The insert date/time information would be really good feature in the 6.x-1.x-dev too.

#6

miahawk - November 12, 2008 - 15:58

I would love to see this feature in 6.x!

 
 

Drupal is a registered trademark of Dries Buytaert.