Support » Plugin: Author Chat » Advice on Modifications?

  • Looking into the js code to generate the message wrap, I was wondering if the plugin can be modified to include other profile meta info along with the “nickname.”
    For example, I have a profile field that retrieves a set image for a user (not gravatar) that is called using the php code below.
    <?php echo esc_attr( get_the_author_meta( ‘image’, $user->ID ) ); ?>

    Would this be enough to call the image into a message thread so it appears next to each message? I would like it to look like this if possible. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Piotr Pesta

    (@piotr-pesta)

    You can try to modify pp-proess.php file, array at lines 73 and 93 🙂

    I would like some help with that. Would it go like
    $result = array(
    ‘avatar’ => array_column($text, ‘<?php echo esc_attr( get_the_author_meta( ‘image’, $user->ID ) ); ?>’),
    ‘id’ => array_column($text, ‘id’),
    ‘uid’ => array_column($text, ‘user_id’),
    ‘nick’ => array_column($text, ‘nickname’),
    ‘msg’ => array_column($text, ‘content’),
    ‘date’ => $date
    );

    Plugin Author Piotr Pesta

    (@piotr-pesta)

    More like

    ‘avatar’ => get_the_author_meta( ‘image’, array_column($text, ‘id’)),

    then you have to modify chat.js file lines 386, 452, and showMsg function I guess line 568 to put img to chat window. Now I see that it’s pretty big mod for that plugin 🙁

    • This reply was modified 2 years, 4 months ago by Piotr Pesta.

    I tried adding this code snippit to the lines mentioned in the first reply, but it immediately crashed after doing so. Is that code missing something?

    Plugin Author Piotr Pesta

    (@piotr-pesta)

    Yes, you need to follow my second answer. It’s pretty big modification, so you need to code some lines of code.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Advice on Modifications?’ is closed to new replies.