1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-08 07:36:32 +02:00

Reformat of code, small changes

This commit is contained in:
mcfly
2008-12-21 18:15:04 +00:00
parent 64b024a80f
commit 1c428e1d5a

View File

@@ -1,26 +1,24 @@
<?php <?php
/* /*
+ ----------------------------------------------------------------------------+ * e107 website system
| e107 website system *
| * Copyright (C) 2001-2008 e107 Inc (e107.org)
| <20>Steve Dunstan 2001-2002 * Released under the terms and conditions of the
| http://e107.org * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
| jalist@e107.org *
| * Forum plugin notify configuration
| Released under the terms and conditions of the *
| GNU General Public License (http://gnu.org). * $Source: /cvs_backup/e107_0.8/e107_handlers/notify_class.php,v $
| * $Revision: 1.4 $
| $Source: /cvs_backup/e107_0.8/e107_handlers/notify_class.php,v $ * $Date: 2008-12-21 18:15:04 $
| $Revision: 1.3 $ * $Author: mcfly_e107 $
| $Date: 2008-04-26 14:34:17 $ *
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/ */
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
class notify { class notify
{
var $notify_prefs; var $notify_prefs;
function notify() function notify()
@@ -39,7 +37,8 @@ class notify {
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php'); include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php');
} }
function send($id, $subject, $message) { function send($id, $subject, $message)
{
global $sql,$tp; global $sql,$tp;
e107_require_once(e_HANDLER.'mail.php'); e107_require_once(e_HANDLER.'mail.php');
$subject = SITENAME.': '.$subject; $subject = SITENAME.': '.$subject;
@@ -73,10 +72,14 @@ class notify {
} }
} }
global $nt;
$nt = new notify;
function notify_usersup($data) { global $nt;
$e107->notify = new notify;
$nt = &$e107->notify;
function notify_usersup($data)
{
global $nt; global $nt;
foreach ($data as $key => $value) foreach ($data as $key => $value)
{ {
@@ -98,7 +101,8 @@ function notify_usersup($data) {
$nt->send('usersup', NT_LAN_US_1, $message); $nt->send('usersup', NT_LAN_US_1, $message);
} }
function notify_userveri($data) { function notify_userveri($data)
{
global $nt, $e107; global $nt, $e107;
$msgtext = NT_LAN_UV_2.$data['user_id']."\n"; $msgtext = NT_LAN_UV_2.$data['user_id']."\n";
$msgtext .= NT_LAN_UV_3.$data['user_loginname']."\n"; $msgtext .= NT_LAN_UV_3.$data['user_loginname']."\n";
@@ -106,7 +110,8 @@ function notify_userveri($data) {
$nt->send('userveri', NT_LAN_UV_1, $msgtext); $nt->send('userveri', NT_LAN_UV_1, $msgtext);
} }
function notify_login($data) { function notify_login($data)
{
global $nt; global $nt;
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$message .= $key.': '.$value.'<br />'; $message .= $key.': '.$value.'<br />';
@@ -114,17 +119,20 @@ function notify_login($data) {
$nt->send('login', NT_LAN_LI_1, $message); $nt->send('login', NT_LAN_LI_1, $message);
} }
function notify_logout() { function notify_logout()
{
global $nt; global $nt;
$nt->send('logout', NT_LAN_LO_1, USERID.'. '.USERNAME.' '.NT_LAN_LO_2); $nt->send('logout', NT_LAN_LO_1, USERID.'. '.USERNAME.' '.NT_LAN_LO_2);
} }
function notify_flood($data) { function notify_flood($data)
{
global $nt; global $nt;
$nt->send('flood', NT_LAN_FL_1, NT_LAN_FL_2.': '.$data); $nt->send('flood', NT_LAN_FL_1, NT_LAN_FL_2.': '.$data);
} }
function notify_subnews($data) { function notify_subnews($data)
{
global $nt,$tp; global $nt,$tp;
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$message .= $key.': '.$value.'<br />'; $message .= $key.': '.$value.'<br />';
@@ -132,32 +140,38 @@ function notify_subnews($data) {
$nt->send('subnews', NT_LAN_SN_1, $message); $nt->send('subnews', NT_LAN_SN_1, $message);
} }
function notify_newspost($data) { function notify_newspost($data)
{
global $nt; global $nt;
$message = '<b>'.$data['news_title'].'</b><br /><br />'.$data['news_summary'].'<br /><br />'.$data['data'].'<br /><br />'.$data['news_extended']; $message = '<b>'.$data['news_title'].'</b><br /><br />'.$data['news_summary'].'<br /><br />'.$data['data'].'<br /><br />'.$data['news_extended'];
$nt->send('newspost', $data['news_title'], $message); $nt->send('newspost', $data['news_title'], $message);
} }
function notify_newsupd($data) { function notify_newsupd($data)
{
global $nt; global $nt;
$message = '<b>'.$data['news_title'].'</b><br /><br />'.$data['news_summary'].'<br /><br />'.$data['data'].'<br /><br />'.$data['news_extended']; $message = '<b>'.$data['news_title'].'</b><br /><br />'.$data['news_summary'].'<br /><br />'.$data['data'].'<br /><br />'.$data['news_extended'];
$nt->send('newsupd', NT_LAN_NU_1.': '.$data['news_title'], $message); $nt->send('newsupd', NT_LAN_NU_1.': '.$data['news_title'], $message);
} }
function notify_newsdel($data) { function notify_newsdel($data)
{
global $nt; global $nt;
$nt->send('newsdel', NT_LAN_ND_1, NT_LAN_ND_2.': '.$data); $nt->send('newsdel', NT_LAN_ND_1, NT_LAN_ND_2.': '.$data);
} }
function notify_fileupload($data) { function notify_fileupload($data)
{
global $nt; global $nt;
$message = '<b>'.$data['upload_name'].'</b><br /><br />'.$data['upload_description'].'<br /><br />'.$data['upload_size'].'<br /><br />'.$data['upload_user']; $message = '<b>'.$data['upload_name'].'</b><br /><br />'.$data['upload_description'].'<br /><br />'.$data['upload_size'].'<br /><br />'.$data['upload_user'];
$nt->send('fileupload', $data['upload_name'], $message); $nt->send('fileupload', $data['upload_name'], $message);
} }
if (isset($nt -> notify_prefs['plugins'])) { if (isset($nt->notify_prefs['plugins']))
foreach ($nt -> notify_prefs['plugins'] as $plugin_id => $plugin_settings) { {
foreach ($nt->notify_prefs['plugins'] as $plugin_id => $plugin_settings)
{
if(is_readable(e_PLUGIN.$plugin_id.'/e_notify.php')) if(is_readable(e_PLUGIN.$plugin_id.'/e_notify.php'))
{ {
require_once(e_PLUGIN.$plugin_id.'/e_notify.php'); require_once(e_PLUGIN.$plugin_id.'/e_notify.php');