1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-26 17:30:24 +02:00

Notice removal, general tidy

This commit is contained in:
e107steved
2009-09-25 21:22:34 +00:00
parent 5c34e89f0a
commit feaed2f097

View File

@@ -11,21 +11,21 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/email.php,v $ | $Source: /cvs_backup/e107_0.8/email.php,v $
| $Revision: 1.6 $ | $Revision: 1.7 $
| $Date: 2009-08-28 15:30:25 $ | $Date: 2009-09-25 21:22:34 $
| $Author: marj_nl_fr $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
require_once("class2.php"); require_once('class2.php');
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
require_once(HEADERF); require_once(HEADERF);
$use_imagecode = FALSE; $use_imagecode = FALSE;
$imgtypes = array("jpeg", "png", "gif"); $imgtypes = array('jpeg', 'png', 'gif');
foreach($imgtypes as $t) foreach($imgtypes as $t)
{ {
if(function_exists("imagecreatefrom".$t)) if(function_exists('imagecreatefrom'.$t))
{ {
$use_imagecode = TRUE; $use_imagecode = TRUE;
} }
@@ -33,24 +33,30 @@ foreach($imgtypes as $t)
if ($use_imagecode) if ($use_imagecode)
{ {
require_once(e_HANDLER."secure_img_handler.php"); require_once(e_HANDLER.'secure_img_handler.php');
$sec_img = new secure_image; $sec_img = new secure_image;
} }
$qs = explode(".", e_QUERY, 2); if (e_QUERY)
if ($qs[0] == "")
{ {
header("location:".e_BASE."index.php"); $qs = explode('.', e_QUERY, 2);
}
else
{
header('location:'.e_BASE.'index.php');
exit; exit;
} }
$source = $qs[0]; $source = $qs[0];
$parms = $qs[1]; $parms = varset($qs[1], '');
unset($qs);
$error = '';
$message = '';
$emailurl = ($source == "referer") ? $_SERVER['HTTP_REFERER'] : SITEURL; $emailurl = ($source == 'referer') ? strip_tags($_SERVER['HTTP_REFERER']) : SITEURL;
$comments = $tp->post_toHTML($_POST['comment'], TRUE, 'retain_nl, emotes_off, no_make_clickable'); $comments = $tp->post_toHTML(varset($_POST['comment'],''), TRUE, 'retain_nl, emotes_off, no_make_clickable');
$author = $tp->post_toHTML($_POST['author_name'],FALSE,"emotes_off, no_make_clickable"); $author = $tp->post_toHTML(varset($_POST['author_name'],''),FALSE,'emotes_off, no_make_clickable');
$email_send = check_email($_POST['email_send']); $email_send = check_email(varset($_POST['email_send'],''));
if (isset($_POST['emailsubmit'])) if (isset($_POST['emailsubmit']))
@@ -64,19 +70,19 @@ if (isset($_POST['emailsubmit']))
{ {
if(!isset($_POST['code_verify']) || !isset($_POST['rand_num'])) if(!isset($_POST['code_verify']) || !isset($_POST['rand_num']))
{ {
header("location:".e_BASE."index.php"); header('location:'.e_BASE.'index.php');
exit; exit;
} }
if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify'])) if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify']))
{ {
header("location:".e_BASE."index.php"); header('location:'.e_BASE.'index.php');
exit; exit;
} }
} }
if ($comments == "") if ($comments == '')
{ {
$message = LAN_EMAIL_188." ".SITENAME." (".SITEURL.")"; $message = LAN_EMAIL_188.' '.SITENAME.' ('.SITEURL.')';
if (USER == TRUE) if (USER == TRUE)
{ {
$message .= "\n\n".LAN_EMAIL_1." ".USERNAME; $message .= "\n\n".LAN_EMAIL_1." ".USERNAME;
@@ -88,43 +94,43 @@ if (isset($_POST['emailsubmit']))
} }
else else
{ {
$message .= $comments; $message .= $comments."\n";
} }
$ip = $e107->getip(); $ip = $e107->getip();
$message .= "\n\n".LAN_EMAIL_2." ".$ip."\n\n"; $message .= "\n\n".LAN_EMAIL_2." ".$ip."\n\n";
if(strpos($source,'plugin:') !== FALSE) if (substr($source,0,7) == 'plugin:')
{ {
$plugin = substr($source,7); $plugin = substr($source,7);
$text = ""; $text = '';
if(file_exists(e_PLUGIN.$plugin."/e_emailprint.php")) if(file_exists(e_PLUGIN.$plugin.'/e_emailprint.php'))
{ {
include_once(e_PLUGIN.$plugin."/e_emailprint.php"); include_once(e_PLUGIN.$plugin.'/e_emailprint.php');
$text = email_item($parms); $text = email_item($parms);
$emailurl = SITEURL; $emailurl = SITEURL;
} }
if($text == "") if($text == '')
{ {
header("location:".e_BASE."index.php"); header('location:'.e_BASE.'index.php');
exit; exit;
} }
$message .= $text; $message .= $text;
} }
elseif($source == "referer") elseif($source == 'referer')
{ {
if(!isset($_POST['referer']) || $_POST['referer'] == '') if(!isset($_POST['referer']) || $_POST['referer'] == '')
{ {
header("location:".e_BASE."index.php"); header('location:'.e_BASE.'index.php');
exit; exit;
} }
$message .= $_POST['referer']; $message .= strip_tags($_POST['referer']);
$emailurl = $_POST['referer']; $emailurl = strip_tags($_POST['referer']);
} }
else else
{ {
$emailurl = strip_tags($_POST['referer']);
$emailurl = $_POST['referer'];
$message = ''; $message = '';
$parms = intval($parms);
if($sql->db_Select('news', 'news_title, news_body, news_extended', 'news_id='.((int)$parms))) if($sql->db_Select('news', 'news_title, news_body, news_extended', 'news_id='.((int)$parms)))
{ {
$row = $sql->db_Fetch(); $row = $sql->db_Fetch();
@@ -132,20 +138,19 @@ if (isset($_POST['emailsubmit']))
$message = $tp->toEmail($message); $message = $tp->toEmail($message);
} }
if($message == "") if($message == '')
{ {
header("location:".e_BASE."index.php"); header('location:'.e_BASE.'index.php');
exit; exit;
} }
} }
if ($error == "") if ($error == '')
{ {
// Load Mail Handler and Email Template. // Load Mail Handler and Email Template.
require_once(e_HANDLER."mail.php"); require_once(e_HANDLER.'mail.php');
$email_body = $EMAIL_HEADER; $email_body = $EMAIL_HEADER;
$email_body .= (trim($comments) != "") ? $tp->toEmail($comments)."<hr />" : ""; $email_body .= (trim($comments) != '') ? $tp->toEmail($comments).'<hr />' : '';
$email_body .= $tp->toEmail($message).$EMAIL_FOOTER; $email_body .= $tp->toEmail($message).$EMAIL_FOOTER;
if (sendemail($email_send, LAN_EMAIL_3.SITENAME,$email_body)) if (sendemail($email_send, LAN_EMAIL_3.SITENAME,$email_body))