[Plugin: WPBook] Comments Facebook avatar
-
Hi,
first I wanna thanks for this great plugin!!!
I’m trying to customize something inside the comments.php
for retrive the facebook avatar instead the default gravatar..I have create a query that stamp the avatar of the facebook user nearby the comments but when I try to post a comment the page stops
and don’t communicate with wordpress database..
the url in the browser is: https://www.mysite.com/index.php?fb_sig_in_iframe&wpbook=comment-handlerHereby the code
<div id="commentlist"> <?php $comment_class = 'acomment'; ?> <?php foreach ($comments as $comment) : ?> <div class="<?php echo $comment_class ?>"> <?php $urlu = get_comment_author_url(); if ($use_gravatar == "true" && !ereg("facebook",$urlu)){ echo'<div class="gravatarr">'; $grav_url = "https://www.gravatar.com/avatar/" . md5(strtolower(get_comment_author_email())) . "?d=" . $gravatar_default . "&s=50&r=".$gravatar_rating; echo "<img src='$grav_url'/></div>"; echo '<div class="gravatarpadding">'; } elseif ($use_gravatar == "true" && ereg("facebook",$urlu)){ echo'<div class="gravatarr">'; $parsed = parse_url($urlu, PHP_URL_QUERY); $parsed = parse_str($parsed); $idfb = $parsed['id']; echo "<img src='https://graph.facebook.com/"; echo "{$id}"; echo "/picture?type=square' />"; echo '</div><div class="gravatarpadding">'; } ?> <span class="wpbook_comment_author"><?php comment_author_link(); ?></span> <br/><span class="wpbook_comment_date"> <?php comment_date('F jS, Y') ?> at <?php comment_time() ?></span> <span class="wpbook_comment_text"> <?php if ($comment->comment_approved == '0') : ?> <em>Your comment is awaiting moderation.</em> <?php endif; ?> <?php comment_text() ?></span> <?php if ($use_gravatar == "true"){ echo '</div>'; } ?> </div> <?php /* Changes every other comment to a different class */ if ('acomment' == $comment_class){$comment_class = 'bcomment';} else {$comment_class = 'acomment';} ?> <?php endforeach; /* end for each comment */ ?> </div><!-- //commentlist -->
In my setting pages inside wordpress I have set a custom gravatar..
If I delete $urlu = get_comment_author_url();
in the code I’m able again to comment but obviously it doesn’t show me the facebook avatar..
but it show only the custom gravatar..Any suggestion?
Thank you
Claudio
- The topic ‘[Plugin: WPBook] Comments Facebook avatar’ is closed to new replies.