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.

Comments

dwees’s picture

Assigned: Unassigned » dwees

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

Dave

rschaa’s picture

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

dtabach’s picture

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?

dwees’s picture

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.

ottos’s picture

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

miahawk’s picture

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

doitDave’s picture

Version: 5.x-1.0.x-dev » 6.x-1.x-dev
Priority: Normal » Minor

Yes, there will most likely be *some kind of* a timestamp in the upcoming first stable release. But I will have to identify the less CPU consuming variant (either server localtime or relative time or whatever) as chatblock will strictly focus on efficiency and speed in the future. (And, sorry, will not be maintained for D5 unless someone applies to fix that branch.)

doitDave’s picture

Status: Active » Fixed

Date/time now configurable and implemented as resource-preserving as possible. Will be available in dev-snapshot within the next 12 hours.

doitDave’s picture

Assigned: dwees » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.