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

📄 member.php

📁 很不错的php聊天室源码,提供给大家学习
💻 PHP
📖 第 1 页 / 共 2 页
字号:
	&nbsp;<?=$infoRow["cents"]?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	货币&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=$infoRow["money"]?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	未存积分&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=$notsavecents?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	级别&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=$infoRow["rank"]?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	系统信息&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=$useragent?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	登录IP&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=$loginip?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	登录时间&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=$infoRow["lastlogintime"]?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	注册时间&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=$infoRow["regtime"]?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	注册IP&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=$infoRow["regip"]?>
	</tr>
</tr>
</table>
<br>

<table align="center" width=300 cellspacing=1 cellpadding=2 bgcolor="black">
<tr>
	<Td colspan=2 bgcolor="#6699ff" align="center">
	<b>个人资料</b>
	</td>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	电子邮件&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=htmlspecialchars($infoRow["email"])?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	OICQ&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=htmlspecialchars($infoRow["oicq"])?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	个人主页&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=htmlspecialchars($infoRow["homepage"])?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	年龄&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=htmlspecialchars($infoRow["age"])?>
	</tr>
</tr>
<tr>
	<td width=100 align="right" bgcolor="buttonface">
	真实姓名&nbsp;
	</td>
	<td width=200 bgcolor="white">
	&nbsp;<?=htmlspecialchars($infoRow["realname"])?>
	</tr>
</tr>
</table>
<center><input type="button" onclick="window.close()" value="关闭窗口"></center>
<?php
include "include/copyrights.php";
?>
</body>
</html>
<?php
exit;
}
function register_user($name,$rank)
{
	checkFull();
	session_register("roomid");
	session_register("username");
	session_register("userrank");
	session_register("gender");
	$_SESSION["roomid"] = $_POST["chatroom"];
	$_SESSION["username"] = $name;
	$_SESSION["userrank"] = $rank;
	$_SESSION["gender"] = $_POST["gender"];

	global $db;
	$activeTime = time();
	$time = date("H:i:s");
	$db->query("insert into `onlinelist` set `username` = '{$_POST["username"]}',`activetime`={$activeTime},`loginip` = '{$_SERVER["REMOTE_ADDR"]}',`logintime` = '{$time}',`roomid`='{$_POST["chatroom"]}',`useragent`='{$_SERVER["HTTP_USER_AGENT"]}',`gender` = '{$_POST["gender"]}',`sessionid`='".session_id()."',`lastsavecentstime` ='".time()."'");
	//发送有人进入的消息
	$message = array("private"=>"","event"=>"","from_user"=>"","type"=>"","roomid"=>"","content"=>"","to_user"=>"","title"=>"","namecolor"=>"","saycolor"=>"","face"=>"");
	$message["event"] = msg_login;
	$message["from_user"] = $_POST["username"];
	$message["type"] = type_system;
	$message["roomid"] = $_POST["chatroom"];
	$message["saycolor"] = $_POST["gender"];
	addMessage($message,$db);
	//写进日志记录
	$db->query("insert into `logs` set `type`='".logtype_login."',`action` = '40',`user`='{$_POST["username"]}',`manager`='{$_SERVER["REMOTE_ADDR"]}',`why`='',`time`='".date("Y-m-d H:i:s")."'");
	//查看是否超过最高在线人数的记录
	$totalOnlines = $db->result($db->query("select count(*) from `onlinelist`"),0,"count(*)");
	if($totalOnlines>getConfig("top_online_record"))
	{
		//更新记录
		$db->query("update `config` set `value` = '".date("Y-m-d H:i:s")."' where `name` = 'top_online_record_time'");
		$db->query("update `config` set `value` = '{$totalOnlines}' where `name` = 'top_online_record'");
		$db->query("update `config` set `value` = '{$_POST["username"]}' where `name` = 'top_online_record_user'");
	}
	header("location:main.php");
}
function verifyName($name)
{
	//这里处理系统所禁止的字符
	$badWords = "/[~!@#\$%^&*()_+-=`\\/|?<>,.\'\";:\s*]/i";
	if(preg_match($badWords,$name))
	{
		header("location:notice.php?id=".not_allow_word);
		exit;
	}
	if(strlen($name)>getConfig("name_max_length"))
	{
		header("location:notice.php?id=".name_too_long);
		exit;
	}
	if(strlen($name)<getConfig("name_min_length"))
	{
		header("location:notice.php?id=".name_too_short);
		exit;
	}
	if(strlen($_POST["password"])<getConfig("password_min_length"))
	{
		header("location:notice.php?id=".password_too_short);
		exit;
	}
	else
		return true;
}
function isKicked($name)
{
	global $db;
	//检测是否被踢过?
	$lastkicktime = $db->result($db->query("select `lastkicktime` from `members` where `username` = '{$name}'"),0,"lastkicktime");
	$cfg_cantlogin_time = $db->result($db->query("select `value` from `config` where `name` = 'kick_cantlogin_time'"),0,"value");
	if((time()-$lastkicktime)<$cfg_cantlogin_time*60)
	{
		header("location:notice.php?id=".iskicked);
		exit;
	}
}
function isLocked($ip)
{
	global $db;
	if($db->result($db->query("select `rank` from `members` where `username` = '{$_POST["username"]}'"),0,"rank")==12)
	{
		return;
	}
	$ipResult = $db->query("select `locktime`,`always` from `lockedip` where `ip` = '{$ip}'");
	if($db->numrows($ipResult))
	{
		$ipRow = $db->fetchArray($ipResult);
		if($ipRow["always"])
		{
			header("location:notice.php?id=".always_locked);
			exit;
		}
		if((time()-$ipRow["locktime"])<getConfig("lock_cantlogin_time")*60)
		{
			header("location:notice.php?id=".is_locked);
			exit;
		}
		else
		{
			$db->query("delete from `lockedip` where `ip` = '{$ip}'");
		}
	}
}
function isForbid($name)
{
	global $db;
	if($db->result($db->query("select `forbid` from `members` where `username` = '{$name}'"),0,"forbid"))
	{
		header("location:notice.php?id=".is_forbid);
		exit;
	}
}
///////////////////////////////////////////////////////////////////

