<!--#include file="head.asp"-->
<%response.buffer=true%>
<!--#include file="md5.asp"-->
<%Function HtmlEncode(Content)
  Content = Replace(Content, ">", "&gt;") 
  Content = Replace(Content, "<", "&lt;")
  Content = Replace(Content, "'", "")
  HtmlEncode = content 
End Function

Function HtmlEncode2(Content)
  Content = Replace(Content, ">", "&gt;") 
  Content = Replace(Content, "<", "&lt;")
  'Content = Replace(Content, " ", "&nbsp;")
  Content = Replace(Content, "'", "")
  Content = Replace(Content, vbcrlf,"<br>") 
  HtmlEncode2 = content 
End Function

dim page

page = Request.QueryString("page")
if isnumeric(page)=false then
response.write "<script>alert('参数错误，窗口关闭！');window.close();</script>"
response.end
end if
if page="" then page=1
page2 = Request.QueryString("k")
if isnumeric(page2)=false then
response.write "<script>alert('参数错误，窗口关闭！');window.close();</script>"
response.end
end if
if page2="" then page2=1

On Error Resume Next
action = HtmlEncode(Request.QueryString("action"))
action_e = HtmlEncode(Request.Form("action_e"))


dim webtitle,webname,webyn,webgl,webyn2,view2
set rs1 = conn.execute("select * from nyeee_admin")

if rs1("title")<>"" then webtitle=rs1("title")
if rs1("webname")<>"" then webname=rs1("webname")
if rs1("gbyn")<>"" then webyn=rs1("gbyn")
webgl=rs1("gl")

rs1.close
set rs1=nothing%>
<html>
	

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<style type="text/css">
<!-- 
td           { font-size: 12px; line-height: 17px }
body         { font-size: 12px; line-height: 17px }
p            { margin-top: 1px; margin-bottom: 1px }
body,p,td    { font-family:Verdana, Arial, Helvetica, sans-serif; }
-->
</style>
<script language="JavaScript">
function shuzi(message,total,used,remain)
{
	var max;
	max = total.value;
	if (message.value.length > max) {
	message.value = message.value.substring(0,max);
	used.value = max;
	remain.value = 0;
	alert("留言不能超过 500 个字!");
	}
	else {
	used.value = message.value.length;
	remain.value = max - used.value;
	}
}
</script>

<body marginwidth="0" marginheight="0">   

<table width="900" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="CAE2F8">      
              <tr>       
                <td bgcolor="#FFFFFF"> <div align="center">       
<%Select Case action_e      
	Case ""      
      
	Case "Add_New"      
		Call Add_New_Execute()      
	Case "reply"      
		Call Reply_Execute()      
	Case "admin"      
		Call Admin_Login_Execute()      
	Case "EditPWD"      
		Call EditPWD_Execute()      
	Case "Edit"      
		Call Edit_Execute()      
		      
    Case "Edit_web"      
		Call Edit_web()      
		      
End Select      
Call Main_Menu()      
Select Case action      
    Case "UbbHelp"      
        Call UbbHelp()      
	Case "Admin_Login"      
		Call Admin_Login()      
	Case "Exit"      
		Call Exit_Admin()      
		      
		Call View_Words()      
		      
	Case ""      
		      
		Call View_Words()      
		      
	Case "Add_New"      
		Call Add_New()      
	Case "reply"      
		Call Reply()      
	Case "View_Words"      
		      
		Call View_Words()      
		      
	Case "Delete"      
		Call Delete()      
		Call View_Words()      
	Case "EditPWD"      
		Call EditPWD()      
	Case "Edit"      
		Call Edit()      
		      
	Case "Edit_web"      
		Call Edit_web()      
				      
End Select%></td>      
              </tr>      
</table>
<TABLE width="860" height=4 border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD></TD>
    </TR>
  </TBODY>
</TABLE>
<!--#include file="foot.asp"-->     
<%'添加一条新留言%>
<%Sub Add_New()%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="new" method="post" action="gbook.asp">
    <tr> 
      <td height="10" colspan="3" align="center" width="548">
 </td>
    </tr>
    <tr> 
      <td width="106" height="25"  > <div align="right">姓名：</div></td>
      <td width="291" height="25"> <input type="text" name="name" size="20" maxLength=10>
        <font color="#FF0000">(必填)</font></td>                                                                                                                                             
      <td width="147">&nbsp;</td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td align="right" height="25" width="106"> 性别： </td>                                                                                                                                             
      <td height="25" width="291"> <input type="radio" name="sex" value="1" checked>                                                                                                                                             
        男                                                                                                                                              
        <input type="radio" name="sex" value="0">                                                                                                                                             
        女 </td>                                                                                                                                             
      <td rowspan="5" width="147">&nbsp; </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td align="right" height="25" width="106">电话或QQ：</td>                                                                                                                                            
      <td height="25" width="291"> <input name="qq" type="text" id="qq" size="20" maxLength=13>                                                                                                                                            
        <font color="#FF0000">(必填)</font></td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td align="right" height="25" width="106">主页： </td>                                                                                                                                            
      <td height="25" width="291"> <input name="web" type="text" value="http://" size="35" maxLength=50>                                                                                                                                             
      </td>                                                                                                                                            
    </tr>                                                                                                                                            
    <tr>                                                                                                                                             
      <td align="right" height="25" width="106">地址：</td>                                                                                                                                            
      <td height="25" width="291"> <input name="come" type="text" id="come" size="35"></td>                                                                                                                                            
    </tr>                                                                                                                                            
    <tr>                                                                                                                                             
      <td align="right" height="25" width="106"> 电子邮箱： </td>                                                                                                                                            
      <td height="25" width="291"> <input name="email" type="text" value="@" size="20" maxLength=50>                                                                                                                                            
        <font color="#FF0000">(必填)</font> </td>                                                                                                                                              
    </tr>                                                                                                                                              
    <tr>                                                                                                                                               
      <td align="right" valign="top" width="106"> <br>                                                                                                                                              
        <br>                                                                                                                                              
        <br>                                                                                                                                              
        <br>                                                                                                                                              
        留言内容： </td>                                                                                                                                              
      <td colspan="2" width="440"> <textarea name="words" cols="36" rows="10"></textarea>                                                                                                                                               
        <font color="#FF0000">(必填)</font></td>                                                                                                                                               
    </tr>                                                                                                                                               
    <tr>                                                                                                                                                
      <td align="right" valign="middle" height="35" width="108"> <div align="center">                                                                                                                                               
          <input type="hidden" name="action_e" value="Add_New">                                                                                                                                              
 </div></td>                                                                                                                                              
      <td colspan="2" align="right" valign="middle" height="35" width="442">     
        <p align="left">                                                                                                                                              
          <input type="submit" name="Submit" value="立即提交">&nbsp; <input type="reset" name="Submit2" value="重新填写">                                                                                                                                             
      </td>                                                                                                                                             
    </tr>                                                                                                                                             
  </form>                                                                                                                                             
