• Resolved nyukuri

    (@nyukuri)


    First THANK YOU for this plugin, its the best self-hosted group chat I found so far.

    I adapted the code with the following:

    function rgbcode($s){
        return '#'.substr(md5($s), 0, 6);
    }
    
    function show_avatar($s) {
       $resultat = $GLOBALS['wpdb']->get_results("SELECT ID FROM wp_users WHERE display_name='".$s."'", ARRAY_A); $s = "";
       foreach($resultat as $row) {
          $id = $row['ID'];
       }
       return get_avatar($id, 20);
    }

    then $chat_name would be
    show_avatar($chat_name).' <span style="color:'.rgbcode($chat_name).'">'.$chat_name.'</span>';

    That will give each user his own color and will show the users avatar. But this works only for already existing messages when the chat is loaded. It would need to be added also to the via Ajax fetched messages.

    Would be great if you could implement this in a future version!

    Thank you for your consideration!!!
    Nyukuri

    https://www.ads-software.com/plugins/simple-ajax-chat/

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

    (@specialk)

    Hi nyukuri, thank you that looks quite interesting. I will take a closer look during the next update and see if there is time to implement it or something similar. Cheers ??

Viewing 1 replies (of 1 total)
  • The topic ‘avatars and colors for user names’ is closed to new replies.