ok. ich versuche es jetzt erneut.
vorweg tritt folgender fehler auf, wenn ich über ein kontakt-formular eine email versenden lassen will.
Warning: filesize() [function.filesize]: Stat failed for (errno=2 - No such file or directory) in /www/htdocs/inu/includes/emailer.php on line 98
tja. nun geht es um folgendes. die email wird versendet. jedoch wird das template irgendwie nicht angenommen. keine ahnung warum. am besten ich poste einmal hier alles wichtige:
funktion der emailer.php:
Code: Alles auswählen
function use_template($template_file)
{
global $boot_root_path;
if (trim($template_file) == '')
{
message_die(GENERAL_ERROR, 'No template file set', '', __LINE__, __FILE__);
}
if (empty($this->tpl_msg[$template_file]))
{
$tpl_file = $boot_root_path . 'email/' . $template_file . '.tpl';
if (!@file_exists(@phpbb_realpath($tpl_file)))
{
$tpl_file = $boot_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($this->tpl_file));
fclose($fd);
}
$this->msg = $this->tpl_msg[$template_file];
return true;
}
ausführung der funktionen in der jeweiligen datei. hier die contact.php:
Code: Alles auswählen
if ( !$error )
{
include($boot_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('contact_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'],
'L_NAME' => $name,
'L_EMAIL' => $email,
'L_CONTENT' => $content)
);
$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=contact">', '</a>'));
}
}
if ( $error )
{
message_die(GENERAL_MESSAGE, $error_msg);
}
und der code der template datei, die im pfad
root/email/contact_email.tpl vorliegt:
Code: Alles auswählen
Charset: iso-8859-1
{SITENAME}
{BOARD_EMAIL}
Die Nachricht :
~~~~~~~~~~~~~~~
Name: {L_NAME}
E-Mail: {L_EMAIL}
Nachricht: {L_CONTENT}
beim empfangen der email sehe ich zwar email adresse und subject aber nicht den email inhalt.
auffällig ist, dass in der fehlermeldung nach
Stat failed for der pfad der template datei nicht angezeigt wird.
bitte um hilfe. der fehler ist bestimmt banal aber ich finde ihn nicht.
HINWEIS: Wie man sieht lehnt sich diese ganze Code-Geschichte an phpbb an.