月光
看我代替月亮惩罚你!
|
分享:
▲
▼
下面是引用闲人于2006-12-27 20:40发表的 聊天室乱码问题,请各大指导: 【类型】插件 【版本】通 用
内挂聊天室,但有些人没有问题,有些人看见和打出来的字是乱码, 为何有这情况出现,又如何解决,请各高人大大指导, ....... 您尚未繁化当然是乱码阿...我已经帮您繁化了请自行把xnwybbs_chat.php取代为 复制程式
<?php
require('global.php');
$time=date("H:i",$timestamp);
$date=date("Y-m-d|H:i:s",$timestamp);
if ($windid!=NULL) $hidename='<input name="hide" type="checkbox" value="1" id="hide"><label for="hide">隐身</label>'
if ($windid==NULL){
$cookieguest=$guestname;
if ($cookieguest==NULL) {
$cookieguest='游客'
if ($_COOKIE[yourgname]!=NULL && $txt==NULL)$cookieguest="$_COOKIE[yourgname]";
}
$guestin="<input name=guestname type='text' size=ƌ' value='$cookieguest' maxlength=' title='您好访客,由于您未登陆论坛,输入聊天信息将直接用游客做代名\n\n但您也可以在此输入您的昵称,这样记录中就将显示您的昵称而非游客了^^'>";
}
if($txt!="")
{
$file=file("chat.dat");
$count=count($file);
$guestname=Char_cv($guestname);
if ($windid!=NULL) unset($guestname);
else{
$guestcheck='[游客]'
if ($guestname=='游客')$guestname=''
setcookie(yourgname,$guestname);
}
if ($hide==1 && $windid!=NULL)$showname="<font color=gray>隐身会员</font>";
elseif ($windid||$guestname) $showname="<label onclick=this.form.to.value='".$windid.$cookieget."'><font color=red>".$windid.$guestname."</font></label>";
$user="$showname$guestcheck";
if($count>30)unset($file[30]);
if($groupid==3){//管理员权限
$del=explode("[del]",$txt); if ($del[1]){$which=$del[1]-1;unset($file[$which]);$nomsg=1;}
}
$ee=implode('',$file);
if($to!='所有人'){
$sendto=Char_cv($to);
$sendto="<font style='background-color: #FFF0F0;padding-left: 3px; padding-right: 3px;'>To</font><font color=orangered><u>$sendto</u></font>";}
$txt = str_replace(" ", " ", $txt);
$txt = Char_cv($txt);
$txt = str_replace("[u]","<u>",$txt);
$txt = str_replace("[/u]","</u>",$txt);
$txt = str_replace("[b]","<b>",$txt);
$txt = str_replace("[/b]","</b>",$txt);
$txt = str_replace("[i]","<i>",$txt);
$txt = str_replace("[/i]","</i>",$txt);
$txt = preg_replace("/\[img\](.+?)\[\/img\]/eis","cvpic('\\1','',餠',餠')",$txt,3);
$txt= preg_replace("/\[Hunter\s*(\S+?)\s*\]/is","<img src=./image/post/chatface/\\1.gif>",$txt,5);
$txt= preg_replace("/\[Hunter\s*(\S+?)\s*\]/is"," ",$txt);
if($color)$txt="<font color=".$color.">".$txt."</font>";
if(!$nomsg)$ff="<a title=$date>[$time]</a> "."$user$sendto: ".$txt." "."</b></i></u><br>\n".$ee;
else $ff=$ee;
if ($txt=="<font color=".$color.">/cls</font>" && $groupid==3) $ff=' '
writeover("chat.dat",$ff,"wb");
}
$rr=readover("chat.dat","rb");
function cvpic($url,$type='',$picwidth='',$picheight=''){
global $db_bbsurl,$picpath,$attachpath,$code_htm;
if(strtolower(substr($url,0,4)) != 'http' && !$type)$url=$db_bbsurl.$url;
$code = "<img src='$url' border=0 onclick=\"if(this.width>screen.width-461) window.open('$url');\" onload=\"if(this.width>screen.width-460)this.width=screen.width-460;\">";
return $code;
}
?>
<html>
<head><script language="JavaScript" src="require/common.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<META HTTP-EQUIV="Refresh" content="100">
<meta name="description" content="本聊天程序由PW白色猎人进行功能强化,版权归属原开发作者所有,请使用者不要删除本行信息,感谢您的配合,祝您使用的愉快。by XnwyBbs.Com" />
<title>西南位育网上俱乐部即时聊天系统</title>
<style type="text/css">
<!--
body {
background-color:#FFFFFF;
}
body,td,th {
font-family: 细明体;
font-size: 12px;
}
textarea,input,object {
font-family: Tahoma, Verdana;
font-size: 12px;
color: #000000;
font-weight: normal;
background-color: <?=$forumcolorone?> ;
}
-->
</style>
<script language="javascript">
function image(){
code=window.prompt("图片地址:","[url]http://"[/url]);
if (code!=null){
code='[img]'+code+'[/img]'
document.chat.txt.value+=code;}
}
</script>
<SCRIPT>
function showmuti(){
if (face.style.display == "none"){
face.style.display = "";
}else{
face.style.display = "none";
}
}
function AddText(NewCode)
{
document.chat.txt.value+=NewCode
}
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0">
<form name="chat" method="post" action="">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="20" valign="top"><DIV id=floater
style="Z-INDEX: 1; POSITION: absolute; align=center"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="20" valign="top">
<?=$guestin?><input type="button" name="refresh" value="刷新" onClick="javascript:location='xnwybbs_chat.php'">
<script language="javascript">
var secs = 60;
var wait = secs * 1000;
document.chat.refresh.value = "刷新(" + secs + ")";
function update(num, value) {
if(num == (wait/1000)) {
document.chat.refresh.value = "刷新";
} else {
printnr = (wait / 1000)-num;
document.chat.refresh.value = "刷新(" + printnr + ")";
}
}
for(i = 1; i <= secs; i++) {
window.setTimeout("update(" + i + ")", i * 1000);
}
</script>
<input name="to" type="text" id="to" size="6" value="所有人" maxlength="12" onClick="if(this.value=='所有人')this.value=''" title="聊天对象" onBlur="if (this.value =='') this.value='所有人'">
<input name="txt" type="text" id="txt" size="40">
<select name=color>
<option value="black" style="color:black">黑色</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>
<img onClick=showmuti() alt='表情' src='image/face.gif'>
<img onClick=image() alt='插入图片' src='image/pic.gif'>
<input type="submit" name="Submit" value="发送">
<?=$hidename?>
</td></tr></table>
</div>
</td>
</tr>
<script language="javascript">
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
<!-- STALKER CODE -->
function heartBeat() {
if(IE) {
diffY = document.body.scrollTop;
diffX = 0;
}
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelTop += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelLeft += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
}
if(NS || IE) action = window.setInterval("heartBeat()",1);
</script>
<tr><td><p> </p></td></tr>
<tr>
<td valign="top" id=face style="DISPLAY: none">
<img name="QQ" src="image/post/chatface/QQ.gif" width="406" height="179" border="0" usemap="#m_QQ"><br>
<map name="m_QQ">
<area shape="rect" coords="136,157,162,183" href="javascript:AddText('[Hunter95]')">
<area shape="rect" coords="109,157,135,183" href="javascript:AddText('[Hunter94]')">
<area shape="rect" coords="82,157,108,183" href="javascript:AddText('[Hunter93]')">
<area shape="rect" coords="55,157,81,183" href="javascript:AddText('[Hunter92]')">
<area shape="rect" coords="28,157,54,183" href="javascript:AddText('[Hunter91]')">
<area shape="rect" coords="1,157,27,183" href="javascript:AddText('[Hunter90]')">
<area shape="rect" coords="217,130,243,156" href="javascript:AddText('[Hunter83]')">
<area shape="rect" coords="244,130,270,156" href="javascript:AddText('[Hunter84]')">
<area shape="rect" coords="271,130,297,156" href="javascript:AddText('[Hunter85]')">
<area shape="rect" coords="298,130,324,156" href="javascript:AddText('[Hunter86]')">
<area shape="rect" coords="325,130,351,156" href="javascript:AddText('[Hunter87]')">
<area shape="rect" coords="352,130,378,156" href="javascript:AddText('[Hunter88]')">
<area shape="rect" coords="379,103,405,129" href="javascript:AddText('[Hunter74]')">
<area shape="rect" coords="379,130,405,156" href="javascript:AddText('[Hunter89]')">
<area shape="rect" coords="352,103,378,129" href="javascript:AddText('[Hunter73]')">
<area shape="rect" coords="325,103,351,129" href="javascript:AddText('[Hunter72]')">
<area shape="rect" coords="298,103,324,129" href="javascript:AddText('[Hunter71]')">
<area shape="rect" coords="271,103,297,129" href="javascript:AddText('[Hunter70]')">
<area shape="rect" coords="244,103,270,129" href="javascript:AddText('[Hunter69]')">
<area shape="rect" coords="217,103,243,129" href="javascript:AddText('[Hunter68]')">
<area shape="rect" coords="379,76,405,102" href="javascript:AddText('[Hunter59]')">
<area shape="rect" coords="352,76,378,102" href="javascript:AddText('[Hunter58]')">
<area shape="rect" coords="325,76,351,102" href="javascript:AddText('[Hunter57]')">
<area shape="rect" coords="298,76,324,102" href="javascript:AddText('[Hunter56]')">
<area shape="rect" coords="271,76,297,102" href="javascript:AddText('[Hunter55]')">
<area shape="rect" coords="244,76,270,102" href="javascript:AddText('[Hunter54]')">
<area shape="rect" coords="217,76,243,102" href="javascript:AddText('[Hunter53]')">
<area shape="rect" coords="379,49,405,75" href="javascript:AddText('[Hunter44]')">
<area shape="rect" coords="352,49,378,75" href="javascript:AddText('[Hunter43]')">
<area shape="rect" coords="325,49,351,75" href="javascript:AddText('[Hunter42]')">
<area shape="rect" coords="298,49,324,75" href="javascript:AddText('[Hunter41]')">
<area shape="rect" coords="271,49,297,75" href="javascript:AddText('[Hunter40]')">
<area shape="rect" coords="244,49,270,75" href="javascript:AddText('[Hunter39]')">
<area shape="rect" coords="217,49,243,75" href="javascript:AddText('[Hunter38]')">
<area shape="rect" coords="379,22,405,48" href="javascript:AddText('[Hunter29]')">
<area shape="rect" coords="352,22,378,48" href="javascript:AddText('[Hunter28]')">
<area shape="rect" coords="325,22,351,48" href="javascript:AddText('[Hunter27]')">
<area shape="rect" coords="298,22,324,48" href="javascript:AddText('[Hunter26]')">
<area shape="rect" coords="271,22,297,48" href="javascript:AddText('[Hunter25]')">
<area shape="rect" coords="244,22,270,48" href="javascript:AddText('[Hunter24]')">
<area shape="rect" coords="217,22,243,48" href="javascript:AddText('[Hunter23]')">
<area shape="rect" coords="379,-5,405,21" href="javascript:AddText('[Hunter14]')">
<area shape="rect" coords="352,-5,378,21" href="javascript:AddText('[Hunter13]')">
<area shape="rect" coords="325,-5,351,21" href="javascript:AddText('[Hunter12]')">
<area shape="rect" coords="298,-5,324,21" href="javascript:AddText('[Hunter11]')">
<area shape="rect" coords="271,-5,297,21" href="javascript:AddText('[Hunter10]')">
<area shape="rect" coords="244,-5,270,21" href="javascript:AddText('[Hunter9]')">
<area shape="rect" coords="217,-5,243,21" href="javascript:AddText('[Hunter8]')">
<area shape="rect" coords="190,-5,216,21" href="javascript:AddText('[Hunter7]')">
<area shape="rect" coords="190,22,216,48" href="javascript:AddText('[Hunter22]')">
<area shape="rect" coords="190,49,216,75" href="javascript:AddText('[Hunter37]')">
<area shape="rect" coords="190,76,216,102" href="javascript:AddText('[Hunter52]')">
<area shape="rect" coords="190,103,216,129" href="javascript:AddText('[Hunter67]')">
<area shape="rect" coords="190,130,216,156" href="javascript:AddText('[Hunter82]')">
<area shape="rect" coords="163,130,189,156" href="javascript:AddText('[Hunter81]')">
<area shape="rect" coords="163,103,189,129" href="javascript:AddText('[Hunter66]')">
<area shape="rect" coords="163,-5,189,21" href="javascript:AddText('[Hunter6]')">
<area shape="rect" coords="163,76,189,102" href="javascript:AddText('[Hunter51]')">
<area shape="rect" coords="163,49,189,75" href="javascript:AddText('[Hunter36]')">
<area shape="rect" coords="163,22,189,48" href="javascript:AddText('[Hunter21]')">
<area shape="rect" coords="136,-5,162,21" href="javascript:AddText('[Hunter5]')">
<area shape="rect" coords="136,22,162,48" href="javascript:AddText('[Hunter20]')">
<area shape="rect" coords="136,49,162,75" href="javascript:AddText('[Hunter35]')">
<area shape="rect" coords="136,76,162,102" href="javascript:AddText('[Hunter50]')">
<area shape="rect" coords="136,103,162,129" href="javascript:AddText('[Hunter65]')">
<area shape="rect" coords="136,130,162,156" href="javascript:AddText('[Hunter80]')">
<area shape="rect" coords="82,130,108,156" href="javascript:AddText('[Hunter78]')">
<area shape="rect" coords="109,130,135,156" href="javascript:AddText('[Hunter79]')">
<area shape="rect" coords="109,103,135,129" href="javascript:AddText('[Hunter64]')">
<area shape="rect" coords="82,103,108,129" href="javascript:AddText('[Hunter63]')">
<area shape="rect" coords="82,76,108,102" href="javascript:AddText('[Hunter48]')">
<area shape="rect" coords="109,76,135,102" href="javascript:AddText('[Hunter49]')">
<area shape="rect" coords="109,49,135,75" href="javascript:AddText('[Hunter34]')">
<area shape="rect" coords="109,-5,135,21" href="javascript:AddText('[Hunter4]')">
<area shape="rect" coords="109,22,135,48" href="javascript:AddText('[Hunter19]')">
<area shape="rect" coords="82,-5,108,21" href="javascript:AddText('[Hunter3]')">
<area shape="rect" coords="82,22,108,48" href="javascript:AddText('[Hunter18]')">
<area shape="rect" coords="82,49,108,75" href="javascript:AddText('[Hunter33]')">
<area shape="rect" coords="55,49,81,75" href="javascript:AddText('[Hunter32]')">
<area shape="rect" coords="55,76,81,102" href="javascript:AddText('[Hunter47]')">
<area shape="rect" coords="55,103,81,129" href="javascript:AddText('[Hunter62]')">
<area shape="rect" coords="55,130,81,156" href="javascript:AddText('[Hunter77]')">
<area shape="rect" coords="28,103,54,129" href="javascript:AddText('[Hunter61]')">
<area shape="rect" coords="28,130,54,156" href="javascript:AddText('[Hunter76]')">
<area shape="rect" coords="55,-5,81,21" href="javascript:AddText('[Hunter2]')">
<area shape="rect" coords="55,22,81,48" href="javascript:AddText('[Hunter17]')">
<area shape="rect" coords="28,22,54,48" href="javascript:AddText('[Hunter16]')">
<area shape="rect" coords="28,49,54,75" href="javascript:AddText('[Hunter31]')">
<area shape="rect" coords="28,76,54,102" href="javascript:AddText('[Hunter46]')">
<area shape="rect" coords="1,130,27,156" href="javascript:AddText('[Hunter75]')">
<area shape="rect" coords="1,103,27,129" href="javascript:AddText('[Hunter60]')">
<area shape="rect" coords="1,22,27,48" href="javascript:AddText('[Hunter15]')">
<area shape="rect" coords="28,-5,54,21" href="javascript:AddText('[Hunter1]')">
<area shape="rect" coords="1,49,27,75" href="javascript:AddText('[Hunter30]')">
<area shape="rect" coords="1,76,27,102" href="javascript:AddText('[Hunter45]')">
<area shape="rect" coords="1,-5,27,21" href="javascript:AddText('[Hunter0]')">
</map>
</td>
</tr>
<tr>
<td width="100%" height="150" valign="top"><?=$rr?></td>
</tr>
</table>
</form>
</body>
</html>
|
|
x0
[1 楼]
From:台湾中华电信HINET | Posted:2006-12-28 07:50 |
|
|
闲人
|
分享:
▲
▼
下面是引用月光于2006-12-28 07:50发表的 :
您尚未繁化当然是乱码阿...我已经帮您繁化了请自行把xnwybbs_chat.php取代为
[code]<?php ....... 我也试过把它翻成繁化,但完全什么也看不了,全白, 今次用大大的也是一样,什么也没有,全白 重点是,为何有些人没问题,有些人是乱码, 小部份说网站其它都无问题,只有在线聊天有问题, 不过大部份人都无问题,l
[ 此文章被闲人在2006-12-28 21:41重新编辑 ]
|
|
x0
[2 楼]
From:香港城市电讯 | Posted:2006-12-28 21:34 |
|
|
|