</table>                                                                                                                                             
<br>                                                                                                                                             
<%End Sub%>                                                                                                                                             
<%''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''%>                                                                                                                                               
<%Sub Main_Menu()%>                                                                                                                                                
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">                                          
<tr><td colspan="2" height="10"></td></tr>                                                                                                                                             
  <tr>                                                                                                                                                
    <td width="554" height="35" valign="top">&nbsp;<a href="gbook.asp?action=Admin_Login"><img border="0" src="images/gblogin.gif"></a> <a href="gbook.asp?action=Add_New"><img src="images/write.gif" border="0"></a> <a href="gbook.asp?action=View_Words"><img border="0" src="images/view.gif"></a>                                                                                                                                                
        <%If Session("Admin")="glok1" Then%>                                            
        <a href="gbook.asp?action=Edit_web"><img border="0" src="images/setup.gif"></a> <a href="gbook.asp?action=EditPWD"><img border="0" src="images/editpass.gif"></a>                                                                                                                                             
        <%End If%>                                                                                                    
        <%If Session("Admin")="glok1" Then%><a href="gbook.asp?action=Exit"><img border="0" src="images/quit.gif"></a>                                                                                                                                             
        <%End If%>                                                                                                       
    </td>                                                                                                                                                                                       
    <td width="146" height="35" valign="middle">              
    <%if len(webtitle)>2 then%><font color="#FF0000" style="font-size:12px"><marquee onMouseOut=start(); onMouseOver=stop(); scrollamount=3 width="145" height="20">                                                                                                                                           
      <%=webtitle%> </marquee></font><%end if%>            
    </td>                                                                                                                                                                                      
  </tr>                                                                                                                                             
