thanks for greate module.
could you let me know how to stick Author Pane on each page for logged in user, for example: og lists, searches etc...?
at now moment AuthorPane display for nodes, which was created by author...

thanks in advance...

regards
zzemm

Comments

michelle’s picture

Status: Active » Fixed

This is not easy and requires programming. Roughly:

  1. Create a new block
  2. Use PHP to figure out what UID to use on each page and load the user object.
  3. Call the Author Pane theme function with that user object and use that for the block content

Michelle

zzemm’s picture

Dear Michelle

Thanks for the clue!!!

For others... detailed:
1. Create a new block
2. Insert the following PHP code

global $user;
$uid = $user->uid;

$account = user_load(array('uid' => $uid));
print theme('author_pane', $account, NULL, 'advanced_profile_author-pane'); // I am using Aqcuia Marina theme

3. Put the block on site

Again, Michelle - thanks a lot.

zzemm’s picture

Status: Fixed » Closed (fixed)
michelle’s picture

Ooooh, you wanted to show the author pane of the person logged in? Sorry, I missed that. Yeah, getting that isn't so hard. I thought you wanted to show the author on non node/user pages which is very difficult because you have to try and figure out who the author of that page is. Like, how would you show the author of a taxonomy listing? Who would be the author? That's why I said it would be hard.

Glad you were able to figure it out and sorry to mislead you on the difficulty.

Michelle

dalegrebey’s picture

Title: how to stick Author Pane » Display Author Pane / Make Visible on Other Pages (e.g. a profile page such as /user/1/edit)

Michelle,
Great module. Well written and I like that it can be easily integrated with other modules that I am also using. Thanks for that.

I've read in a couple posts where you mentioned that displaying the author pane for non author pages is difficult and requires quite a bit of programming. For my specific usage, displaying author pane on the /user/%/edit page; this was really easy. It seemed rather odd to me that this didn't work by default, but nonetheless--hopefully this will help another adventurous Drupal'r.

All I did was tap into Drupal's templating system and strip away the first part of the string to get the User ID.


// Get the User ID from the templating system and than remove
// page-user- resulting in the User ID alone
$profile_page_user = $variables['template_files'][1];
$profile_page_user = str_replace('page-user-', '', $profile_page_user);

// Pass the $profile_page_user variable (which is now the UID) to author_pane theme function
// Note that this does not work with URL aliasing (for example if the page is /user/admin/edit
// you would first need to query the database for that name and than retrieve the UID from there)
$account = user_load(array('uid' => $profile_page_user));
print theme('author_pane', $account, NULL, 'author-pane-block'); 

Thanks again.

michelle’s picture

I was talking about the Author Pane block, which is intentionally designed to not show on the edit page. There's an issue to change that, though.

Michelle

vertazzar’s picture

I also used


$uid = arg(1);

$account = user_load(array('uid' => $uid));
print theme('author_pane', $account, NULL, 'author-pane-block3');

and it works everywhere