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

📄 ignore.cmd.php3

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

// Check if a nick is already in the ignored list
function is_user_ignored($who, $userlist)
{
	$users = explode(",", $userlist);
	for (reset($users); $user_name=current($users); next($users))
	{
		if (strcasecmp($who, urldecode($user_name)) == 0) return true;
	}
	return false;
}

// Check for invalid characters in the name of the user to be ignored
if ($Cmd[3] != "" && ereg("[\ ]", stripslashes($Cmd[3])))
{
	$Error = L_ERR_USR_16;
}
elseif ($Cmd[1] == "")
{
	// Launch the ignored popup	
	if ($Cmd[3] == "")
	{
		$IsCommand = true;
		$IsPopup = true;
		$Tmp = isset($Ign) ? "&Ign=".urlencode(stripslashes($Ign)) : "";
		?>
		<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
		<!--
		if (parent.is_ignored_popup && !parent.is_ignored_popup.closed)
		{
			parent.is_ignored_popup.focus();
		}
		else
		{
			parent.is_ignored_popup = window.open("ignore_popup.php3?<?php echo("L=$L$Tmp"); ?>","ignore_popup","width=180,height=300,scrollbars=yes,resizable=yes");
		}
		// -->
		</SCRIPT>
		<?php
	}
	// Add user(s) to ignored list
	else
	{
		if (!isset($Ign)) $Ign="";
		$Ignore = explode (",", stripslashes($Cmd[3]));
		for ($i = 0; $i < count($Ignore); $i++)
		{
			$Ignore[$i] = trim($Ignore[$i]);
			if ($Ignore[$i] == "") continue;
			if ($Ignore[$i] != "" && $Ignore[$i] != stripslashes($U) && !is_user_ignored($Ignore[$i], $Ign))
			{
				$tmp = urlencode($Ignore[$i]);
				$IsCommand = true;
				$Ign .= $Ign != "" ? ",".$tmp : $tmp;
				$RefreshMessages = true;
			}
		}
	}
}
else
{
	// Unset ignored list	
	if ($Cmd[3] == "")
	{
		$IsCommand = true;
		if (isset($Ign))
		{
			$RefreshMessages = true;
			unset($Ign);
		}
	}
	// Remove user(s) from ignored list
	else
	{
		$IsCommand = true;
		if (isset($Ign))
		{
			$Ignore = explode (",", stripslashes($Cmd[3]));
			for ($i = 0; $i < count($Ignore); $i++)
			{
				$Ignore[$i] = trim($Ignore[$i]);
				if ($Ignore[$i] == "") continue;
				if ($Ignore[$i] != "" && is_user_ignored($Ignore[$i], $Ign))
				{
					$users = explode(",", $Ign);
					$Ign = "";
					for (reset($users); $user_name=current($users); next($users))
					{
						if ($Ignore[$i] != urldecode($user_name)) $Ign .= ($Ign != "")? ",".$user_name : $user_name;
					}
					if ($Ign == "") unset($Ign);
					$RefreshMessages = true;
				}
			}
		}
	}
}

if ($IsCommand) $First = 1;		// Will completly reload the loader script
if (!$IsPopup && $IsCommand)
{
	$Tmp = isset($Ign) ? "&Ign=".urlencode(stripslashes($Ign)) : "";
	?>
	<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
	<!--
	// Refresh the ignored popup
	with (parent)
	{
		if (is_ignored_popup != null && !is_ignored_popup.closed)
		{
			is_ignored_popup.document.Form.Refresh.value = 1;
			is_ignored_popup.location = "ignore_popup.php3?<?php echo("L=$L$Tmp"); ?>";
		}
	};
	// -->
	</SCRIPT>
	<?php
}

?>

⌨️ 快捷键说明

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