problem mit emailer.php
Verfasst: 19.12.2004 15:26
hi. also ich habe ein problem mit dem email system von phpbb. ich übertrage ja schon das templatesystem auf meine homepage nun möchte ich auch die emailer klasse übernehmen. soweit so gut, doch stellt sich ein fehler heraus (s.u.)
ANMERKUNG: das languages-system von phpbb nutze ich nicht.
use_template function der emailer.php
ausführung der news_send.php
email template im ordner: root/email/news_send_email.tpl
folgende fehlermeldung:
ANMERKUNG: das languages-system von phpbb nutze ich nicht.
use_template function der emailer.php
Code: Alles auswählen
function use_template($template_file)
{
global $inu_root_path;
if (trim($template_file) == '')
{
message_die(GENERAL_ERROR, 'No template file set', '', __LINE__, __FILE__);
}
if (empty($this->tpl_msg[$template_file]))
{
if (!@file_exists(@phpbb_realpath($tpl_file)))
{
$tpl_file = $inu_root_path . 'email/' . $template_file . '.tpl';
if (!@file_exists(@phpbb_realpath($tpl_file)))
{
message_die(GENERAL_ERROR, 'Could not find email template file :: ' . $template_file, '', __LINE__, __FILE__);
}
}
if (!($fd = @fopen($tpl_file, 'r')))
{
message_die(GENERAL_ERROR, 'Failed opening template file :: ' . $tpl_file, '', __LINE__, __FILE__);
}
$this->tpl_msg[$template_file] = fread($fd, filesize($tpl_file));
fclose($fd);
}
$this->msg = $this->tpl_msg[$template_file];
return true;
}
Code: Alles auswählen
if ( !$error )
{
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer(0);
$emailer->from($page_config['page_email']);
$emailer->replyto($page_config['page_email']);
for ($i = 0; $i < count($bcc_list); $i++)
{
$emailer->bcc($bcc_list[$i]);
}
$email_headers = 'X-AntiAbuse: Board servername - ' . $page_config['server_name'] . "\n";
$emailer->use_template('news_send_email');
$emailer->email_address($page_config['page_email']);
$emailer->set_subject($subject);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'SITENAME' => $page_config['page_name'],
'BOARD_EMAIL' => $page_config['page_email'],
'MESSAGE' => $message)
);
$emailer->send();
$emailer->reset();
message_die(GENERAL_MESSAGE, 'E-Mail wurde gesendet<br /><br />' . sprintf('Hier klicken, um zurück zu kehren', '<a href="index.'.$phpEx.'?show=news_send">', '</a>'));
}
folgende fehlermeldung:
warum findet er die template-datei nicht, obwohl doch der pfad etc. richtig angegeben ist?Template->make_filename(): Error - file does not exist