Closed (fixed)
Project:
Instant messenger
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
12 Nov 2009 at 21:28 UTC
Updated:
3 Dec 2009 at 17:47 UTC
First off, this module is AWESOME! Thanks so much for the work put into making it. It was exactly what I was looking for.
My only question is if there is a way to add a timestamp for each message? Ie, I send a message at 3:42 pm and to the right of the message, across from my name, it posts '3:42 pm'. Is there a way to configure that functionality with the present module? And if not, any pointers in the right direction on how I might go about coding that?
Thanks a bunch for the help!
Comments
Comment #1
pahariwalla commentedThe theming of messages is performed by the function theme_im_msgs($msgs, $other_name) in im.moduke
you can override this with any of the normal Drupal theme overide methods such as a function in your theme's template.php
The $msgs array holds a single message and contain the following fields:
The current function looks like this:
If you wanted the datetime to appear at the beginning of each message, you might add this modified function to your theme's template.php
If you want it to appear on the right, justified, then you probably want to use tables or divs with css.
Hope this helps.
Comment #2
Dain Berrett commentedWow, thanks so much! That worked perfect, it looks great.
I guess one last question I have: is there a way to change the 'sent-time' output from 'Y-m-d H:i:s' to 'H:i a', so that I can get a shorter timestamp like 4:20 pm?
Thanks!
Comment #3
pahariwalla commentedYeah ... i should have put the formatting in a themable function ... but you can convert the formatted time string back to an integer with the strtotime() function and then reformat it as you want like so:
Comment #4
Dain Berrett commentedOnce again, you rock! Thanks so much for the help. :)