Hi,

On my site authors can be contacted by anonymous users using the 6x port of Anonymous Contact module http://drupal.org/node/310895#comment-1129097

But, while they can see the "Email" tab on their profile pages, they cannot see the little Envelope icon (which is a lot more attention grabbing) in that author's Author Pane. How can I make that envelope icon visible to Anonymous readers???

Many thanks!

Comments

drupalina’s picture

I just need a little help here.

I suspect that a simple answer may be in the file "contact.author-pane.inc". Here's the original code:

<?php
// $Id: contact.author-pane.inc,v 1.1.2.1 2009/01/05 04:38:06 michellec Exp $

/**
 * @file
 *   This file provides a preprocess function on behalf of the contact module.
 */

/**
 * Implementation of hook_preprocess_author_pane().
 */
function contact_preprocess_author_pane(&$variables) {
  global $user;
  $account = $variables['account'];
  $account_id = $account->uid;
  $image_path = $variables['image_path'];

  if (($account->contact) && ($account_id != $user->uid) && ($user->uid != 0)) {
    $variables['contact'] =
      l(theme('image', "$image_path/contact.png", t('Contact user'), t('Contact user'), NULL, TRUE),
        "user/$account_id/contact", array('html' => TRUE)) ;

    $variables['contact_link'] = l(t('Contact user'), "user/$account_id/contact");
  }
}

What do I need to change in

 if (($account->contact) && ($account_id != $user->uid) && ($user->uid != 0)) {
    $variables['contact'] =
      l(theme('image', "$image_path/contact.png", t('Contact user'), t('Contact user'), NULL, TRUE),
        "user/$account_id/contact", array('html' => TRUE)) ;

in order for the Anonymous users to see that contact.png image???

Please help...

drupalina’s picture

as a wild guess of a non-coder, I removed the bit that says
&& ($user->uid != 0)
and it seems to work.

Is this the correct thing to do? Please reply...

michelle’s picture

Status: Active » Fixed

Well, it's better to write your own preprocess than to hack the module but, yes, that's the change that needs to be made.

Michelle

drupalina’s picture

Thanks Michelle!

Status: Fixed » Closed (fixed)

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