WordPress.org

Ready to get started?Download WordPress

Forums

Simple Ajax Chat
[resolved] Display date/time in every message (3 posts)

  1. Marlimant
    Member
    Posted 1 month ago #

    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/

  2. Jeff Starr
    Member
    Plugin Author

    Posted 1 month ago #

    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).

  3. Marlimant
    Member
    Posted 1 month ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic