Plugin Directory

Changeset 1305603


Ignore:
Timestamp:
12/10/2015 07:25:58 PM (10 years ago)
Author:
chatroll
Message:

Improve BuddyPress avatar support; test on WordPress 4.4

Location:
chatroll-live-chat/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chatroll-live-chat/trunk/readme.txt

    r1247904 r1305603  
    22Contributors: chatroll
    33Donate link: http://chatroll.com
    4 Tags: chatroll, live, widget, chat, facebook, twitter, sidebar, shoutbox
     4Tags: chatroll, live, chat, buddypress, facebook, twitter, sidebar, shoutbox, widget
    55Requires at least: 2.8
    6 Tested up to: 4.3
    7 Stable tag: 2.1.3
     6Tested up to: 4.4
     7Stable tag: 2.2.0
    88
    9 Chatroll is a great way to reach, engage and grow your site's social media following. Add Chatroll social chat to your WordPress sidebar, posts, and pages.
     9Chatroll is a great way to reach, engage and grow your site's audience. Add Chatroll chat to your WordPress and BuddyPress sidebar, posts, and pages.
    1010
    1111== Description ==
    1212
    13 Chatroll is a great way to reach, engage and grow your site's social media following. Add Chatroll social chat to your WordPress sidebar, posts, and pages.
     13Chatroll is a great way to reach, engage and grow your site's audience. Add Chatroll chat to your WordPress and BuddyPress sidebar, posts, and pages.
    1414
    1515**Plugin Highlights:**
    1616
    17 ***Social Chat***
     17***Chatroll Chat***
    1818
    19 * True real-time social interaction for WordPress
    20 * Reach, engage and grow your social media following
    21 * Facebook and Twitter support
     19* Fast, easy-to-use live chat for WordPress and BuddyPress
     20* Add live chat to your pages, posts or sidebar
     21* Supports WordPress and BuddyPress profiles and avatars
     22* Supports social networks including Facebook and Twitter
     23* Powered by Chatroll, the most reliable and powerful live chat plugin for WordPress and BuddyPress
    2224
    2325***Simple Design***
     
    2931***Flexible Customization***
    3032
    31 * Customize colors and size to match the look of your site
    32 * Single Sign-On (SSO) for seamless integration with WordPress avatars
     33* Customize colors, size and CSS to match the look of your site
     34* Single Sign-On (SSO) for seamless integration with WordPress and BuddyPress avatars
    3335
    3436***Powerful Moderation***
     
    4446***Hosted, Cloud Solution***
    4547
    46 * Hosted on Chatroll's servers for maximum performance
     48* Hosted on Chatroll's servers for rock-solid performance
    4749* On-demand scaling - Supports over 500+ simultaneous users in chat
    48 
    49 ***Free***
    50 
    51 * Free version is limited to 10 simultaneous users
    52 * Upgrade for additional capacity and support
    5350
    5451**Tags**
    5552
    56 chat, live chat, chatroll, sidebar, Facebook, Twitter, admin, WordPress chat, WordPress plugin, WordPress live chat, WordPress live chat plugin, chat box, online chat, chat online, chat plugin, chat software, chat widget, chat system, moderated chat, private chat, css, custom css, customize css, analytics, white label, message history, scalable chat, video streaming, live video, live streaming, streaming, webcast, webcasting, livecast, commenting system, live event chat, engagement, engage, real time engagement, real time chat, live chat, live chat software, live chat services, live chatting, live help, live support, live web chat, livechat, php live chat, guest login, online chat, online support, support chat, single chat, single chat free, free chat, chatbox, commenting, commenting system, contact plugin, contact us, customer support, free chat, IM Chat, shoutbox, social, social chat, support software, website chat, widget
     53chat, live chat, chatroll, sidebar, Facebook, Twitter, admin, WordPress chat, WordPress plugin, WordPress live chat, WordPress live chat plugin, BuddyPress chat plugin, BuddyPress live chat plugin, chat box, online chat, chat online, chat plugin, chat software, chat widget, chat system, moderated chat, private chat, css, custom css, customize css, analytics, white label, message history, scalable chat, video streaming, live video, live streaming, streaming, webcast, webcasting, livecast, commenting system, live event chat, engagement, engage, real time engagement, real time chat, live chat, live chat software, live chat services, live chatting, live help, live support, live web chat, livechat, php live chat, guest login, online chat, online support, support chat, single chat, single chat free, free chat, chatbox, commenting, commenting system, contact plugin, contact us, customer support, free chat, IM Chat, shoutbox, social, social chat, support software, website chat, widget
    5754
    5855== Installation ==
     
    111108== Changelog ==
    112109
     110= 2.2.0 =
     111* Improved BuddyPress avatar support
     112* Tested on WordPress 4.4
     113
    113114= 2.1.3 =
    114115* Enable HTTPS/SSL by default
  • chatroll-live-chat/trunk/wp-chatroll.php

    r1247904 r1305603  
    261261        }
    262262        if (empty($attr['upic'])) {
    263             // Set the picture using 'get_avatar' (available in WordPress 2.5 and up)
    264             // This ONLY takes effect when the Single Sign-On (SSO) check box is turned on via the Chatroll's Settings page!
    265             if (function_exists('get_avatar')) {
     263            // Get the avatar URL to populate the Chatroll 'upic' parameter.
     264            // BuddyPress and different versions of WordPress use different methods.
     265            $avatar_url = '';
     266            if (function_exists('bp_core_fetch_avatar')) {
     267                // BuddyPress: Use bp_core_fetch_avatar ONLY if the current user has an avatar.
     268                // Otherwise, fallback to WordPress avatar functions (e.g. Gravatar)
     269                $avatar_url = bp_core_fetch_avatar( array(
     270                    'html' => false,
     271                    'no_grav' => true,
     272                    'item_id' => $current_user->ID,
     273                    'type' => 'thumb',
     274                    'width' => 96,
     275                    'height' => 96 ) );
     276            } else if (function_exists('get_avatar_url')) {
     277                // WordPress >= 4.2.0: Set the avatar URL using get_avatar_url
     278                $avatar_url = get_avatar_url($current_user->ID, 96);
     279            } else if (function_exists('get_avatar')) {
     280                // (WordPress < 4.2.0) Set the avatar URL using get_avatar_url
     281                // Set the picture using 'get_avatar' (available in WordPress 2.5 and up)
    266282                // 38px image size
    267                 $avtr = get_avatar($current_user->ID, 38);
    268                 $avtr_src = preg_replace("/.*src='([^']*)'.*/", "$1", $avtr);
    269                 if (strlen($avtr_src) > 0) {
    270                     if ($avtr_src[0] == '/') {
    271                         // Turn local image URIs into full URLs.
     283                $avatar = get_avatar($current_user->ID, 96);
     284                $avatar_url = preg_replace("/.*src='([^']*)'.*/", "$1", $avatar);
     285                if (strlen($avatar_url) > 0) {
     286                    if ($avatar_url[0] == '/') {
     287                        // Turn relative image URIs into absolute image URLs.
    272288                        $url = get_bloginfo('url');
    273289                        $domain = preg_replace("/^(http[s]?:\/\/[^\/]+).*/", "$1", $url);
    274                         $avtr_src = $domain . $avtr_src;
    275                     } 
     290                        $avatar_url = $domain . $avatar_url;
     291                    }
    276292                    // The gravatar image URL is extracted from an image tag and ampersands (&) are escaped to &amp;
    277                     // Chatroll uses the URL to download the image, as opposed to using it directly for an html img tag.
    278293                    // Thus we need to un-escape the specialchars. (e.g. &amp; -> &)
    279                     $attr['upic'] = htmlspecialchars_decode($avtr_src);
     294                    $avatar_url = htmlspecialchars_decode($avatar_url);
    280295                }
    281296            }
     297
     298            /*
     299            print "<pre>Avatar URL: ";
     300            print_r($avatar_url);
     301            print "</pre>";
     302            */
     303
     304            // Set the 'upic' parameter:
     305            // Chatroll uses the URL to download the avatar, so this must be an absolute, publicly accessible URL.
     306            $attr['upic'] = $avatar_url;
    282307        }
    283308        if (empty($attr['ulink'])) {
Note: See TracChangeset for help on using the changeset viewer.