插件名称:简单聊天室
插件说明:聊天室插件
开发作者:liverxing
完成时间:2005.4.25
程序版本:1.0
修改难度:低等
所属插件分类:扩展类
代码:
简单聊天室1.0
本聊天室程序不使用任何数据库,所有聊天记录都以文件形式备份至文件夹“chattmpchat.txt”中,只有管理员拥有清屏权限(及清空聊天记录。)
安装说明:
1. 上传压缩包中的文件至论坛根目录.
2.在论坛目录下,打开“cachetemplatescacheid_Xindex.php”(X代表数字,表示你使用的模板号),寻找“<? include $forums->func->load_template('footer'); ?>”在他前面一行添加如下代码:
<!-- chat修改开始 -->
<table width='100%' cellpadding='4' cellspacing='1' id='ttable'>
<tr><table width='100%' cellpadding='0' cellspacing='0' id='ttable'><td colspan='2' class='thead'>
论坛聊天
</td></table></tr><tr><table width='100%' cellpadding='4' cellspacing='1' id='ttable'>
<?
require("includes/chat.php");
if(file_exists($chatpath) == false){
echo "<tr>尚未开张</tr>";
}else{
$lines = file("chat/tmp/chat.txt");
$n = count($lines);
if($n<=5){$r=$n;}else{$r=5;}
for ($i=0;$i<=$r;$i++){
echo "<tr><td class='row1'>".$lines[$n]."</td></tr>";
$n--;
}
}
?>
</table></tr></table>
<table width='100%' cellpadding='4' cellspacing='1' id='ttable'>
<tr>
<td class='row1' >
<form action='./../../p'ost.php method=post>
<input type='hidden' name='chatuser' value='<?=$bbuserinfo['name']?>' />
<input type='hidden' name='do' value='insert' />
<td align=right class='row1' >发言:</td>
<td class='row1' ><input type=text name=chattext size=100 maxlength=100>(最大字符数:100)</td>
<td class='row1' ><input type=submit value="送出">
</form>
</td>
<?
if ($bbuserinfo['usergroupid'] == 4)
{
?>
<td class='row1' >
<form action='./../../p'ost.php method=post>
<input type='hidden' name='do' value='delete' />
<td class='row1' ><input type=submit value="清屏">
</form></td>
<?
}
?>
</tr>
</table>
<!-- chat修改结束 -->