|
 | | |
| Autor | Správa |
JanoF
 Správca fóra
 Založený: 01.05.2005 Príspevky: 8736 Bydlisko: Bratislava Vek: 27
 | Zaslal: So 14.10.06 15:13 |   |
| kód: | ##############################################################
## MOD Title: Email on Errors
## MOD Author: aboyd < N/A > (N/A) http://www.outshine.com/forums/
## MOD Description: Emails the admin address when phpBB errors out.
## MOD Version: 1.0
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: includes/functions.php
##
## Included Files: N/A
##############################################################
## For Security Purposes, Please Check: http://www.outshine.com/ for
## the latest version of this MOD. Downloading this MOD from other sites could
## cause malicious code to enter into your phpBB Forum.
##############################################################
## Author Notes: This is not an official mod from phpBB. It is licensed under
## the GPL, which should have been included. If you find bugs, visit:
## http://www.outshine.com/forums/
##
##############################################################
## MOD History:
##
## 2005-07-23 - Version 1.0
## - Initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To
## This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
$template->pparse('message_body');
#
#-----[ AFTER, ADD ]------------------------------------------
#
/*
Adding email here so I can be aware of errors. Avoid using phpBB-specific
code (such as the built-in emailer class), in case that's part of the error.
*/
if ($msg_code == GENERAL_ERROR) {
if (isset($board_config['board_email'])) {
$email_from = 'From: ' . $board_config['board_email'] . "\n";
$email_to = $board_config['board_email'];
$email_username = (isset($userdata['username'])) ? $userdata['username']: '';
$email_username = ($email_username == '') ? 'no defined username': $email_username;
$email_subject = 'FORUM ERROR';
$email_body = $msg_title . " Message:\n\n" . $msg_text . "\n\n\nIP: " . $_SERVER['REMOTE_ADDR'] . "\nUSER: " . $email_username . "\nURL: " . $_SERVER['REQUEST_URI'] . "\n\nFORM:\n" . print_r($_POST, true);
mail($email_to, $email_subject, $email_body, $email_from);
}
}
#
#-----[ FIND ]------------------------------------------
#
echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>";
#
#-----[ BEFORE, ADD ]------------------------------------------
#
/*
Adding email here so I can be aware of errors. Avoid using phpBB-specific
code (such as the built-in emailer class), in case that's part of the error.
TO DO: drop this into a function so the code isn't duplicated.
*/
if (isset($board_config['board_email'])) {
$email_from = 'From: ' . $board_config['board_email'] . "\n";
$email_to = $board_config['board_email'];
$email_username = (isset($userdata['username'])) ? $userdata['username']: '';
$email_username = ($email_username == '') ? 'no defined username': $email_username;
$email_subject = 'FORUM ERROR';
$email_body = $msg_title . " Message:\n\n" . $msg_text . "\n\n\nIP: " . $_SERVER['REMOTE_ADDR'] . "\nUSER: " . $email_username . "\nURL: " . $_SERVER['REQUEST_URI'] . "\n\nFORM:\n" . print_r($_POST, true);
mail($email_to, $email_subject, $email_body, $email_from);
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM |
|
_________________ Skrinka: Nexus Morpho & Enermax UCTB12P | Zdroj: Enermax EMG800AWT 800W | Základná doska: Asus Rampage III Gene | Procesor: Intel Core i7 990X Extreme Edition 3.46 GHz & Scythe Susanoo SCSO-1000 | Pamäť: Kingston HyperX XMP 24 GB DDR3 1600 MHz | Grafická karta: Asus GeForce GT 440 1 GB DDR3 & Thermalright HR-03 | Pevný disk: Intel SSD 510 Series 250 GB & Hitachi Deskstar 5K4000 4000 GB | Optická mechanika: Plextor PX-820SA | Čítačka kariet: Akasa AK-ICR-11 | Klávesnica: Logitech G19 | Myš: Logitech G9x & Razer Kabuto | Monitor: 24" LCD Eizo FlexScan S2431WE | Reproduktory: Logitech Z-2300 | Operačný systém: Microsoft Windows 7 & FreeBSD 9 | Záložný zdroj: APC Back-UPS ES 700 | Spotreba: Idle - 200W / Burn - 400W | Mobil: Nokia N9 64 GB | |
       |
 |
|
Nemôžete pridávať nové témy do tohto fóra. Nemôžete odpovedať na témy v tomto fóre. Nemôžete upravovať svoje príspevky v tomto fóre. Nemôžete mazať svoje príspevky v tomto fóre. Nemôžete hlasovať v tomto fóre.
|
| |