Hi, I need to display the user picture outside the author div, and I just dont know if this is possible, as I´ve seen that "$author" controls the username and the user image display at the same time.

This is part of the code:

  $output .= "\n<div class=\"guestbook-entry\">\n";
  if ($comment_entry == $entry['id']) {
    $output .= '<a name="comment-entry"></a>';
  }

  // author
  if ($entry['author'] == 0)
     $author = "<b>" . check_plain($entry['anonname']) . "</b>";
  else
     $author = theme('guestbook_user_picture', $entry['author']);

  $output .= '<div class="entry-details"><div class="entry-author">' . $author .'</div>';
  
  // date, email, website
  $output .= '<div class="entry-date">';
  if (in_array('date', $display)) {
    $output .= format_date($entry["created"], "medium");
  }
  if (in_array('email', $display) && !empty($entry['anonemail'])) {
    $output .= '&nbsp;|&nbsp;<a href="mailto:'. check_url($entry['anonemail']) .'">' . t('e-mail') . '</a>';
  }
  if (in_array('website', $display) && !empty($entry['anonwebsite'])) {
    $output .= '&nbsp;|&nbsp;<a href="http://'. check_url($entry['anonwebsite']) .'">' . t('website') . '</a>&nbsp;';
  }
  $output .= '</div></div>';

  // message
  $output .= '<div class="guestbook-message">'. check_markup($entry['message'], variable_get('guestbook_input_format',1)) ."</div>";
  if ($entry['picture']) {
    $output .= '<hr style="clear:both;" />';
  }

  // links
  if (_guestbook_access('administer', $uid) && !$confirm_delete) {
    if ($comment_entry != $entry['id']) {
      $pager = $_GET['page'] ? 'page='. $_GET['page'] : NULL;
      $output .= '<div class="guestbook-admin">';
      $output .= l(t('delete entry'), "guestbook/$uid/delete/{$entry["id"]}", array(), $pager);
      $output .= '</div>';  
    }
  }

  $output .= "\n</div>";

Right now username and picture are in the entry-author div. I need to put the picture in the message (guestbook-message) div, I suppose this is something about the theme_guestbook_user_picture function but I have no idea how could this be fixed.

Is this possible? Thanks! :)

Comments

amardeshbd’s picture

Title: Username and user picture positioning » No picture listing !

Hi there....
i dont want to show the picture in the posts !
what do i need to modify there? any idea ?

// Copy of theme_user_picture, with adjustments

function theme_guestbook_user_picture($uid) {

   $account = user_load(array('uid' => $uid));
   // OTHER CODES 
   // OTHER CODES ....
    $output = l($account->name ? $account->name : variable_get('anonymous', 'Anonymous'), $user_link, $user_text);


    if (isset($picture)) {
      $alt = t('%user\'s picture', array('%user' => $account->name ? $account->name : variable_get('anonymous', 'Anonymous')));
      $picture = theme('image', $picture, $alt, $alt, '', false);
      if (!empty($account->uid) && user_access('access user profiles')) {
        $picture = l($picture, $user_link, array('title' => $user_text), NULL, NULL, FALSE, TRUE);
      }

      $output .= "<div class=\"picture\">$picture</div>";
    }
    return $output;
  }
}

I belive it should work if i dont add the picture link with output.

      if (!empty($account->uid) && user_access('access user profiles')) {
        $picture = l($picture, $user_link, array('title' => $user_text), NULL, NULL, FALSE, TRUE);
      }

      $output .= "";

Will this work without causing any problem !?

nahhe’s picture

yes, that won´t cause any problem, just will not show the pics :)

hba’s picture

Title: No picture listing ! » Username and user picture positioning

Please don't change the title.

sun’s picture

Title: Username and user picture positioning » Username and user picture positioning
Status: Active » Closed (works as designed)

Sorry, this issue has been in the queue for too long.