_config = parse_ini_file('../config.ini', true); } else { $this->_config = parse_ini_file('config.ini', true); } // Setup Flexy $this->_options = &PEAR::getStaticProperty('HTML_Template_Flexy','options'); $this->_options = $this->_config['HTML_Template_Flexy']; $this->_options["templateDir"] = str_replace(";", PATH_SEPARATOR, $this->_options["templateDir"]); if(file_exists(".portal")) { $this->_options["templateDir"] .= PATH_SEPARATOR . "../Templates"; } // Set global email settings if($this->fromName == "") $this->fromName = $this->_config["site"]["email_name"]; if($this->fromEmail == "") $this->fromEmail = $this->_config["site"]["email_address"]; // Set other global settings foreach($this->_config["site"] as $k => $v) { $this->set($k, $v); } // Include REQUEST vars foreach($_REQUEST as $k => $v) { $this->set($k, $v); } } function set($var, $val) { $this->$var = $val; } function generateActivationCode($seed) { $seed .= date("His"); // Seed + 24 Hour , Minute , Second $this->actcode = md5($seed); return $this->actcode; } function includeFile($file) { $template = new HTML_Template_Flexy(); $template->compile("Email/".$file.".tpl"); return $template->bufferedOutputObject($this); } function includeBody() { return $this->includeFile("body_".$this->body); } function sendMessage() { // {unsubscribe_link} fix $this->unsubscribe_link = str_replace("{site_root}", $this->site_root, $this->unsubscribe_link); if($this->template != "") { $template = new HTML_Template_Flexy(); if($this->templateType == "file") { $template->compile("Email/".$this->template.".tpl"); } else { $filename = date("Ymd") . rand(10000, 99999) . ".tpl"; file_put_contents($this->_config["HTML_Template_Flexy"]["templateDir"]."/tmp/$filename", $this->template); $template->compile("tmp/$filename"); unlink($this->_config["HTML_Template_Flexy"]["templateDir"]."/tmp/$filename"); } $this->message = $template->bufferedOutputObject($this); } if($this->to == "") $this->to = $this->fromEmail; //$headers = "From: \"$this->fromName\" <$this->fromEmail>\nReply-To: $this->fromEmail\nContent-Type: text/html"; //mail($this->to, $this->subject, $this->message, $headers); //error_reporting(15); include_once('Mail.php'); include_once('Mail/mail.php'); $mail = Mail::factory("smtp", array("localhost", 25, "", "")); $headers = array("From" => $this->fromName . " <$this->fromEmail>", "Subject" => $this->subject, "Content-Type" => "text/html"); $mail->send($this->to, $headers, $this->message); } } ?> HTML_Template_Flexy fatal error:HTML_Template_Flexy::failed to write to Templates/compiled/body_home.tpl.en.php