</table>                                                                                                                                             
<%End Sub                                                                                                                                              
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                                                                             
'查看留言                                                                                                                                             
Sub View_Words()                                                                                                                                              
         '几个ASP语句说明(温故而知新)                                                                                                                                             
         'sql="select sum(字段名) as 别名 from 数据表 where 条件表达式"  使用 rs("别名") 得到值                                                                                                                                             
		 'AVG(字段名) 得出一个表格栏平均值                                                                                                                                              
         'COUNT(*|字段名) 对数据行数的统计或对某一栏有值的数据行数统计                                                                                                                                              
         'MAX(字段名) 取得一个表格栏最大的值                                                                                                                                              
         'MIN(字段名) 取得一个表格栏最小的值                                                                                                                                              
         'SUM(字段名) 把数据栏的值相加                                                                                                                                              
		 ' OleDbDataReader dr = db1.getReader("select top "+n+" * from news where 类别="+strCID+" and (id not in (select top "+n*(page-1)+"  id from news where 类别="+strCID+" order by ID DESC))  order by ID DESC");                        
		 '''''''''' 使用TOP分页方法                                                                                                                                             
         dim gbcount,n,x,y,j,k                                                                                                                                             
		 n=25 '每页显示留言数                                                                                                                                             
		 x=10 '每页显示的页数                                                                                                                                             
         set rs = conn.execute("select COUNT(*) as gbcount from nyeee_words")                                                                                                                                             
		 gbcount=rs("gbcount")                                                                                                                                             
		 rs.close         
		 if gbcount/n = int(gbcount/n) then '计算出分页数                                                                                                                                             
		 y=int(gbcount/n)                                                                                                                                             
		 else                                                                                                                                             
		 y=int(gbcount/n)+1                                                                                                                                             
		 end if                                                                                                                                             
		                
		 if (page2)*x > y then '计算出每页显示的页数                                                                                                                                             
		 k=y                                                                                                                                             
		 else                                                                                                                                             
		 k=(page2)*x                                                                                                                                             
		 end if                                                                                                                                             
		                                                                                                                               
		 if page=1 then '判断页数,从而从第几条记录开始读数据                                                                                                                                             
		 j=""                                                                                                                                             
		 else                                                                                                                                             
		 j="where id not in (select top "&n*(page-1)&" id from nyeee_words  Order By id Desc)"                                                                                                                                             
         end if                                                                                                                                             
		 ' 在第J条记录之后取得前N条记录                                                                                                                                              
		'set rs = conn.execute("select top "&n&" id,name,sex,head,web,email,title,words,date,reply,ip,come,view,qq from nyeee_words "&j&" Order By id Desc") '打开记录的另一种方式,这种方式效率高,但没有打开记录集,一些功能受限                                                                                                                                             
		                         
		Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                             
		Sql="select top "&n&" * from nyeee_words "&j&" Order By id Desc"                                                                                                                                             
		Rs.Open Sql,Conn,1,1   '打开记录集                                                                                            
		'传统的分页代码,*********开始                                                                                                                                             
		'TotalRecord=Rs.RecordCount  '记录总数                                                                                                                                             
		'Rs.PageSize = 8   '每页显示的记录数                                                                                                                                             
		'PageSize = Rs.PageSize                                                                                                                                             
		'PageCount=Rs.PageCount  ' 总页数                                                                                                                                             
		'if rs.bof  and rs.eof then    '错误处理                                                                                                                                             
		'CM="当前没有留言"                                                                                                                                             
		'else                                                                                                                                             
		'If page="" Then                                                                                                                                               
			'Rs.AbsolutePage = 1                                                                                                                                             
		'Else                                                                                                                                             
			'Rs.AbsolutePage = page                                                                                                                                             
		'End If                                                                                                                                             
		'end if                                                                                                                                             
		''*************传统的分页代码*****结%>                                                                                                                                                                                                                   
<span>                                                                                                                                           
<%if rs.bof  and rs.eof then Response.Write "当前没有留言记录"%>                                                                                                                                           
</span>                                                                                                                                            
<%dim lou,words,reply,email,qq,web,come                                                                                                                                           
if Request.QueryString("page")<2 then                                                                                                                                           
lou=gbcount                                                                                                                                           
else                                                                                                                                           
lou=gbcount-((Request.QueryString("page")-1)*n)                                                                                                                                           
end if                                                                                                                                            
    
  do while not rs.eof                                                                                                                                            
reply=""                                                                                                                                           
words=""                                                                                                                                             
email=""                                                                                                                                           
qq=""                                                                                                                                           
web=""                                                                                                                                           
come=""                                                                                                                                           
if rs("email")="" then                                                                                                                                           
email=rs("name") & "&nbsp;没有留下电子邮件"                                                                                                                                           
else                                                                                                                                           
email=rs("name") & "&nbsp;的电子邮件是:&nbsp;"&rs("email")                                                                                                                                           
end if                                                                                                                                           
                                                                                                                      
if rs("web")="" or rs("web")="http://" then                                                                                                                                           
web=rs("name") & "&nbsp;暂时没有主页"                                                                                                                                           
else                                                                                                                                           
web=rs("name") & "&nbsp;的主页是:&nbsp;"&rs("web")                                                                                                                                           
end if                                                                                                                                           
      
if rs("qq")="" or len(rs("qq"))<4 then                                                                                                                                           
qq=rs("name") & "&nbsp;没有留下QQ号"                                                                                                                                           
else                                                                                                                                           
qq=rs("name") & "&nbsp;的QQ号是:&nbsp;"&rs("qq")                                                                                                                                           
end if                                                                                                                                           
                                                                                                                     
  words=rs("words")                                                                                                                                           
  if rs("reply")<>"" then reply=rs("reply")                                
  If Session("Admin") = "glok1" Then                               
  theip=Rs("ip")                                
  else                               
  shuzu=split(Rs("ip"),".")                                
  theip=shuzu(0)&"."&shuzu(1)&"."&shuzu(2)&".xxx"                               
  end if%>                                                                                                                                           
<table width="700" border="1" align="center" cellspacing="0" style="border-collapse:collapse" bordercolor="CAE2F8">                                                                                                                                           
  <tr>                                                                                                                                            
    <td width="100%" height="59" colspan="2" valign="top">                                                                                                                                            
      <table width="100%" border="0" cellpadding="0" cellspacing="0">                                                                                                                                           
        <tr>                                                                                                                                            
          <td width="39%" height="22" background="images/topnav_bg1.jpg">&nbsp; <!--【<%=lou%>】--><font style="font-size:14px"></font><font color="#006699"><%=rs("name")%></font></td>                                                                                                                                            
          <td width="61%" height="22" background="images/topnav_bg1.jpg"> <div align="right"> <font color="#006699"><%=Rs("date")%><!--&nbsp;&nbsp;&nbsp;IP:<%=theip%>--></font>&nbsp;&nbsp;                                                                                                                                                
              <%If Session("Admin") = "glok1" Then%>                                                                                                                                               
                <a href="gbook.asp?action=Edit&id=<%=Rs("id")%>"><img src="images/reply.gif" alt="修改回复" width="16" height="16" border="0"></a>                                                                                                                                               
              <a href="gbook.asp?action=Delete&id=<%=Rs("id")%>" onClick="return confirm('确定要删除吗？\n\n该操作不可恢复！')"><img src="images/del.gif" alt="删除留言" width="15" height="15" border="0"></a>                                                                                                                                                
              <%end if%>                                                                                                                                               
          </div></td>                                                                                                                                               
        </tr>                                                                                                                                               
        <tr>                                                                                                                                                
          <td colspan="2"> <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" height="60">                                                                                                                                               
              <tr>                                                                                                                                                
                <td width="15%" valign="top"> 
				<table width="100%"  border="0" cellspacing="0" cellpadding="0" height="10">
  <tr>
    <td></td>
  </tr>
</table>
                                                                                                                            
                  <p align="center">                                                                                                                                               
                  <%if rs("sex")="1" then%>                                                                               
                   <img src="images/male.gif" <%if rs("come")<>"" then%>alt="<%=rs("come")%>"<%end if%>>                                                                                                                                            
                  <%else%>                                                                                
                  <img src="images/female.gif">                                                                                                                                              
                  <%end if%>                                                                                                                                               
                  </p>                                                                               
                </td>                                                                                                                                               
                <td width="85%" align="center"><table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#E1EFFB">
                  <tr>
                    <td bgcolor="#FFFFFF">
                        <%if webyn=1 and rs("view")=1 then%>
                        <%=Ubb(unHtml(words))%>
                        <%if reply<>"" then%>
                        <!--<br><font color="#919191">-------------------------------------------------------------------------------------------------------------------</font>-->
                        <p style="margin-top: 8"><font color="#800000">回复： <%=Ubb(unHtml(reply))%></font>
                            <%end if%>
                            <%end if%>
                            <%if webyn<>1 then%>
                            <font color="#800000"><%=Ubb(unHtml(words))%></font>
                            <%if reply<>"" then%>
                            <!--<br><font color="#919191">-------------------------------------------------------------------------------------------------------------------</font>-->
                        <p style="margin-top: 8"><font color="#800000">回复： <%=Ubb(unHtml(reply))%></font>
                            <%end if%>
                            <%end if%>
                            <%if webyn=1 and rs("view")=0 then%>
        恭喜您留言成功，请等待我们的答复。
        <%end if%></td>
                  </tr>
                </table></td>
              </tr>                                                                                                                                               
          </table>          </td>                                                                                                                                               
        </tr>                                                                                                                                               
      </table> </td>                                                                                                                                               
  </tr>                                                                                                                                               
</table>                                                                                                                                               
<br>                                                                                                                                               
<%lou=lou-1	                                                                                                                                                
		rs.movenext                                                                                                                                               
    	loop                                                                                                                                               
		Rs.Close                                                                                                                                               
		Set Rs = Nothing%>                                                                                                                                               
<table width="700" border="0" cellspacing="0" cellpadding="0" align="center">                                                                                                                                               
  <tr>                                                                                                                                                
    <td height="20" align="right"> <div align="right">有<%=gbcount%>条留言 共<%=y%>页 分页                                                                                                                                                
        <%if page2>1 then%>                                                                                                                                               
        <a href="gbook.asp?page=<%=((page2-1)*x)-(x-1)%>&k=<%=page2-1%>">前<%=x%>页</a>                                                                                                                                                
        <%end if%>                                                                                                                                               
        <%For m =((page2)*x)-(x-1) To k%>                                                                                                                                               
        [<a href="gbook.asp?page=<%=m%>&k=<%=page2%>"><%=m%></a>]                                                                                                                                                
        <%Next%>                                                                                                                                               
        <%if page2*x < y then%>                                                                                                                                               
        <a href="gbook.asp?page=<%=((page2+1)*x)-(x-1)%>&k=<%=page2+1%>">后<%=x%>页</a>                                                                                                                                                
        <%end if%>                                                                                                                                                                                      
      </div></td>                                                                                                                                               
  </tr>                                                                                                                                               
</table>                                                                                                                                               
<span>                                                                                                                                                
<%End Sub%>                                                                                                                                               
<%'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                                                                               
'管理员登陆接口%>                                                                                                                                               
<%Sub Admin_Login()%>                                                                                                                                               
</span><br>                                                                                                                                               
<table width="400" border="0" cellspacing="1" cellpadding="4" align="center">                                                                                                                                               
  <form name="reply" method="post" action="gbook.asp">                                                                                                                                               
    <tr>                                                                                                                                                
      <td colspan="2" align="center" class="topic" height="40"> <font style="font-size:14px"> <b>管理员登陆</b></font> </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td width="105" align="right" valign="top"> 用户名： </td>                                                                                                                                             
      <td width="226"> <input type="text" name="username"> </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td width="105" align="right" valign="top"> 密&nbsp; 码： </td>                                                                                                                                             
      <td width="226"> <input type="password" name="password">                                                                                                                                              
        <input type="hidden" name="action_e" value="admin"> </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr align="center">                                                                                                                                              
      <td height="29" colspan="2"> <input type="submit" name="Submit32" value="登陆">                                                                                                                                              
      </td>                                                                                                                                             
    </tr>                                                                                                                                             
  </form>                                                                                                                                             
</table>                                                                                                                                             
<br>                                                                                                                                             
<%End Sub%>                                                                                                                                             
<%''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''%>                                                                                                                                               
<%Sub UbbHelp()%>                                                                                                                                               
<div align="left">                                                                                                                                                
  <%End Sub%>                                                                                                                                               
</div>                                                                                                                                               
<%Sub EditPWD()%>                                                                                                                                               
<table width="400" border="0" align="center" cellpadding="4" cellspacing="1">                                                                                                                                               
  <form name="editpwd" method="post" action="gbook.asp">                                                                                                                                               
    <tr>                                                                                                                                                
      <td colspan="2" align="center" height="40"> <b><font style="font-size:14px">修改管理信息</font></b></td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td align="right" valign="middle" width="105" height="24">旧用户名：</td>                                                                                                                                             
      <td width="226" height="24" align="left">                                                                                                                                              
        <input type="text" name="oldusername">                                                                                                                                              
      </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td align="right" valign="middle" width="105" height="24">新用户名：</td>                                                                                                                                             
      <td width="226" height="24" align="left">                                                                                                                                              
        <input type="text" name="username">                                                                                                                                              
      </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td align="right" valign="middle" width="105" height="24">确认新用户名：</td>                                                                                                                                             
      <td width="226" height="24" align="left">                                                                                                                                              
        <input type="text" name="username_c">                                                                                                                                              
      </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td align="right" valign="middle" width="105" height="24"> 旧 密 码： </td>                                                                                                                                             
      <td width="226" height="24" align="left">                                                                                                                                              
        <input type="password" name="oldpwd">                                                                                                                                              
      </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td align="right" valign="middle" width="105">新 密 码： </td>                                                                                                                                             
      <td width="226" align="left"> <input type="password" name="newpwd">                                                                                                                                              
      </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr>                                                                                                                                              
      <td align="right" valign="middle" width="105" height="27">确认新密码：</td>                                                                                                                                             
      <td width="226" align="left" height="27">                                                                                                                                              
        <input type="password" name="newpwd_c">                                                                                                                                              
        <input type="hidden" name="action_e" value="EditPWD"> </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr align="center">                                                                                                                                              
      <td colspan="2"> <input type="submit" name="EditPWD" value="修改密码">                                                                                                                                              
      </td>                                                                                                                                             
    </tr>                                                                                                                                             
  </form>                                                                                                                                             
</table>                                                                                                                                             
<%End Sub%>                                                                                                                                             
<%Sub Edit()%>                                                                                                                                             
<%theid=Request.QueryString("id")                     
if isnumeric(theid)=false then                     
response.write "<script>alert('参数错误，关闭窗口！');window.close();</script>"                     
response.end                     
end if                                                                                                                                        
Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                             
Sql="Select * from nyeee_words Where id="&theid                                                                                                                                             
Rs.Open Sql,Conn,1,1                                                                                                                                             
          
view2=""                                                                                                                                             
if rs("view")=1 then                                                                                                                                             
view2="checked"                                                                                                                                             
end if%>                                                                                                                                             
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">                                                                                                                                             
  <form name="reply" method="post" action="gbook.asp">                                                                                                                                             
    <tr>                                                                                                                                              
      <td colspan="2" align="center" class="topic" height="60"> <b> <font style="font-size:14px"> 修改留言内容及回复</font><br>                                                                                                                                            
        </b>                                                                                                                                            
        <span>留言者资料</span>                                                                                                                                             
        <%If Rs("sex")=1 Then                                                                                                                                              
					Response.Write "<img src='images/Male.gif' alt='你点到帅哥了' width='16' height='16'>"                                                                                                                                              
					Else                                                                                                                                              
					Response.Write "<img src='images/FeMale.gif' alt='你点到美女了' width='16' height='16'> "                                                                                                                                              
					End If%>                                                                                                                                              
        <img src="images/oicq.gif" alt="<%=Rs("qq")%>" width="19" height="16" border="0">                                                                                                                                               
        <a href="mailto:<%=Rs("email")%>"><img src="images/icon_email.gif" alt="<%=Rs("email")%>" width="17" height="16" border="0"></a>                                                                                                                                               
        <a href="<%=Rs("web")%>" target="_blank"><img src="images/homepage.gif" alt="<%=Rs("web")%>" width="16" height="16" border="0"></a>                                                                                                                                               
        <img src="images/come.gif" alt="<%=Rs("name")%>来自:<%=Rs("come")%>" width="16" height="16">                                                                                                                                               
      </td>                                                                                                                                              
    </tr>                                                                                                                                              
    <tr>                                                                                                                                               
      <td width="113" align="right" valign="top"> 留言内容： </td>                                                                                                                                              
      <td width="468"> <textarea name="words" cols="60" rows="8"><%if Rs("words")<>"" then%><%=replace(Rs("words"),"<br>",vbcrlf)%><%end if%></textarea>                                                                                                                                               
      </td>                                                                                                                                              
    </tr>                                                                                                                                              
    <tr align="center">                                                                                                                                               
      <td align="right">回复：</td>                                                                                                                                              
      <td align="left"> <textarea name="reply" cols="60" rows="8"><%if Rs("reply")<>"" then%><%=replace(Rs("reply"),"<br>",vbcrlf)%><%end if%></textarea>                                                                                                                                               
        <br> <br> <input name="view" type="checkbox" id="view" value="1" <%=view2%>>                                                                                                                                              
        通过审批</td>                                                                                                                                               
    </tr>                                                                                                                                               
    <tr align="center">                                                                                                                                                
      <td colspan="2"> <input type="hidden" name="action_e" value="Edit"> <input type="hidden" name="id" value="<%=Request.QueryString("id")%>">                                                                                                                                                
        <input type="submit" name="Submit" value="修改留言" id="Submit">                                                                                                                                               
      </td>                                                                                                                                               
    </tr>                                                                                                                                               
  </form>                                                                                                                                               
</table>                                                                                                                                               
<%End Sub%>                                                                                                                                               
<br>                                                                                                                                               
<%Sub Edit_web()%>                                                                                                                                               
<%If Session("Admin")="" Then                                                                                                                                                
		Response.Write "连接超时,请重新登录"                                                                                                                                               
		Response.End                                                                                                                                               
end if                                                                                                                                               
   
if HtmlEncode(Request.Form("submit"))="修改" then                                                                                                                                               
Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                               
Sql="Select * from nyeee_admin"                                                                                                                                               
Rs.Open Sql,Conn,2,3                                                                                                                                               
   rs("title")=HtmlEncode(Request.Form("webtitle"))                                                                                                                                              
   rs("gl")=HtmlEncode(Request.Form("webggg"))                                                                                                                                               
   rs("gbyn")=cint(HtmlEncode(Request.Form("webyn")))                                                                                                                                               
   rs("webname")=HtmlEncode(Request.Form("webname"))                                                                                                                                               
   rs.update                                                                                                                                                  
'if rs("title")<>"" then webtitle=rs("title")                                                                                                                                               
'if rs("webname")<>"" then webname=rs("webname")                                                                                                                                               
'if rs("gbyn")<>"" then webyn=rs("gbyn")                                                                                                                                               
'if rs("words")<>"" then webgg=rs("words")                                                                                                                                               
rs.close                                                                                                                                               
set rs=nothing                                                                                                                                               
response.redirect"gbook.asp?action=Edit_web"                                                                                                                                               
response.end                                                                                                                                               
end if                                                                                                                                               
webyn2=""                                                                                                                                               
if webyn=1 then                                                                                                                                               
webyn2="checked"                                                                                                                                               
end if%>                                                                                                                                               
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">                                                                                                                                               
  <form name="reply" method="post" action="gbook.asp">                                                                                                                                               
    <tr>                                                                                                                                                
      <td colspan="2" align="center" class="topic" height="40"> <font style="font-size:14px"> <b> 修改留言板属性</b></font></td>                                                                                                                                              
    </tr>                                                                                                                                              
    <tr>                                                                                                                                               
      <td width="202" align="right" valign="top"> 留言板名称：</td>                                                                                                                                             
      <td width="379"><input name="webname" type="text" id="webname" value="<%=webname%>" size="50" maxLength=25>                                                                                                                                              
      </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr align="center">                                                                                                                                              
      <td align="right">公告内容：</td>                                                                                                                                             
      <td align="left"><input name="webtitle" type="text" id="webtitle" value="<%=webtitle%>" size="50" maxLength=25></td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr align="center">                                                                                                                                              
      <td align="right"  valign="top">词语过滤：</td>                                                                                                                                             
      <td align="left"><input name="webggg" type="text" id="webggg" value="<%=webgl%>" size="50" maxLength=300>                                                                                                                                              
        <br>                                                                                                                                             
        <span>用&quot;|&quot;分隔过滤的词,例：月亮|星星</span> </td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr align="center">                                                                                                                                              
      <td align="right">经过审批才显示留言：</td>                                                                                                                                             
      <td align="left"><input name="webyn" type="checkbox" id="webyn" value="1" <%=webyn2%>>                                                                                                                                             
        是</td>                                                                                                                                             
    </tr>                                                                                                                                             
    <tr align="center">                                                                                                                                              
      <td colspan="2"> <input type="hidden" name="action_e" value="Edit_web">                                                                                                                                              
        <input type="submit" name="Submit" value="修改" id="Submit">                                                                                                                                             
      </td>                                                                                                                                             
    </tr>                                                                                                                                             
  </form>                                                                                                                                             
</table>                                                                                                                                             
<%End Sub%>                                                                                                                                             
</body>                                                                                                                        
<%Sub Add_New_Execute()                             
	If HtmlEncode(trim(Request.Form("name")))="" Then                                                                                                                                                                                            
	Response.Write "<script>alert('姓名不能为空，请返回！');history.back();</script>"                                                                                                                                             
	Response.End                                                                                                                                             
	End If                                                                                                                                             
	If Len(HtmlEncode(trim(Request.Form("name"))))>20 Then                                                                                                                                             
	Response.Write "<script>alert('姓名不能太长，请返回！');history.back();</script>"                                                                                                                                             
	Response.End                                                                                                                                            
	End If                                                                                               
	If HtmlEncode(trim(Request.Form("qq")))="" Then                                                                                                                                               
	Response.Write "<script>alert('请填写联系电话或QQ号码，以便尽快与您取得联系，请返回！');history.back();</script>"                                                                                                                                             
	Response.End                                                                                                                                         
	End If                                                                                                                                        
	If HtmlEncode(trim(Request.Form("email")))<>"" Then                                                                                                                                             
	If instr(HtmlEncode(trim(Request.Form("email"))),"@")=0 or instr(HtmlEncode(trim(Request.Form("email"))),".")=0 or instr(HtmlEncode(trim(Request.Form("email"))),"@")=1 or instr(HtmlEncode(trim(Request.Form("email"))),"@")=len(email) then                                                                                                                                                                                                
	Response.Write "<script>alert('您填写的电子信箱一看就是假的，请重填！');history.back();</script>"                                                                                                                                             
	Response.End                                                                                                                                                 
	End If                                                                                                                                             
	End If                                                                                                                                             
	If HtmlEncode2(Request.Form("words"))="" Then                                                                                                                                               
	Response.Write "<script>alert('请您填写留言内容，谢谢！');history.back();</script>"                                                                                                                                             
	Response.End                                                                                                                                         
	End If                                                         
	If len(HtmlEncode2(Request.Form("words")))>500 Then                                                                                                                                               
	Response.Write "<script>alert('留言内容请控制在500字以内，谢谢！');history.back();</script>"                                                                                                                                             
	Response.End                                                                                                                                         
	End If                                                                                                                                            
	Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                             
	Sql="Select * from nyeee_words"                                                                                                                                             
	Rs.Open Sql,Conn,2,3                                                                                                                                             
	Rs.AddNew                                                                                                                                             
	Rs("name")=HtmlEncode(trim(Request.Form("name")))                                                                                                                                             
	Rs("sex")=HtmlEncode(trim(Request.Form("sex")))                                                                                                                                          
	Rs("head")=HtmlEncode(trim(Request.Form("head")))                                                                                                                                             
	Rs("web")=HtmlEncode(trim(Request.Form("web")))                                                                                                                                             
	Rs("email")=HtmlEncode(trim(Request.Form("email")))                                                                                                                                             
	Rs("words")=HtmlEncode2(Request.Form("words"))                                                                                                                                             
	Rs("qq")=HtmlEncode(trim(Request.Form("qq")))                                                                                                                                             
	Rs("head")=HtmlEncode(trim(Request.Form("Image")))                                                                                                                                             
	                 
	Rs("date")=Now()                                                                                                                                             
Rs("ip")=request.servervariables("remote_addr")                                                                                                                                             
Rs("come")=HtmlEncode(trim(Request.Form("come")))                                                                                                                                             
	Rs.Update                                                                                                                                             
	Rs.Close                                                                                                                                             
	Set Rs = Nothing                                                                                                                                             
End Sub                                                                                                                                             
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                                                                             
'验证管理员登陆                                                                                                                                             
                                                                                                                       
Sub Admin_Login_Execute()                                                                                                                                             
	username = HtmlEncode(trim(Request.Form("username")))                                                                                                                                             
	password = HtmlEncode(trim(Request.Form("password")))                                                                                                                                             
	If username = "" OR password = "" Then                                                                                                                                             
		Response.Write "用户名或者密码为空"                                                                                                                                             
		Response.End                                                                                                                                             
	End If                                                                                                                                             
	Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                             
	Sql="Select * from nyeee_admin"                                                                                                                                             
	Rs.Open Sql,Conn,1,1                                                                                                                                             
	If username = Rs("username") AND md5(password) = Rs("password") Then                                                                                                                                             
		Session("Admin") = "glok1"                                                                                                                                             
		Else                                                                                                                                             
		Response.Write "用户名或者密码不对，登陆失败"                                                                                                                                             
	End If                                                                                                                                             
	Rs.Close                                                                                                                                             
	Set Rs = Nothing                                                                                                                                             
End Sub                                                                                                                                             
Sub EditPWD_Execute()                                                                                                                                             
    If Session("Admin")="" Then                                                                                                                                              
		Response.Write "连接超时,请重新登录"                                                                                                                                             
		Response.End                                                                                                                                             
	end if                                                                                                                                             
  
	oldusername=HtmlEncode(trim(Request.Form("oldusername")))                                                                                                                                             
	username = HtmlEncode(trim(Request.Form("username")))                                                                                                                                             
	username_c = HtmlEncode(trim(Request.Form("username_c")))                                                                                                                                             
	oldpwd = HtmlEncode(trim(Request.Form("oldpwd")))                                                                                                                                             
	newpwd = HtmlEncode(trim(Request.Form("newpwd")))                                                                                                                                             
	newpwd_c = HtmlEncode(trim(Request.Form("newpwd_c")))                                                                                                                                            
	If username = "" OR username_c="" Then                                                                                                                                             
		Response.Write "新旧用户名均不能为空"                                                                                                                                             
		Response.End                                                                                                                                             
	End If                                                                                                                                             
	If oldpwd = "" OR newpwd = "" OR newpwd_c="" Then                                                                                                                                             
		Response.Write "新旧密码均不能为空"                                                                                                                                             
		Response.End                                                                                                                                             
	End If                                                                                                                                             
	If username<>username_c Then                                                                                                                                             
		Response.Write "新填写的两个新用户名不一致，请重新填写"                                                                                                                                             
		Response.End                                                                                                                                             
	End If                                                                                                                                             
	If newpwd<>newpwd_c Then                                                                                                                                             
		Response.Write "新填写的两个密码不一致，请重新填写"                                                                                                                                             
		Response.End                                                                                                                                             
	End If                                                                                                                                             
	Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                             
	Sql="Select * from nyeee_admin"                                                                                                                                             
	Rs.Open Sql,Conn,2,3                                                                                                                                             
	If Rs("password")=md5(oldpwd) And Rs("username")=oldusername Then                                                                                                                                             
		Rs("username")=username                                                                                                                                             
		Rs("password")=md5(newpwd)                                                                                                                                             
		Rs.Update                                                                                                                                             
	Else                                                                                                                                             
		Response.Write "你的旧密码填写不对或者旧用户名不对，修改不成功"                                                                                                                                             
		Response.End                                                                                                                                             
	End If                                                                                                                                             
	Rs.Close                                                                                                                                             
	Set Rs = Nothing                                                                                                                                             
End Sub                                                                                                                                             
Sub Exit_Admin()                                                                                                                                             
	Session.Abandon                                                                                                                                             
	response.redirect"gbook.asp"                                                                                                                                             
End Sub                                                                                                                                             
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                                                                             
'删除数据                                                                                                                                             
Sub Delete()                                                                                                                                             
     If Session("Admin")="" Then                                                                                                                                              
		Response.Write "连接超时,请重新登录"                                                                                                                                             
		Response.End                                                                                                                                             
	 end if                                                                                                                                             
	'删除数据                      
theid=Request.QueryString("id")                     
if isnumeric(theid)=false then                     
response.write "<script>alert('参数错误，关闭窗口！');window.close();</script>"                     
response.end                     
end if                                                                                                                                           
	Conn.Execute("Delete * from nyeee_words Where id="&theid)                                                                                                                                             
End Sub                                                                                                                                             
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                                                                             
'回复留言添加到数据库                                                                                                                                             
  
Sub Reply_Execute()                                                                                                                                             
    If Session("Admin")="" Then                                                                                                                                              
		Response.Write "连接超时,请重新登录"                                                                                                                                             
		Response.End                                                                                                                                             
	end if                                                                                                                                             
	                     
theid=Request.Form("id")                     
if isnumeric(theid)=false then                     
response.write "<script>alert('参数错误，关闭窗口！');window.close();</script>"                     
response.end                     
end if                      
                                                                                                                     
	Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                             
	Sql="Select reply from nyeee_words Where id="&theid                                                                                                                                             
	Rs.Open Sql,Conn,2,3                                                                                                                                             
	Rs("reply") = HtmlEncode(trim(Request.Form("reply")))                                                                                                                                             
	Rs.Update                                                                                                                                             
	Rs.Close                                                                                                                                             
	Set Rs=Nothing                                                                                                                                             
End Sub                                                                                                                                             
                                                                                                                       
Sub Edit_Execute()                                                                                                                                             
    If Session("Admin")="" Then                                                                                                                                              
		Response.Write "连接超时,请重新登录"                                                                                                                                             
		Response.End                                                                                                                                             
	end if                                                                                                                                             
	                      
theid=Request.Form("id")                     
if isnumeric(theid)=false then                     
response.write "<script>alert('参数错误，关闭窗口！');window.close();</script>"                     
response.end                     
end if                      
                                                                                                                      
	Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                             
	Sql="Select * from nyeee_words Where id="&theid                                                                                                                                             
	Rs.Open Sql,Conn,2,3                                                                                                                                             
	Rs("words") = HtmlEncode2(Request.Form("words"))                                                                                                                                            
	Rs("reply") = HtmlEncode2(Request.Form("reply"))                                                                                                                                             
	     
	if cint(HtmlEncode(trim(Request.Form("view"))))=1 then                                                                                                                                             
	Rs("view")=1                                                                                                                                             
	else                                                                                                                                             
	Rs("view")=0                                                                                                                                             
	end if                                                                                                               
	'Rs("name")=HtmlEncode(trim(Request.Form("name")))                                                                                                                                             
	'Rs("sex")=HtmlEncode(trim(Request.Form("sex")))                                                                                                                                             
	'Rs("head")=HtmlEncode(trim(Request.Form("head")))                                                                                                                                             
	'Rs("web")=HtmlEncode(trim(Request.Form("web")))                                                                                                                                             
	'Rs("email")=HtmlEncode(trim(Request.Form("email")))                                                                                                                                             
	'Rs("qq")=HtmlEncode(trim(Request.Form("qq")))                                                                                                                                             
	'Rs("head")=HtmlEncode(trim(Request.Form("Image")))                                                                                                                                             
	Rs.Update                                                                                                                                             
	Rs.Close                                                                                                                                             
	Set Rs=Nothing                                                                                                                                             
End Sub                                                                                                                                             
                                                                                                                    
Conn.Close                                                                                                                                             
Set Conn = Nothing%>                                                                                                                                             
<%function unHtml(content)                                                                                                                                             
unHtml=content                                                                                                                                             
if content <> "" then                                                                                                                                             
unHtml=replace(unHtml,"&","&amp;")                                                                                                                                             
'unHtml=replace(unHtml,"<","&lt;")                                                                                                                                             
'unHtml=replace(unHtml,">","&gt;")                                                                                                                                             
unHtml=replace(unHtml,chr(34),"&quot;")                                                                                                                                             
unHtml=replace(unHtml,chr(13),"<br>")                                                                                                                                             
unHtml=replace(unHtml,chr(32),"&nbsp;")                                                                                                                                             
  '使用数组 返回值数组 = Split("字符串","分割符")                                                                                                                                             
  'IsArray()判断是否数组的函数,LBound()取数组的下标,UBound()取数组的上标。                                                                                                                                              
   unhtmlgl=split(webgl,"|")                                                                                                                                             
   if IsArray(unhtmlgl) then                                                                                                                                             
   for i=0 to UBound(unhtmlgl)                                                                                                                                             
   unhtml=replace(unhtml,unhtmlgl(i),"***")                                                                                                                                             
   next                                                                                                                                             
   end if                                                                                                                                             
'unHtml=ubb(unHtml)                                                                                                                                             
end if                                                                                                                                             
end function                                                                                                             
function ubb(content)                                                                                                                                             
ubb=content                                                                                                                                             
    nowtime=now()                                                                                                                                             
    UBB=Convert(ubb,"code")                                                                                                                                             
    UBB=Convert(ubb,"html")                                                                                                                                             
    UBB=Convert(ubb,"url")                                                                                                                                             
    UBB=Convert(ubb,"color")                                                                                                                                             
    UBB=Convert(ubb,"font")                                                                                                                                             
    UBB=Convert(ubb,"size")                                                                                                                                             
    UBB=Convert(ubb,"quote")                                                                                                                                             
    UBB=Convert(ubb,"email")                                                                                                                                             
    UBB=Convert(ubb,"img")                                                                                                                                             
    UBB=Convert(ubb,"swf")                                                                                                                                             
	ubb=convert(ubb,"cen")                                                                                                                                             
	ubb=convert(ubb,"rig")                                                                                                                                             
    ubb=convert(ubb,"lef")                                                                                                                                             
    ubb=convert(ubb,"center")                                                                                       
  
    UBB=AutoURL(ubb)                                                                                                                                             
    ubb=replace(ubb,"[b]","<b>",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,"[/b]","</b>",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,"[i]","<i>",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,"[/i]","</i>",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,"[u]","<u>",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,"[/u]","</u>",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,"[blue]","<font color='#000099'>",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,"[/blue]","</font>",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,"[red]","<font color='#990000'>",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,"[/red]","</font>",1,-1,1)                                                                                                                                             
    for i=1 to 28                                                                                                                                             
    ubb=replace(ubb,"{:em"&i&"}","<IMG SRC=emot/emotface/em"&i&".gif ></img>",1,6,1)                                                                                                                                             
    ubb=replace(ubb,"{:em"&i&"}","",1,-1,1)                                                                                                                                             
    next                                                                                                                                             
    ubb=replace(ubb,"["&chr(176),"[",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,chr(176)&"]","]",1,-1,1)                                                                                                                                             
    ubb=replace(ubb,"/"&chr(176),"/",1,-1,1)                                                                                                                                             
'    ubb=replace(ubb,"{;em","{:em",1,-1,1)                                                                                                                                             
end function                                                                                                         
      
function Convert(ubb,CovT)                                                                                                                                             
cText=ubb                                                                                                                                             
startubb=1                                                                                                                                             
do while Covt="url" or Covt="color" or Covt="font" or Covt="size"                                                                                                                                             
startubb=instr(startubb,cText,"["&CovT&"=",1)                                                                                                                                             
if startubb=0 then exit do                                                                                                                                             
endubb=instr(startubb,cText,"]",1)                                                                                                                                             
if endubb=0 then exit do                                                                                                                                             
Lcovt=Covt                                                                                                                                             
startubb=startubb+len(lCovT)+2                                                                                                                                             
text=mid(cText,startubb,endubb-startubb)                                                                                                                                             
codetext=replace(text,"[","["&chr(176),1,-1,1)                                                                                                                                             
codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)                                                                                                                                             
'codetext=replace(codetext,"{:em","{;em",1,-1,1)                                                                                                                                             
codetext=replace(codetext,"/","/"&chr(176),1,-1,1)                                                                                                                                             
select case CovT                                                                                                                                             
    case "color"                                                                                                                                             
	cText=replace(cText,"[color="&text&"]","<font color='"&text&"'>",1,1,1)                                                                                                                                             
	cText=replace(cText,"[/color]","</font>",1,1,1)                                                                                                                                             
    case "font"                                                                                                                                             
	cText=replace(cText,"[font="&text&"]","<font face='"&text&"'>",1,1,1)                                                                                                                                             
	cText=replace(cText,"[/font]","</font>",1,1,1)                                                                                                                                             
    case "size"                                                                                                                                             
	if IsNumeric(text) then                                                                                                                                             
	if text>6 then text=6                                                                                                                                             
	if text<1 then text=1                                                                                                                                             
	cText=replace(cText,"[size="&text&"]","<font size='"&text&"'>",1,1,1)                                                                                                                                             
	cText=replace(cText,"[/size]","</font>",1,1,1)                                                                                                                                             
	end if                                                                                                                                             
    case "url"                                                                                                                                             
	cText=replace(cText,"[url="&text&"]","<a href='"&codetext&"' target=_blank>",1,1,1)                                                                                                                                             
	cText=replace(cText,"[/url]","</a>",1,1,1)                                                                                                                                             
    case "email"                                                                                                                                             
	cText=replace(cText,"["&CovT&"="&text&"]","<a href=mailto:"&text&">",1,1,1)                                                                                                                                             
	cText=replace(cText,"[/"&CovT&"]","</a>",1,1,1)                                                                                                                                             
end select                                                                                                                                             
loop                                                                                                                 
startubb=1                                                                                                                                             
do                                                                                                                                             
startubb=instr(startubb,cText,"["&CovT&"]",1)                                                                                                                                             
if startubb=0 then exit do                                                                                                                                             
endubb=instr(startubb,cText,"[/"&CovT&"]",1)                                                                                                                                             
if endubb=0 then exit do                                                                                                                                             
Lcovt=Covt                                                                                                                                             
startubb=startubb+len(lCovT)+2                                                                                                                                             
text=mid(cText,startubb,endubb-startubb)                                                                                                                                             
codetext=replace(text,"[","["&chr(176),1,-1,1)                                                                                                                                             
codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)                                                                                                                                             
'codetext=replace(codetext,"{:em","{;em",1,-1,1)                                                                                                                                             
codetext=replace(codetext,"/","/"&chr(176),1,-1,1)                                                                                                                                             
select case CovT                                                                                                                                             
    case "center"                                                                                                                                             
    cText=replace(cText,"[center]","<div align='center'>",1,1,1)                                                                                                                                             
	cText=replace(cText,"[/center]","</div>",1,1,1)                                                                                                                                             
      
    case "url"                                                                                                                                             
	cText=replace(cText,"["&CovT&"]"&text,"<a href='"&codetext&"' target=_blank>"&codetext,1,1,1)                                                                                                                                             
	cText=replace(cText,"<a href='"&codetext&"' target=_blank>"&codetext&"[/"&CovT&"]","<a href="&codetext&" target=_blank>"&codetext&"</a>",1,1,1)                                                                                                                                             
    case "email"                                                                                                                                             
	cText=replace(cText,"["&CovT&"]","<a href=mailto:"&text&">",1,1,1)                                                                                                                                             
	cText=replace(cText,"[/"&CovT&"]","</a>",1,1,1)                                                                                                                                             
    case "html"                                                                                                                                             
	codetext=replace(codetext,"<br>",chr(13),1,-1,1)                                                                                                                                             
	codetext=replace(codetext,"&nbsp;",chr(32),1,-1,1)                                                                                                                                             
	Randomize                                                                                                                                             
	rid="temp"&Int(100000 * Rnd)                                                                                                                                             
	cText=replace(cText,"[html]"&text,"代码片断如下：<TEXTAREA id="&rid&" rows=15 style='width:100%' class='bk'>"&codetext,1,1,1)                                                                                                                                             
	cText=replace(cText,"代码片断如下：<TEXTAREA id="&rid&" rows=15 style='width:100%' class='bk'>"&codetext&"[/html]","代码片断如下：<TEXTAREA id="&rid&" rows=15 style='width:100%' class='bk'>"&codetext&"</TEXTAREA><INPUT onclick=runEx('"&rid&"') type=button value=运行此段代码 name=Button1 class='Tips_bo'> <INPUT onclick=JM_cc('"&rid&"') type=button value=复制到我的剪贴板 name=Button2 class='Tips_bo'>",1,1,1)                                                                                                                                             
    case "img" '一般显示的图片                                                                                                                                             
	cText=replace(cText,"[img]"&text,"<a href="&chr(34)&"about:<img src="&codetext&" border=0>"&chr(34)&" target=_blank><img src="&codetext ,1,1,1 )                                                                                                                                             
	cText=replace(cText,"[/img]"," vspace=2 hspace=2 border=0 alt=::点击图片在新窗口中打开:: onload='javascript:if(this.width>580)this.width=580'></a>",1,1,1)                                                                                                                                             
                                                                                                                               
	case "cen" '图片居中                                                                                                                                             
	cText=replace(cText,"[cen]"&text,"<table border='0' align='center' cellpadding='0' cellspacing='0'><tr><td > <a href="&chr(34)&"about:<img src="&codetext&" border=0>"&chr(34)&" target=_blank><img src="&codetext ,1,1,1 )                                                                                                                           
	cText=replace(cText,"[/cen]"," vspace=2 hspace=2 border=0 alt=::点击图片在新窗口中打开:: onload='javascript:if(this.width>580)this.width=580'></a></td></tr></table>",1,1,1)                                         
	case "rig" '图片居右,文字绕排                                                                                                                                             
	cText=replace(cText,"[rig]"&text,"<a href="&chr(34)&"about:<img src="&codetext&" border=0>"&chr(34)&" target=_blank><img src="&codetext ,1,1,1 )                                                                                                                                             
	cText=replace(cText,"[/rig]"," vspace=2 hspace=2 border=0 align='right' alt=::点击图片在新窗口中打开:: onload='javascript:if(this.width>580)this.width=580'></a>",1,1,1)                                                                                                                                             
                  
    case "lef" '图片居左,文字绕排                                                                                                                                             
	cText=replace(cText,"[lef]"&text,"<a href="&chr(34)&"about:<img src="&codetext&" border=0>"&chr(34)&" target=_blank><img src="&codetext ,1,1,1 )                                                                                                                                             
	cText=replace(cText,"[/lef]"," vspace=2 hspace=2 border=0 align='left' alt=::点击图片在新窗口中打开:: onload='javascript:if(this.width>580)this.width=580'></a>",1,1,1)                                                                                                                                             
                 
	case "code"                                                                                                                                             
	cText=replace(cText,"[code]"&text,"以下内容为程序代码<hr noshade>"&codetext,1,1,1)                                                                                                                                             
	cText=replace(cText,"以下内容为程序代码<hr noshade>"&codetext&"[/code]","以下内容为程序代码<hr noshade>"&codetext&"<hr noshade>",1,1,1)                                                                                                                                             
    case "quote"                                                                                                                                             
    atext=replace(text,"[cen]","",1,-1,1)                                                                                                                                             
	atext=replace(text,"[/cen]","",1,-1,1)                                                                                                                                             
                
	atext=replace(text,"[img]","",1,-1,1)                                                                                                                                             
	atext=replace(atext,"[/img]","",1,-1,1)                                                                                                                                             
	atext=replace(atext,"[swf]","",1,-1,1)                                                                                                                                             
	atext=replace(atext,"[/swf]","",1,-1,1)                                                                                                                                             
	atext=replace(atext,"[html]","",1,-1,1)                                                                                                                                             
	atext=replace(atext,"[/html]","",1,-1,1)                                                                                                                                             
'	atext=replace(atext,"{:em","{;em",1,-1,1)                                                                                                                                             
	atext=SplitWords(atext,350)                                                                                                                                             
	atext=replace(atext,chr(32),"&nbsp;",1,-1,1)                                                                                                                                             
	cText=replace(cText,"[quote]"&text,"<blockquote><hr noshade>"&atext,1,1,1)                                                                                                                                             
	cText=replace(cText,"<blockquote><hr noshade>"&atext&"[/quote]","<blockquote><hr noshade>"&atext&"<hr noshade></blockquote>",1,1,1)                                                                                                                                             
    case "swf"                                                                                                                                             
	                          
	cText=replace(cText,"[swf]"&text,"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='500' height='400'><param name=movie value='"&codetext&"'><param name=quality value=high><embed src='"&codetext&"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='500' height='400'>",1,1,1)                                                                                                                                             
                                                                                                                            
	cText=replace(cText,"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='500' height='400'><param name=movie value='"&codetext&"'><param name=quality value=high><embed src='"&codetext&"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='500' height='400'>"&"[/swf]","<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='500' height='400'><param name=movie value='"&codetext&"'><param name=quality value=high><embed src='"&codetext&"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='500' height='400'>"&"</embed></object>",1,1,1)                                                                                                                                             
end select                                                                                                                                             
loop                                                                                                                                             
Convert=cText                                                                                                                                             
end function                                                                                                                                             
                                                                                                                                
function AutoURL(ubb)                                                                                                                                             
cText=ubb                                                                                                                                             
startubb=1                                                                                                                                             
do                                                                                                                                             
startubb=1                                                                                                                                             
endubb_a=0                                                                                                                                             
endubb_b=0                                                                                                                                             
endubb=0                                                                                                                                             
startubb=instr(startubb,cText,"http://",1)                                                                                                                                             
if startubb=0 then exit do                                                                                                                                             
endubb_b=instr(startubb,cText,"<",1)                                                                                                                                             
endubb_a=instr(startubb,cText,"&nbsp;",1)                                                                                                                                             
                 
endubb=endubb_a                                                                                                                                             
              
if endubb=0 then                                                                                                                                             
endubb=endubb_b                                                                                                                                             
end if                                                                                                                                                                                                                                     
if endubb_b<endubb and endubb_b>0 then                                                                                                                                             
endubb=endubb_b                                                                                                                                             
end if                                                                                                                                             
                
if endubb=0 then                                                                                                                                             
lenc=ctext                                                                                                                                             
endubb=len(lenc)+1                                                                                                                                             
end if                                                                                                                                             
           
'response.write startubb&","&endubb                                                                                                                                             
if startubb>endubb then exit do                                                                                                                                             
text=mid(cText,startubb,endubb-startubb)                                                                                                                                             
'response.write text                                                                                                                                             
'codetext=replace(text,"/","/"&chr(176),1,-1,1)                                                                                                                                             
codetext=text                                                                                                                                             
'response.write text&","                                                                                                                                             
urllink="<a href='"&codetext&"' target=_blank>"&codetext&"</a> "                                                                                                                                             
'response.write urllink                                                                                                                                             
urllink=replace(urllink,"/","/"&chr(176),1,-1,1)                                                                                                                                             
cText=replace(cText,text,urllink,1,1,1)                                                                                                                                             
loop                                                                                                                                             
AutoURL=cText                                                                                                                                             
end function%>                                                                                                                 