感谢秋舞叶对模板的修正和美化.
请把以下代码保存为chat.htm覆盖原文件!
- {template header}
- <table cellspacing="0" cellpadding="0" border="0" width="{TABLEWIDTH}" align="center" style="table-layout: fixed">
- <tr><td class="nav" width="90%" align="left" nowrap> <a href="index.php">$bbname</a> » 即时聊天室</td>
- <td align="right" width="10%"> <a href="#bottom"><img src="{IMGDIR}/arrow_dw.gif" border="0" align="absmiddle"></a></td>
- </tr></table>
- <br><br>
- <table cellspacing="{BORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <tr><td colspan="6" class="header"><font color="{HEADERTEXT}"><span class="bold"> 〓 即时聊天 〓 </span></font> </td></tr>
- <tr>
- <td ><form method="POST" target="wog_vvt5" action="chatwrite.php" name="wogb" >
- 发言颜色:<select name=coloer>
- <option value="defa" style="color:{CATTEXT}" selected>默认</option>
- <option value="skyblue" style="color:skyblue">天蓝</option>
- <option value="royalblue" style="color:royalblue">品蓝</option>
- <option value="blue" style="color:blue">蓝</option>
- <option value="darkblue" style="color:darkblue">暗蓝</option>
- <option value="orange" style="color:orange">橙</option>
- <option value="orangered" style="color:orangered">桔红</option>
- <option value="crimson" style="color:crimson">深红</option>
- <option value="red" style="color:red">红</option>
- <option value="firebrick" style="color:firebrick">棕</option>
- <option value="darkred" style="color:darkred">暗红</option>
- <option value="green" style="color:green">绿色</option>
- <option value="limegreen" style="color:limegreen">灰绿</option>
- <option value="seagreen" style="color:seagreen">海绿</option>
- <option value="deeppink" style="color:deeppink">粉</option>
- <option value="tomato" style="color:tomato">西红柿色</option>
- <option value="coral" style="color:coral">珊瑚色</option>
- <option value="purple" style="color:purple">紫色</option>
- <option value="indigo" style="color:indigo">靛青</option>
- <option value="burlywood" style="color:burlywood">棕木</option>
- <option value="sandybrown" style="color:sandybrown">沙褐</option>
- <option value="sienna" style="color:sienna">土黄</option>
- <option value="chocolate" style="color:chocolate">巧克力色</option>
- <option value="teal" style="color:teal">土绿</option>
- <option value="silver" style="color:silver">银</option>
- </select>
- <input id=advcheck name="mmcbbs" type=checkbox onClick=showmuti() value=1>表情<input type="hidden" name="bsay" type="text" value=""><font color='Green'>[<u><b> 你 </b></u>]</font><input name="checkbox" type="checkbox" value="2"><font color="red">悄悄地</font>对<select name="toname">
- <option value="大家">大家</option>
- <?=$chatmn?>
- </select>说:<input type="text" onkeydown=bsay_onkeydown() onblur="" name="bbsay" size="50" value=""><input onclick=subb_onclick() type="submit" value="送出" name="subb" ></td></tr>
- <tr><td height="60" valign="top" id=qqface style="DISPLAY: none"><img src="images/chat/qqbg.jpg" width="453" height="60" border="0" usemap="#Map"></td></tr>
- <tr><td><iframe name="wog_vvt5" src="chatlist.php" width="99%" height="300" border="0" frameborder="0" scrolling="yes"></iframe>
- </tr>
- </table>
- </form>
- <script LANGUAGE="javascript">
- function bsay_onkeydown(){
- if (window.event.keyCode==13){
- wogb.bsay.value=wogb.bbsay.value
- qqface.style.display = "none"
- document.wogb.mmcbbs.checked=false
- document.wogb.submit;
- document.wogb.bbsay.value=""
- }}
- function subb_onclick(){
- wogb.bsay.value=wogb.bbsay.value
- qqface.style.display = "none"
- document.wogb.mmcbbs.checked=false
- document.wogb.submit;
- document.wogb.bbsay.value=""
- document.wogb.bbsay.focus()
- }
- </script>
- <SCRIPT LANGUAGE="javascript">
- function showmuti(){
- if (document.wogb.mmcbbs.checked == true){
-
- qqface.style.display = "";
-
- }else{
-
- qqface.style.display = "none";
- }
- document.wogb.bbsay.focus()
- }
- function AddText(NewCode)
- {
- document.wogb.bbsay.value+=NewCode
- document.wogb.bbsay.focus()
- }
- </SCRIPT>
- <map name="Map">
- <area shape="rect" coords="0,1,25,19" onClick="javascript:AddText('[chimg0]');">
- <area shape="rect" coords="26,2,54,20" onClick="javascript:AddText('[chimg1]');">
- <area shape="rect" coords="55,3,81,18" onClick="javascript:AddText('[chimg2]');">
- <area shape="rect" coords="82,3,107,18" onClick="javascript:AddText('[chimg3]');">
- <area shape="rect" coords="109,3,135,18" onClick="javascript:AddText('[chimg4]');">
- <area shape="rect" coords="140,2,163,20" onClick="javascript:AddText('[chimg5]');">
- <area shape="rect" coords="165,3,196,18" onClick="javascript:AddText('[chimg6]');">
- <area shape="rect" coords="197,3,219,20" onClick="javascript:AddText('[chimg7]');">
- <area shape="rect" coords="221,1,250,20" onClick="javascript:AddText('[chimg8]');">
- <area shape="rect" coords="253,1,275,19" onClick="javascript:AddText('[chimg9]');">
- <area shape="rect" coords="281,2,303,19" onClick="javascript:AddText('[chimg10]');">
- <area shape="rect" coords="306,3,334,20" onClick="javascript:AddText('[chimg11]');">
- <area shape="rect" coords="337,3,360,20" onClick="javascript:AddText('[chimg12]');">
- <area shape="rect" coords="366,1,387,21" onClick="javascript:AddText('[chimg13]');">
- <area shape="rect" coords="395,3,417,20" onClick="javascript:AddText('[chimg14]');">
- <area shape="rect" coords="423,1,448,20" onClick="javascript:AddText('[chimg15]');">
- <area shape="rect" coords="5,22,25,39" onClick="javascript:AddText('[chimg16]');">
- <area shape="rect" coords="31,22,56,39" onClick="javascript:AddText('[chimg17]');">
- <area shape="rect" coords="57,18,77,43" onClick="javascript:AddText('[chimg18]');">
- <area shape="rect" coords="83,19,107,41" onClick="javascript:AddText('[chimg19]');">
- <area shape="rect" coords="111,20,135,41" onClick="javascript:AddText('[chimg20]');">
- <area shape="rect" coords="142,21,162,39" onClick="javascript:AddText('[chimg21]');">
- <area shape="rect" coords="168,19,189,37" onClick="javascript:AddText('[chimg22]');">
- <area shape="rect" coords="199,19,218,40" onClick="javascript:AddText('[chimg23]');">
- <area shape="rect" coords="226,21,247,40" onClick="javascript:AddText('[chimg24]');">
- <area shape="rect" coords="252,20,275,40" onClick="javascript:AddText('[chimg25]');">
- <area shape="rect" coords="279,23,306,39" onClick="javascript:AddText('[chimg26]');">
- <area shape="rect" coords="310,20,331,38" onClick="javascript:AddText('[chimg27]');">
- <area shape="rect" coords="339,22,358,40" onClick="javascript:AddText('[chimg28]');">
- <area shape="rect" coords="369,21,389,42" onClick="javascript:AddText('[chimg29]');">
- <area shape="rect" coords="395,21,418,41" onClick="javascript:AddText('[chimg30]');">
- <area shape="rect" coords="422,22,442,42" onClick="javascript:AddText('[chimg31]');">
- <area shape="rect" coords="1,40,22,58" onClick="javascript:AddText('[chimg32]');">
- <area shape="rect" coords="31,43,51,60" onClick="javascript:AddText('[chimg33]');">
- <area shape="rect" coords="59,44,80,60" onClick="javascript:AddText('[chimg34]');">
- <area shape="rect" coords="86,43,109,58" onClick="javascript:AddText('[chimg35]');">
- <area shape="rect" coords="112,43,129,62" onClick="javascript:AddText('[chimg36]');">
- <area shape="rect" coords="145,38,165,58" onClick="javascript:AddText('[chimg37]');">
- <area shape="rect" coords="171,43,190,61" onClick="javascript:AddText('[chimg38]');">
- <area shape="rect" coords="197,42,220,58" onClick="javascript:AddText('[chimg39]');">
- <area shape="rect" coords="229,41,248,59" onClick="javascript:AddText('[chimg40]');">
- <area shape="rect" coords="254,43,274,56" onClick="javascript:AddText('[chimg41]');">
- <area shape="rect" coords="283,43,308,58" onClick="javascript:AddText('[chimg42]');">
- <area shape="rect" coords="312,40,331,58" onClick="javascript:AddText('[chimg43]');">
- <area shape="rect" coords="340,42,359,59" onClick="javascript:AddText('[chimg44]');">
- <area shape="rect" coords="364,43,389,60" onClick="javascript:AddText('[chimg45]');">
- <area shape="rect" coords="395,43,417,61" onClick="javascript:AddText('[chimg46]');">
- <area shape="rect" coords="424,45,447,60" onClick="javascript:AddText('[chimg47]');">
- </map>
- <script>
- wogb.bbsay.focus();
- </script>
- </body>
- </html>
- <p>{template footer}
复制代码
再次感谢!
全面支持多模板多语言模式正式发布
#HACK名称: 即时聊天室
#HACK作者: oytktk
#HACK版本: 2.5F SP1
演示: 提供个测试帐号具有管理功能的,大家可以先去试试~
http://www.huasa.org/dz/index.php
name :admin
pass :admim
问题 :最后四位
回答 :admin
第二演示地址: http://breath.wo2j.com/
第三演示地址: http://www.nyul.net
我的论坛有可能要关闭了,如果谁安装好了,而且服务器稳定的话麻烦给提供一个演示地址!
# 要转贴的朋友请使用附件的专用文本,已经写好标签代码!
#~~~费话就少说啦..安装开始!
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
已经安装好的朋友要增加发言字段的长度,后台升级数据库:
- ALTER TABLE `cdb_chat` CHANGE `says` `says` VARCHAR( 255 ) NOT NULL
复制代码
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
########### 升级数据库 ###########
- CREATE TABLE `cdb_chat` (
- `cid` mediumint(18) unsigned NOT NULL auto_increment,
- `fn` VARCHAR( 15 ) NOT NULL ,
- `tn` VARCHAR( 15 ) NOT NULL ,
- `tim` VARCHAR( 20 ) NOT NULL ,
- `col` VARCHAR( 20 ) NOT NULL ,
- `says` VARCHAR( 250 ) NOT NULL ,
- `oth` VARCHAR( 1 ) NOT NULL ,
- `deltime` int(15) NOT NULL ,
- KEY `cid` (`cid`)
- )TYPE=MyISAM AUTO_INCREMENT=2 ;
复制代码
########### [END] ###########
然后按结构上传附件内所有文件夹及文件!
/---------------------------------
附件在此:
感谢会员2010的繁化,下载繁体版的朋友点击这里:
https://discuz.dismall.com/attachment.php?aid=13533
/---------------------------------
########### [1]-index.php ###########
查找
上面加上:
- //----------即时聊天 BY OYTKTK -------------
- $query = $db->query("SELECT username FROM $table_sessions");
- while($onliner = $db->fetch_array($query)) {
- if($onliner['username']){
- $chatmn.="<option value="".$onliner['username']."">".$onliner['username']."</option>";
- }
- }
- //-----------即时聊天 BY OYTKTK END.--------------
复制代码
########### [END] ###########
########### [2]-admincp.php ###########
查找:
- }elseif($action == 'plugin') {
- $cpscript = 'plugin.php';
- }
复制代码
[请注意下,有三行内容,请在三行内容之下加,不然会出错!]
下面加:
- elseif($action == 'chat_one' || $action == 'chat_set') {
- $cpscript ='chat_admin.php';
- }
复制代码
########### [END] ###########
##### [3]-templates\default\index.htm 加在顶部公告上面的使用方法一 在加底部联盟论坛上面的使用方法二 ######
方法一
查找:
- <!--{if !empty($newpmexists)}-->
复制代码
上面加:
方法二
查找:
- </table></td></tr></table><br><!--{/if}-->
复制代码
下面加:
########### [END] ###########
########### [4]-include\global.php ###########
在最后的"?>"两个字符前加:
- //即时聊天小巧美观专用提示页 BY oytkt
- function chat_msg($show_message, $url_forward = '') {
- @include_once language('messages');
- if(isset($language[$show_message])) {
- eval("\$show_message = "".$language[$show_message]."";");
- }
- if($url_forward==''){
- $url_forward = "chat_reg.php";}
- $url_redirect = '<meta http-equiv="refresh" content="1;url='.$url_forward.'">';
- include template('chat_msg');
- dexit();
- }
- //即时聊天 BY oytkt end
复制代码
########### [END] ###########
########### [5]-admin/menu.php ###########
查找
- admincp.php?action=menu&expand=1_2_3_4_5_6_7_8_9_10_11_12_13
复制代码
看看最后一个数是多少.如果是13,再加一个_14
变成:
- admincp.php?action=menu&expand=1_2_3_4_5_6_7_8_9_10_11_12_13_14
复制代码
找到
- showmenu($lang['menu_plugins'], $pluginsarray);
复制代码
在上面添加
- showmenu($lang['chat_set'], array(
- array('name' => $lang['chat_one_one'], 'url' => 'admincp.php?action=chat_one'),
- array('name' => $lang['chat_set_set'], 'url' => 'admincp.php?action=chat_set')));
复制代码
########### [END] ###########
########### [6]-templates\default\messages.lang.php ###########
查找
- 'board_closed' => '对不起,本论坛暂时关闭,详情请<a href="mailto:$adminemail">联系管理员</a>。',
复制代码
在上面添加
- 'chat_msg_you' => '<b><u> 你 </u></b>',
- 'chat_msg_oth' => '<font color=red>悄悄地</font>',
- 'chat_msg_to' => '对【',
- 'chat_msg_say' => '】说道:',
- 'chat_msg_think' => '〗自言自语道:',
- 'chat_msg_noreg' => '对不起,您现在不能通过聊天室注册,请至论坛注册!',
- 'chat_msg_sorry' => '如果您还没有注册过本论坛,本次登录将直接记录您的信息!',
复制代码
########### [END] ###########
########### [7]-templates\default\admincp.lang.php ###########
查找
在上面添加
- 'chat_set' => '即时聊天室',
- 'chat_dele_err' => '<font color=red>您没有指定要操作的对象, 重新修改!</font>',
- 'chat_dele_ups' => '<font color=blue>操作成功, 所选择的记录已经被删除!</font>',
- 'chat_set_fname' => '发言人:',
- 'chat_set_tname' => '发言对象:',
- 'chat_set_dtime' => '某时间之前(选中"全选"删除所有记录):',
- 'chat_set_error' => '程式意外中止,请返回并稍候重试!',
- 'chat_one_enter' => '确认删除',
- 'chat_one_return' => '重置所选',
- 'chat_one_one' => '记录整理',
- 'chat_set_set' => '高级管理',
- 'chat_one_fname' => '发言人',
- 'chat_one_tname' => '发言对象',
- 'chat_one_time' => '发言时间',
- 'chat_one_says' => '发言内容',
- 'chat_set_system' => '高级管理选项',
- 'chat_sele_year' => ' 年 ',
- 'chat_sele_moon' => ' 月 ',
- 'chat_sele_day' => ' 日 ',
- 'chat_sele_hour' => ' 时 ',
- 'chat_sele_minute' => ' 分 ',
- 'chat_sele_second' => ' 秒 ',
- 'chat_sele_all' => ' 全选 ',
- 'chat_list_hide' => '<font color=red>***私聊内容, 不公开***</font>',
复制代码
########### [END] ###########
########### [8]-templates\default\actions.lang.php ###########
查找
在上面添加
########### [END] ###########
########### [@@@]-补充 ###########
关闭即时聊天的自动注册程式方法:
chat_reg.php文件内查找:
- /*取消直接注册功能的话,把注释删除即可!
- chat_msg('chat_msg_noreg');
- exit;
- 删除至此!
- */
复制代码
改为
- chat_msg('chat_msg_noreg');
- exit;
复制代码
即可.
########### [END] ###########
########### [@@@]-补充 ###########
让游客能看到聊天记录但不可发言:
chatlist.php文件内查找:
- if(empty($name)) {
- chat_msg('forum_nopermission', 'chat_reg.php') ;
- }
复制代码
删除!即可.
########### [END] ###########
########### 更新缓存 OK ###########
这是主页嵌入样式:
这是独版样式:
这是即时登录与注册一体化提示页
这是后台管理接口:
这是可视话选择性删除管理页面:
这是可选择删除某人发言/对某人发言/全部删除/删除某个时间段之前的管理页面:
大家有什么好的提议的话请告诉我.
//===============================
[ 本帖最后由 oytktk 于 2007-8-24 08:39 编辑 ] |