8 ? $locale['susp_sys'] : $locale['susp'.$i.$type]; } function suspend_log($user_id, $type, $reason = "", $system = FALSE, $time = TRUE) { $userdata = fusion_get_userdata(); dbquery("INSERT INTO ".DB_SUSPENDS." ( suspended_user, suspending_admin, suspend_ip, suspend_ip_type, suspend_date, suspend_reason, suspend_type ) VALUES ( '$user_id', '".(!$system ? $userdata['user_id'] : 0)."', '".(!$system ? USER_IP : 0)."', '".(!$system ? USER_IP_TYPE : 0)."', '".($time ? time() : 0)."', '$reason', '$type' )"); } function unsuspend_log($user_id, $type, $reason = "", $system = FALSE) { $userdata = fusion_get_userdata(); $result = dbquery("SELECT suspend_id FROM ".DB_SUSPENDS." WHERE suspended_user='$user_id' AND suspend_type='$type' AND reinstate_date='0' LIMIT 1"); if (!dbrows($result)) { suspend_log($user_id, $type, "", TRUE, FALSE); } dbquery("UPDATE ".DB_SUSPENDS." SET reinstating_admin='".(!$system ? $userdata['user_id'] : 0)."', reinstate_reason='$reason', reinstate_date='".time()."', reinstate_ip='".(!$system ? USER_IP : 0)."', reinstate_ip_type='".(!$system ? USER_IP_TYPE : 0)."' WHERE suspended_user='$user_id' AND suspend_type='$type' AND reinstate_date='0' "); } function display_suspend_log($user_id, $type = "all", $rowstart = 0, $limit = 0) { $locale = fusion_get_locale("", LOCALE.LOCALESET."admin/members_include.php"); $db_type = ($type != "all" && isnum($type) ? " AND suspend_type='$type'" : ""); $rows = dbcount("(suspend_id)", DB_SUSPENDS, "suspended_user='$user_id'$db_type"); $result = dbquery("SELECT sp.suspend_id, sp.suspend_ip, sp.suspend_ip_type, sp.suspend_date, sp.suspend_reason, sp.suspend_type, sp.reinstate_date, sp.reinstate_reason, sp.reinstate_ip, sp.reinstate_ip_type, a.user_name AS admin_name, b.user_name AS admin_name_b FROM ".DB_SUSPENDS." sp LEFT JOIN ".DB_USERS." a ON sp.suspending_admin=a.user_id LEFT JOIN ".DB_USERS." b ON sp.reinstating_admin=b.user_id WHERE suspended_user='$user_id'$db_type ORDER BY suspend_date DESC".($limit > 0 ? " LIMIT $limit" : "")); $rows = dbrows($result); $udata = dbarray(dbquery("SELECT user_name FROM ".DB_USERS." WHERE user_id='$user_id' LIMIT 1")); if ($type == "all") { opentable(sprintf($locale['susp100'], $udata['user_name'])); member_nav(member_url("view", $user_id)."|".$udata['user_name'], member_url("log", $user_id)."|".$locale['susp114']); } else { opentable(sprintf($locale['susp100b'], getsuspension($type, TRUE), $udata['user_name'])); } if ($rows) { echo "\n\n"; if ($type == "all") { $description = sprintf($locale['susp101'], $udata['user_name']); } else { $description = sprintf(str_replace(['[STRONG]', '[/STRONG]'], ['', ''], $locale['susp102']), getsuspension($type), $udata['user_name']); } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; while ($data = dbarray($result)) { $suspension = ($data['suspend_type'] != 2 ? getsuspension($data['suspend_type']) : $locale['susp111']); $reason = ($data['suspend_reason'] ? ": ".$data['suspend_reason'] : ""); $admin = ($data['admin_name'] ? $data['admin_name']." (".$locale['susp108'].": ".$data['suspend_ip'].")" : $locale['susp109']); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n\n"; if ($data['reinstate_date']) { $r_reason = ($data['reinstate_reason'] ? ": ".$data['reinstate_reason'] : ""); $admin = ($data['admin_name_b'] ? $data['admin_name_b']." (".$locale['susp112'].$data['reinstate_ip'].")" : $locale['susp109']); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n\n"; } echo "\n"; echo "\n"; } echo "
".$locale['susp103']."".$locale['susp104']."".$locale['susp105']."".$locale['susp106']."
#".$data['suspend_id']."".showdate('forumdate', $data['suspend_date'])."".$suspension."".$reason."".$admin."
 ".showdate('forumdate', $data['reinstate_date'])."".$locale['susp113'].$r_reason."".$admin."

\n"; } else { echo "
".$locale['susp110']."
\n"; } closetable(); } function member_nav($second = "", $third = "") { $locale = fusion_get_locale("", LOCALE.LOCALESET."admin/members_include.php"); echo "\n"; } function member_url($step, $user_id) { return FUSION_SELF.fusion_get_aidlink()."&ref=".$step.($user_id ? "&lookup=$user_id" : ""); }