dfnorris
Forum Replies Created
-
Forum: Hacks
In reply to: Restrict Page Access to Return from PayPalHi Ross,
Thanks for the replay and I apologise for the delayed response. I managed to get it working.
Resolved
Maybe this will be of some use to someone else –
WordPress BeTheme
Using Super Socializer with s2Member, either of the functions above will work if you put the code in betheme-child/functions.php.
Using Super Socializer with UltimateMember, only the second function (function heateor_ss_custom_social_avatar()) seems to work. But only if you put the code in betheme/functions.php
Hope that makes sense.
Thanks for getting back.
It is a clean install with only Super Socializer and UltimateMember, no other plugin/functionality overriding avatar functionality (not forgetting that it works perfectly with s2Member). I have also cleared the website and browser caches.
Super Socializer is retrieving the //graph.facebook/photos, though they do not appear to be being passed to the avatar.
Thanks
Yes I did, this is what I have:-
/* —————————————————————————
* @do not apply to backend default avatars
* ————————————————————————— */add_filter(‘avatar_defaults’, ‘um_avatar_defaults’, 99999 );
function um_avatar_defaults($avatar_defaults) {
//remove_filter(‘get_avatar’, ‘um_get_avatar’, 99999, 5);
return $avatar_defaults;
}/* —————————————————————————
* Replace default avatar with social avatar
* ————————————————————————— *///add_filter(‘get_avatar’, ‘um_get_avatar’, 99999, 5);
function um_get_avatar($avatar = ”, $id_or_email=”, $size = ’96’, $avatar_class = ”, $default = ”, $alt = ”) {if ( is_numeric($id_or_email) )
$user_id = (int) $id_or_email;
elseif ( is_string( $id_or_email ) && ( $user = get_user_by( ’email’, $id_or_email ) ) )
$user_id = $user->ID;
elseif ( is_object( $id_or_email ) && ! empty( $id_or_email->user_id ) )
$user_id = (int) $id_or_email->user_id;
if ( empty( $user_id ) )
return $avatar;um_fetch_user( $user_id );
$avatar = um_user(‘profile_photo’, $size);
if ( !um_profile(‘profile_photo’) && um_get_option(‘use_gravatars’) ) {
if ( is_ssl() ) {
$protocol = ‘https://’;
} else {
$protocol = ‘https://’;
}$default = get_option( ‘avatar_default’, ‘mystery’ );
if ( $default == ‘gravatar_default’ ) {
$default = ”;
}$rating = get_option(‘avatar_rating’);
if ( !empty( $rating ) ) {
$rating = “&r={$rating}”;
}$avatar = ‘<img src=”‘ . $protocol . ‘gravatar.com/avatar/’ . md5( um_user(‘user_email’) ) .
‘?d=’. $default . ‘&s=’ . $size . $rating .'” class=”gravatar avatar avatar-‘.$size.’ um-avatar” width=”‘.$size.'” height=”‘.$size.'” alt=”” />’;}else if( empty( $avatar ) ){
$default_avatar_uri = um_get_default_avatar_uri();
$avatar = ‘<img src=”‘ .$default_avatar_uri .'” class=”gravatar avatar avatar-‘.$size.’ um-avatar” width=”‘.$size.'” height=”‘.$size.'” alt=”” />’;
}return $avatar;
}
`Still not working though ??
I done a clean install and the function is still not working with UltimateMember/ Super Socializer setup.
Still only works with s2Member. I will try a clean install and make the change first.
Hi Team Heateor,
Thanks for the quick response. I using the second piece of code
/**
* Replace default avatar with social avatar
*/
function heateor_ss_custom_social_avatar()so, no I haven’t removed anything.
Am I using the wrong one?
Thanks
Hi Team Heateor,
First of all, a massive thank you for providing such an awesome plugin, simple to use yet very powerful – brilliant!
Testing the function above, I currently have two test setups, both using BeTheme, the first is with s2Member/Super Socializer and the second with UltimateMember/Super Socializer. I put the function from above into both childtheme/fuctions.php files and with the s2Member/Super Socializer setup it it working perfectly. However, not with the UltimateMember/ Super Socializer setup.
Setup 1 is on a domain whilst setup 2 is on a sub-domain so I swapped the setups around to see if that would have any impact, alas not! I would prefer to use the Ultimate Member setup as I believe it to be more flexible, though perhaps not as powerful as s2Member.
Any suggestions would be greatly appreciated.
Thanks