* @version $Id$
* @access public
* @license http://opensource.org/licenses/gpl-3.0.html
*/
?>
false));
$a['module']= $_GET['name'];
$a['module_id']= $_GET['id'];
$a['email']= $_GET['email'];
include_once('../class/class.comment.php');
$comm = new comment;
$r = $comm->unsubscribe($a, $GLOBALS['sql_object']);
$item = $comm->getCommentItem($a, $GLOBALS['sql_object']);
$itemM = itemMapping($a['module']);
$full_item = $item[0]['item_title'] .' ('.$itemM['name'].')';
echo '
'._t('comment','unsubscribe_title').'
'.PHP_EOL;
if($r === true) {
echo ''.PHP_EOL;
echo $full_item . ' : ' ._t('comment','unsubscribe_successful').PHP_EOL;
echo '
'.PHP_EOL;
}
}
if( ActiveItemKey($GLOBALS['activeitem']) =='subscribe-newsletter') {
// set HTML Title
SetHTMLTitle(_t('newsletter','subscribe_title'));
setBreadcrumb(array(_t('newsletter','subscribe_title') => false));
include_once('../newsletter/subscribe.php');
echo ''._t('newsletter','subscribe_title').'
'.PHP_EOL;
echo ''.PHP_EOL;
echo _t('divers','newsletter_public_comment').PHP_EOL;
echo '
'.PHP_EOL;
if(isset($msg)) {
echo ''.PHP_EOL;
echo $msg['string'].PHP_EOL;
echo '
'.PHP_EOL;
}
}
if( ActiveItemKey($GLOBALS['activeitem']) =='contact') {
// set HTML Title
SetHTMLTitle(_t('contact','contact_us'));
setBreadcrumb(array(_t('contact','contact_us') => HrefMaker(array('rub'=> $GLOBALS['links'][U_L]['contact']['linkvalue']))));
$name='';
$email='';
$subject='';
$body='';
if(isset($_GET['s'])) $subject = htmlentities(urldecode($_GET['s']), ENT_QUOTES, 'utf-8');
if(isset($_POST['name'])) {
$passed = true;
$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$body=$_POST['body'];
if(strlen($body)< 8) {
$msg=sprintf(_t('contact','str_error'), _t('contact', 'body'));
$class='error';
$passed = false;
}
if(strlen($subject)< 3) {
$msg=sprintf(_t('contact','str_error'), _t('contact', 'subject'));
$class='error';
$passed = false;
}
if(!validEmail($email)) {
$msg=sprintf(_t('contact','email_error'), $email);
$class='error';
$passed = false;
}
if(strlen($email)< 3) {
$msg=sprintf(_t('contact','str_error'), _t('contact', 'email'));
$class='error';
$passed = false;
}
if(strlen($name)< 3) {
$msg=sprintf(_t('contact','str_error'), _t('contact', 'name'));
$class='error';
$passed = false;
}
// prevent spam only if enabled
if(defined('CONTACT_ANTISPAM') && CONTACT_ANTISPAM ==1) {
if($_SESSION['securityaction']!=md5($_POST['securitycode'])) {
$msg=_t('security','message');
$class='error';
$passed = false;
}
}
if($passed == true) {
$class = 'info';
$msg = _t('contact', 'message_sent');
include_once(override('../mail/send.php'));
$emailContainer['recipient'] = SITE_MAIL;
$emailContainer['from_name'] = $name;
$emailContainer['from'] = $email;
$emailContainer['reply_to'] = array( $email => $name);
$emailContainer['subject'] = formatText($subject, '2HTML') . ' - '. SITE_NAME;
$emailContainer['html_body'] = formatText($body, '2HTML')."
\n\n(".$name . ' - '. $email . ")
\n\n----------------
\n".CURRENT_APP_URL;
$emailContainer['txt_body'] = strip_tags($emailContainer['html_body']);
$cip = i2c_realip();
$obanIP = new banIP();
if($obanIP->isBannedIP($cip)) {
logfile ( LOG_MAILER, array ('[BANNED IP DETECTED]', sprintf('Email from %s is rejected', $cip), $cip, $emailContainer ['subject'], $emailContainer['recipient']));
} else {
// we add ability to ban IP in footer
$emailContainer['txt_body'] = strip_tags($emailContainer['html_body']). "\n". sprintf(_t('mail','ban_ip'), $cip) . ' : ' . SITE_ROOT_URL.'admin/index.php?rub=system&todo=ban-ip-add&id='.$cip;
$emailContainer['html_body'] = $emailContainer['html_body']. '' . sprintf(_t('mail','ban_ip'), $cip) . '
';
$r = send_email($emailContainer);
if(isset($_POST['receive_copy'])) {
$emailContainer['recipient'] = $email;
$emailContainer['subject'] = $emailContainer['subject']. ' ('._t('contact','copy') .')';
$emailContainer['html_body'] = ''. _t('contact','copy'). ' :
' . formatText($body, '2HTML')."
\n\n(".$name . ' - '. $email . ")
\n\n----------------
\n".CURRENT_APP_URL;
$emailContainer['txt_body'] = ''. _t('contact','copy'). ' :\n' .strip_tags($emailContainer['html_body']);;
$r = send_email($emailContainer);
}
}
}
}
echo ''._t('contact','contact_us').'
'.PHP_EOL;
$slot = get_page_slot('contact'); // default slot
if($slot) echo ''.$slot.'
'.PHP_EOL;
if(isset($passed)) echo ''.$msg.'
'.PHP_EOL;
if(!isset($passed) || $passed == false) {
$output = '';
echo $output;
}
}
?>