Download & Extend

Don't show contact author block if e-mail is invalid

Project:Author Contact
Version:6.x-1.x-dev
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

For my site I have some users who do not have valid e-mail addresses, but they still need to be in the system as place holders and with other types of contact information. I use the bio module to make these contact pages uniform for all people associated with my site. For users with invalid e-mail addresses, I am imputing the address username@invalid.nomail. So for my block visibility I try to put in this check before showing the block:

if(strpos(%mail,'invalid') ==true) {
    print "";
  }
  else {

I am having difficulty calling the e-mail for the author of the currently viewed node (%mail isn't cutting it, I'm thinking). Anyway, any help with this would be greatly appreciated. Thank you!

Comments

#1

Status:active» postponed (maintainer needs more info)

In this module I use this code to get the node author's email address, try this in your block visibility code and check the $to value:

$node = node_load(arg(1));
$pageAuthor = user_load(array('uid' => $node->uid));
$to = $pageAuthor->mail;
nobody click here