if($_GET["mode"]=="taxis")
{
$page = $_GET["page"];
$pagesize = getConfig("taxis_pagesize");
$startRecord = ($page-1)*$pagesize;
$grade = $startRecord;
$userResult = $db->query("select `loginnumbers`,`lastlogintime`,`username`,`cents`,`regtime` from `members` order by `cents` desc limit {$startRecord},{$pagesize}");
$totalRecords = $db->result($db->query("select count(*) from `members`"),0,"count(*)");
$totalPages = ceil($totalRecords/$pagesize);
$nextPage = ($totalPages==$page)?$totalPages:($page+1);
$prevPage = ($page==1)?1:($page-1);
?>
<html>
<head>
<title>
聊友排行 -- <?=getConfig("chatroom_name")?>
</title>
<style>
td,body
{
	font-size:13px;
}
a{color:blue;text-decoration:none}
a:hover{color:red;text-decoration:underline}
</style>
</head>
<body bgcolor="<?=getConfig("page_bgcolor")?>">
<table align="center" cellspacing=1 cellpadding=2 bgcolor="black" width=600>
<tr>
	<Td colspan=6 align="center" bgcolor="#6699ff"><b>聊友排行</b></td>
</tr>
<tr>	
	<td colspan=6 bgcolor="white" height=20>
	会员总数 <font color="blue"><?=$totalRecords?></font> 分 <font color="blue"><?=$totalPages?></font> 页  每页 <font color="blue"><?=$pagesize?></font> 位,当前第 <font color="blue"><?=$page?></font> 页。 <a href="member.php?mode=taxis&page=<?=$prevPage?>">上一页</a> <a href="member.php?mode=taxis&page=<?=$nextPage?>">下一页</a> 
	</td>
</tr>
<tr>
	<Td align="center" bgcolor="buttonface" width=50>名次</td>
	<td align="center" bgcolor="buttonface" width=120>用户名称</td>
	<td align="center" bgcolor="buttonface" width=50>总积分</td>
	<td align="center" bgcolor="buttonface" width=60>登录次数</td>
	<td align="center" bgcolor="buttonface" width=170>注册时间</td>
	<td align="center" bgcolor="buttonface" width=170>最后登陆</td>
</tr>
<?php
while($userRow = $db->fetchArray($userResult))
{
	$grade ++;
	echo "<tr>";
	echo "<td bgcolor=\"white\">{$grade}</td>";
	echo "<td bgcolor=\"white\">{$userRow["username"]}</td>";
	echo "<td bgcolor=\"white\">{$userRow["cents"]}</td>";
	echo "<td bgcolor=\"white\">{$userRow["loginnumbers"]}</td>";
	echo "<td bgcolor=\"white\" align=\"center\">{$userRow["regtime"]}</td>";
	echo "<td bgcolor=\"white\" align=\"center\">{$userRow["lastlogintime"]}</td>";
	echo "</tr>";
}
?>
</table>
<br>
<?php
include "include/copyrights.php";
?>
</body>
</html>
<?php
$db->close();
}
?>

⌨️ 快捷键说明

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