diff --git a/class2.php b/class2.php index 2a19ed1d9..15f8eac4e 100755 --- a/class2.php +++ b/class2.php @@ -656,6 +656,12 @@ if(!isset($_E107['no_event'])) $dbg->logTime('Register Core Events'); e107::getNotify()->registerEvents(); } + +if(!defined('SITENAME')) // Allow override by English_custom.php or English_global.php plugin files. +{ + define('SITENAME', trim($tp->toHTML($pref['sitename'], '', 'USER_TITLE,er_on,defs'))); +} + // // O: Start user session // @@ -680,10 +686,7 @@ $developerMode = (vartrue($pref['developer'],false) || E107_DEBUG_LEVEL > 0); // for multi-language these definitions needs to come after the language loaded. -if(!defined('SITENAME')) // Allow override by English_custom.php or English_global.php plugin files. -{ - define('SITENAME', trim($tp->toHTML($pref['sitename'], '', 'USER_TITLE,er_on,defs'))); -} + if(!defined('SITEDESCRIPTION')) // Allow override by English_custom.php or English_global.php plugin files. { define('SITEDESCRIPTION', $tp->toHTML($pref['sitedescription'], '', 'emotes_off,defs')); diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index c56da6f20..de62f558d 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -3363,7 +3363,7 @@ class e107 $path = self::templatePath($plug_name, $id, $override); - if(ADMIN && E107_DBG_INCLUDES) + if(deftrue('ADMIN') && E107_DBG_INCLUDES) { self::getMessage()->addDebug( "Attempting to load Template File: ".$path ); } diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 80fb8bc2a..c8967e7f4 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -3045,7 +3045,7 @@ class e_parse $e107::getFolder('web'), $e107->site_theme ? $e107::getFolder('themes') . $e107->site_theme . '/' : '', defset('THEME_ABS'), - (ADMIN ? $e107::getFolder('admin') : ''), + (deftrue('ADMIN') ? $e107::getFolder('admin') : ''), '', $e107::getFolder('core'), $e107::getFolder('system'), @@ -3109,7 +3109,7 @@ class e_parse SITEURLBASE . e_WEB_ABS, defset('THEME_ABS') ? SITEURLBASE . THEME_ABS : '', defset('THEME_ABS') ? SITEURLBASE . THEME_ABS : '', - (ADMIN ? SITEURLBASE . e_ADMIN_ABS : ''), + (deftrue('ADMIN') ? SITEURLBASE . e_ADMIN_ABS : ''), SITEURL, '', // no e_CORE absolute path '', // no e_SYSTEM absolute path @@ -5261,7 +5261,7 @@ class e_parse { $this->grantScriptAccess(); } - elseif(ADMIN && (strpos($html, '') !== false)) + elseif(deftrue('ADMIN') && (strpos($html, '') !== false)) { $lan1 = defset('LAN_NO_SCRIPT_ACCESS', "You don't have permission to use [script] tags."); $lan2 = defset('', "If you believe this is an error, please ask the main administrator to grant you script access via [b]Preferences > Content Filters[/b]"); diff --git a/e107_handlers/notify_class.php b/e107_handlers/notify_class.php index a83b0e059..49d6a2ed9 100644 --- a/e107_handlers/notify_class.php +++ b/e107_handlers/notify_class.php @@ -231,7 +231,7 @@ class notify $devMode = e107::getPref('developer', false); - if((ADMIN || $devMode) && E107_DEBUG_LEVEL > 0 || deftrue('e_DEBUG_NOTIFY')) + if((deftrue('ADMIN') || $devMode) && E107_DEBUG_LEVEL > 0 || deftrue('e_DEBUG_NOTIFY')) { $data = array('id'=>$id, 'subject'=>$subject, 'recipients'=> $recipients, 'prefs'=>$this->notify_prefs['event'][$id], 'message'=>$message); diff --git a/e107_handlers/user_model.php b/e107_handlers/user_model.php index e989eb298..875927262 100644 --- a/e107_handlers/user_model.php +++ b/e107_handlers/user_model.php @@ -2140,6 +2140,7 @@ class e_user extends e_user_model $this->set('last_ip', $this->get('user_ip')); $current_ip = e107::getIPHandler()->getIP(); $update_ip = ''; + $edata = []; if($this->get('user_ip') != $current_ip) { @@ -2152,12 +2153,11 @@ class e_user extends e_user_model 'user_name' => $this->get('user_name'), ]; - e107::getEvent()->trigger('user_ip_changed', $edata); // new v2.3.3 + } - - $update_ip = ($this->get('user_ip') != $current_ip) ? ", user_ip = '".$current_ip."'" : ''; $this->set('user_ip', $current_ip); + if($this->get('user_currentvisit') + 3600 < time() || !$this->get('user_lastvisit')) { $this->set('user_lastvisit', (integer) $this->get('user_currentvisit')); @@ -2169,6 +2169,11 @@ class e_user extends e_user_model $this->set('user_currentvisit', time()); $sql->update('user', "user_currentvisit = ".$this->get('user_currentvisit').$update_ip." WHERE user_id = ".$this->getId()." LIMIT 1 "); } + + if(!empty($edata)) + { + e107::getEvent()->trigger('user_ip_changed', $edata); // new v2.3.3 + } } }