Title: [Plugin: WP phpBB Bridge] Author Avatar
Last modified: August 20, 2016

---

# [Plugin: WP phpBB Bridge] Author Avatar

 *  Anonymous User 8295407
 * (@anonymized-8295407)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-phpbb-bridge-author-avatar/)
 * Okay so I’ve been looking into the functions.php in regards to getting author
   avatars used as well instead of it just being for commenter’s. Has anybody done
   this before? I almost think I need to write a new function to accomplish this
   but would rather not.
 * [http://wordpress.org/extend/plugins/wp-phpbb-bridge/](http://wordpress.org/extend/plugins/wp-phpbb-bridge/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter Anonymous User 8295407
 * (@anonymized-8295407)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-phpbb-bridge-author-avatar/#post-2281418)
 * `<?php echo get_avatar( get_the_author_meta( 'user_email' ), '50' ); ?>`
 * Okay so that’s what is displaying the image.
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * That’s the function that is grabbing the commenter’s avatar. I have a feeling
   the issue is with
 * `$qr = "SELECT u.`user_avatar`, u.`user_avatar_type`FROM`” . $table_prefix . “
   users`u WHERE u.`user_email`= '" . $comment->comment_author_email . "'";`
 * specifically
 * `$comment->comment_author_email . "'";``
 * I can’t find where $comment is getting filled. It’s working for comments no problem,
   but what I see, $comment is only getting passed “50”. Any pointers?
 *  Thread Starter Anonymous User 8295407
 * (@anonymized-8295407)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-phpbb-bridge-author-avatar/#post-2281593)
 * Alright.. I got it working. I had to create a new function and then edit the 
   theme a bunch. got it working!
 *  [Mark](https://wordpress.org/support/users/markjcasey/)
 * (@markjcasey)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-phpbb-bridge-author-avatar/#post-2281687)
 * Any chance you can post the solution? Cheers
 *  Thread Starter Anonymous User 8295407
 * (@anonymized-8295407)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-phpbb-bridge-author-avatar/#post-2281713)
 * No! It’s a secret!
 * Okay so I’m not a php programmer but I know enough to figure things out. I couldn’t
   figure out a way to make it work within the same function because they have to
   call different variables from the SQL database. So what I did was copy the function,
   and then just change the variable..
 *     ```
       function get_forum_author_avatar($authemail, $size)
       {
           global $user;
   
           $phpbb_config = trim(get_option('wpb_path'));
   
               $phpbb_config = trim(get_option('wpb_path'));
               require($phpbb_config);
   
               $cn = mysql_pconnect($dbhost . ":" . $dbport, $dbuser, $dbpasswd);
   
               if($cn)
               {
                   if(@mysql_select_db($dbname))
                   {
                       $qr = "SELECT u.<code>user_avatar</code>, u.<code>user_avatar_type</code> FROM <code>&quot; . $table_prefix  . &quot;users</code> u WHERE u.<code>user_email</code> = '" . $authemail . "'";
                       $rs = @mysql_query($qr, $cn);
                   }
   
                   while($i = mysql_fetch_assoc($rs))
                   {
                       $avatar = "<img class=\"avatar photo\" src=\"" . wpb_get_avatar($i['user_avatar'], $i['user_avatar_type']) . "\" alt=\"\" />";
                   }
               }
   
           return $avatar;
       }
       ```
   
 * I put this right after the get_forum_avatar function. Then to make it work, I
   manually edited the theme file wherever it called for get_avatar for the author
   avatar, I changed it to get_forum_author_avatar. That was it!
 *  [undead1](https://wordpress.org/support/users/undead1/)
 * (@undead1)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-phpbb-bridge-author-avatar/#post-2281746)
 * for me not work, need help 🙁
 *  [undead1](https://wordpress.org/support/users/undead1/)
 * (@undead1)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-phpbb-bridge-author-avatar/#post-2281747)
 * i don’t find get_avatar work with get_forum_author_avatar, can u help me mbazdell,
 * Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: WP phpBB Bridge] Author Avatar’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-phpbb-bridge_eaeaea.svg)
 * [WP phpBB Bridge](https://wordpress.org/plugins/wp-phpbb-bridge/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-phpbb-bridge/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-phpbb-bridge/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-phpbb-bridge/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-phpbb-bridge/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [undead1](https://wordpress.org/support/users/undead1/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-phpbb-bridge-author-avatar/#post-2281747)
 * Status: not resolved