Version 1.1.1

This commit is contained in:
Neo committed 2025-12-19 00:16:25 -08:00
1 parent aabfdc1f57
commit 7ef3d1712a
179 files changed
+57457 -44972

No files matched your search

+39 -22
View File
@@ -2,10 +2,10 @@
/*
+--------------------------------------------------------------------------
| IBFORUMS v1
| Invision Board v1.1
| ========================================
| by Matthew Mecham and David Baxter
| (c) 2001,2002 IBForums
| by Matthew Mecham
| (c) 2001,2002 Invision Power Services
| http://www.ibforums.com
| ========================================
| Web: http://www.ibforums.com
@@ -44,7 +44,7 @@ class emailer {
var $template = "";
var $error = "";
var $parts = array();
var $bcc = "";
var $bcc = array();
var $mail_headers = array();
var $multipart = "";
var $boundry = "";
@@ -59,6 +59,8 @@ class emailer {
$this->from = $ibforums->vars['email_out'];
$this->temp_dump = $ibforums->vars['fake_mail'];
// Temporarily assign $header and $footer, this can be over-riden
// also
@@ -68,27 +70,33 @@ class emailer {
}
function add_attachment($data = "", $name = "", $ctype='application/octet-stream') {
function add_attachment($data = "", $name = "", $ctype='application/octet-stream')
{
$this->parts[] = array( 'ctype' => $ctype,
'data' => $data,
'encode' => 'base64',
'name' => $name
);
}
function build_headers() {
$this->mail_headers = "From: ".$this->from. "\n";
function build_headers()
{
global $ibforums;
$this->mail_headers = "From: \"".$ibforums->vars['board_name']."\" <".$this->from.">\n";
if ( count( $this->bcc ) > 1 )
{
$this->mail_headers .= "Bcc: ".implode( "," , $this->bcc ) . "\n";
}
$this->mail_headers .= "Return-Path: ".$this->from."\n";
$this->mail_headers .= "X-Priority: 3\n";
$this->mail_headers .= "X-Mailer: IBForums PHP Mailer\n";
if (is_array( $this->bcc ) )
{
$this->mail_headers .= "BCC: ".implode( "," , $this->bcc ) . "\n";
}
if ( count ($this->parts) > 0 )
{
@@ -130,7 +138,9 @@ class emailer {
// Physically sends the email
//+--------------------------------------------------------------------------
function send_mail() {
function send_mail()
{
global $ibforums;
$this->to = preg_replace( "/[ \t]+/" , " " , $this->to );
$this->from = preg_replace( "/[ \t]+/" , " " , $this->from );
@@ -147,12 +157,13 @@ class emailer {
if ( ($this->from) and ($this->subject) )
{
$this->subject .= " ( From ".$ibforums->vars['board_name']." )";
if ($this->temp_dump == 1)
{
$blah = $this->to."\n".$this->from."\n".$this->subject."\n".$this->mail_headers."\n\n".$this->message;
$blah = $this->subject."\n------------\n".$this->mail_headers."\n\n".$this->message;
$pathy = '/Library/WebServer/Documents/mail/'.date("js.F.Y.h:i.A"); // OS X rules!
$pathy = '/Library/WebServer/Documents/mail/'.date("F.Y.h:i.A").".txt"; // OS X rules!
$fh = fopen ($pathy, 'w');
fputs ($fh, $blah, strlen($blah) );
fclose($fh);
@@ -178,7 +189,7 @@ class emailer {
//+--------------------------------------------------------------------------
function get_template($name="", $language="en") {
global $IB, $DB;
global $ibforums, $IB, $DB;
if ($name == "")
{
@@ -186,19 +197,21 @@ class emailer {
$this->fatal_error("A valid email template ID was not passed to the email library during template parsing", "");
}
if (! file_exists("./lang/$language/email_content.php") )
{
require "./lang/en/email_content.php";
require "./lang/".$ibforums->vars['default_language']."/email_content.php";
}
else
{
require "./lang/$language/email_content.php";
}
if (! isset($EMAIL[ $name ]) ) {
if (! isset($EMAIL[ $name ]) )
{
$this->fatal_error("Could not find an email template with an ID of '$name'", "");
}
$this->template = $EMAIL[ $name ];
$this->template = $EMAIL['header'] . $EMAIL[ $name ] . $EMAIL['footer'];
}
//+--------------------------------------------------------------------------
@@ -241,6 +254,8 @@ class emailer {
function clean_message($message = "" ) {
$message = preg_replace( "/^(\r|\n)+?(.*)$/", "\\2", $message );
$message = preg_replace( "#<b>(.+?)</b>#" , "\\1", $message );
$message = preg_replace( "#<i>(.+?)</i>#" , "\\1", $message );
$message = preg_replace( "#<s>(.+?)</s>#" , "--\\1--", $message );
@@ -266,8 +281,10 @@ class emailer {
$message = preg_replace( "#<!--EDIT\|.+?\|.+?-->#" , "" , $message );
$message = preg_replace( "#<.+?".">#" , "" , $message );
//$message = str_replace( "\r" , "" , $message );
//$message = str_replace( "\n\n", "\n" , $message );
$message = preg_replace( "/(<br>|\n)/" , "\r\n", $message );
$message = str_replace( "<br>" , "\n", $message );
$message = str_replace( "&quot;", "\"", $message );
$message = str_replace( "&#092;", "\\", $message );