Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8515015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:01:29+00:00 2026-06-11T05:01:29+00:00

I use this micro message system script and I want to add an avatar

  • 0

I use this micro message system script and I want to add an avatar to it, however, my lack of PHP knowledge is making this difficult.

The code I use to display an avatar is:

userphoto_thumbnail($user_info, $before = '', $after = '', $attributes = array(width => '40', height => '40'), $default_src = '')

And I want to inject this avatar to this part of the message script (inside a loop):

$r = $r . '<tr id="wpam-reply-' . $post->post_ID . '-' . $count . '" ' . $style . '>';
$r = $r . '<td style="padding:10px 0 10px 10px; width:40px;"><span title="' . $user_info->display_name . ' (' . $user_info->user_login . ')">' . userphoto_thumbnail($user_info, $before = '', $after = '', $attributes = array(width => '40', height => '40'), $default_src = '') . '</span></td>';
$r = $r . '<td>' . wpam_get_message($reply, $user_info, $options, 2) . '</td>';
$r = $r . '</tr>';

If you look at the second line, you will see how I added it there. However, this does not return the avatar where it should be. It appears outside everything else. Maybe because it returns a string rather than data? I am not sure as I am only just familiarising myself with PHP terminology.

I am certain that I have not added the avatar code to the script correctly, can you assist?

EDIT: Just to clarify, on the HTML output, the avatar images appear outside of the table, when they should be inside the <td style="padding:10px 0 10px 10px; width:40px;"> tag.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:01:30+00:00Added an answer on June 11, 2026 at 5:01 am

    From the documentation, it looks like userphoto_thumbnails prints out the image. You’re trying to concatenate it instead. When you call it, it’s being printed out when you’re creating the string, so it’s appearing in the wrong place.

    Try this:

    echo '<tr id="wpam-reply-' . $post->post_ID . '-' . $count . '" ' . $style . '>';
    echo '<td style="padding:10px 0 10px 10px; width:40px;"><span title="' . $user_info->display_name . ' (' . $user_info->user_login . ')">';
    userphoto_thumbnail($user_info, $before = '', $after = '', $attributes = array(width => '40', height => '40'), $default_src = '');
    echo . '</span></td>';
    echo '<td>' . wpam_get_message($reply, $user_info, $options, 2) . '</td>';
    echo '</tr>';
    

    That will print everything out in the right place, though you’re no longer creating the $r variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use this script in two different servers: function curlGetFileInfo($url, $cookies=default){ global $_config; $ch
i use this script to load content of some div, inside another div: $(function()
I use this : <?php foreach($_SERVER as $key => $value){ echo <b>$key:</b> $value<br>\n; }
I use this class to parse a .css file. https://github.com/sabberworm/PHP-CSS-Parser I thought it's easy
I want a macro that I can use like this: CREATE_URL(@{SOME-TOKEN}/some/url/path); The macro should
I get this error message when i use URL Linter with my website http://developers.facebook.com/tools/debug/og/object?q=iulianonofrei.com
I have this problem. I use caliburn micro in WPF. In view I have
I have a very interesting problem. I use this technologies in WPF app: Caliburn.Micro
Hi i try use Nlog in with caliburn micro, I have use this tutorial
I want to add a warning message during the compilation to warn the user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.