function sc_admin_status($parm) { if ($parm == 'infopanel' && e_PAGE != 'admin.php') { return; } if (getperms('0') || getperms('4')) { if (!function_exists('admin_status')) { function admin_status($parm = '') { $mes = e107::getMessage(); $sql = e107::getDb(); $ns = e107::getRender(); $pref = e107::getPref(); $members = $sql->count('user', '(*)', 'WHERE user_ban=0'); $unverified = $sql->count('user', '(*)', 'WHERE user_ban=2'); $banned = $sql->count('user', '(*)', 'WHERE user_ban=1'); $comments = $sql->count('comments'); /* $unver = ($unverified ? " <a href='".e_ADMIN."users.php?searchquery=&filter_options=user_ban__2&filter=unverified'> ".ADLAN_111.": {$unverified}</a>" : ADLAN_111); $lban = ($banned) ? "<a href='".e_ADMIN_ABS."users.php??searchquery=&filter_options=user_ban__1&filter=banned'>".ADLAN_112. ": ".$banned."</a>" : ADLAN_112.":"; $lcomment = ($comments) ? "<a href='".e_ADMIN_ABS."comment.php'>".ADLAN_114.": ".$comments."</a>" : ADLAN_114; $text = " <div class='left'> <div style='padding-bottom: 2px;'>". E_16_USER." <a href='".e_ADMIN_ABS."users.php?filter=0'>".ADLAN_110.": ".$members."</a></div> <div style='padding-bottom: 2px;'>".E_16_USER." {$unver}</div> <div style='padding-bottom: 2px;'>".E_16_BANLIST." ".$lban."</div> <div style='padding-bottom: 2px;'>".E_16_COMMENT." ".$lcomment."</div>\n\n"; */ // for BC only. $oldconfigs['e-user'][0] = array('icon' => E_16_USER, 'title' => ADLAN_110, 'url' => e_ADMIN_ABS . "users.php?searchquery=&filter_options=user_ban__0", 'total' => $members, 'invert' => 1); $oldconfigs['e-user'][1] = array('icon' => E_16_USER, 'title' => ADLAN_111, 'url' => e_ADMIN . "users.php?searchquery=&filter_options=user_ban__2", 'total' => $unverified); $oldconfigs['e-user'][2] = array('icon' => E_16_BANLIST, 'title' => ADLAN_112, 'url' => e_ADMIN . "users.php?searchquery=&filter_options=user_ban__1", 'total' => $banned); if (empty($pref['comments_disabled']) && varset($pref['comments_engine'], 'e107') == 'e107') { $oldconfigs['e-comments'][0] = array('icon' => E_16_COMMENT, 'title' => LAN_COMMENTS, 'url' => e_ADMIN_ABS . "comment.php", 'total' => $comments); } if ($flo = $sql->count('generic', '(*)', "WHERE gen_type='failed_login'")) { //$text .= "\n\t\t\t\t\t<div style='padding-bottom: 2px;'>".E_16_FAILEDLOGIN." <a href='".e_ADMIN_ABS."fla.php'>".ADLAN_146.": $flo</a></div>"; $oldconfigs['e-failed'][0] = array('icon' => E_16_FAILEDLOGIN, 'title' => ADLAN_146, 'url' => e_ADMIN_ABS . "banlist.php?mode=failed&action=list", 'total' => $flo); } if ($emls = $sql->count('mail_recipients', '(*)', "WHERE mail_status = 13")) { //$text .= "\n\t\t\t\t\t<div style='padding-bottom: 2px;'>".E_16_FAILEDLOGIN." <a href='".e_ADMIN_ABS."fla.php'>".ADLAN_146.": $flo</a></div>"; $oldconfigs['e-mailout'][0] = array('icon' => E_16_MAIL, 'title' => "Pending Mailshots", 'url' => e_ADMIN_ABS . "mailout.php?mode=pending&action=list", 'total' => $emls); } if (vartrue($pref['e_status_list'])) { foreach ($pref['e_status_list'] as $val) { $text = ""; if (is_readable(e_PLUGIN . $val . '/e_status.php')) { include_once e_PLUGIN . $val . '/e_status.php'; if (!class_exists($val . "_status")) { $mes->addDebug("<strong>" . $val . "</strong> using deprecated e_status method. See the chatbox plugin folder for a working example of the new one. "); } $oldconfigs[$val] = admin_shortcodes::legacyToConfig($text); } } } // New in v2.x // $configs = e107::getAddonConfig('e_status'); $configs = e107::getAddonConfig('e_dashboard', null, 'status'); if (!is_array($configs)) { $configs = array(); } $allconfigs = array_merge($oldconfigs, $configs); $allconfigs = multiarray_sort($allconfigs, 'title'); //XXX FIXME - not sorting correctly. $text = "<ul id='e-status' class='unstyled list-unstyled'>"; foreach ($allconfigs as $k => $v) { foreach ($v as $val) { $type = empty($val['invert']) ? 'latest' : 'invert'; $class = admin_shortcodes::getBadge($val['total'], $type); $link = "<a href='" . $val['url'] . "'>" . str_replace(":", " ", $val['title']) . " <span class='" . $class . "'>" . $val['total'] . "</span></a>"; $text .= "<li>" . $val['icon'] . " " . $link . "</li>\n"; } } $text .= "</ul>"; if ($parm == 'list') { // $text = str_replace("<div style='padding-bottom: 2px;'>","<li>",$text);; } // $text .= "\n\t\t\t\t\t</div>"; return $parm != 'norender' ? $ns->tablerender(LAN_STATUS, $text, '', TRUE) : $text; } } if ($parm == 'request') { if (function_exists('status_request')) { if (status_request()) { return admin_status($parm); } } } else { return admin_status($parm); } } }
function sc_admin_status($parm) { if (getperms('0') || getperms('4')) { if (!function_exists('admin_status')) { function admin_status($parm = '') { global $sql, $ns, $pref; $members = $sql->db_Count('user'); $unverified = $sql->db_Count('user', '(*)', 'WHERE user_ban=2'); $banned = $sql->db_Count('user', '(*)', 'WHERE user_ban=1'); $comments = $sql->db_Count('comments'); $unver = $unverified ? " <a href='" . e_ADMIN . "users.php?searchquery=&filter_options=user_ban__2&filter=unverified'>" . ADLAN_111 . "</a>" : ADLAN_111; $text = "\n\t\t\t\t\t<div class='left'>\n\t\t\t\t\t\t<div style='padding-bottom: 2px;'>" . E_16_USER . " " . ADLAN_110 . ": <a href='" . e_ADMIN_ABS . "users.php?filter=0'>" . $members . "</a></div>\n\t\t\t\t\t\t<div style='padding-bottom: 2px;'>" . E_16_USER . " {$unver}: <a href='" . e_ADMIN_ABS . "users.php?filter=unverified'>" . $unverified . "</a></div>\n\t\t\t\t\t\t<div style='padding-bottom: 2px;'>" . E_16_BANLIST . " " . ADLAN_112 . ": <a href='" . e_ADMIN_ABS . "users.php?filter=banned'>" . $banned . "</a></div>\n\t\t\t\t\t\t<div style='padding-bottom: 2px;'>" . E_16_COMMENT . " " . ADLAN_114 . ": <a href='" . e_ADMIN_ABS . "comment.php'>" . $comments . "</a></div>"; if (vartrue($pref['e_status_list'])) { foreach ($pref['e_status_list'] as $val) { if (is_readable(e_PLUGIN . $val . '/e_status.php')) { include_once e_PLUGIN . $val . '/e_status.php'; } } } if ($flo = $sql->db_Count('generic', '(*)', "WHERE gen_type='failed_login'")) { $text .= "<img src='" . e_IMAGE_ABS . "admin_images/failedlogin_16.png' alt='' class='icon S16' /> <a href='" . e_ADMIN_ABS . "fla.php'>" . ADLAN_146 . ": {$flo}</a>"; } $text .= "</div>"; return $parm != 'norender' ? $ns->tablerender(LAN_STATUS, $text, '', TRUE) : $text; } } if ($parm == 'request') { if (function_exists('status_request')) { if (status_request()) { return admin_status($parm); } } } else { return admin_status($parm); } } }