⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 whois.cmd.php3

📁 使用PHP编程的聊天室
💻 PHP3
字号:
<?php

function room_in($what, $in)
{
	for (reset($in); $room_name=current($in); next($in))
	{
		if (strcasecmp($what, $room_name) == 0) return true;
	}
	return false;
}

// Check for invalid characters in the user name
if (ereg("[\, ]", stripslashes($Cmd[1])))
{
	$Error = L_ERR_USR_16;
}
else
{
	$IsCommand = true;

	// Define what can see the current user:
	// - the whole profile including e-mail and IP address if he is admin or moderator of the current room
	//   if this room is one of the default rooms;
	// - e-mail only if the registered user accepted this to be displayed and no IP
	if ($status == "a")
	{	
		$power = "all";
	}
	elseif ($status == "m" && room_in(stripslashes($R),$DefaultChatRooms))
	{
		$power = "medium";
	}
	else
	{
		$power = "weak";
	};

	// Ensure the user whose profile is required is a registered one
	$DbLink->query("SELECT count(*) FROM ".C_REG_TBL." WHERE username='".$Cmd[1]."' LIMIT 1");
	list($count) = $DbLink->next_record();
	$DbLink->clean_results();
	if ($count == 0)
	{
		$Error = sprintf(L_NONREG_USER, stripslashes($Cmd[1]));
		if ($power != "weak")
		{
			$DbLink->query("SELECT ip FROM ".C_USR_TBL." WHERE username='".$Cmd[1]."' LIMIT 1");
			$Nb = $DbLink->num_rows();
			if ($Nb != "0")
			{
				list($IP) = $DbLink->next_record();
				if (substr($IP, 0, 1) == "p") $IP = substr($IP, 1)." (proxy)";
				$Error .= "\\n".sprintf(L_NONREG_USER_IP, $IP);
			};
			$DbLink->clean_results();
 		};
	}
	else
	{
		$IsPopup = true;
		$win_name = "whois_popup_".md5(uniqid(""));
		?>
		<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
		<!--
		// Lauch the whois popup
		window.open("whois_popup.php3?<?php echo("L=$L&power=$power&U=".urlencode(stripslashes($Cmd[1]))."&R=".urlencode(stripslashes($R))); ?>","<?php echo($win_name); ?>","width=420,height=240,resizable=yes,scrollbars=yes");
		// -->
		</SCRIPT>
		<?php
	}
}

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -