WordPress.org

Support

Support » Plugins and Hacks » Simple Ajax Chat » [Resolved] Display date/time in every message

[Resolved] Display date/time in every message

  • Hello and thanks for the plugin (It is very light!):

    I found the way to print the date/time in every post, changing the lines 71, 72 y 73 in the file simple-ajax-chat-form.php
    for this:

    <li class="sac-chat-message sac-static sac-user-<?php echo $name_class; ?>">
    <span><?php echo stripslashes($url); ?> : </span> <p><?php the_time('j \d\e\ F, Y \-\ g:i a'); ?></p><?php echo convert_smilies("" . stripslashes($r->text)); ?>
    </li>

    But the date/time only appear if I refresh the site (www.rneradio.cl)
    How can make the date/time appear at the same time of the post (without need to refresh the page)?

    Thank you!

    https://wordpress.org/plugins/simple-ajax-chat/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeff Starr

    @specialk

    You also need to modify the JavaScript file, sac.php – that is responsible for the Ajax functionality (so you don’t need to refresh the page).

    Thanks for the quick answer Jeff.
    I made a mistake. I changed the lines 71, 72 y 73 for this (the previous code was incorrect):

    <li class="sac-chat-message sac-static sac-user-<?php echo $name_class; ?>">
    <span><?php echo stripslashes($url); ?> : </span> <p><?php echo date_i18n('j \d\e\ F, Y \-\ g:i a'); $timezone_offet = get_option( 'gmt_offset' ); ?></p><?php echo convert_smilies("" . stripslashes($r->text)); ?>
    </li>

    Unfortunately I only know of css and some of php, but your answer will be very helpful in my search for a solution.

    Best regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Display date/time in every message’ is closed to new replies.
Skip to toolbar