Don't show contact author block if e-mail is invalid
bomarmonk - October 20, 2009 - 19:49
| Project: | Author Contact |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Description
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!

#1
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;