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 "
".$locale['susp103']." | \n"; echo "".$locale['susp104']." | \n"; echo "".$locale['susp105']." | \n"; echo "".$locale['susp106']." | \n"; echo "
#".$data['suspend_id']." | \n"; echo "".showdate('forumdate', $data['suspend_date'])." | \n"; echo "".$suspension."".$reason." | \n"; echo "".$admin." | \n"; echo "
\n"; echo " | ".showdate('forumdate', $data['reinstate_date'])." | \n"; echo "".$locale['susp113'].$r_reason." | \n"; echo "".$admin." | \n"; echo "