diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index c88a0f4cf..0d2da000b 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -314,6 +314,7 @@ class admin_shortcodes $sql = e107::getDb(); $ns = e107::getRender(); $pref = e107::getPref(); + $mes = e107::getMessage(); $active_uploads = $sql -> db_Count('upload', '(*)', 'WHERE upload_active = 0'); $submitted_news = $sql -> db_Count('submitnews', '(*)', 'WHERE submitnews_auth = 0'); @@ -324,6 +325,8 @@ class admin_shortcodes $text .= "
".E_16_UPLOADS.($active_uploads ? " ".ADLAN_LAT_7.": $active_uploads" : ' '.ADLAN_LAT_7.': '.$active_uploads).'
'; + + // for BC only. if(vartrue($pref['e_latest_list'])) { foreach($pref['e_latest_list'] as $val) @@ -331,10 +334,27 @@ class admin_shortcodes if (is_readable(e_PLUGIN.$val.'/e_latest.php')) { include_once(e_PLUGIN.$val.'/e_latest.php'); + if(!class_exists($val."_latest")) + { + $mes->addDebug("".$val ." using deprecated e_latest method"); + } } } } + + + $configs = e107::getAddonConfig('e_latest'); + foreach($configs as $k=>$v) + { + foreach($v as $val) + { + $link = "".$val['title'].": ".$val['total'].""; + $text .= "
".$val['icon']." ".$link."
\n"; + } + } + + $messageTypes = array('Broken Download', 'Dev Team Message'); $queryString = ''; foreach($messageTypes as $types) @@ -924,7 +944,12 @@ class admin_shortcodes { function admin_status($parm='') { - global $sql, $ns, $pref; + $mes = e107::getMessage(); + $sql = e107::getDb(); + $ns = e107::getRender(); + $pref = e107::getPref(); + + $members = $sql -> db_Count('user'); $unverified = $sql -> db_Count('user', '(*)', 'WHERE user_ban=2'); $banned = $sql -> db_Count('user', '(*)', 'WHERE user_ban=1'); @@ -940,7 +965,9 @@ class admin_shortcodes
".E_16_USER." {$unver}
".E_16_BANLIST." ".$lban."
".E_16_COMMENT." ".$lcomment."
\n\n"; + + // for BC only. if(vartrue($pref['e_status_list'])) { foreach($pref['e_status_list'] as $val) @@ -949,10 +976,26 @@ class admin_shortcodes if (is_readable(e_PLUGIN.$val.'/e_status.php')) { include_once(e_PLUGIN.$val.'/e_status.php'); + if(!class_exists($val."_status")) + { + $mes->addDebug("".$val ." using deprecated e_status method"); + } } } } + // New in v2.x + $configs = e107::getAddonConfig('e_status'); + foreach($configs as $k=>$v) + { + foreach($v as $val) + { + $link = "".$val['title'].": ".$val['total'].""; + $text .= "
".$val['icon']." ".$link."
\n"; + } + } + + if($flo = $sql->db_Count('generic', '(*)', "WHERE gen_type='failed_login'")) { $text .= "\n\t\t\t\t\t
".E_16_FAILEDLOGIN." ".ADLAN_146.": $flo
"; diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 99f350d4f..b673232e3 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -1632,6 +1632,7 @@ class e107 public function getAddonConfig($addonName, $className = '') { $new_addon = array(); + $sql = e107::getDb(); // Might be used by older plugins. $filename = $addonName; // e.g. 'e_cron'; if(!$className) diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 4a28480b8..b51a464b8 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -1977,7 +1977,9 @@ class e107plugin $method_name = $what."_".$when; - // {PLUGIN}_setup.php should ALWAYS be the name. + // {PLUGIN}_setup.php should ALWAYS be the name of the file.. + + // if (varset($this->plug_vars['@attributes']['setupFile'])) // { // $setup_file = e_PLUGIN.$this->plugFolder.'/'.$this->plug_vars['@attributes']['setupFile']; @@ -2011,13 +2013,13 @@ class e107plugin } else { - $mes->add("Setup Class ".$class_name." NOT found.", E_MESSAGE_DEBUG); + // $mes->add("Setup Class ".$class_name." NOT found.", E_MESSAGE_DEBUG); return FALSE; } } else { - $mes->add("Optional Setup File NOT Found ".$path."_setup.php ", E_MESSAGE_DEBUG); + //$mes->add("Optional Setup File NOT Found ".$path."_setup.php ", E_MESSAGE_DEBUG); } return FALSE; // IMPORTANT. diff --git a/e107_plugins/chatbox_menu/e_status.php b/e107_plugins/chatbox_menu/e_status.php index edb3224c2..112e8d967 100644 --- a/e107_plugins/chatbox_menu/e_status.php +++ b/e107_plugins/chatbox_menu/e_status.php @@ -25,6 +25,22 @@ if (!defined('e107_INIT')) { exit; } -$chatbox_posts = $sql -> db_Count('chatbox'); -$text .= "
".ADLAN_115.": ".$chatbox_posts."
"; +class chatbox_menu_status // include plugin-folder in the name. +{ + function config() + { + $sql = e107::getDb(); + $chatbox_posts = $sql -> db_Count('chatbox'); + + $var[0]['icon'] = " "; + $var[0]['title'] = ADLAN_115; + $var[0]['url'] = e_PLUGIN."chatbox_menu/admin_chatbox.php"; + $var[0]['total'] = $chatbox_posts; + + return $var; + } +} + + + ?> \ No newline at end of file diff --git a/e107_plugins/forum/e_latest.php b/e107_plugins/forum/e_latest.php index 8bb54028f..d5ed86e9c 100644 --- a/e107_plugins/forum/e_latest.php +++ b/e107_plugins/forum/e_latest.php @@ -1,15 +1,22 @@ db_Count('generic', '(*)', "WHERE gen_type='reported_post' OR gen_type='Reported Forum Post'"); -$text .= "
- "; -if ($reported_posts) { - $text .= "".ADLAN_LAT_6.": ".$reported_posts.""; -} else { - $text .= ADLAN_LAT_6.": ".$reported_posts; +class forum_latest // include plugin-folder in the name. +{ + function config() + { + $sql = e107::getDb(); + $reported_posts = $sql->db_Count('generic', '(*)', "WHERE gen_type='reported_post' OR gen_type='Reported Forum Post'"); + + $var[0]['icon'] = E_16_FORUM; + $var[0]['title'] = ADLAN_LAT_6; + $var[0]['url'] = e_PLUGIN."forum/forum_admin.php"; + $var[0]['total'] = $reported_posts; + + return $var; + } } -$text .= '
'; + ?> \ No newline at end of file diff --git a/e107_plugins/forum/e_status.php b/e107_plugins/forum/e_status.php index 363752aba..3dcb5114f 100644 --- a/e107_plugins/forum/e_status.php +++ b/e107_plugins/forum/e_status.php @@ -1,6 +1,20 @@ db_Count('forum_post'); -$text .= "
".E_16_FORUM." ".ADLAN_113.": ".$forum_posts."
"; + +class forum_status // include plugin-folder in the name. +{ + function config() + { + $sql = e107::getDb(); + $forum_posts = $sql->db_Count('forum_post'); + + $var[0]['icon'] = E_16_FORUM; + $var[0]['title'] = ADLAN_113; + $var[0]['url'] = e_PLUGIN."forum/forum_admin.php"; + $var[0]['total'] = $forum_posts; + + return $var; + } +} ?> \ No newline at end of file