update(); } $nc -> config(); class notify_config { var $notify_prefs; function notify_config() { global $sysprefs, $eArrayStorage, $tp, $sql; $this -> notify_prefs = $sysprefs -> get('notify_prefs'); $this -> notify_prefs = $eArrayStorage -> ReadArray($this -> notify_prefs); $handle = opendir(e_PLUGIN); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)) { $plugin_handle = opendir(e_PLUGIN.$file."/"); while (false !== ($file2 = readdir($plugin_handle))) { if ($file2 == "e_notify.php") { if ($sql -> db_Select("plugin", "plugin_path", "plugin_path='".$file."' AND plugin_installflag='1'")) { if (!isset($this -> notify_prefs['plugins'][$file])) { $this -> notify_prefs['plugins'][$file] = TRUE; require_once(e_PLUGIN.$file.'/e_notify.php'); foreach ($config_events as $event_id => $event_text) { $this -> notify_prefs['event'][$event_id] = array('type' => 'off', 'class' => '254', 'email' => ''); } $recalibrate = true; } } } } } } if ($recalibrate) { $s_prefs = $tp -> toDB($this -> notify_prefs); $s_prefs = $eArrayStorage -> WriteArray($s_prefs); $sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'"); } } function config() { global $ns, $rs; $text = "
"; $text .= ""; $text .= $this -> render_event('usersup', NU_LAN_2); $text .= $this -> render_event('userveri', NU_LAN_3); $text .= $this -> render_event('login', NU_LAN_4); $text .= $this -> render_event('logout', NU_LAN_5); $text .= ""; $text .= $this -> render_event('flood', NS_LAN_2); $text .= ""; $text .= $this -> render_event('subnews', NN_LAN_2); $text .= $this -> render_event('newspost', NN_LAN_3); $text .= $this -> render_event('newsupd', NN_LAN_4); $text .= $this -> render_event('newsdel', NN_LAN_5); foreach ($this -> notify_prefs['plugins'] as $plugin_id => $plugin_settings) { require(e_PLUGIN.$plugin_id.'/e_notify.php'); $text .= ""; foreach ($config_events as $event_id => $event_text) { $text .= $this -> render_event($event_id, $event_text); } } $text .= "
".NT_LAN_2.":
".NU_LAN_1."
".NS_LAN_1."
".NN_LAN_1."
".$config_category."
".$rs -> form_button('submit', 'update', LAN_UPDATE)."
"; $ns -> tablerender(NT_LAN_1, $text); } function render_event($id, $description) { global $rs, $tp; $text .= " ".$description.": notify_prefs['event'][$id]['type'] == 'off' || !$this -> notify_prefs['event'][$id]['type']) ? " checked='checked'" : "")." /> ".NT_LAN_3." notify_prefs['event'][$id]['type'] == 'main' ? " checked='checked'" : "")." /> ".NT_LAN_4." notify_prefs['event'][$id]['type'] == 'class' ? " checked='checked'" : "")." /> ".NT_LAN_5.": ".r_userclass('event['.$id.'][class]', $this -> notify_prefs['event'][$id]['class'], 'off', 'member,admin,classes')." notify_prefs['event'][$id]['type'] == 'email' ? " checked='checked'" : "")." /> ".NT_LAN_6.": ".$rs -> form_text('event['.$id.'][email]', 17, $tp -> toForm($this -> notify_prefs['event'][$id]['email']))." "; return $text; } function update() { global $sql, $pref, $tp, $eArrayStorage; foreach ($_POST['event'] as $key => $value) { if ($this -> update_event($key)) { $active = TRUE; } } $s_prefs = $tp -> toDB($this -> notify_prefs); $s_prefs = $eArrayStorage -> WriteArray($s_prefs); $sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'"); if ($active) { $pref['notify'] = TRUE; } else { $pref['notify'] = FALSE; } save_prefs(); } function update_event($id) { $this -> notify_prefs['event'][$id]['type'] = $_POST['event'][$id]['type']; $this -> notify_prefs['event'][$id]['class'] = $_POST['event'][$id]['class']; $this -> notify_prefs['event'][$id]['email'] = $_POST['event'][$id]['email']; if ($this -> notify_prefs['event'][$id]['type'] != 'off') { return TRUE; } else { return FALSE; } } } require_once('footer.php'); ?>