super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation"); $stats['changes'] = $row['count']; $row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how > '0'"); $stats['incr'] = $row['count']; $row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how < '0'"); $stats['decr'] = $row['count']; $row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how = 'totalminus'"); $stats['tot_m'] = $row['count']; $row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how = 'totalplus'"); $stats['tot_p'] = $row['count']; $row = $db->super_query("SELECT COUNT(*) as count FROM ".USERPREFIX."_users WHERE repa_off='1'"); $stats['repa_off'] = $row['count']; $row = $db->super_query("SELECT COUNT(*) as count FROM ".USERPREFIX."_users WHERE r_freeze='1'"); $stats['r_freeze'] = $row['count']; function show_stats() { global $repa_cf, $stats, $lang, $lang_repa; if ($repa_cf['status'] == 'yes') $repastatus = ''.$lang_repa['repa_st_on'].''; else $repastatus = ''.$lang_repa['repa_st_off'].''; echo "
{$lang_repa['repa_st_st']}{$repastatus}
{$lang_repa['repa_st_ca']}{$stats['changes']}
{$lang_repa['repa_st_in']}{$stats['incr']}
{$lang_repa['repa_st_tot_p']}{$stats['tot_p']}
{$lang_repa['repa_st_es']}{$stats['decr']}
{$lang_repa['repa_st_tot_m']}{$stats['tot_m']}
{$lang_repa['repa_st_repa_off']}{$stats['repa_off']}
{$lang_repa['repa_st_freeze']}{$stats['r_freeze']}
"; } echoheader("options", $lang_repa['repa_options']); $options = array(); $options['menu'] = array( array( 'name' => $lang_repa['repa_m_opts'], 'url' => "$PHP_SELF?mod=repa&action=opt", 'descr' => $lang_repa['repa_m_sub'], 'image' => "repa_opt.png", 'access' => "1", ), array( 'name' => $lang_repa['repa_control'], 'url' => "$PHP_SELF?mod=repa&action=control", 'descr' => $lang_repa['repa_con_sub'], 'image' => "repa_control.png", 'access' => "1", ), ); foreach($options as $sub_options => $value) { $count_options = count($value); for($i=0; $i < $count_options; $i++){ if($member_db[1] > $value[$i]['access'] AND $value[$i]['access'] != "all"){ unset($options[$sub_options][$i]); } } } $subs = 0; foreach($options as $sub_options) { if (!count($sub_options)) continue; echo << HTML; } echo <<
HTML; $i=0; foreach($sub_options as $option) { if ($i > 1) {echo ""; $i=0;} $i++; echo <<
HTML; } if ($_REQUEST['save_moderation']) { include_once SYSTEM_DIR.'/data/repa.php'; $user = $db->query("SELECT user_id, name, repa FROM ".PREFIX."_users"); while ($row = $db->get_row($user)) { $repa_plus = 0; $repa_minus = 0; $repa_pereschet = $db->query("SELECT * FROM " . PREFIX . "_reputation WHERE komu = '$row[name]'"); while ($row_min = $db->get_row($repa_pereschet)) { if ($row_min['how'] < 0 OR $row_min['how'] == "totalminus") { if ($row_min['how'] == "totalminus") $repa_minus = $repa_minus + $repa_cf['adm_minus']; else $repa_minus = $repa_minus + $row_min['how']; } else { if ($row_min['how'] == "totalplus") $repa_plus = $repa_plus + $repa_cf['adm_plus']; else $repa_plus = $repa_plus + $row_min['how']; } } $db->free($repa_pereschet); $repa_sum = $repa_plus + $repa_minus; $repa_mod = $repa_plus."|".$repa_minus; $db->query("UPDATE " . USERPREFIX . "_users set repa='$repa_sum' WHERE user_id = '$row[user_id]'"); $db->query("UPDATE " . USERPREFIX . "_users set repa_mod='$repa_mod' WHERE user_id = '$row[user_id]'"); } $db->free($user); header( "Location: {$_SERVER['REQUEST_URI']}" ); } // ******************************************************************************** // Вывод статистики модуля // ******************************************************************************** opentable(); tableheader($lang_repa['repa_stats']); show_stats(); closetable(); echofooter(); ?>