returnarray(array('title'=>t('Contact settings'),'data'=>form_checkbox(t('Personal contact form'),'contact',1,$edit['contact'],t('Allow other users to contact you by e-mail via <a href="%url">your personal contact form</a>. Note that your e-mail address is not made public and that privileged users such as site administrators are able to contact you even if you choose not to enable this feature.',array('%url'=>"user/$user->uid/contact"))),'weight'=>2));
$output=t('%name is not accepting e-mails.',array('%name'=>$account->name));
}
elseif(!$user->uid){
$output=t('Please <a href="%login">login</a> or <a href="%register">register</a> to send %name a message.',array('%login'=>url('user/login'),'%register'=>url('user/register'),'%name'=>$account->name));
}
elseif(!valid_email_address($user->mail)){
$output=t('You need to provide a valid e-mail address to contact other users. Please edit your <a href="%url">user information</a>.',array('%url'=>url("user/$user->uid/edit")));
$output=t("You can't contact more than %number users per hour. Please try again later.",array('%number'=>CONTACT_HOURLY_THRESHOLD));
}
else{
$edit=$_POST['edit'];
if($edit){
// Validate the message:
if(!$edit['message']){
form_set_error('message',t('You must enter a message.'));
}
if(!form_get_errors()){
// Compose the body:
$message[]="$account->name,";
$message[]=t("%name (%name-url) has sent you a message via your contact form (%form-url) at %site.",array('%name'=>$user->name,'%name-url'=>url("user/$user->uid",NULL,NULL,TRUE),'%form-url'=>url($_GET['q'],NULL,NULL,TRUE),'%site'=>variable_get('site_name','drupal')));
$message[]=t("If you don't want to receive such e-mails, you can change your settings at %url.",array('%url'=>url("user/$account->uid",NULL,NULL,TRUE)));
$message[]=t('Message:');
$message[]=$edit['message'];
// Tidy up the body:
foreach($messageas$key=>$value){
$message[$key]=wordwrap(strip_tags($value));
}
// Prepare all fields:
$to=$account->mail;
$from=$user->mail;
$subject='['.variable_get('site_name','drupal').'] '.t('message from %name',array('%name'=>$user->name));
returnarray(array('title'=>t('Contact settings'),'data'=>form_checkbox(t('Personal contact form'),'contact',1,$edit['contact'],t('Allow other users to contact you by e-mail via <a href="%url">your personal contact form</a>. Note that your e-mail address is not made public and that privileged users such as site administrators are able to contact you even if you choose not to enable this feature.',array('%url'=>"user/$user->uid/contact"))),'weight'=>2));
$output=t('%name is not accepting e-mails.',array('%name'=>$account->name));
}
elseif(!$user->uid){
$output=t('Please <a href="%login">login</a> or <a href="%register">register</a> to send %name a message.',array('%login'=>url('user/login'),'%register'=>url('user/register'),'%name'=>$account->name));
}
elseif(!valid_email_address($user->mail)){
$output=t('You need to provide a valid e-mail address to contact other users. Please edit your <a href="%url">user information</a>.',array('%url'=>url("user/$user->uid/edit")));
$output=t("You can't contact more than %number users per hour. Please try again later.",array('%number'=>CONTACT_HOURLY_THRESHOLD));
}
else{
$edit=$_POST['edit'];
if($edit){
// Validate the message:
if(!$edit['message']){
form_set_error('message',t('You must enter a message.'));
}
if(!form_get_errors()){
// Compose the body:
$message[]="$account->name,";
$message[]=t("%name (%name-url) has sent you a message via your contact form (%form-url) at %site.",array('%name'=>$user->name,'%name-url'=>url("user/$user->uid",NULL,NULL,TRUE),'%form-url'=>url($_GET['q'],NULL,NULL,TRUE),'%site'=>variable_get('site_name','drupal')));
$message[]=t("If you don't want to receive such e-mails, you can change your settings at %url.",array('%url'=>url("user/$account->uid",NULL,NULL,TRUE)));
$message[]=t('Message:');
$message[]=$edit['message'];
// Tidy up the body:
foreach($messageas$key=>$value){
$message[$key]=wordwrap(strip_tags($value));
}
// Prepare all fields:
$to=$account->mail;
$from=$user->mail;
$subject='['.variable_get('site_name','drupal').'] '.t('message from %name',array('%name'=>$user->name));