复制内容到剪贴板
代码:
<% @ LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'///////////////////////////////////////////////////////////////////////////////
'// PJBlog2 to Z-Blog 数据库转换
'// 作 者: duduwolf,sipo
'// 版权所有: RainbowSoft Studio
'// 技术支持: rainbowsoft@163.com
'// 程序名称:
'// 程序版本:
'// 单元名称: PJBLOG数据库转换组件
'// 开始时间: 2006-8-15
'// 最后修改:
'// 备 注:
'///////////////////////////////////////////////////////////////////////////////
Option Explicit
Response.Buffer=True
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Dim AspCode
AspCode=""
'调试函数
Function Debug(Str)
Response.Write "<p>"&Str&"</p>"
Response.End
End Function
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Dim lmdb, zmdb, fs
If Trim(Request.Form("lmdb")) = "" Or Trim(Request.Form("zmdb")) = "" Then
ErrorMsg("请填写数据库相对路径文件名!")
End If
If Not CheckFile(Request.Form("lmdb")) Or Not CheckFile(Request.Form("zmdb")) Then ErrorMsg("非法文件名!")
lmdb = Server.MapPath(Request.Form("lmdb"))
zmdb = Server.MapPath(Request.Form("zmdb"))
Set fs = CreateObject("Scripting.FileSystemObject")
If Not fs.FileExists(lmdb) Then Set fs = Nothing:ErrorMsg("pj-blog数据库文件不存在!")
If Not fs.FileExists(zmdb) Then
If Not CreateMDB(zmdb) Then ErrorMsg("Z-Blog数据库创建失败,请检查文件路径和文件名!")
End If
Head
Response.Write("<div id=""divResult"">"&vbcrlf)
Call PJ2Z(lmdb, zmdb)
Response.Write("</div>"&vbcrlf)
Foot
Else
Head:Main:Foot
End If
'报错函数
Function ErrorMsg(Msg)
Head
Response.Write("<div id=""divError"">"&Msg&"<br /><br /><a href=""javascript:history.back();"">返回</a></div>")
Foot
Response.End
End Function
'检查文件名的合法性,暂时不完全
Function CheckFile(FileName)
If Instr(FileName, ":\") = 0 And Instr(FileName, "?") = 0 And Instr(FileName, "%") = 0 Then
CheckFile = True
Else
CheckFile = False
End If
End Function
'建立Access数据库文件
Function CreateMDB(DBName)
'On Error Resume Next
Dim Cat
If DBName<>"" Then
If Instr(DBName,":\")=0 And Instr(DBName,":/")=0 Then
DBName=Server.MapPath(DBName)
End If
Set Cat=Server.CreateObject("ADOX.Catalog")
Cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&DBName
Set Cat=nothing
If Err.Number <> 0 Then
ErrorMsg(Err.Description)
CreateMDB = False
Else
CreateMDB = CreateTable(DBName)
End If
Err.Clear
Else
CreateMDB = False
End If
End Function
'在新创建的Access数据库文件中创建Z-Blog的数据表
Function CreateTable(DB_Name)
Dim Conn
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&DB_Name
'[blog_Article]:
Conn.execute("CREATE TABLE [blog_Article] ("&_
"[log_ID] integer IDENTITY (1,1) not null,"&_
"[log_CateID] integer Default 0,"&_
"[log_AuthorID] integer Default 0,"&_
"[log_Level] integer Default 1,"&_
"[log_Url] text(255),"&_
"[log_Title] text(255),"&_
"[log_Intro] text,"&_
"[log_Content] text,"&_
"[log_IP] text(15),"&_
"[log_PostTime] datetime Default Now(),"&_
"[log_CommNums] integer Default 0,"&_
"[log_ViewNums] integer Default 0,"&_
"[log_TrackBackNums] integer Default 0,"&_
"[log_Tag] VARCHAR(255),"&_
"[log_IsTop] YESNO DEFAULT FALSE"&_
")")
Conn.execute("CREATE Unique INDEX [PrimaryKey] on [blog_Article]([log_ID] ) with Primary")
Conn.execute("CREATE INDEX [blog_ID] on [blog_Article]([log_ID] )")
Conn.execute("CREATE INDEX [log_AuthorID] on [blog_Article]([log_AuthorID] )")
Conn.execute("CREATE INDEX [log_CateID] on [blog_Article]([log_CateID] )")
Conn.execute("CREATE INDEX [log_PostTime] on [blog_Article]([log_PostTime] )")
'[blog_Category]:
Conn.execute("CREATE TABLE [blog_Category] ("&_
"[cate_ID] integer IDENTITY (1,1) not null,"&_
"[cate_Name] text(50),"&_
"[cate_Order] integer Default 0,"&_
"[cate_Intro] text(255),"&_
"[cate_Count] integer Default 0"&_
")")
Conn.execute("CREATE Unique INDEX [PrimaryKey] on [blog_Category]([cate_ID] ) with Primary")
Conn.execute("CREATE INDEX [cate_ID] on [blog_Category]([cate_ID] )")
'[blog_Comment]:
Conn.execute("CREATE TABLE [blog_Comment] ("&_
"[comm_ID] integer IDENTITY (1,1) not null,"&_
"[log_ID] integer Default 0,"&_
"[comm_AuthorID] integer Default 0,"&_
"[comm_Author] text(20),"&_
"[comm_Content] text,"&_
"[comm_Email] text(50),"&_
"[comm_HomePage] text(255),"&_
"[comm_PostTime] datetime Default Now(),"&_
"[comm_IP] text(15),"&_
"[comm_Agent] text"&_
")")
Conn.execute("CREATE Unique INDEX [PrimaryKey] on [blog_Comment]([comm_ID] ) with Primary")
Conn.execute("CREATE INDEX [comm_AuthorID] on [blog_Comment]([comm_AuthorID] )")
Conn.execute("CREATE INDEX [comm_ID] on [blog_Comment]([comm_ID] )")
Conn.execute("CREATE INDEX [comm_PostTime] on [blog_Comment]([comm_PostTime] )")
Conn.execute("CREATE INDEX [log_ID] on [blog_Comment]([log_ID] )")
'[blog_Member]:
Conn.execute("CREATE TABLE [blog_Member] ("&_
"[mem_ID] integer IDENTITY (1,1) not null,"&_
"[mem_Level] integer Default 0,"&_
"[mem_Name] text(20),"&_
"[mem_Password] text(32),"&_
"[mem_Sex] tinyint Default 0,"&_
"[mem_Email] text(50),"&_
"[mem_MSN] text(50),"&_
"[mem_QQ] text(50),"&_
"[mem_HomePage] text(255),"&_
"[mem_LastVisit] datetime Default Now(),"&_
"[mem_Status] integer Default 0,"&_
"[mem_PostLogs] integer Default 0,"&_
"[mem_PostComms] integer Default 0,"&_
"[mem_Intro] text,"&_
"[mem_IP] text(15),"&_
"[mem_Count] integer Default 0"&_
")")
Conn.execute("CREATE Unique INDEX [mem_Name] on [blog_Member]([mem_Name] )")
Conn.execute("CREATE Unique INDEX [PrimaryKey] on [blog_Member]([mem_ID] ) with Primary")
Conn.execute("CREATE INDEX [mem_ID] on [blog_Member]([mem_ID] )")
Conn.execute("CREATE INDEX [mem_UserGroupID] on [blog_Member]([mem_Level] )")
'[blog_TrackBack]:
Conn.execute("CREATE TABLE [blog_TrackBack] ("&_
"[tb_ID] integer IDENTITY (1,1) not null,"&_
"[log_ID] integer Default 0,"&_
"[tb_URL] text(255),"&_
"[tb_Title] text(100),"&_
"[tb_Blog] text(50),"&_
"[tb_Excerpt] text,"&_
"[tb_PostTime] datetime Default Now(),"&_
"[tb_IP] text(15),"&_
"[tb_Agent] text"&_
")")
Conn.execute("CREATE Unique INDEX [PrimaryKey] on [blog_TrackBack]([tb_ID] ) with Primary")
Conn.execute("CREATE INDEX [blog_ID] on [blog_TrackBack]([log_ID] )")
Conn.execute("CREATE INDEX [tb_ID] on [blog_TrackBack]([tb_ID] )")
Conn.execute("CREATE INDEX [tb_PostTime] on [blog_TrackBack]([tb_PostTime] )")
'[blog_UpLoad]:
Conn.execute("CREATE TABLE [blog_UpLoad] ("&_
"[ul_ID] integer IDENTITY (1,1) not null,"&_
"[ul_AuthorID] integer Default 0,"&_
"[ul_FileSize] integer Default 0,"&_
"[ul_FileName] text(50),"&_
"[ul_PostTime] datetime Default Now()"&_
")")
Conn.execute("CREATE Unique INDEX [PrimaryKey] on [blog_UpLoad]([ul_ID] ) with Primary")
Conn.execute("CREATE Unique INDEX [ul_FileName] on [blog_UpLoad]([ul_FileName] )")
Conn.execute("CREATE INDEX [log_AuthorID] on [blog_UpLoad]([ul_AuthorID] )")
Conn.execute("CREATE INDEX [log_PostTime] on [blog_UpLoad]([ul_PostTime] )")
Conn.execute("CREATE INDEX [ul_AuthorID] on [blog_UpLoad]([ul_FileSize] )")
Conn.execute("CREATE INDEX [ym_ID] on [blog_UpLoad]([ul_ID] )")
Conn.execute("CREATE TABLE [blog_Tag] (tag_ID AutoIncrement primary key,tag_Name VARCHAR(255),tag_Intro text,tag_ParentID int,tag_URL VARCHAR(255),tag_Order int,tag_Count int)")
Conn.execute("CREATE TABLE [blog_Counter] (coun_ID AutoIncrement primary key,coun_IP VARCHAR(20),coun_Agent text,coun_Refer VARCHAR(255),coun_PostTime TIME DEFAULT Now())")
Conn.execute("CREATE TABLE [blog_Keyword] (key_ID AutoIncrement primary key,key_Name VARCHAR(255),key_Intro text,key_URL VARCHAR(255))")
If Conn.Errors.Count <> 0 Then
CreateTable = False
Else
CreateTable = True
End If
Set Conn = Nothing
End Function
'执行SQL脚本
Function MyExeSql(Sql, ConnObj)
Dim Rs_Fun, Conn
Set Conn = ConnObj
Set Rs_Fun = Conn.Execute(Sql)
If Not Rs_Fun.Eof Then
MyExeSql = Rs_Fun(0)
Else
MyExeSql = Null
End If
Rs_Fun.Close
Set Rs_Fun = Nothing
Set Conn = Nothing
End Function
'页面头部
Function Head()
Response.Write("<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">"&vbcrlf&"<html>"&vbcrlf&"<head>"&vbcrlf&"<title>pj-blog2数据库 - Z-Blog1.6数据库转换程序</title>"&vbcrlf&"<meta name=""generator"" content=""editplus"">"&vbcrlf&"<meta name=""author"" content=""duduwolf,sipo"">"&vbcrlf&"<meta name=""Keywords"" content=""blog开发 blog转换程序 z-blog pj-blog blog"">"&vbcrlf&"<meta name=""Description"" content=""pj-blog2数据库转换为z-blog1.6数据库格式"">"&vbcrlf&"<style>"&vbcrlf&"body{ margin:0; padding:0; color:#000000; font-size:12pt; background:#ffffff repeat-x top; text-align:center;}"&vbcrlf&"#divTop { width:80%; padding:20px 20px; border-bottom:#0099FF solid 2px; font-weight:bolder; font-size:1.5em;}"&vbcrlf&"#divMain { margin:50px 20px 20px 20px;}"&vbcrlf&"#divFoot { width:80%; margin:10px; padding:10px 10px; border-top:#0099FF solid 2px; font-size:0.8em; text-align:center;}"&vbcrlf&"input.mdb{ width:300px; }"&vbcrlf&"form{ margin:0 auto; margin:0;}"&vbcrlf&"#divForm { text-align:left;}"&vbcrlf&"#divForm ul{ margin:0; padding:0 0 0 20px;}"&vbcrlf&"#divSubmit { text-align:center;}"&vbcrlf&"#divForm li{ margin:0 5px 0 0px; list-style-type:none;}"&vbcrlf&"#divError { text-align:center; color:red; margin:50px 0 50px 0;}"&vbcrlf&".note{ color:#0099CC; font-size:11pt;}"&vbcrlf&"#divResult {margin:20px 20px 20px 20px; font-size:1.2em; text-align:center;}"&vbcrlf&"#divNote {margin:110px 50px 0 50px;font-size:0.8em;}"&vbcrlf&"</style>"&vbcrlf&"</head>"&vbcrlf&"<body>"&vbcrlf)
End Function
'页面底部
Function Foot()
Response.Write("</body>"&vbcrlf&"</html>")
End Function
'主页面
Function Main()
Response.Write("<div id=""divTop"">"&vbcrlf&"pj-blog2数据库 to Z-Blog1.6数据库转换程序 Build 60815"&vbcrlf&"</div>"&vbcrlf&"<div id=""divMain"">"&vbcrlf&"<form name=""trans"" method=""post"" onsubmit=""return checkValue();"">"&vbcrlf&"<script language=""JAVASCRIPT"">"&vbcrlf&"<!--"&vbcrlf&"function checkValue(){"&vbcrlf&" var b = true;"&vbcrlf&" if(document.trans.lmdb.value==""""){"&vbcrlf&" lnote.innerText=""请输入pj-blog2的数据库相对路径的文件名"";"&vbcrlf&" lnote.style.color=""red"";"&vbcrlf&" b=false;"&vbcrlf&" }else lnote.innerText="""";"&vbcrlf&" if(document.trans.zmdb.value==""""){"&vbcrlf&" znote.innerText=""请输入Z-Blog1.6的数据库相对路径的文件名"";"&vbcrlf&" znote.style.color=""red"";"&vbcrlf&" b=false;"&vbcrlf&" }else znote.innerText="""";"&vbcrlf&" return b;"&vbcrlf&"}"&vbcrlf&"//-->"&vbcrlf&"</script>"&vbcrlf&"<div id=""divForm"">"&vbcrlf&"<p>pj-blog2数据库地址:<input type=""text"" class=""mdb"" name=""lmdb"" id=""lmdb"" value=""pjblog2.mdb""> <span class=""note"" id=""lnote"">请使用相对路径</span></p>"&vbcrlf&"<p> Z-Blog1.6数据库地址:<input type=""text"" class=""mdb"" name=""zmdb"" id=""zmdb"" value=""zblog.mdb""> <span class=""note"" id=""znote"">请使用相对路径</span></p>"&vbcrlf&"</div>"&vbcrlf&"<div id=""divSubmit"">"&vbcrlf&"<p><input type=""submit"" name=""btnSubmit"" value=""进行转换""></p>"&vbcrlf&"</div>"&vbcrlf&"</form>"&vbcrlf&"<div id=""divNote"">请按照提示输入pj-blog数据库相对路径的文件名,Z-Blog的数据库文件可以输入存在的文件或者输入新的文件名进行新创建。</div>"&vbcrlf&"</div>"&vbcrlf&"<div id=""divFoot"">"&vbcrlf&"Power by <a href=""http://www.duduwolf.com/"" target=""_blank"">duduwolf</a> ,<a href=""http://www.dc9.cn/"" target=""_blank"">sipo</a>"&vbcrlf&"</div>"&vbcrlf)
End Function
'成功转换后显示结果
Function ShowResult(Msg)
Response.Write("<p>"&Msg&"</p>"&vbcrlf)
Response.Flush
End Function
Public Arr_Smilies,Arr_Keywords
'pjblog到ZBlog的转换函数
Sub PJ2Z(l, z)
Dim ConnL, ConnZ, RsPJ, RsZ, Rs, Count
'On Error Resume Next
Set ConnL=Server.CreateObject("ADODB.Connection")
ConnL.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&l
Set ConnZ=Server.CreateObject("ADODB.Connection")
ConnZ.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&z
Set RsPJ = Server.CreateObject("ADODB.RecordSet")
Set RsZ = Server.CreateObject("ADODB.RecordSet")
Dim log_Smilies,log_SmiliesList,TempVar
Set log_Smilies=ConnL.Execute("SELECT sm_ID,sm_Image,sm_Text FROM blog_Smilies")
TempVar=""
Do While Not log_Smilies.EOF
log_SmiliesList=log_SmiliesList&TempVar&log_Smilies("sm_ID")&"|"&log_Smilies("sm_Image")&"|"&log_Smilies("sm_Text")
TempVar=","
log_Smilies.MoveNext
Loop
Set log_Smilies=Nothing
Arr_Smilies=Split(log_SmiliesList,",")
Dim log_Keywords,log_KeywordsList
Set log_Keywords=ConnL.Execute("SELECT key_ID,key_Text,key_URL,key_Image FROM blog_Keywords")
TempVar=""
Do While Not log_Keywords.EOF
IF log_Keywords("key_Image")<>Empty Then
log_KeywordsList=log_KeywordsList&TempVar&log_Keywords("key_ID")&"$|$"&log_Keywords("key_Text")&"$|$"&log_Keywords("key_URL")&"$|$"&log_Keywords("key_Image")
Else
log_KeywordsList=log_KeywordsList&TempVar&log_Keywords("key_ID")&"$|$"&log_Keywords("key_Text")&"$|$"&log_Keywords("key_URL")&"$|$None"
End IF
TempVar="|$|"
log_Keywords.MoveNext
Loop
Set log_Keywords=Nothing
Arr_Keywords=Split(log_KeywordsList,"|$|")
'blog_Category
RsPJ.Open "select * from blog_Category order by cate_Order", ConnL, 1, 1
If Not RsPJ.Eof Then
RsZ.Open "select * from blog_Category", ConnZ, 1, 3
Count = 0
Do While Not RsPJ.Eof
If CInt(MyExeSql("select count(*) from blog_Category where cate_name='"&RsPJ("cate_name")&"'", ConnZ)) = 0 Then
RsZ.AddNew
RsZ("cate_name") = RsPJ("cate_name")
RsZ("cate_order") = RsPJ("cate_Order")
RsZ("cate_intro") = RsPJ("cate_Intro")
RsZ("cate_count") = RsPJ("cate_count")
RsZ.Update
Else
ConnZ.Execute("update blog_category set cate_count=cate_count+"&MyExeSql("select count(*) from blog_content where log_cateid="&RsPJ("cate_id"), ConnL)&" where cate_id=(select cate_id from blog_category where cate_name='"&RsPJ("cate_name")&"')")
End If
Count = Count + 1
RsPJ.MoveNext
Loop
RsZ.Close
End If
RsPJ.Close
If Err.Number<>0 Then ShowResult("Blog_Category表转换失败!"):Exit Sub Else ShowResult("Blog_Category表转换成功,共导入"&Count&"条数据!")
'////////////////////////////////////////////////////////////////////////
'blog_Member
RsPJ.Open "select * from blog_member order by mem_id", ConnL, 1, 1
If Not RsPJ.Eof Then
RsZ.Open "select * from blog_member", ConnZ, 1, 3
Count = 0
Do While Not RsPJ.Eof
If CInt(MyExeSql("select count(*) from blog_member where mem_name='"&RsPJ("mem_name")&"'", ConnZ)) = 0 Then
if RsPJ("mem_status")<>"Member" then
RsZ.AddNew
Select Case RsPJ("mem_status")
Case "SupAdmin":RsZ("mem_level") = 1
Case "Admin":RsZ("mem_level") = 2
'Case "Member":RsZ("mem_level") = 4
End Select
RsZ("mem_name") = RsPJ("mem_name")
RsZ("mem_password") = "aa055c6d7875a18fa49058c2c48f2140"
RsZ("mem_sex") = RsPJ("mem_sex")
If IsNull(RsPJ("mem_email")) Or RsPJ("mem_email")="" Then
RsZ("mem_email") = "a@b.com"
Else
RsZ("mem_email") = RsPJ("mem_email")
End If
RsZ("mem_msn") = ""
RsZ("mem_QQ") = RsPJ("mem_QQ")
RsZ("mem_homepage") = RsPJ("mem_homepage")
RsZ("mem_lastvisit") = Null
RsZ("mem_status") = 1
RsZ("mem_postlogs") = RsPJ("mem_postlogs")
RsZ("mem_postcomms") = RsPJ("mem_postcomms")
RsZ("mem_intro") = RsPJ("mem_intro")
RsZ("mem_ip") = RsPJ("mem_lastip")
RsZ("mem_count") = 0
RsZ.Update
End If
Else
ConnZ.Execute("update blog_member set mem_postlogs=mem_postlogs+"&RsPJ("mem_postlogs")&",mem_postcomms=mem_postcomms+"&RsPJ("mem_postcomms")&" where mem_name='"&RsPJ("mem_name")&"'")
End If
Count = Count + 1
RsPJ.MoveNext
Loop
RsZ.Close
End If
RsPJ.Close
If Err.Number<>0 Then ShowResult("Blog_Member表转换失败!"):Exit Sub Else ShowResult("Blog_Member表转换成功,共导入"&Count&"条数据!")
'blog_Tags
RsPJ.Open "select * from blog_tag order by tag_id", ConnL, 1, 1
If Not RsPJ.Eof Then
RsZ.Open "select * from blog_tag", ConnZ, 1, 3
Count = 0
Do While Not RsPJ.Eof
If CInt(MyExeSql("select count(*) from blog_tag where tag_name='"&RsPJ("tag_name")&"'", ConnZ)) = 0 Then
RsZ.AddNew
RsZ("tag_name") = RsPJ("tag_name")
RsZ("tag_count") = RsPJ("tag_count")
RsZ.Update
Else
ConnZ.Execute("update blog_tag set tag_count=tag_count+"&MyExeSql("select count(*) from blog_content where log_tag LIKE '%{"&RsPJ("tag_id")&"}%'", ConnL)&" where tag_id=(select tag_id from blog_tag where tag_name='"&RsPJ("tag_name")&"')")
End If
Count = Count + 1
RsPJ.MoveNext
Loop
RsZ.Close
End If
RsPJ.Close
If Err.Number<>0 Then ShowResult("Blog_Tag表转换失败!"):Exit Sub Else ShowResult("Blog_Tag表转换成功,共导入"&Count&"条数据!")
'blog_Article
Dim Dict
Dim aryTAGs,Tag,j,strTag,zTag
Set Dict = Server.CreateObject("Scripting.Dictionary")
RsPJ.Open "select * from blog_content order by log_posttime", ConnL, 1, 1
If Not RsPJ.Eof Then
RsZ.Open "select * from blog_article", ConnZ, 1, 3
Count = 0
Do While Not RsPJ.Eof
RsZ.AddNew
RsZ("log_cateid") = MyExeSql("select cate_id from blog_category where cate_name='"&MyExeSql("select cate_name from blog_category where cate_id="&RsPJ("log_cateid"), ConnL)&"'", ConnZ)
Tag=RsPJ("log_Tag")
zTag=""
Tag=Replace(Tag,"}","")
aryTAGs=Split(Tag,"{")
For j = LBound(aryTAGs) To UBound(aryTAGs)
If aryTAGs(j)<>"" Then
strTag = MyExeSql("select tag_id from blog_tag where tag_name='"&MyExeSql("select tag_name from blog_tag where tag_id="&aryTAGs(j),ConnL)&"'",ConnZ)
strTag="{"&strTag&"}"
if strTag<>"{}" then zTag=zTag&strTag
If j=UBound(aryTAGs) Then Exit For
End If
Next
RsZ("log_tag")=zTag
RsZ("log_authorid") = MyExeSql("select mem_id from blog_member where mem_name='"&RsPJ("log_author")&"'", ConnZ)
RsZ("log_level") = 4
If RsPJ("log_DisComment")=-1 Then RsZ("log_level") = 3
If RsPJ("log_IsShow")=False Then RsZ("log_level") = 2
if rsPj("log_IsTop")=true then rsz("log_IsTop")=true
RsZ("log_url") = ""
RsZ("log_title") = RsPJ("log_title")
RsZ("log_intro") =UnCheckStr( UBBCode(RsPJ("log_intro"),0,0,0,0,0) )
RsZ("log_content") = UnCheckStr (UBBCode(RsPJ("log_content"),0,0,0,0,0))
RsZ("log_ip") = ""
RsZ("log_posttime") = RsPJ("log_posttime")
RsZ("log_commnums") = RsPJ("log_commnums")
RsZ("log_viewnums") = RsPJ("log_viewnums")
RsZ("log_trackbacknums") = MyExeSql("select count(*) from blog_trackback where blog_id="&RsPJ("log_id"), ConnL)
RsZ.Update
Dict.Add CStr(RsPJ("log_id")), CStr(RsZ("log_id"))
Count = Count + 1
RsPJ.MoveNext
Loop
RsZ.Close
End If
RsPJ.Close
If Err.Number<>0 Then ShowResult("Blog_Article表转换失败!"):Exit Sub Else ShowResult("Blog_Article表转换成功,共导入"&Count&"条数据!")
'blog_TrackBack
RsPJ.Open "select * from blog_trackback", ConnL, 1, 1
If Not RsPJ.Eof Then
RsZ.Open "select * from blog_trackback", ConnZ, 1, 3
Count = 0
Do While Not RsPJ.Eof
RsZ.AddNew
RsZ("log_id") = Dict.Item(CStr(RsPJ("blog_id")))
RsZ("tb_url") = RsPJ("tb_url")
RsZ("tb_title") = RsPJ("tb_title")
RsZ("tb_blog") = RsPJ("tb_site")
RsZ("tb_excerpt") = RsPJ("tb_intro")
RsZ("tb_posttime") = RsPJ("tb_posttime")
RsZ("tb_ip") = ""
RsZ("tb_agent") = ""
RsZ.Update
Count = Count + 1
RsPJ.MoveNext
Loop
RsZ.Close
End If
RsPJ.Close
If Err.Number<>0 Then ShowResult("Blog_TrackBack表转换失败!"):Exit Sub Else ShowResult("Blog_TrackBack表转换成功,共导入"&Count&"条数据!")
'blog_Comment
RsPJ.Open "select * from blog_comment", ConnL, 1, 1
If Not RsPJ.Eof Then
RsZ.Open "select * from blog_comment", ConnZ, 1, 3
Count = 0
Do While Not RsPJ.Eof
RsZ.AddNew
RsZ("log_id") = Dict.Item(CStr(RsPJ("blog_id")))
If IsNumeric(MyExeSql("select mem_id from blog_member where mem_name='"&RsPJ("comm_author")&"'", ConnZ)) Then
RsZ("comm_authorid") = MyExeSql("select mem_id from blog_member where mem_name='"&RsPJ("comm_author")&"'", ConnZ)
RsZ("comm_email") = MyExeSql("select mem_Email from blog_member where mem_name='"&RsPJ("comm_author")&"'", ConnZ)
Else
RsZ("comm_authorid") = 0
RsZ("comm_email") = "a@b.com"
End If
RsZ("comm_author") = RsPJ("comm_author")
RsZ("comm_content") = RsPJ("comm_content")
RsZ("comm_homepage") = ""
RsZ("comm_posttime") = RsPJ("comm_posttime")
RsZ("comm_ip") = RsPJ("comm_postip")
RsZ("comm_agent") = ""
RsZ.Update
Count = Count + 1
RsPJ.MoveNext
Loop
RsZ.Close
End If
RsPJ.Close
Set Dict = Nothing
If Err.Number<>0 Then ShowResult("Blog_Comment表转换失败!"):Exit Sub Else ShowResult("Blog_Comment表转换成功,共导入"&Count&"条数据!")
'pj-blog.Blog_Info
RsPJ.Open "select * from blog_info", ConnL, 1, 1
If Not RsPJ.Eof Then
AspCode = AspCode & "'------------以下内容请插入(替换)""c_custom.asp""文件中-------------"&vbcrlf
AspCode = AspCode & "Const ZC_BLOG_TITLE="""&RsPJ("blog_name")&""""&vbcrlf
AspCode = AspCode & "Const ZC_BLOG_HOST="""&RsPJ("blog_url")&""""&vbcrlf
End If
RsPJ.Close
'pj-blog.Blog_Links
RsPJ.Open "select * from blog_links order by link_order", ConnL, 1, 1
If Not RsPJ.Eof Then
AspCode = AspCode & vbcrlf & vbcrlf & "'------------以下内容请插入(替换)""INCLUDE/link.asp""文件中-------------"&vbcrlf
Do While Not RsPJ.Eof
AspCode = AspCode & "<li><a href="""&RsPJ("link_url")&""">"&RsPJ("link_name")&"</a></li>"&vbcrlf
RsPJ.MoveNext
Loop
End If
RsPJ.Close
AspCode=AspCode&"'-----################################################################-----'"&vbcrlf
AspCode=AspCode&"'-------注意所有管理员密码变更为zblogger,请登陆后台更改所有管理员密码-----'"&vbcrlf
AspCode=AspCode&"'-------################################################################-----'"&vbcrlf
AspCode=AspCode&"'---注意请把PJBLOG下面的attachments和image文件夹上传并覆盖Z-Blog根目录下!!这样你才能显示图片和附件哦!!-----'"&vbcrlf
ShowResult("数据库成功转换,请按照下面的说明将相应代码插入Z-Blog系统中<br /><textarea readonly rows=""20"" cols=""100"" wrap=""off"">"&AspCode&"</textarea>")
If ConnL.Errors.Count <> 0 Or ConnZ.Errors.Count <> 0 Or Err.Number <> 0 Then
Err.Clear
ShowResult("数据插入时出现了错误,转换失败!")
End If
Set RsPJ = Nothing
Set RsZ = Nothing
Set ConnL = Nothing
Set ConnZ = Nothing
End Sub
Function UBBCode(ByVal strContent,DisSM,DisUBB,DisIMG,AutoURL,AutoKEY)
If isEmpty(strContent) Or isNull(strContent) Then
Exit Function
Else
Dim re, strMatchs, strMatch, rndID,tmpStr1,tmpStr2,tmpStr3,tmpStr4
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
IF AutoURL=1 Then
re.Pattern="([^=\]][\s]*?|^)(http|https|rstp|ftp|mms|ed2k)://([A-Za-z0-9\.\/=\?%\-_~`@':+!]*)"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=strMatch.SubMatches(1)
tmpStr3=checkURL(strMatch.SubMatches(2))
strContent=replace(strContent,strMatch.Value,tmpStr1&"<a href="""&tmpStr2&"://"&tmpStr3&""" target=""_blank"">"&tmpStr2&"://"&tmpStr3&"</a>",1,-1,0)
Next
're.Pattern="(^|\s)(www\.\S+)"
'strContent=re.Replace(strContent,"$1<a href=""http://$2"" target=""_blank"">$2</a>")
End IF
IF Not DisUBB=1 Then
IF Not DisIMG=1 Then
re.Pattern="(\[img\])(.[^\]]*)\[\/img\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=(strMatch.SubMatches(1))
strContent=replace(strContent,strMatch.Value,"<img src="""&tmpStr1&""" border=""0"" alt=""""/>",1,-1,0)
Next
re.Pattern="\[img=(left|right|center|absmiddle|)\](.[^\]]*)(\[\/img\])"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=checkURL(strMatch.SubMatches(1))
strContent=replace(strContent,strMatch.Value,"<img align="""&tmpStr1&""" src="""&tmpStr2&""" border=""0"" alt=""""/>",1,-1,0)
Next
re.Pattern="\[img=(\d*|),(\d*|)\](.[^\]]*)\[\/img\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=strMatch.SubMatches(1)
tmpStr3=checkURL(strMatch.SubMatches(2))
strContent=replace(strContent,strMatch.Value,"<img width="""&tmpStr1&""" height="""&tmpStr2&""" src="""&tmpStr3&""" border=""0"" alt=""""/>",1,-1,0)
Next
re.Pattern="\[img=(\d*|),(\d*|),(left|right|center|absmiddle|)\](.[^\]]*)(\[\/img\])"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=strMatch.SubMatches(1)
tmpStr3=strMatch.SubMatches(2)
tmpStr4=checkURL(strMatch.SubMatches(3))
strContent=replace(strContent,strMatch.Value,"<img width="""&tmpStr1&""" height="""&tmpStr2&""" align="""&tmpStr3&""" src="""&tmpStr4&""" border=""0"" alt=""""/>",1,-1,0)
Next
else
re.Pattern="(\[img\])(.[^\]]*)\[\/img\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(1))
strContent=replace(strContent,strMatch.Value,"<a href="""&tmpStr1&""" target=""_blank"" title="""&tmpStr1&"""><img src=""images/image.gif"" alt="""" style=""margin:0px 2px -3px 0px"" border=""0""/>查看图片</a>",1,-1,0)
Next
re.Pattern="\[img=(left|right|center|absmiddle|)\](.[^\]]*)(\[\/img\])"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=checkURL(strMatch.SubMatches(1))
strContent=replace(strContent,strMatch.Value,"<a href="""&tmpStr2&""" target=""_blank"" title="""&tmpStr2&"""><img src=""images/image.gif"" alt="""" style=""margin:0px 2px -3px 0px"" border=""0""/>查看图片</a>",1,-1,0)
Next
re.Pattern="\[img=(\d*|),(\d*|)\](.[^\]]*)\[\/img\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=strMatch.SubMatches(1)
tmpStr3=checkURL(strMatch.SubMatches(2))
strContent=replace(strContent,strMatch.Value,"<a href="""&tmpStr3&""" target=""_blank"" title="""&tmpStr3&"""><img src=""images/image.gif"" alt="""" style=""margin:0px 2px -3px 0px"" border=""0""/>查看图片</a>",1,-1,0)
Next
re.Pattern="\[img=(\d*|),(\d*|),(left|right|center|absmiddle|)\](.[^\]]*)(\[\/img\])"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=strMatch.SubMatches(1)
tmpStr3=strMatch.SubMatches(2)
tmpStr4=checkURL(strMatch.SubMatches(3))
strContent=replace(strContent,strMatch.Value,"<a href="""&tmpStr4&""" target=""_blank"" title="""&tmpStr4&"""><img src=""images/image.gif"" alt="""" style=""margin:0px 2px -3px 0px"" border=""0""/>查看图片</a>",1,-1,0)
Next
End IF
'-----------多媒体标签----------------
re.Pattern="\[(swf|wma|wmv|rm|ra|qt)(=\d*?|)(,\d*?|)\]([^<>]*?)\[\/(swf|wma|wmv|rm|ra|qt)\]"
Set strMatchs=re.Execute(strContent)
dim strType,strWidth,strHeight,strSRC,TitleText
For Each strMatch in strMatchs
RAndomize
strType=strMatch.SubMatches(0)
if strType="swf" then
TitleText="<img src=""images/flash.gif"" alt="""" style=""margin:0px 2px -3px 0px"" border=""0""/>Flash动画"
elseif strType="wma" then
TitleText="<img src=""images/music.gif"" alt="""" style=""margin:0px 2px -3px 0px"" border=""0""/>播放音频文件"
elseif strType="wmv" then
TitleText="<img src=""images/mediaplayer.gif"" alt="""" style=""margin:0px 2px -3px 0px"" border=""0""/>播放视频文件"
elseif strType="rm" then
TitleText="<img src=""images/realplayer.gif"" alt="""" style=""margin:0px 2px -3px 0px"" border=""0""/>播放real视频流文件"
elseif strType="ra" then
TitleText="<img src=""images/realplayer.gif"" alt="""" style=""margin:0px 2px -3px 0px"" border=""0""/>播放real音频流文件"
elseif strType="qt" then
TitleText="<img src=""images/mediaplayer.gif"" alt="""" style=""margin:0px 2px -3px 0px"" border=""0""/>播放mov视频文件"
end if
strWidth=strMatch.SubMatches(1)
strHeight=strMatch.SubMatches(2)
if (len(strWidth)=0) then
strWidth="400"
else
strWidth=right(strWidth,(len(strWidth)-1))
end if
if (len(strHeight)=0) then
strHeight="300"
else
strHeight=right(strHeight,(len(strHeight)-1))
end if
strSRC=checkURL(strMatch.SubMatches(3))
rndID="temp"&Int(100000 * Rnd)
strContent= Replace(strContent,strMatch.Value,"<div class=""UBBPanel""><div class=""UBBTitle"">"&TitleText&"</div><div class=""UBBContent""><a id="""+rndID+"_href"" href=""javascript:MediaShow('"+strType+"','"+rndID+"','"+strSRC+"','"+strWidth+"','"+strHeight+"')""><img name="""+rndID+"_img"" src=""images/mm_snd.gif"" style=""margin:0px 3px -2px 0px"" border=""0"" alt=""""/><span id="""+rndID+"_text"">在线播放</span></a><div id="""+rndID+"""></div></div></div><script> var MediaTemp=new Array();function MediaShow(strType,strID,strURL,intWidth,intHeight){ var tmpstr; if (MediaTemp[strID]==undefined) MediaTemp[strID]=false; else MediaTemp[strID]=!MediaTemp[strID]; if(MediaTemp[strID]){ if ( document.all ) { document.getElementById(strID).outerHTML = '<div id=""'+strID+'""></div>'; } else { document.getElementById(strID).innerHTML = ''; } document.images[strID+""_img""].src=""images/mm_snd.gif""; document.getElementById(strID+""_text"").innerHTML=""在线播放"" ; }else{ document.images[strID+""_img""].src=""images/mm_snd_stop.gif""; document.getElementById(strID+""_text"").innerHTML=""关闭在线播放""; switch(strType){ case ""swf"": tmpstr='<div style=""height:6px;overflow:hidden""></div><object codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"" classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" width=""'+intWidth+'"" height=""'+intHeight+'""><param name=""movie"" value=""'+strURL+'"" /><param name=""quality"" value=""high"" /><param name=""AllowScriptAccess"" value=""never"" /><embed src=""'+strURL+'"" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width=""'+intWidth+'"" height=""'+intHeight+'"" /></object>'; break; case ""wma"": tmpstr='<div style=""height:6px;overflow:hidden""></div><object classid=""CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"" id=""MediaPlayer"" width=""450"" height=""70""><param name=""""howStatusBar"" value=""-1""><param name=""AutoStart"" value=""False""><param name=""Filename"" value=""'+strURL+'""></object>'; break; case ""wmv"": tmpstr='<div style=""height:6px;overflow:hidden""></div><object classid=""clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"" codebase=""http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902"" type=""application/x-oleobject"" standby=""Loading..."" width=""'+intWidth+'"" height=""'+intHeight+'""><param name=""FileName"" VALUE=""'+strURL+'"" /><param name=""ShowStatusBar"" value=""-1"" /><param name=""AutoStart"" value=""true"" /><embed type=""application/x-mplayer2"" pluginspage=""http://www.microsoft.com/Windows/MediaPlayer/"" src=""'+strURL+'"" autostart=""true"" width=""'+intWidth+'"" height=""'+intHeight+'"" /></object>'; break; case ""rm"": tmpstr='<div style=""height:6px;overflow:hidden""></div><object classid=""clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"" width=""'+intWidth+'"" height=""'+intHeight+'""><param name=""SRC"" value=""'+strURL+'"" /><param name=""CONTROLS"" VALUE=""ImageWindow"" /><param name=""CONSOLE"" value=""one"" /><param name=""AUTOSTART"" value=""true"" /><embed src=""'+strURL+'"" nojava=""true"" controls=""ImageWindow"" console=""one"" width=""'+intWidth+'"" height=""'+intHeight+'""></object><br/><object classid=""clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"" width=""'+intWidth+'"" height=""32"" /><param name=""CONTROLS"" value=""StatusBar"" /><param name=""AUTOSTART"" value=""true"" /><param name=""CONSOLE"" value=""one"" /><embed src=""'+strURL+'"" nojava=""true"" controls=""StatusBar"" console=""one"" width=""'+intWidth+'"" height=""24"" /></object>'+'<br /><object classid=""clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"" width=""'+intWidth+'"" height=""32"" /><param name=""CONTROLS"" value=""ControlPanel"" /><param name=""AUTOSTART"" value=""true"" /><param name=""CONSOLE"" value=""one"" /><embed src=""'+strURL+'"" nojava=""true"" controls=""ControlPanel"" console=""one"" width=""'+intWidth+'"" height=""24"" autostart=""true"" loop=""false"" /></object>'; break; case ""ra"": tmpstr='<div style=""height:6px;overflow:hidden""></div><object classid=""clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA"" id=""RAOCX"" width=""450"" height=""60""><param name=""_ExtentX"" value=""6694""><param name=""_ExtentY"" value=""1588""><param name=""AUTOSTART"" value=""true""><param name=""SHUFFLE"" value=""0""><param name=""PREFETCH"" value=""0""><param name=""NOLABELS"" value=""0""><param name=""SRC"" value=""'+strURL+'""><param name=""CONTROLS"" value=""StatusBar,ControlPanel""><param name=""LOOP"" value=""0""><param name=""NUMLOOP"" value=""0""><param name=""CENTER"" value=""0""><param name=""MAINTAINASPECT"" value=""0""><param name=""BACKGROUNDCOLOR"" value=""#000000""><embed src=""'+strURL+'"" width=""450"" autostart=""true"" height=""60""></embed></object>'; break; case ""qt"": tmpstr='<div style=""height:6px;overflow:hidden""></div><embed src=""'+strURL+'"" autoplay=""true"" loop=""false"" controller=""true"" playeveryframe=""false"" cache=""false"" scale=""TOFIT"" bgcolor=""#000000"" kioskmode=""false"" targetcache=""false"" pluginspage=""http://www.apple.com/quicktime/"" />'; } document.getElementById(strID).innerHTML = tmpstr; } document.getElementById(strID+""_href"").blur();} </script>")
Next
Set strMatchs=nothing
re.Pattern="(\[mid\])(.[^\]]*)\[\/mid\]"
strContent= re.Replace(strContent,"<embed src=""$2"" height=""45"" width=""314"" autostart=""0""></embed>")
'-----------常规标签----------------
re.Pattern = "\[url=(.[^\]]*)\](.[^\[]*)\[\/url]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=replace(strContent,strMatch.Value,"<a target=""_blank"" href="""&tmpStr1&""">"&tmpStr2&"</a>",1,-1,0)
Next
re.Pattern = "\[url](.[^\[]*)\[\/url]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
strContent=replace(strContent,strMatch.Value,"<a target=""_blank"" href="""&tmpStr1&""">"&tmpStr1&"</a>",1,-1,0)
Next
re.Pattern = "\[ed2k=([\s\S]*?)\]([\s\S]*?)\[\/ed2k]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=replace(strContent,strMatch.Value,"<img border="""" src=""images/ed2k.gif"" alt=""""/><a target=""_blank"" href="""&tmpStr1&""">"&tmpStr2&"</a>",1,-1,0)
Next
re.Pattern = "\[ed2k]([\s\S]*?)\[\/ed2k]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
strContent=replace(strContent,strMatch.Value,"<img border="""" src=""images/ed2k.gif"" alt=""""/><a target=""_blank"" href="""&tmpStr1&""">"&tmpStr1&"</a>",1,-1,0)
Next
re.Pattern = "\[email=(.[^\]]*)\](.[^\[]*)\[\/email]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=replace(strContent,strMatch.Value,"<a href=""mailto:"&tmpStr1&""">"&tmpStr2&"</a>",1,-1,0)
Next
re.Pattern = "\[email](.[^\[]*)\[\/email]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
strContent=replace(strContent,strMatch.Value,"<a href=""mailto:"&tmpStr1&""">"&tmpStr1&"</a>",1,-1,0)
Next
'-----------字体格式----------------
re.Pattern="\[align=(\w{4,6})\]([\s\S]*?)\[\/align\]"
strContent=re.Replace(strContent,"<div align=""$1"">$2</div>")
re.Pattern="\[color=(#\w{3,10}|\w{3,10})\]([\s\S]*?)\[\/color\]"
strContent=re.Replace(strContent,"<span style=""color:$1"">$2</span>")
re.Pattern="\[size=(\d{1,2})\]([\s\S]*?)\[\/size\]"
strContent=re.Replace(strContent,"<span style=""font-size:1$1pt"">$2</span>")
re.Pattern="\[font=([\s\S]*?)\](\s\S]*?)\[\/font\]"
strContent=re.Replace(strContent,"<span style=""font-family:$1"">$2</span>")
re.Pattern="\[b\]([\s\S]*?)\[\/b\]"
strContent=re.Replace(strContent,"<strong>$1</strong>")
re.Pattern="\[i\]([\s\S]*?)\[\/i\]"
strContent=re.Replace(strContent,"<i>$1</i>")
re.Pattern="\[u\]([\s\S]*?)\[\/u\]"
strContent=re.Replace(strContent,"<u>$1</u>")
re.Pattern="\[s\]([\s\S]*?)\[\/s\]"
strContent=re.Replace(strContent,"<s>$1</s>")
re.Pattern="\[sup\]([\s\S]*?)\[\/sup\]"
strContent=re.Replace(strContent,"<sup>$1</sup>")
re.Pattern="\[sub\]([\s\S]*?)\[\/sub\]"
strContent=re.Replace(strContent,"<sub>$1</sub>")
re.Pattern="\[fly\]([\s\S]*?)\[\/fly\]"
strContent=re.Replace(strContent,"<marquee width=""90%"" behavior=""alternate"" scrollamount=""3"">$1</marquee>")
End IF
'-----------特殊标签----------------
re.Pattern = "\[down=(.[^\]]*)\](.[^\[]*)\[\/down]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""下载文件"" style=""margin:0px 2px -4px 0px""/> <a href="""&tmpStr1&""" target=""_blank"">"&tmpStr2&"</a>",1,-1,0)
Next
re.Pattern = "\[down\](.[^\[]*)\[\/down]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""下载文件"" style=""margin:0px 2px -4px 0px""/> <a href="""&tmpStr1&""" target=""_blank"">下载此文件</a>",1,-1,0)
Next
re.Pattern = "\[mDown=(.[^\]]*)\](.[^\[]*)\[\/mDown]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""只允许会员下载"" style=""margin:0px 2px -4px 0px""/> 该文件只允许会员下载! <a href=""login.asp"">登录</a> | <a href=""register.asp"">注册</a>",1,-1,0)
Next
re.Pattern = "\[mDown\](.[^\[]*)\[\/mDown]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
if len(memName)>0 then
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""下载文件"" style=""margin:0px 2px -4px 0px""/> <a href="""&tmpStr1&""" target=""_blank"">下载此文件</a>",1,-1,0)
else
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""只允许会员下载"" style=""margin:0px 2px -4px 0px""/> 该文件只允许会员下载! <a href=""login.asp"">登录</a> | <a href=""register.asp"">注册</a>",1,-1,0)
end if
Next
re.Pattern="\[code\](.*?)\[\/code\]"
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src=""images/code.gif"" style=""margin:0px 2px -3px 0px"" alt=""程序代码""/> 程序代码</div><div class=""UBBContent"">$1</div></div>")
re.Pattern="\[quote\](.*?)\[\/quote\]"
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src=""images/quote.gif"" style=""margin:0px 2px -3px 0px"" alt=""引用内容""/> 引用内容</div><div class=""UBBContent"">$1</div></div>")
re.Pattern="\[quote=(.[^\]]*)\](.*?)\[\/quote\]"
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src=""images/quote.gif"" style=""margin:0px 2px -3px 0px"" alt=""引用来自 $1""/> 引用来自 $1</div><div class=""UBBContent"">$2</div></div>")
re.Pattern="\[hidden\](.*?)\[\/hidden\]"
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src=""images/quote.gif"" style=""margin:0px 2px -3px 0px"" alt=""隐藏内容""/> 隐藏内容</div><div class=""UBBContent"">该内容已经被作者隐藏,只有会员才允许查阅 <a href=""login.asp"">登录</a> | <a href=""register.asp"">注册</a></div></div>")
re.Pattern="\[hidden=(.[^\]]*)\](.*?)\[\/hidden\]"
&nbs