Newsletter Subscriber email - Joomla! Forum - community, help and support
i installed newsletter subscriber plug in.http://www.mavrosxristoforos.com/index.php/joomla-plugins/50-newslettersubscriber
i want delete date stamp email me name , email details.
the line want delete is:
date("r")
the code:
i want delete date stamp email me name , email details.
the line want delete is:
date("r")
the code:
code: select all
<html dir="rtl">
<?php
// no direct access
defined( '_jexec' ) or die( 'restricted access' );
jimport( 'joomla.plugin.plugin' );
class plgcontentnewsletter_subscriber extends jplugin {
function plgcontentnewsletter_subscriber( &$subject, $config ) {
parent::__construct( $subject, $config );
}
function onpreparecontent(&$row, &$params, $page=0) {
if (is_object($row)) {
$text = &$row->text;
}
else {
$text = &$row;
}
global $mainframe;
if (jstring::strpos($text, '{newsletter_subscriber}') === false) {
return true;
}
$plugin = & jpluginhelper::getplugin('content', 'newsletter_subscriber');
$pluginparams = new jparameter($plugin->params);
$mynamelabel = $pluginparams->def('name_label', 'name:');
$myemaillabel = $pluginparams->def('email_label', 'email:');
$recipient = $pluginparams->def('email_recipient', '');
$buttontext = $pluginparams->def('button_text', 'subscribe newsletter');
$pagetext = $pluginparams->def('page_text', 'thank subscribing our site.');
$errortext = $pluginparams->def('errot_text', 'your subscription not submitted. please try again.');
$subject = $pluginparams->def('subject', 'new subscription site!');
$fromname = $pluginparams->def('from_name', 'newsletter subscriber');
$fromemail = $pluginparams->def('from_email', 'newsletter_subscriber@yoursite.com');
$sendingwithsetemail = $pluginparams->def('sending_from_set', true);
$noname = $pluginparams->def('no_name', 'please write name');
$noemail = $pluginparams->def('no_email', 'please write email');
$invalidemail = $pluginparams->def('invalid_email', 'please write valid email');
$classsuffix = $pluginparams->def('class_suffix', '');
$savelist = $pluginparams->def('save_list', true);
$savepath = $pluginparams->def('save_path', 'c:\mailing_list.txt');
$thankstextcolor = $pluginparams->def('thank_text_color', '#ff0000');
$disable_https = $pluginparams->def('disable_https', false);
$exact_url = $pluginparams->def('exact_url', true);
if (!$exact_url) {
$url = juri::current();
}
else {
if (!$disable_https) {
$url = (!empty($_server['https'])) ? "https://".$_server['server_name'].$_server['request_uri'] : "http://".$_server['server_name'].$_server['request_uri'];
}
else {
$url = "http://".$_server['server_name'].$_server['request_uri'];
}
}
$fixed_url = $pluginparams->def('fixed_url', true);
if ($fixed_url) {
$url = $pluginparams->def('fixed_url_address', "");
}
$unique_id = $pluginparams->def('unique_id', "");
$enable_anti_spam = $pluginparams->def('enable_anti_spam', true);
$myantispamquestion = $pluginparams->def('anti_spam_q', 'how many eyes has typical person? (ex: 1)');
$myantispamanswer = $pluginparams->def('anti_spam_a', '2');
$myerror = "";
$errors = 3;
if (isset($_post["name".$unique_id])) {
$errors = 0;
if ($enable_anti_spam) {
if ($_post["ns_anti_spam_answer".$unique_id] != $myantispamanswer) {
$myerror = $myerror. '<span style="color: #f00;">' . jtext::_('wrong anti-spam answer') . '</span><br/>';
}
}
if ($_post["name".$unique_id] === "") {
$myerror = $myerror . '<span style="color: #f00;">' . $noname . '</span><br/>';
$errors = $errors + 1;
}
if ($_post["email".$unique_id] === "") {
$myerror = $myerror. '<span style="color: #f00;">' . $noemail . '</span><br/>';
$errors = $errors + 2;
}
else if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $_post["email".$unique_id])) {
$myerror = $myerror. '<span style="color: #f00;">' . $invalidemail . '</span><br/>';
$errors = $errors + 2;
}
if ($myerror == "") {
$mymessage =
$mynamelabel . ' ' . $_post["name".$unique_id] . ', ' .
$myemaillabel . ' ' . $_post["email".$unique_id] . ', ' .
date("r")
;
$mailsender = &jfactory::getmailer();
$mailsender->addrecipient($recipient);
if ($sendingwithsetemail) {
$mailsender->setsender(array($fromemail,$fromname));
}
else {
$mailsender->setsender(array($_post["email".$unique_id],$_post["name".$unique_id]));
}
$mailsender->setsubject($subject);
$mailsender->setbody($mymessage);
if (!$mailsender->send()) {
$myreplacement = '<span style="color: #f00;">' . $errortext . '</span>';
$text = jstring::str_ireplace('{newsletter_subscriber}', $myreplacement, $text);
}
else {
$myreplacement = '<span style="color: '.$thankstextcolor.';">' . $pagetext . '</span>';
$text = jstring::str_ireplace('{newsletter_subscriber}', $myreplacement, $text);
}
if ($savelist) {
$file = fopen($savepath, "a");
fwrite($file, $_post["name".$unique_id]." (".$_post["email".$unique_id]."); ");
fclose($file);
}
return true;
}
}
if ($recipient === "") {
$myreplacement = '<span style="color: #f00;">no recipient specified</span>';
$text = jstring::str_ireplace('{newsletter_subscriber}', $myreplacement, $text);
return true;
}
if ($recipient === "email@email.com") {
$myreplacement = '<span style="color: #f00;">mail recipient specified email@email.com.<br/>please change module parameters.</span>';
$text = jstring::str_ireplace('{newsletter_subscriber}', $myreplacement, $text);
return true;
}
$myreplacement = "";
if ($myerror != "") {
$myreplacement = $myerror;
}
$myreplacement = $myreplacement . '<div class="ns ' . $classsuffix . '"><form action="' . $url . '" method="post"><table>' . "\n";
if ($enable_anti_spam) {
$myreplacement = $myreplacement . '<tr><td colspan="2">' . $myantispamquestion . '</td></tr><tr><td></td><td><input class="ns inputbox ' . $classsuffix . '" type="text" name="ns_anti_spam_answer'.$unique_id.'" width="250"/></td></tr>' . "\n";
}
$myreplacement = $myreplacement . '<tr><td>' . $mynamelabel . '</td><td><input class="ns inputbox ' . $classsuffix . '" type="text" name="name'.$unique_id.'" width="250"';
if (($errors & 1) != 1) {
$myreplacement = $myreplacement . ' value="'.$_post["name".$unique_id].'"';
}
$myreplacement = $myreplacement . '/></td></tr>' . "\n" .
'<tr><td>' . $myemaillabel . '</td><td><input class="ns inputbox ' . $classsuffix . '" type="text" name="email'.$unique_id.'" width="250"';
if (($errors & 2) != 2) {
$myreplacement = $myreplacement . ' value="'.$_post["email".$unique_id].'"';
}
$myreplacement = $myreplacement . '/></td></tr>' . "\n" .
'<tr><td colspan="2"><input class="ns button ' . $classsuffix . '" type="submit" value="' . $buttontext . '" style="width: 100%;"/></td></tr></table></form></div>' . "\n";
$text = jstring::str_ireplace('{newsletter_subscriber}', $myreplacement, $text);
return true;
}
}
Comments
Post a Comment