Hi,

I install the module its an awesome but the author pane block gets disappear if i visit any of the user/uid/photos or user/uid/videos (i.e. My Photos, My Videos) i have to come back again to click on another link.Hoping for some good response.

Comments

michelle’s picture

Title: Author pane block visibility » Expand Author pane block visibility
Assigned: abhishek sawant » Unassigned
Category: bug » feature
Priority: Critical » Normal

This isn't a bug; it's by design. It's meant to show on user/# only. I'll give some thought to whether there's a better way to do it that will be more flexible.

Michelle

abhishek sawant’s picture

Hi,

I recheck it but still no result any help will be highly appreciated.

michelle’s picture

I just said I'd give it some thought... Unless you have a magical computer than turns thoughts into code, rechecking it won't do any good. ;)

Michelle

clockwood’s picture

Version: 6.x-2.x-dev » 6.x-2.0-alpha2

I just ran up against this myself and I'm curious if you've decided to tackle this or not ;)

My usage case:
I'm creating an image gallery, using views/panels to show user 'galleries' (all of a user's nodes) and I'm showing the Author Info in a block to the side. My paths are set up differently, and I can't change 'em at this point.

I don't know the dirty details, but maybe an option/override to use the block's php visibility logic?

btw - Thanks for this little gem :)

michelle’s picture

Version: 6.x-2.0-alpha2 » 6.x-2.x-dev

I'm still going to do this. Just haven't gotten to it, yet. I haven't spent much time on my modules in the last couple of months. Hopefully I'll have more time for them soon.

Michelle

clockwood’s picture

I got it working for my needs, so I'll post what I did in case someone else wants to do something similar.

This code will show the author pane in a block on a non-user page. In my case a gallery (views) of all photos submitted by a user. The username is passed as a views argument, and the url is set up as: /gallery/username.

<?php
$arg1 = arg(1); // get username from URL
$ref_user = user_load(array('name'=>$arg1)); //load user by username

$account = content_profile_load('profile', $ref_user->uid); //load user's Content Profile in $account. 'profile' is the name of the Content Profile content type.
$caller = 'author_pane_block'; //set the caller for Author Pane

print theme('author_pane', $account, $caller, 'artist_photo_sm'); // display info through Author pane
?>

Then you can use author_pane.tpl.php to customize and style the output.

clockwood’s picture

Well, the above code -was- working until I upgraded to drupal 6.14. Now I'm getting some annoying errors:

    * warning: array_fill() [function.array-fill]: Number of elements must be positive in D:\wamp\www\epi2\includes\database.inc on line 253.
    * warning: implode() [function.implode]: Invalid arguments passed in D:\wamp\www\epi2\includes\database.inc on line 253.
    * warning: array_keys() [function.array-keys]: The first argument should be an array in D:\wamp\www\epi2\modules\user\user.module on line 502.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in D:\wamp\www\epi2\modules\user\user.module on line 502.

It only happens when calling the author pane outside of /user.

This error appears often in search results, but from what I've seen it's possibly a problem with partial data being passed in the user object (ie, roles). I might be totally off though. Hope someone has some suggestions.

I'm doing some testing calling and presenting the referenced author directly from a block (not using author pane) and it seems to be working. Makes me think its an issue with the module (at least when used in this way).

I know Michelle isn't actively working on the module, but does anyone have suggestions?

updated testing
after some testing, it appears the problem is with trying to load the content profile data into the $account variable required by author pane. It's beyond my knowledge to dig into the module, so I'll likely have to theme a separate block template as a faux author pane.

Anonymous’s picture

In my case, what I want to to is prevent the Author Info from appearing on some pages. My solution is to disable the block entirely and re-create using Views :(.

michelle’s picture

@Becky: It only appears on /user /blog and /node/N. If you don't want it to appear on some of those, just list those in the "show on all pages except" box. The problem in this issue is to have it show on /user and /user/N/somepage and not /user/N/edit. That gets trickier.

Michelle

michelle’s picture

Status: Active » Fixed

I changed it to specifically exclude /edit. Other paths can be excluded in the block visibility options as needed.

Michelle

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drupalina’s picture

Status: Closed (fixed) » Active

Well, thankfully, Author Pane provides 2 tpl files. So you can use author-pane-block for the standard Author Pane block, and then create another custom block, and use author-pane.tpl.php as it's template. All you need to enter in the body of that custom block is:

<?php print theme('author_pane', $account, $image_path, $author-pane); ?>

Like this you can display this block on a custom views page like user/*/friends (where normal AP block won't appear)

BUT....
You will need to do some modifications to the author-pane.tpl.php
Specifically, it will need to deduce the UID, usernamename and picture path from the url's arg (1)

I tried putting $account_id = arg(1) at the beginning of author-pane.tpl.php , but that got me only half way -- username and picture still don't load correctly.
Does anyone know what else do we need to write in a custom block or author-pane.tpl.php to make this work???

PS: author-pane is awesome!

michelle’s picture

Status: Active » Closed (fixed)

Please don't hijack closed issues for unrelated support requests.

To get the UID, use $account->uid.

If you need more help, please start your own issue to keep the issue queue organized.

Michelle

cbovard’s picture

Hello,
I have encountered this issue and found a solution. I need the author pane block available on other pages.
In the author_pane.module file on line 237 I commented out this code:

  Check that we're in the right area.
  if (!($area == 'user' || $area == 'node' || $area == 'blog') || !is_numeric(arg(1)) || arg(2) != '') {
    return;
  }

Basically you can control the block visibility on the: /admin/build/block/configure/author_pane/0 page.

I hope this helps someone out.

Chris Bovard
www.chrisbovard.com

kent_drupal’s picture

Issue tags: +author-pane

I had modified author-pane.module to allow Author Pane block on all the pages. You can still control the pages from block settings. Here is the code:

Under function author_pane_get_block(), add following code:

1. comment:
/*if (!($area == 'user' || $area == 'node' || $area == 'blog') || !is_numeric(arg(1)) || arg(2) == 'edit') {
return;
} */

2. Under else case, comment
if (empty($allowed_types[$node->type]) condition

3. add following code:

// added below if case to allow AP on node/add/ pages as well
if($area == 'node' && arg(1) == 'add' && arg(2) == ''){
global $user;
$uid = $user->uid;
}
else{
$uid = $node->uid; // put it in else case.
}

This works for me Perfect !!!

avpaderno’s picture

Issue summary: View changes
Issue tags: -author-pane

I am removing the tags used in just few issues. I apologize for bumping this issue.

michelle’s picture

No worries. Good to see the tag list getting a cleaning. Thanks for all you do to make this site better. :)