save.cmd.php3

来自「使用PHP编程的聊天室」· PHP3 代码 · 共 30 行

PHP3
30
字号
<?php

// ** Check for messages to be saved **

// Define the SQL query (depends on values for ignored users list and on whether to display
// notification messages or not)

$CondForQuery = "";
$IgnoreList = "'SYS enter','SYS exit','SYS delreg','SYS promote'";
if (isset($Ign)) $IgnoreList = ",'".str_replace(",","','",addslashes(urldecode($Ign)))."'";
if ($IgnoreList != "") $CondForQuery = "username NOT IN (${IgnoreList}) AND ";
$CondForQuery .= "(address IN ('$U',' *') OR (room = '$R' AND (address = '' OR username = '$U')))";

$DbLink->query("SELECT Count(*) FROM ".C_MSG_TBL." WHERE ".$CondForQuery." LIMIT 1");
list($Count) = $DbLink->next_record();
$DbLink->clean_results();

if ($Count != "0")
{
	$IsCommand = true;
	$Save_URL_Query = isset($Ign) ? "&Ign=".urlencode(stripslashes($Ign)) : "";
	if (C_SAVE != "*" && ($Cmd[2] > C_SAVE || $Cmd[2] == "")) $Cmd[2] = C_SAVE;
	if ($Cmd[2] != "") $Save_URL_Query .= "&Limit=$Cmd[2]";
}
else
{
	$Error = L_NO_SAVE;
};

?>

⌨️ 快捷键说明

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