<%
Function QvodCms_CLng(ByVal str1)'将字符转为整型数值
    If IsNumeric(str1) Then
        QvodCms_CLng = Fix(CDbl(str1))
    Else
        QvodCms_CLng = 0
    End If
End Function

Function QvodCms_CDate(ByVal str1)'将字符转为日期
    If IsDate(str1) Then
        QvodCms_CDate = CDate(str1)
    Else
        QvodCms_CDate = Now
    End If
End Function

Function QvodCms_MaxId(str)'当前表中最大ID值-str ---- 表名
	Set mrs=Conn.Execute("Select max("&str&"_id) from qvodcms_"&str&"")
	If IsNull(mrs(0)) then
	    QvodCms_MaxId = 1  
	Else 
	    QvodCms_MaxId = mrs(0) + 1 
	End if 
	Set mrs = Nothing
End Function

Sub QvodCms_Err(ErrMsg)'JS提示框
	Response.Write("<script language=""javascript"">")
	Response.Write("alert('"&ErrMsg&"');history.back()")
	Response.Write("</script>")
	Response.End
End Sub

'**************************************************
'作  用：JS提示框，确认后转向
'**************************************************
Sub QvodCms_Err_Url(ErrMsg,Url)
Response.Write("<script language=""javascript"">")
Response.Write("var con;")
Response.Write("con=confirm('"&ErrMsg&"');")
Response.Write("if (con==true) window.location='"&Url&"';")
Response.Write("</script>")
End Sub

Function Max_id(max)
	Set mrs=Conn.Execute("select max("&max&"_id) from qvodcms_"&max&"")'当前表中最大ID值
	If IsNull(mrs(0)) then
	    Max_id = 1  
	Else 
	    Max_id = mrs(0) + 1 
	End if 
	Set mrs = Nothing
End Function

Function QvodCms_Ip()'获取用户真实IP
    Dim UserTrueIP
	UserTrueIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")'获取用户来源IP
	If UserTrueIP = "" Then UserTrueIP = Request.ServerVariables("REMOTE_ADDR")
	UserTrueIP = ReplaceBadChar(UserTrueIP)
	QvodCms_Ip=UserTrueIP
End Function

Function QvodCms_Replace(strChar)'过滤非法的SQL字符
    If strChar = "" Or IsNull(strChar) Then
        QvodCms_Replace = ""
        Exit Function
    End If
    Dim strBadChar, arrBadChar, tempChar, i
    strBadChar = "',;," & Chr(34) & "," & Chr(0) & ""
    arrBadChar = Split(strBadChar, ",")
    tempChar = strChar
    For i = 0 To UBound(arrBadChar)
        tempChar = Replace(tempChar, arrBadChar(i), "")
    Next
    tempChar = Replace(tempChar, "@@", "@")
    QvodCms_Replace = tempChar
End Function

Function QvodCms_Time(s_Time, n_Flag) 
   Dim y, m, d, h, mi, s 
   QvodCms_Time = "" 
   If IsDate(s_Time) = False Then Exit Function 
   y = cstr(year(s_Time)) 
   m = cstr(month(s_Time)) 
   If len(m) = 1 Then m = "0" & m 
   d = cstr(day(s_Time)) 
   If len(d) = 1 Then d = "0" & d 
   h = cstr(hour(s_Time)) 
   If len(h) = 1 Then h = "0" & h 
   mi = cstr(minute(s_Time)) 
   If len(mi) = 1 Then mi = "0" & mi 
   s = cstr(second(s_Time)) 
   If len(s) = 1 Then s = "0" & s 
   select Case n_Flag 
   Case 1 
     QvodCms_Time = y & "-" & m & "-" & d & " " & h & ":" & mi & ":" & s 
   Case 2 
     QvodCms_Time = y & "-" & m & "-" & d
   Case 3 
     QvodCms_Time = m & "月" & d & "日" 
   Case 4 
     QvodCms_Time = y & "年" & m & "月" & d & "日" 
   Case 5 
     QvodCms_Time = y & m & d & h & mi & s
   Case 6
     QvodCms_Time = m & "-" & d 	 
   End select 
End Function

'==================================================
'函数名：GetPicurl [大图生成]
'作  用：保存远程图片并生成路径
'参  数：picurl ------远程图片地址
'参  数：filepath ------自定义保存目录(默认Picfile)
'==================================================
Function GetPicurl(picurl,filepath)
    '定义图片大小开始
    Dim bigw,bigh
    bigw=replace(left(AdminId(7),3),"*","")
    bigh=replace(right(AdminId(7),3),"*","")
    smallw=replace(left(AdminId(8),3),"*","")
    smallh=replace(right(AdminId(8),3),"*","")
    Up_Dir=QvodCms_UpDir(Now())
	If IsFolder(filepath&Up_Dir)=False Then'检测文件夹是否存在
	    Call CreateFolder (filepath&Up_Dir)'新建文件夹
	End if
	re_data_picurl=filepath&Up_Dir&GenerateRandomFileName(picurl)'新文件名与相对保存路径
	If SaveRemoteFile(picurl, re_data_picurl) = True Then
	    GetPicurl=Replace(re_data_picurl,"../","")
		  If Cint(AdminId(5))=1 Then Call ImgAspJpeg(re_data_picurl,newpic,bigw,bigh)
	Else
	    GetPicurl="images/nopic.gif"
	End If	
End Function

'==================================================
'函数名：GetPicurl [小图生成]
'作  用：保存远程图片并生成路径
'==================================================
Function GetPicurll(picurl,filepath)
    '定义图片大小开始
    Dim smallw,smallh
    smallw=replace(left(AdminId(8),3),"*","")
    smallh=replace(right(AdminId(8),3),"*","")
    Up_Dir=QvodCms_UpDir(Now())
	If IsFolder(filepath&Up_Dir)=False Then'检测文件夹是否存在
	    Call CreateFolder (filepath&Up_Dir)'新建文件夹
	End if
	re_data_picurl=filepath&Up_Dir&GenerateRandomFileName(picurl)'新文件名与相对保存路径
	If SaveRemoteFile(picurl, re_data_picurl) = True Then
	    GetPicurll=Replace(re_data_picurl,"../","")
		  If Cint(AdminId(5))=1 Then Call ImgAspJpeg(re_data_picurl,newpic,smallw,smallh)  
	Else
	    GetPicurll="images/nopic.gif"
	End If	
End Function

Function QvodCms_UpDir(dtnow)'按年月生成保存路径  dtnow=Now()
	QvodCms_UpDir = Year(dtnow) & Right("0" & Month(dtnow), 2) & "/"
End Function

'**************************************************
'函数名：GetSubStr
'作  用：截字符串，汉字一个算两个字符，英文算一个字符
'参  数：str   ----原字符串
'        strlen ----截取长度
'        bShowPoint ---- 是否显示省略号
'返回值：截取后的字符串
'**************************************************
Function GetSubStr(ByVal str, ByVal strlen, bShowPoint)
    If str = "" Then
        GetSubStr = ""
        Exit Function
    End If
    Dim l, t, c, i, strTemp
    str = Replace(Replace(Replace(Replace(str, "&nbsp;", " "), "&quot;", Chr(34)), "&gt;", ">"), "&lt;", "<")
    l = Len(str)
    t = 0
    strTemp = str
    strlen = QvodCms_CLng(strlen)
    For i = 1 To l
        c = Abs(Asc(Mid(str, i, 1)))
        If c > 255 Then
            t = t + 2
        Else
            t = t + 1
        End If
        If t >= strlen Then
            strTemp = Left(str, i)
            Exit For
        End If
    Next
    strTemp = Replace(Replace(Replace(Replace(strTemp, " ", "&nbsp;"), Chr(34), "&quot;"), ">", "&gt;"), "<", "&lt;")
    If strTemp <> str And bShowPoint = True Then
        strTemp = strTemp & ""
    End If
    GetSubStr = strTemp
End Function

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function GetSkinCache(Byval MoBan_Path)'获取模板的缓存值
	Dim CacheName : CacheName="Skin_"&MoBan_Path
	If Cint(Config(19))=1 Then
		If (CacheObj.ChkCache(CacheName)) Then  GetSkinCache = CacheObj.GetCache(CacheName) Else GetSkinCache = GetMoBan(MoBan_Path) : CacheObj.SetCache CacheName,GetSkinCache
	Else
		GetSkinCache = GetMoBan(MoBan_Path)
	End If
End Function

Function GetClassSkinNews(strid)'取分类绑定模板
    GetClassSkinNews="news_type.html"
    Set rs = Conn.Execute("Select news_class_id,class_skin from qvodcms_news_class where news_class_id="&strid&"")
	If Not rs.eof Then GetClassSkinNews=rs("class_skin")
	Set rs=nothing
End Function

Function GetClassSkin(strid)'取分类绑定模板
    GetClassSkin="type.html"
    Set rs = Conn.Execute("Select class_skin from qvodcms_class where class_id="&strid&"")
	If Not rs.eof Then GetClassSkin=rs("class_skin")
	Set rs=nothing
End Function

Function GetDetailSkin(strid)'取分类绑定内容模板
    GetDetailSkin="details.html"
    Set rs = Conn.Execute("Select detail_skin from qvodcms_class where class_id="&strid&"")
	If Not rs.eof Then GetDetailSkin=rs("detail_skin")
	Set rs=nothing
End Function

Function GetDataSkin(strid)'取内容绑定模板
    GetDataSkin="details.html"
    Set rs = Conn.Execute("Select class_id,name_id,data_inputer from qvodcms_name where name_id="&strid&"")
	If Not rs.eof Then
	 If right(rs("data_inputer"),4)<>"html" or IsNul(rs("data_inputer")) Then GetDataSkin=GetDetailSkin(rs("class_id")) Else GetDataSkin=rs("data_inputer"):End If
	End If 
	Set rs=nothing
End Function

Function GetClassName(class_id)'取分类中文名
	GetClassName=Eval("Class_N_"&class_id)
End Function

Function GetClassEn(class_id)'取分类英文名
	GetClassEn=Eval("Class_E_"&class_id)
End Function

Function GetClassNameNews(class_id)'取分类中文名
	GetClassNameNews=Eval("NewsClass_N_"&class_id)
End Function

Function GetClassEnNews(class_id)'取分类英文名
	GetClassEnNews=Eval("NewsClass_E_"&class_id)
End Function

Function GetClassId(name_id)'取分类Id
	Set rcs = Conn.Execute("Select class_id,name_id from qvodcms_name where name_id="&Clng(name_id)&"")
	If Not rcs.eof Then GetClassId=rcs("class_id") Else GetClassId=0
	Set rcs=nothing
End Function

Function GetClassNameBig(class_id)'取一级分类
Set rcc = Conn.Execute("Select class_bigid,class_name from qvodcms_class where class_id="&Clng(class_id)&" and class_bigid>0")
If Not rcc.eof Then GetClassNameBig=Eval("Class_N_"&rcc("class_bigid")):Set rcc=nothing
End Function

Function GetClassNameBigId(class_id)'取一级ID
Set rId = Conn.Execute("Select class_bigid,class_name from qvodcms_class where class_id="&Clng(class_id)&" and class_bigid>0")
If Not rId.eof Then GetClassNameBigId=rId("class_bigid"):Set rId=nothing
End Function

Function ReplaceStr(Byval str,Byval finStr,Byval repStr)'替换模板标签
	On Error Resume Next : If IsNull(repStr) Then repStr=""
	ReplaceStr = Replace(str,finStr,repStr)
	If Err Then ReplaceStr = "标签参数错误" : Err.Clear
End Function

Function isNul(str)
	if isnull(str) or str = "" then isNul = true else isNul = false 
End Function

Function isNum(str)
	if not isNul(str) then isNum=isnumeric(str) else isNum=false
End Function

Function OpenContent(str)
    if isnull(str) or str = "" then Response.Write err_content Else Response.Write str 
End Function

Function GetReplace(str)'替换空字符
	If str="" or IsNull(str) Then str="未知" End If
	GetReplace=str
End Function

Function GetColor(dataname,datacolor)
    Dim str
	If len(datacolor)<>0 Then str="<font color="""&datacolor&""">"&dataname&"</font>" Else str=dataname End If
	GetColor=str
End Function

Function setStartTime()
	Dim StartTime
	StartTime=timer()
	Session("StartTime")=StartTime
End Function

Function GetRunTime()
	Dim EndTime,StartTime,OkTime
	StartTime=Session("StartTime")
	EndTime=timer() 
	OkTime="0"&FormatNumber((EndTime-StartTime),3):Response.Flush() 
	GetRunTime=OkTime    
End Function

'****************************************************
'函数名：getpychar
'作  用：'取汉字首字母,汉字转拼音
'参  数：char ----字符串
'****************************************************

Function getpychar(char)
dim tmp
tmp=65536+asc(char)
if(tmp>=45217 and tmp<=45252) then
getpychar= "A"
elseif(tmp>=45253 and tmp<=45760) then
getpychar= "B"
elseif(tmp>=45761 and tmp<=46317) then
getpychar= "C"
elseif(tmp>=46318 and tmp<=46825) then
getpychar= "D"
elseif(tmp>=46826 and tmp<=47009) then
getpychar= "E"
elseif(tmp>=47010 and tmp<=47296) then
getpychar= "F"
elseif(tmp>=47297 and tmp<=47613) then
getpychar= "G"
elseif(tmp>=47614 and tmp<=48118) then
getpychar= "H"
elseif(tmp>=48119 and tmp<=49061) then
getpychar= "J"
elseif(tmp>=49062 and tmp<=49323) then
getpychar= "K"
elseif(tmp>=49324 and tmp<=49895) then
getpychar= "L"
elseif(tmp>=49896 and tmp<=50370) then
getpychar= "M"
elseif(tmp>=50371 and tmp<=50613) then
getpychar= "N"
elseif(tmp>=50614 and tmp<=50621) then
getpychar= "O"
elseif(tmp>=50622 and tmp<=50905) then
getpychar= "P"
elseif(tmp>=50906 and tmp<=51386) then
getpychar= "Q"
elseif(tmp>=51387 and tmp<=51445) then
getpychar= "R"
elseif(tmp>=51446 and tmp<=52217) then
getpychar= "S"
elseif(tmp>=52218 and tmp<=52697) then
getpychar= "T"
elseif(tmp>=52698 and tmp<=52979) then
getpychar= "W"
elseif(tmp>=52980 and tmp<=53688) then
getpychar= "X"
elseif(tmp>=53689 and tmp<=54480) then
getpychar= "Y"
elseif(tmp>=54481 and tmp<=62289) then
getpychar= "Z"
else '如果不是中文，则不处理
getpychar=getEnglish(char)
end if
End Function
'****************************************************
'函数名：getpy
'作  用：'取第一个汉字首字母
'参  数：str ----字符串
'****************************************************
Function getpy(str)
getpy=getpychar(mid(str,1,1))
End Function

'****************************************************
'函数名：getpyin
'作  用：'汉字转拼音
'参  数：str ----字符串
'****************************************************

Function getpyin(Txt)'汉字转拼音
Dim d,TmpTxt
Dim wzcode,i,TmpWZ,a,b,ii
Set d = CreateObject("Scripting.Dictionary")
d.add "a",-20319
d.add "ai",-20317
d.add "an",-20304
d.add "ang",-20295
d.add "ao",-20292
d.add "ba",-20283
d.add "bai",-20265
d.add "ban",-20257
d.add "bang",-20242
d.add "bao",-20230
d.add "bei",-20051
d.add "ben",-20036
d.add "beng",-20032
d.add "bi",-20026
d.add "bian",-20002
d.add "biao",-19990
d.add "bie",-19986
d.add "bin",-19982
d.add "bing",-19976
d.add "bo",-19805
d.add "bu",-19784
d.add "ca",-19775
d.add "cai",-19774
d.add "can",-19763
d.add "cang",-19756
d.add "cao",-19751
d.add "ce",-19746
d.add "ceng",-19741
d.add "cha",-19739
d.add "chai",-19728
d.add "chan",-19725
d.add "chang",-19715
d.add "chao",-19540
d.add "che",-19531
d.add "chen",-19525
d.add "cheng",-19515
d.add "chi",-19500
d.add "chong",-19484
d.add "chou",-19479
d.add "chu",-19467
d.add "chuai",-19289
d.add "chuan",-19288
d.add "chuang",-19281
d.add "chui",-19275
d.add "chun",-19270
d.add "chuo",-19263
d.add "ci",-19261
d.add "cong",-19249
d.add "cou",-19243
d.add "cu",-19242
d.add "cuan",-19238
d.add "cui",-19235
d.add "cun",-19227
d.add "cuo",-19224
d.add "da",-19218
d.add "dai",-19212
d.add "dan",-19038
d.add "dang",-19023
d.add "dao",-19018
d.add "de",-19006
d.add "deng",-19003
d.add "di",-18996
d.add "dian",-18977
d.add "diao",-18961
d.add "die",-18952
d.add "ding",-18783
d.add "diu",-18774
d.add "dong",-18773
d.add "dou",-18763
d.add "du",-18756
d.add "duan",-18741
d.add "dui",-18735
d.add "dun",-18731
d.add "duo",-18722
d.add "e",-18710
d.add "en",-18697
d.add "er",-18696
d.add "fa",-18526
d.add "fan",-18518
d.add "fang",-18501
d.add "fei",-18490
d.add "fen",-18478
d.add "feng",-18463
d.add "fo",-18448
d.add "fou",-18447
d.add "fu",-18446
d.add "ga",-18239
d.add "gai",-18237
d.add "gan",-18231
d.add "gang",-18220
d.add "gao",-18211
d.add "ge",-18201
d.add "gei",-18184
d.add "gen",-18183
d.add "geng",-18181
d.add "gong",-18012
d.add "gou",-17997
d.add "gu",-17988
d.add "gua",-17970
d.add "guai",-17964
d.add "guan",-17961
d.add "guang",-17950
d.add "gui",-17947
d.add "gun",-17931
d.add "guo",-17928
d.add "ha",-17922
d.add "hai",-17759
d.add "han",-17752
d.add "hang",-17733
d.add "hao",-17730
d.add "he",-17721
d.add "hei",-17703
d.add "hen",-17701
d.add "heng",-17697
d.add "hong",-17692
d.add "hou",-17683
d.add "hu",-17676
d.add "hua",-17496
d.add "huai",-17487
d.add "huan",-17482
d.add "huang",-17468
d.add "hui",-17454
d.add "hun",-17433
d.add "huo",-17427
d.add "ji",-17417
d.add "jia",-17202
d.add "jian",-17185
d.add "jiang",-16983
d.add "jiao",-16970
d.add "jie",-16942
d.add "jin",-16915
d.add "jing",-16733
d.add "jiong",-16708
d.add "jiu",-16706
d.add "ju",-16689
d.add "juan",-16664
d.add "jue",-16657
d.add "jun",-16647
d.add "ka",-16474
d.add "kai",-16470
d.add "kan",-16465
d.add "kang",-16459
d.add "kao",-16452
d.add "ke",-16448
d.add "ken",-16433
d.add "keng",-16429
d.add "kong",-16427
d.add "kou",-16423
d.add "ku",-16419
d.add "kua",-16412
d.add "kuai",-16407
d.add "kuan",-16403
d.add "kuang",-16401
d.add "kui",-16393
d.add "kun",-16220
d.add "kuo",-16216
d.add "la",-16212
d.add "lai",-16205
d.add "lan",-16202
d.add "lang",-16187
d.add "lao",-16180
d.add "le",-16171
d.add "lei",-16169
d.add "leng",-16158
d.add "li",-16155
d.add "lia",-15959
d.add "lian",-15958
d.add "liang",-15944
d.add "liao",-15933
d.add "lie",-15920
d.add "lin",-15915
d.add "ling",-15903
d.add "liu",-15889
d.add "long",-15878
d.add "lou",-15707
d.add "lu",-15701
d.add "lv",-15681
d.add "luan",-15667
d.add "lue",-15661
d.add "lun",-15659
d.add "luo",-15652
d.add "ma",-15640
d.add "mai",-15631
d.add "man",-15625
d.add "mang",-15454
d.add "mao",-15448
d.add "me",-15436
d.add "mei",-15435
d.add "men",-15419
d.add "meng",-15416
d.add "mi",-15408
d.add "mian",-15394
d.add "miao",-15385
d.add "mie",-15377
d.add "min",-15375
d.add "ming",-15369
d.add "miu",-15363
d.add "mo",-15362
d.add "mou",-15183
d.add "mu",-15180
d.add "na",-15165
d.add "nai",-15158
d.add "nan",-15153
d.add "nang",-15150
d.add "nao",-15149
d.add "ne",-15144
d.add "nei",-15143
d.add "nen",-15141
d.add "neng",-15140
d.add "ni",-15139
d.add "nian",-15128
d.add "niang",-15121
d.add "niao",-15119
d.add "nie",-15117
d.add "nin",-15110
d.add "ning",-15109
d.add "niu",-14941
d.add "nong",-14937
d.add "nu",-14933
d.add "nv",-14930
d.add "nuan",-14929
d.add "nue",-14928
d.add "nuo",-14926
d.add "o",-14922
d.add "ou",-14921
d.add "pa",-14914
d.add "pai",-14908
d.add "pan",-14902
d.add "pang",-14894
d.add "pao",-14889
d.add "pei",-14882
d.add "pen",-14873
d.add "peng",-14871
d.add "pi",-14857
d.add "pian",-14678
d.add "piao",-14674
d.add "pie",-14670
d.add "pin",-14668
d.add "ping",-14663
d.add "po",-14654
d.add "pu",-14645
d.add "qi",-14630
d.add "qia",-14594
d.add "qian",-14429
d.add "qiang",-14407
d.add "qiao",-14399
d.add "qie",-14384
d.add "qin",-14379
d.add "qing",-14368
d.add "qiong",-14355
d.add "qiu",-14353
d.add "qu",-14345
d.add "quan",-14170
d.add "que",-14159
d.add "qun",-14151
d.add "ran",-14149
d.add "rang",-14145
d.add "rao",-14140
d.add "re",-14137
d.add "ren",-14135
d.add "reng",-14125
d.add "ri",-14123
d.add "rong",-14122
d.add "rou",-14112
d.add "ru",-14109
d.add "ruan",-14099
d.add "rui",-14097
d.add "run",-14094
d.add "ruo",-14092
d.add "sa",-14090
d.add "sai",-14087
d.add "san",-14083
d.add "sang",-13917
d.add "sao",-13914
d.add "se",-13910
d.add "sen",-13907
d.add "seng",-13906
d.add "sha",-13905
d.add "shai",-13896
d.add "shan",-13894
d.add "shang",-13878
d.add "shao",-13870
d.add "she",-13859
d.add "shen",-13847
d.add "sheng",-13831
d.add "shi",-13658
d.add "shou",-13611
d.add "shu",-13601
d.add "shua",-13406
d.add "shuai",-13404
d.add "shuan",-13400
d.add "shuang",-13398
d.add "shui",-13395
d.add "shun",-13391
d.add "shuo",-13387
d.add "si",-13383
d.add "song",-13367
d.add "sou",-13359
d.add "su",-13356
d.add "suan",-13343
d.add "sui",-13340
d.add "sun",-13329
d.add "suo",-13326
d.add "ta",-13318
d.add "tai",-13147
d.add "tan",-13138
d.add "tang",-13120
d.add "tao",-13107
d.add "te",-13096
d.add "teng",-13095
d.add "ti",-13091
d.add "tian",-13076
d.add "tiao",-13068
d.add "tie",-13063
d.add "ting",-13060
d.add "tong",-12888
d.add "tou",-12875
d.add "tu",-12871
d.add "tuan",-12860
d.add "tui",-12858
d.add "tun",-12852
d.add "tuo",-12849
d.add "wa",-12838
d.add "wai",-12831
d.add "wan",-12829
d.add "wang",-12812
d.add "wei",-12802
d.add "wen",-12607
d.add "weng",-12597
d.add "wo",-12594
d.add "wu",-12585
d.add "xi",-12556
d.add "xia",-12359
d.add "xian",-12346
d.add "xiang",-12320
d.add "xiao",-12300
d.add "xie",-12120
d.add "xin",-12099
d.add "xing",-12089
d.add "xiong",-12074
d.add "xiu",-12067
d.add "xu",-12058
d.add "xuan",-12039
d.add "xue",-11867
d.add "xun",-11861
d.add "ya",-11847
d.add "yan",-11831
d.add "yang",-11798
d.add "yao",-11781
d.add "ye",-11604
d.add "yi",-11589
d.add "yin",-11536
d.add "ying",-11358
d.add "yo",-11340
d.add "yong",-11339
d.add "you",-11324
d.add "yu",-11303
d.add "yuan",-11097
d.add "yue",-11077
d.add "yun",-11067
d.add "za",-11055
d.add "zai",-11052
d.add "zan",-11045
d.add "zang",-11041
d.add "zao",-11038
d.add "ze",-11024
d.add "zei",-11020
d.add "zen",-11019
d.add "zeng",-11018
d.add "zha",-11014
d.add "zhai",-10838
d.add "zhan",-10832
d.add "zhang",-10815
d.add "zhao",-10800
d.add "zhe",-10790
d.add "zhen",-10780
d.add "zheng",-10764
d.add "zhi",-10587
d.add "zhong",-10544
d.add "zhou",-10533
d.add "zhu",-10519
d.add "zhua",-10331
d.add "zhuai",-10329
d.add "zhuan",-10328
d.add "zhuang",-10322
d.add "zhui",-10315
d.add "zhun",-10309
d.add "zhuo",-10307
d.add "zi",-10296
d.add "zong",-10281
d.add "zou",-10274
d.add "zu",-10270
d.add "zuan",-10262
d.add "zui",-10260
d.add "zun",-10256
d.add "zuo",-10254

TmpTxt=""
For i=1 to Len(getEnglish(Txt))
     wzcode=ASC(Mid(getEnglish(Txt),i,1))
     If wzcode>0 And wzcode<160 Then
         TmpWZ=chr(wzcode)
     Else
        If wzcode<-20319 OR wzcode>-10247 Then
            TmpWZ=""
         Else
               a=d.Items
               b=d.keys
               For ii=d.count-1 to 0 step -1
                If a(ii)<=wzcode Then Exit For
               Next
               TmpWZ=b(ii)
        End If
    End If
    TmpTxt=TmpTxt&Replace(Replace(Replace(Replace(Replace(Replace(Replace(TmpWZ," ",""),"：",""),"（",""),"）",""),"！",""),"《",""),"》","")
Next
Set d=Nothing
getpyin=Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(TmpTxt,"/","_"),"\","_"),"'","_"),"|",""),"""",""),"*",""),"?",""),"<",""),">",""),":",""),"[",""),"]",""),",","")
End Function

Function PingLink(str)
for i=65   to   90   
  PingAbcd=PingAbcd&"<a title='按首字母["&chr(i)&"]查询' href="&Config(0)&"search.asp?action=ping&keyword="&server.urlencode(chr(i))&">"&chr(i)&"</a>"   
next 
  PingLink=PingAbcd  
End Function

Function GetOrderStr(StrTemp)'处理前台排序
	Select Case StrTemp'推序方法 1,2,3,4,5,6
	Case 1 : GetOrderStr="order by name_id desc"
	Case 2 : GetOrderStr="order by name_id asc"
	Case 3 : If Config(1)="SQL" Then GetOrderStr="order by data_lastdate desc" Else GetOrderStr="order by data_lastdate desc,name_id" End If
	Case 4 : If Config(1)="SQL" Then GetOrderStr="order by data_lastdate asc" Else GetOrderStr="order by data_lastdate asc,name_id" End If
	Case 5 : GetOrderStr="order by data_hits desc,name_id" 
	Case 6 : GetOrderStr="order by data_hits asc,name_id"
	Case Else : GetOrderStr=""
	End Select
End Function

Function GetOrderNews(StrTemp)'处理前台排序
	Select Case StrTemp'推序方法 1,2,3,4,5,6
	Case 1 : GetOrderNews="order by id desc"
	Case 2 : GetOrderNews="order by id asc"
	Case 3 : If Config(1)="SQL" Then GetOrderNews="order by datetimes desc" Else GetOrderNews="order by datetimes desc,id" End If
	Case 4 : If Config(1)="SQL" Then GetOrderNews="order by datetimes asc" Else GetOrderNews="order by datetimes asc,id" End If
	Case 5 : GetOrderNews="order by hits desc,id" 
	Case 6 : GetOrderNews="order by hits asc,id"
	Case Else : GetOrderNews=""
	End Select
End Function
	
Function GetSearchStr(StrTemp,KeyWord)'处理搜索
    If Config(1)="SQL" Then KeyWord=GetLikeSql(KeyWord)
	Select Case StrTemp
	Case "name"
	If Config(1)="SQL" Then GetSearchStr="data_name like '%"&KeyWord&"%'" Else GetSearchStr="InStr(1,LCase(data_name),LCase('"&KeyWord&"'),0)<>0"
	Case "actor"
	If Config(1)="SQL" Then GetSearchStr="data_actor like '%"&KeyWord&"%'" Else GetSearchStr="InStr(1,LCase(data_actor),LCase('"&KeyWord&"'),0)<>0"
	Case "director"
	If Config(1)="SQL" Then GetSearchStr="data_director like '%"&KeyWord&"%'" Else GetSearchStr="InStr(1,LCase(data_director),LCase('"&KeyWord&"'),0)<>0"				
	Case "year"
	GetSearchStr="data_year="&QvodCms_CLng(KeyWord)&""
	Case "language"
	If Config(1)="SQL" Then GetSearchStr="data_language like '%"&KeyWord&"%'" Else GetSearchStr="InStr(1,LCase(data_language),LCase('"&KeyWord&"'),0)<>0"
	Case "erea"
	If Config(1)="SQL" Then GetSearchStr="data_erea like '%"&KeyWord&"%'" Else GetSearchStr="InStr(1,LCase(data_erea),LCase('"&KeyWord&"'),0)<>0"
	Case "ping"
	If Config(1)="SQL" Then GetSearchStr="data_ping like '%"&KeyWord&"%'" Else GetSearchStr="InStr(1,LCase(data_ping),LCase('"&KeyWord&"'),0)<>0"	
	Case Else
	If Config(1)="SQL" Then
	GetSearchStr="data_name like '%"&KeyWord&"%' or data_actor like '%"&KeyWord&"%' or data_director like '%"&KeyWord&"%' or data_year="&QvodCms_CLng(KeyWord)&" or data_erea like '%"&KeyWord&"%' or data_language like '%"&KeyWord&"%'"
	Else
	GetSearchStr="InStr(1,LCase(data_name),LCase('"&KeyWord&"'),0)<>0 or InStr(1,LCase(data_actor),LCase('"&KeyWord&"'),0)<>0 or InStr(1,LCase(data_director),LCase('"&KeyWord&"'),0)<>0 or InStr(1,LCase(data_erea),LCase('"&KeyWord&"'),0)<>0 or InStr(1,LCase(data_language),LCase('"&KeyWord&"'),0)<>0"
	End If
	End Select	
End Function

Function GetLikeSql(str)
    If isNul(str) Then Exit Function
	str=Replace(str,"'","''")
	str=Replace(str,"[","[[]")
	str=Replace(str,"%","[%]")
	str=Replace(str,"_","[_]")
	GetLikeSql=str
End Function

Function GetReplaceTime(str)
    If isNul(str) Then Exit Function
	str=Replace(str,"-","")
	str=Replace(str," ","")
	str=Replace(str,":","")
	GetReplaceTime=str
End Function
		
Function GetTimeStr(s_Time,StrTemp)'处理显示时间方式
    If StrTemp=1 Then
	GetTimeStr=QvodCms_Time(s_Time,1)
	ElseIf StrTemp=2 Then
	GetTimeStr=QvodCms_Time(s_Time,2)
	ElseIf StrTemp=4 Then
	GetTimeStr=QvodCms_Time(s_Time,4)
	ElseIf StrTemp=5 Then
	GetTimeStr=QvodCms_Time(s_Time,3)
	Else
	GetTimeStr=QvodCms_Time(s_Time,6)			
	End If
End Function

'****************************************************
'函数名：htmlActor
'作  用：转换主演导演连接分割指定内容
'参  数：str ----字符串
'****************************************************
Function htmlActor(str)
	code_content=Trim(str)
	code_content=replace(code_content,"&nbsp;",",")
	code_content=replace(code_content,"、",",")
	code_content=replace(code_content," ",",")
	code_content=replace(code_content,"|",",")
	code_content=replace(code_content,"||",",")
	code_content=replace(code_content,"$",",")
	code_content=replace(code_content,"$$",",")
	htmlActor=code_content
End Function

Function GetCu(dataname,datacu)'取得标题加粗属性
    Dim str
	If datacu<>0 Then str="<b>"&dataname&"</b>" Else str=dataname End If
	GetCu=str
End Function

Function GetTu(newshot)'取得标题加粗属性
    Dim str
	If  newshot=1 then GetTu="<font color=red>图</font>"
End Function

Function GetVipName(data_vip)'取得标题加粗属性
    Dim str
	If data_vip=1 Then str="<b>VIP观看</b>" Else str="" End If
	GetVipName=str
End Function

Function GetActor(StrActor) '2.0新增演员查询功能
	On Error Resume Next:dim StrActorr
	StrActor=htmlActor(StrActor)
    If StrActor<>"" Then
	  Str=split(StrActor,",")
	  For x=0 To ubound(Str)
	   StrActorr=StrActorr&"<a href="""&Config(0)&"search.asp?action=actor&keyword="&server.urlencode(Str(x))&""" target=""_blank"" title=""查询《"&Str(x)&"》所有影片!"">"&Str(x)&"</a> "
	  Next	
	Else
	    StrActorr="未知"
	End If
	GetActor=StrActorr
End Function 

Function GetActorCs(StrActor) '2.0新增演员查询功能
	On Error Resume Next:dim StrActorr
	StrActor=htmlActor(StrActor)
    If StrActor<>"" Then
	  Str=split(StrActor,",")
	  For x=0 To ubound(Str)
	   StrActorr=StrActorr&"<a href=""#""  onClick=""LinkUrl('"&jajaPath&"searchcs.asp?action=actor&keyword="&server.urlencode(Str(x))&"')"" title=""查询《"&Str(x)&"》所有影片!"">"&Str(x)&"</a> "
	  Next	
	Else
	    StrActorr="未知"
	End If
	GetActorCs=StrActorr
End Function 

Function GetDirector(StrDirector) '2.0新增导演查询功能
    On Error Resume Next:dim StrDirectorr
    StrDirector=htmlActor(StrDirector)
	If StrDirector<>"" Then
	  Strr=split(StrDirector,",")
	  For y=0 To ubound(Strr)
	    StrDirectorr=StrDirectorr&"<a href="""&Config(0)&"search.asp?action=director&keyword="&server.urlencode(Strr(y))&""" target=""_blank"" title=""查看《"&Strr(y)&"》导演的电影!"">"&Strr(y)&"</a> "
	  Next
	Else
	  StrDirectorr="未知"
	End If  	
	GetDirector=StrDirectorr
End Function 

Function GetDirectorCs(StrDirector) '2.0新增导演查询功能
    On Error Resume Next:dim StrDirectorr
    StrDirector=htmlActor(StrDirector)
	If StrDirector<>"" Then
	  Strr=split(StrDirector,",")
	  For y=0 To ubound(Strr)
		StrDirectorr=StrDirectorr&"<a href=""#""  onClick=""LinkUrl('"&jajaPath&"searchcs.asp?action=director&keyword="&server.urlencode(Strr(y))&"')"" title=""查询《"&Strr(y)&"》导演的电影!"">"&Strr(y)&"</a> "
	  Next
	Else
	  StrDirectorr="未知"
	End If  	
	GetDirectorCs=StrDirectorr
End Function

Function LzReplace(LzName,class_id)'启用自定义显示集数功能
    LzId=Cstr(class_id)
    Bbid=AdminId(33)
    FlId=split(Bbid,",")
	For q=0 To ubound(FlId)
	  If LzId=FlId(q) Then
	  LZ=LzName
	  Exit For
	  Else
	  LZ=""
	  End if
	Next
	LzReplace=LZ
End Function

Function ProdStar(Str)'处理发货状态
   if Str=1 then
	starhtml="<font color='red'>奖品已发√</font>"
   Else
    starhtml= "等待发货×"
   End if	
   ProdStar=starhtml
End Function

Function UserSv(uvip)'验证会员服务
   If uvip<=date() Then
     Uhtml="免费用户"
   Else
     Uhtml="VIP还剩<font color=""red"">("&uvip-date()&")</font>天"
   End If	
   UserSv=Uhtml 	 
End Function

Function UserCon(upic)'转换会员头像
   If upic="nobody" or upic="0"  then
     UserCon=Config(0)&"images/faces/nobody.gif"
    Elseif Instr(upic,"http://")>0 Then
     UserCon=upic
	Else
	 UserCon=Config(0)&"images/faces/"&upic&".gif"
    End if	 
End Function

'***************************************
'函数名：Get_Lable_Order
'作  用：处理兑换记录条件
'****************************************
Function GetListOrder(pid)
   Dim Order_html:Order_html=""
   Set rs = Server.CreateObject("adodb.recordset")
   rs.open"Select* from qvodcms_order where opid="&pid&"",conn,1,1
   If Not(rs.bof And rs.eof) Then
		Order_html=Order_html&"<table width='100%' id='order' border='0' align='center' cellpadding='0' cellspacing='0'><tr>"
		Order_html=Order_html&"<td width='17%' height='24'>&nbsp;会员用户</td>"
		Order_html=Order_html&"<td width='8%' align='center'>兑换数量</td>"
		Order_html=Order_html&"<td width='28%'align='center'>收件地址</td>"
		Order_html=Order_html&"<td width='13%'align='center'>联系手机</td>"
		Order_html=Order_html&"<td width='13%'align='center'>兑换时间</td>"
		Order_html=Order_html&"<td width='10%' align='center'>发货状态</td>"
		Order_html=Order_html&"<td width='13%'align='center'>发货时间</td></tr>"
		Do while not rs.eof
		Order_html=Order_html&"<tr>"
		Order_html=Order_html&"<td height='24'>&nbsp;"&GetUser(rs("ouid"))&"</td>"
		Order_html=Order_html&"<td align='center'>"&rs("ohow")&"</td>"
		Order_html=Order_html&"<td>&nbsp;"&Left(rs("oadd"),12)&"****</td>"
		Order_html=Order_html&"<td align='center'>"&Left(rs("otel"),7)&"****</td>"
		Order_html=Order_html&"<td align='center'>"&QvodCms_Time(rs("otime"),2)&"</td>"
		Order_html=Order_html&"<td align='center'>"&ProdStar(rs("ostar"))&"</td>"
		Order_html=Order_html&"<td align='center'>"&QvodCms_Time(rs("oktime"),2)&"</td>"
		Order_html=Order_html&"</tr>"
		rs.movenext
		Loop
		Order_html=Order_html&"</table>"	
   Else
		Order_html = "暂无网友兑换记录！！！"
   End If
   'rs.Close:Set rs=nothing
   GetListOrder=Order_html
End Function

Function GetUser(uid)'调用会员用户名
   Dim uhtml:uhtml=""
   Set urs=Conn.execute("Select ulc From qvodcms_user Where uid="&uid&"")
   If Not(urs.eof and urs.bof) Then
    uhtml=urs("ulc")
   End If
   urs.Close:Set usr=Nothing	
   GetUser=uhtml
End Function

Function GetVip(UserName,Uid,uvip)'验证收费播放影片
   If UserName="" or Uid<0 Then
     Call QvodCms_Err_Url("会员收费影片,请先登录后观看",""&Config(0)&"Ui/UserLogin.Asp?reurl="&Replace(GetLocationUrl(),"index.asp","")&"")
     Response.End() 
   Elseif DateAdd("m", 0,uvip)<=date() Then	
     Call QvodCms_Err_Url("您是免费会员,无法观看VIP影片,请观看其它免费影片！","../index.asp")
     Response.End()  
   End If
End Function

Function GetProductPage(list_id,page,Ranks)'处理奖品分页标签链接
    List_Page=ShowPage("prodtype.asp?", m, Clng(AdminId(19)), page, True, True, "个", False)
End Function

Function GetProductLinkPath(Link_dataid)'转化奖品连接
		DataUrl=Config(0)&"prod.asp?pid="&Link_dataid
End Function

Function GetNewsLinkPath(list_id)'处理奖品分页标签链接
    List_Page=ShowPage("newstype.asp?", m, Clng(AdminId(19)), page, True, True, "个", False)
End Function

Function GetRanks(Ranks)'列表多选项功能
  Dim RankTemp,Rankid:Rankid=QvodCms_Clng(Ranks)
  If Rankid=1 or Rankid=0 Then
    RankTemp=RankTemp&"<li id=""ron""><a href="""&Config(0)&"listbytype.asp?type_id="&list_id&"&ranks=1"">按时间排序</a></li>"
    RankTemp=RankTemp&"<li><a href="""&Config(0)&"listbytype.asp?type_id="&list_id&"&ranks=2"">按人气排序</a></li>"
    RankTemp=RankTemp&"<li><a href="""&Config(0)&"listbytype.asp?type_id="&list_id&"&ranks=3"">按推荐排序</a></li>"
  ElseIf Rankid=2 Then 
    RankTemp=RankTemp&"<li><a href="""&Config(0)&"listbytype.asp?type_id="&list_id&"&ranks=1"">按时间排序</a></li>"
    RankTemp=RankTemp&"<li id=""ron""><a href="""&Config(0)&"listbytype.asp?type_id="&list_id&"&ranks=2"">按人气排序</a></li>"
    RankTemp=RankTemp&"<li><a href="""&Config(0)&"listbytype.asp?type_id="&list_id&"&ranks=3"">按推荐排序</a></li>"
  ElseIf Rankid=3 Then 
    RankTemp=RankTemp&"<li><a href="""&Config(0)&"listbytype.asp?type_id="&list_id&"&ranks=1"">按时间排序</a></li>"
    RankTemp=RankTemp&"<li><a href="""&Config(0)&"listbytype.asp?type_id="&list_id&"&ranks=2"">按人气排序</a></li>"
    RankTemp=RankTemp&"<li id=""ron""><a href="""&Config(0)&"listbytype.asp?type_id="&list_id&"&ranks=3"">按推荐排序</a></li>"		
  End If	
  GetRanks=RankTemp
End Function

Function GetLinkPage(list_id,page,Ranks,PageNum,m)'得到分页链接
    Dim PageStr
	If Config(17)="asphtml" Then  
	  PageStr=ShowPage_AspHtml(Config(0), list_id, m, PageNum, page, True, True, "条", False)'List/List_2_5.html
	ElseIf Config(17)="html" and Config(21)="1" and Config(22)="1" Then 'html模式+全部生成+ll/ll_2_5.html
	  PageStr=ShowPage_Html(Config(0)&Config(28)&"/", list_id, "."&Config(26), "", m, PageNum, page, True, True, "条",Config(28))
	ElseIf Config(17)="html" and Config(21)="1" and Config(22)="2" Then 'html模式+全部生成+tv/index.html
	  PageStr=ShowPage_Html(Config(0)&GetClassEn(list_id)&"/", 0, "."&Config(26), "", m, PageNum, page, True, True, "条",GetClassEn(list_id))
	Else
	  PageStr=ShowPage(Config(0)&"listbytype.asp?type_id="&list_id&"&ranks="&Ranks&"", m, PageNum, page, True, True, "条", False)
	End If
	GetLinkPage=PageStr
End Function

Function GetListLink(Byval typeId)'得到分类链接
	Dim linkStr
	If Config(17)="asphtml" Then  
		 linkStr=Config(0)&"List_"&typeId&"_1.html"
	ElseIf Config(17)="html" and Config(21)="1" and Config(22)="1" Then 'html模式+全部生成+ll/ll_2_5.html
		linkStr=Config(0)&Config(28)&"/"&Config(28)&"_"&typeId&"_1."&Config(26)
	ElseIf Config(17)="html" and Config(21)="1" and Config(22)="2" Then 'html模式+全部生成+tv/index.html
		linkStr=Config(0)&GetClassEn(typeId)&"/index."&Config(26)
	Else
	    linkStr=Config(0)&"Listbytype.asp?type_id="&typeId
	End If
	GetListLink=linkStr
End Function

Function GetDataLink(Byval ListId,Byval DataId,link_PingYing)'得到数据链接
	Dim DataUrl
	If Config(17)="asphtml" Then  
		 DataUrl=Config(0)&"data_"&DataId&".html"
	ElseIf Config(17)="html" Then
		If Config(24)="2" Then
		    DataUrl=MD5(DataId, 16)&"."&Config(27)                            'Md5(dataid).html
		ElseIf Config(24)="3" Then
		    DataUrl=GetClassEn(ListId)&"_"&DataId&"."&Config(27)              'Xj_1358.html	
		ElseIf Config(24)="4" Then
		    DataUrl=GetClassEn(ListId)&"_"&link_PingYing&"."&Config(27)        ' Xj_yigehaoren.htmll		
		Else
		    DataUrl=DataId&"."&Config(27)                                     '1358.html    	
		End If
		'
		If Config(23)="2" Then
		    DataUrl=Config(0)&GetClassEn(ListId)&"/"&DataUrl                 'XJ/1358.html
		ElseIf Config(23)="3" Then
		    DataUrl=Config(0)&GetClassEn(ListId)&"/"&DataId&"/"              'XJ/1358/	
		ElseIf Config(23)="4" Then
		    DataUrl=Config(0)&GetClassEn(ListId)&"/"&link_PingYing&"/"       'XJ/yigehaoren/index.html				
		Else
		    DataUrl=Config(0)&Config(29)&"/"&DataUrl                         'Html/1358.html    	
		End If	
	Else
	    DataUrl=Config(0)&"details.asp?name_id="&DataId
	End If
	GetDataLink=DataUrl
End Function

Function GetClassLinkNews(Byval typeId)'得到分类链接
	Dim linkStr
	If Config(17)="html" and Config(35)="1"  Then 'html模式+全部生成+ll/ll_2_5.html
		linkStr=Config(0)&Config(33)&"/"&Config(33)&"_"&typeId&"_1."&Config(26)
	ElseIf Config(17)="html" and Config(35)="2" Then 'html模式+全部生成+tv/index.html
		linkStr=Config(0)&GetClassEnNews(typeId)&"/index."&Config(26)
	Else
	    linkStr=Config(0)&"newstype.asp?class_id="&typeId
	End If
	GetClassLinkNews=linkStr
End Function

Function GetListLinkNews(list_id,page,Ranks,PageNum,m)'得到分类链接
    Dim linkStr
	If Config(17)="html" and Config(35)="1" Then 'html模式+全部生成+ll/ll_2_5.html
	  linkStr=ShowPage_Html(Config(0)&Config(33)&"/", list_id, "."&Config(26), "", m, PageNum, page, True, True, "条",Config(33))
	ElseIf Config(17)="html" and Config(35)="2"  Then 'html模式+全部生成+tv/index.html
	  linkStr=ShowPage_Html(Config(0)&GetClassEnNews(list_id)&"/", 0, "."&Config(26), "", m, PageNum, page, True, True, "条",GetClassEnNews(list_id))
	Else
	  linkStr=ShowPage(Config(0)&"newstype.asp?class_id="&list_id&"", m, PageNum, page, True, True, "条", False)
	End If
	GetListLinkNews=linkStr
End Function

Function GetDataLinkNews(Byval list_id,DataId,DataDate,CurrentPage)'得到数据链接
   Dim DataUrl,ConPath
   If Config(17)="html" Then
        If Config(35)="2" Then Config(33)=GetClassEnNews(list_id) Else Config(33)=Config(33) End If
        If CurrentPage>1 Then CurrentPage="_"&CurrentPage Else CurrentPage="" End If
		If Config(34)="1" Then
		    DataUrl=Config(0)&Config(33)&"/"&DataId&CurrentPage&"."&Config(27)                            
		ElseIf Config(34)="2" Then
		    DataUrl=Config(0)&Config(33)&"/"&MD5(DataId, 16)&CurrentPage&"."&Config(27)            
		ElseIf Config(34)="3" Then
		    DataUrl=Config(0)&Config(33)&"/"&DataId&GetReplaceTime(DataDate)&CurrentPage&"."&Config(27)  
		Else
		    DataUrl=Config(0)&Config(33)&"/"&DataId&"."&Config(27)    
		End If
	Else
	    If CurrentPage>1 Then CurrentPage="&page="&CurrentPage Else CurrentPage="" End If
	    DataUrl=Config(0)&"news.asp?id="&DataId&CurrentPage
	End If
	GetDataLinkNews=DataUrl
End Function

Function GetNewsUp(Byval class_id,Id)'上一条连接
   Set NewsUp=Conn.Execute("Select top 1 class_id,Id,datetimes,title From qvodcms_news Where Id<"&Id&" order by Id desc")
   If Not(NewsUp.eof and NewsUp.bof) Then
   GetNewsUp="<a href="&GetDataLinkNews(NewsUp("class_id"),NewsUp("id"),NewsUp("datetimes"),1)&">"&NewsUp("title")&"</a>"
   End If
   Set NewsUp=Nothing
End Function

Function GetNewsNext(Byval class_id,Id)'下一条连接
   Set NewsUp=Conn.Execute("Select top 1 class_id,Id,datetimes,title From qvodcms_news Where Id>"&Id&" order by Id asc")
   If Not(NewsUp.eof and NewsUp.bof) Then
   GetNewsNext="<a href="&GetDataLinkNews(NewsUp("class_id"),NewsUp("id"),NewsUp("datetimes"),1)&">"&NewsUp("title")&"</a>"
   End If
   Set NewsUp=Nothing
End Function

Function GetContentNews(Byval ContentStr,list_id,DataId,DataDate,CurrentPage)'得到内容分页
    Dim DataContent,Content,i,p,y,StrDiv,ContentNum
	If IsNul(ContentStr) Then GetContentNews="没有文章内容！":Exit Function
	Content=Split(ContentStr,"$分页$"):ContentNum=ubound(Content) 
	If CurrentPage>ContentNum+1 then CurrentPage=ContentNum+1  End If
	   For i=CurrentPage to CurrentPage
         DataContent=Content(i-1)
	   Next
    If Cint(ContentNum)>0 then 
	   StrDiv="<div class=""numstyle"">当前"&CurrentPage&"/"&ContentNum+1&"页&nbsp;"
    If CurrentPage<>1 then 
       StrDiv=StrDiv&"<a href='"&GetDataLinkNews(list_id,DataId,DataDate,CurrentPage-1)&"'>&laquo;上一页</a> "
    Else
       StrDiv=StrDiv&"<a href='#'>&laquo;上一页</a>"  
    End If
    For p=1 to ContentNum+1:y=p
      If CurrentPage=p then 
       StrDiv=StrDiv&"<font class=""numstyleOn"">"&p&"</font>" 
      Else
       StrDiv=StrDiv&"<a href='"&GetDataLinkNews(list_id,DataId,DataDate,y)&"'>"&p&"</a> " 
      End If 
    Next    
    If CurrentPage<>ContentNum+1 then 
       StrDiv=StrDiv&"<a href='"&GetDataLinkNews(list_id,DataId,DataDate,CurrentPage+1)&"'>下一页&raquo;</a> " 
    Else
       StrDiv=StrDiv&"<a href='#'>下一页&raquo;</a>" 
    End If
	End If:DataContent=DataContent&StrDiv&"</div>"	   
	GetContentNews=DataContent
End Function

'***************************************
'函数名：GetPlayLink
'说  明：设置播放静态路径
'****************************************
Function GetPlayLink(Data_id,linkPy,ListId)
        Dim Playl
	    If Config(30)="html" Then
		  If Config(23)="1" Then
	         Playl=Config(9)&"/"&Config(29)&"/"&GetClassEn(ListId)&"_"           'html/xj_
		  ElseIf Config(23)="2" Then
	         Playl=Config(9)&"/"&GetClassEn(ListId)&"/"&GetClassEn(ListId)&"_"              'XJ/xj_		 	
	      ElseIf Config(23)="3" Then
	         Playl=Config(9)&"/"&GetClassEn(ListId)&"/"&Data_id&"/"                'XJ/1358/	
	      ElseIf Config(23)="4" Then
	         Playl=Config(9)&"/"&GetClassEn(ListId)&"/"&linkPy&"/"       'XJ/yigehaoren/index.html				
	      Else
	         Playl="静态播放页设置错误!":Exit Function
	      End If
	    Else
	         Playl=Config(9)&"/"&AdminId(9)&"/?" '调用动态方式  
		End If  
    GetPlayLink=Playl
End Function

'***************************************
'函数名：GetMakePlayLink
'说  明：生成播放静态路径
'****************************************
Function GetMakePlayLink(Data_id,linkPy,ListId)
        Dim Playl
	    If Config(30)="html" Then
		  If Config(23)="1" Then
	         Playl=Config(0)&Config(29)&"/"&GetClassEn(ListId)&"_"           'html/xj_
		  ElseIf Config(23)="2" Then
	         Playl=Config(0)&GetClassEn(ListId)&"/"&GetClassEn(ListId)&"_"              'XJ/xj_		 	
	      ElseIf Config(23)="3" Then
	         Playl=Config(0)&GetClassEn(ListId)&"/"&Data_id&"/"                'XJ/1358/	
	      ElseIf Config(23)="4" Then
	         Playl=Config(0)&GetClassEn(ListId)&"/"&linkPy&"/"       'XJ/yigehaoren/index.html				
	      Else
	         Playl="静态播放页设置错误!":Exit Function
	      End If
	    Else
	         Playl=Config(0)&AdminId(9)&"/?" '调用动态方式  
		End If  
    GetMakePlayLink=Playl
End Function

'***************************************
'函数名：PlaymakeShow
'说  明：分割播放地址路径
'****************************************
Function PlaymakeShow(PlayPath,PlayUrl,Data_id,linkPy,ListId)
      Dim unum,PlayFm,PlayUrlData,ui,uJ
	  If isNul(PlayPath) or isNul(PlayUrl) Then Exit Function
	  PlayFm=Split(data_playpath,"$$")
	  PlayUrlData=Split(data_playurl,"$$$")
		 IF Ubound(PlayFm)<>Ubound(PlayUrlData) Then
			 IF Ubound(PlayFm)<Ubound(PlayUrlData) Then
				unum=Ubound(PlayFm)
			 Else
				unum=Ubound(PlayUrlData)
			 End IF
		  Else
				unum=Ubound(PlayFm)
		  End IF
		  For ui=0 to unum  
			 PlayUrlArr=PlayUrlData(ui)
			 PlayUrl1=Split(PlayUrlArr,"#")'视频集数分隔
               For uJ=0 To Ubound(PlayUrl1)
	             If Not IsNul(PlayUrl1(uJ)) Then  url3=Split(PlayUrl1(uJ),"$")
	               StrPath=GetMakePlayLink(Data_id,data_py,List_Id)&AdminId(9)&"_"&Data_id&"_"&ui+1&"_"&uJ+1&".html"
			       
                   PlaySvs=ui+1     '播放服务组
				   PlaySv=PlaySvs-1
                   PlayJD=uJ+1 '播放播集数ID
				   response.Flush()
				   Dim StrTemp:StrTemp=""
                   Lable_Cache="Lable_Cache_Player"&ListId
	               If Config(0)<>"/" Then StrPath=Replace(StrPath,Config(0),"/")
	               If Cint(Config(19))=1 and CacheObj.ChkCache(Lable_Cache) Then
		           StrTemp = CacheObj.GetCache(Lable_Cache)
		             Call LableObj.OpenPlayer(StrTemp)
	               Else
		             Call Moban_Play_Str(Config(0)&"Skin/"&Config(12)&"/"&AdminId(12)&"player.html")
		             If Cint(Config(19))=1 Then Call CacheObj.SetCache(Lable_Cache,LableObj.Content)
		             Call LableObj.OpenPlayer(LableObj.Content)
	               End If
				  Response.Write "播放页:<font color='red'>"&StrPath&"</font> 生成完毕 <a target='_blank' href='../"&StrPath&"'><font color=red>浏览此页面</font></a><br>"
	               StrTemp = LableObj.Content
                   Call MakeHtml (".."&StrPath,StrTemp) '生成文件
				  
	           Next
		  Next	
    'PlaymakeShow=StrPath
End Function

'***************************************
'函数名：PlayDataShow
'说  明：分割播放地址
'****************************************
Function PlayDataShow(PlayUrlData,I,Data_id,target,data_py,List_Id,data_order,data_name)
    Dim PlayUrl,PlayStr,targetStr,forder
    PlayUrl=Split(PlayUrlData,"#")'视频集数分隔
	'For J=0 To Ubound(PlayUrl)
	If data_order=1 then 
	  For J=Ubound(PlayUrl) to 0 step -1
	    l=l+1
		If Not IsNul(PlayUrl(J)) Then  url3=Split(PlayUrl(J),"$")
		   Select Case target
	         Case 0'原窗口
		       If Ubound(url3)=0 Then
				 urlContent="<li><a href="""&GetPlayLink(Data_id,data_py,List_Id)&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html"" title="""&data_name&" 第"&J+1&"集"">第"&J+1&"集</a></li>"
		       Else
			     urlContent="<li><a href="""&GetPlayLink(Data_id,data_py,List_Id)&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html"" title="""&data_name&" "&url3(0)&""">"&url3(0)&"</a></li>"
		       End If
	         Case 1'新窗口
		       If Ubound(url3)=0 Then
				 urlContent="<li><a href="""&GetPlayLink(Data_id,data_py,List_Id)&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html""  title="""&data_name&" 第"&J+1&"集"" target=""_blank"">第"&J+1&"集</a></li>"
		       Else
			    if l=1 or l=2 or l=3 then
			     urlContent="<li><a href="""&GetPlayLink(Data_id,data_py,List_Id)&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html""  title="""&data_name&" "&url3(0)&""" target=""_blank"">"&url3(0)&" <font color=red>新!</font></a></li>"
				else
				 urlContent="<li><a href="""&GetPlayLink(Data_id,data_py,List_Id)&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html""  title="""&data_name&" "&url3(0)&""" target=""_blank"">"&url3(0)&"</a></li>"
				end If
		       End If	
	         Case 2'弹出窗口
		       If Ubound(url3)=0 Then
			     urlContent="<li><a href=""#"" onclick=""$QvodCmsPlayer('"&Config(0)&AdminId(9)&"/?"&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html',"&AdminId(31)&","&AdminId(32)&");"">第"&J+1&"</a></li>"
		       Else
			     urlContent="<li><a href=""#"" onclick=""$QvodCmsPlayer('"&Config(0)&AdminId(9)&"/?"&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html',"&AdminId(31)&","&AdminId(32)&");"">"&url3(0)&"</a></li>"
		       End If	  
	       End Select:PlayStr=PlayStr&urlContent
	   Next
	 Else
	   For J=0 To Ubound(PlayUrl)
		If Not IsNul(PlayUrl(J)) Then  url3=Split(PlayUrl(J),"$")
		   Select Case target
	         Case 0'原窗口
		       If Ubound(url3)=0 Then
				 urlContent="<li><a href="""&GetPlayLink(Data_id,data_py,List_Id)&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html"" title="""&data_name&" 第"&J+1&"集"">第"&J+1&"集</a></li>"
		       Else
			     urlContent="<li><a href="""&GetPlayLink(Data_id,data_py,List_Id)&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html"" title="""&data_name&" "&url3(0)&""">"&url3(0)&"</a></li>"
		       End If
	         Case 1'新窗口
		       If Ubound(url3)=0 Then
				 urlContent="<li><a href="""&GetPlayLink(Data_id,data_py,List_Id)&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html"" title="""&data_name&" 第"&J+1&"集"" target=""_blank"">第"&J+1&"集</a></li>"
		       Else
			     urlContent="<li><a href="""&GetPlayLink(Data_id,data_py,List_Id)&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html"" title="""&data_name&" "&url3(0)&""" target=""_blank"">"&url3(0)&"</a></li>"
		       End If	
	         Case 2'弹出窗口
		       If Ubound(url3)=0 Then
			     urlContent="<li><a href=""#"" onclick=""$QvodCmsPlayer('"&Config(0)&AdminId(9)&"/?"&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html',"&AdminId(31)&","&AdminId(32)&");"">第"&J+1&"</a></li>"
		       Else
			     urlContent="<li><a href=""#"" onclick=""$QvodCmsPlayer('"&Config(0)&AdminId(9)&"/?"&AdminId(9)&"_"&Data_id&"_"&I+1&"_"&J+1&".html',"&AdminId(31)&","&AdminId(32)&");"">"&url3(0)&"</a></li>"
		       End If	  
	       End Select:PlayStr=PlayStr&urlContent
	   Next
	 End If  
    PlayDataShow=PlayStr
End Function

Function PlayUrlShow(Content,PlayPath,PlayUrlData,Data_Id)
    Dim PathName,UrlAdds,PlayFull,PlayPageNext,PlayUp,PlayNext
	IF IsNull(PlayUrlData) Or isNull(PlayPath) Or PlayJD<=0 Then Exit Function
    PathName=Split(PlayPath,"$$")
	UrlAdd=Split(PlayUrlData,"$$$"):Call PlayErr(PlayPath,UrlAdd,PlayJD,PlaySv)
	UrlAdd1=Split(UrlAdd(PlaySv),"#")
	PlayForm=PathName(PlaySv)
	Playx=UrlAdd1(PlayJD-1)
	UrlAdd2=Split(Playx,"$")
    If PlayForm="快播QVOD" Then
	 PlayFull="<label><input name=""qvodcmsfull"" type=""checkbox"" id=""checkAutoFull"" onclick=""QvodcmsCheckAutoFull()""/><font color=""red""><span id=""fullhtml"">开启全屏连播</span></font></label>"
	End If
	
	IF Ubound(UrlAdd2)=1 Then '处理播放地址
		UrlData=UrlAdd2(1)
		playname=UrlAdd2(0)
	Else
		playname="第"&PlayJD&"集"
		UrlData=UrlAdd2(0)
	End IF'处理播放地址结束
	
	IF PlayJD-2>=0 Then'处理上集地址
		PlayUp=UrlAdd1(PlayJD-2)
		PlayUpNum=PlayJD-1
		PlayPageUp=PlayJD-1
	Else
		PlayUp=UrlAdd1(PlayJD-1)
		PlayUpNum=PlayJD
		PlayPageUp=PlayJD
	End IF
	PlayUpArr=Split(PlayUp,"$")
	IF Ubound(PlayUpArr)=1 Then 
		PlayUp=PlayUpArr(1)
	Else 
		PlayUp=PlayUpArr(0)
	End IF'处理上集地址结束
	
	IF PlayJD<=Ubound(UrlAdd1) Then'处理下集地址
		PlayNext=UrlAdd1(PlayJD)
		PlayNextNum=PlayJD+1
		PlayPageNext=PlayJD+1
	Else 
		PlayNext=UrlAdd1(PlayJD-1)
		PlayNextNum=PlayJD
		PlayPageNext=PlayJD
	End IF
	
	PlayNextArr=Split(PlayNext,"$")
	IF Ubound(PlayNextArr)=1 Then 
		PlayNext=PlayNextArr(1)
	ElseIF Ubound(PlayNextArr)=0  Then
		PlayNext=PlayNextArr(0)
	End IF'处理下集地址结束

    Content=ReplaceStr(Content,"@url_txt@",ReplaceSeo(playname))
	Content=ReplaceStr(Content,"@PlayFull@",PlayFull)
	Content=ReplaceStr(Content,"@Player@",PlayOpen(PlayForm,UrlData,Data_Id,PlayNext,PlayPageNext))
	Content=ReplaceStr(Content,"@PlayerPageUp@",PlayPageUrl(PlayAcc,Data_Id,PlaySv,PlayPageUp))
	Content=ReplaceStr(Content,"@PlayerPageNext@",PlayPageUrl(PlayAcc,Data_Id,PlaySv,PlayPageNext))
	Content=ReplaceStr(Content,"@PlayErr@","<a onclick=""window.open ('"&Config(0)&"err.asp?errsubmit=b98b864de069e757713db50c338f95df_________64de069e7577sadf_________64deo44tyy8498f95df&u="&Data_Id&"&j="&PlayJD&"&s="&playsv&"&n="&Server.URLEncode(rs("data_name"))&"&txt="&Server.URLEncode(playname)&"','go', 'height=166, width=350, top=218, left=263, toolbar= no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')"" href=""#"">报告错误</a>")'报错连接设置
	
	'下面是播放器替换
	Content=ReplaceStr(Content,"@PlayerDiziCs@",UrlData)
	Content=ReplaceStr(Content,"@PlayerQvod@",PlayNext)
	Content=ReplaceStr(Content,"@PlayerUp@",PlayPageUrlCs(PlayAcc,Data_Id,PlaySv,PlayPageUp))
	Content=ReplaceStr(Content,"@PlayerNext@",PlayPageUrlCs(PlayAcc,Data_Id,PlaySv,PlayPageNext))
	PlayUrlShow=Content
End Function

Function PlayOpen(PlayForm,PlayUrl,Data_Id,PlayNext,PlayPageNext)
     PlayOpen=GetMoBan("../js/player/Play.html")
	 PlayOpen=ReplaceStr(PlayOpen,"@InstallDir@",Config(0))
     PlayOpen=ReplaceStr(PlayOpen,"@playshow@",unescape(escape(GetMoBan("../js/player/"&PlayServer(PlayForm)&".html"))))
     'PlayOpen=ReplaceStr(PlayOpen,"@playshow@","<script>document.write(unescape('"&escape(GetMoBan("../js/player/"&PlayServer(PlayForm)&".html"))&"'))<//script>")
	 PlayOpen=ReplaceStr(PlayOpen,"@width@",AdminId(31))
	 PlayOpen=ReplaceStr(PlayOpen,"@height@",AdminId(32))
	 PlayOpen=ReplaceStr(PlayOpen,"@PlayerDizi@",PlayUrl)
	 PlayOpen=ReplaceStr(PlayOpen,"@PlayerNextUrl@",PlayNext)
	 PlayOpen=ReplaceStr(PlayOpen,"@PlayerNextPage@",PlayPageUrl(PlayAcc,Data_Id,PlaySv,PlayPageNext))
	 PlayOpen=ReplaceStr(PlayOpen,"@PlayAd@",AdminId(30))
     PlayOpen=ReplaceStr(PlayOpen,"@SiteUrl@",Config(9))
End Function

Function PlayErr(PlayPath,VolumeAdd,PlayJD,PlaySv)
    If Ubound(Split(PlayPath,"$$"))+1<PlaySv+1 Then QvodCms_Err Err_UrlId:Response.End()
	If Cint(PlayJD)>Ubound(Split(VolumeAdd(PlaySv),"#"))+1 Then QvodCms_Err Err_UrlId:Response.End()
End Function

'***************************************
'函数名：DownDataShow
'说  明：分割下载地址
'****************************************
Function DownDataShow(DownUrlData,I,Data_id,target,DownIn,btac,data_order)
    Dim DownUrl,DownStr,targetStr,forder
    DownUrl=Split(DownUrlData,"#")'视频集数分隔
	   For J=0 To Ubound(DownUrl)
		If Not IsNul(DownUrl(J)) Then  url3=Split(DownUrl(J),"$")
		     DownStr="<table width=""100%"" id=""downbox"" border=""0"" cellspacing=""0"" cellpadding=""0"">"
		     If Ubound(url3)=0 Then
				urlContent="<tr><td class=""list2_li""><input type=""checkbox"" name=""enjoy"&I&"[]"" id=""enjoy"&I&"[]"" value=""xzurl="&Trim(url3(0))&"""/><a href=""#"" onclick=""return OnDownloadClick_Simple(this,1)""  oncontextmenu=""return ThunderNetwork_SetHref(this)"" >"&Trim(url3(0))&"</a></td></tr>"
		     Else
			    urlContent="<tr><td class=""list2_li""><input type=""checkbox"" name=""enjoy"&I&"[]"" id=""enjoy"&I&"[]"" value=""xzurl="&Trim(url3(1))&"""/><a href=""#"" onclick=""return OnDownloadClick_Simple(this,1)""  oncontextmenu=""return ThunderNetwork_SetHref(this)"" >"&Trim(url3(1))&"</a></td></tr>"
		     End If
	         PlayStr=PlayStr&urlContent
	   Next 
	   DownSbt="<tr><td><input id=""allDownURL"" class=""downbut"" onclick=""SelectInput(this.checked,'enjoy"&I&"[]','"&I&"')"" type=""checkbox""  name=""allDownURL"" /><label for=""allDownURL"">全选</label>&nbsp;<input onclick=""copythunder("&I&")"" type=""button"" value=""复制链接到剪贴板"" name=""button"" class=""downbut"" />&nbsp;<input onclick=""zhongxz(2)"" id=""button"" class=""downbut"" type=""submit"" value="""&DownIn&""" name=""button""/></td></tr></table>"
    DownDataShow=DownStr&PlayStr&DownSbt
End Function

'****************************************************
'函数名：PlayReplace
'作  用：替换下载服务组信息
'参  数：str ----字符串
'****************************************************
Function PlayReplace(PlayFm_content)
	PlayFm_content=replace(PlayFm_content,"$$迅雷下载","")
	PlayFm_content=replace(PlayFm_content,"$$快车下载","")
	PlayFm_content=replace(PlayFm_content,"$$旋风下载","")
	PlayReplace=PlayFm_content
End Function

Function getPlayurlArray(playurl,Tag)
	dim span1 : span1=Tag
	if isNul(playurl) then playurl=""
	getPlayurlArray=split(playurl,span1)
End Function

Function getArrayElementID(Byval parray,Byval itemid,Byval compareValue)
	dim i
	for i=0 to From_Count
		if trim(PlayFrom(i))=trim(compareValue) then
			getArrayElementID=i
			Exit Function
		end if
	next
End Function

Function getArraySortID(Byval PathArr,Byval PathValue)
	dim i
	PlayPath=Split(PathArr,"$$")
	for i=0 to UBound(PlayPath)
		if trim(PlayPath(i))=trim(PathValue) then
			getArraySortID=i
			Exit Function
		end if
	next
End Function

'***************************************
'函数名：PlayFromSort
'说  明：来源排序
'****************************************
Function PlayFromSort(ByVal sPath)
	if sPath="" then PlayFromSort="":exit function
	on error resume next
	  dim i,j,dd,dl,ff:dd=getPlayurlArray(sPath,"$$"):dl=UBound(dd)
	    if dl>0 then
		   dim ay:ay=From_Count
		   dim ul,ret:ul=From_Count:ReDim li(ul):ret=""
		   for i=0 to dl
			  ff=Split(dd(i),"$$"):j=getArrayElementID(ay,0,ff(0))
			    if ""&li(j)<>"" then
				  li(j)=li(j)&"$$"&dd(i)
			    else
				  li(j)=dd(i)
			    end if
		    next
		
		    for i=0 to ul
			     if li(i)<>"" then
				 if ret<>"" then:ret=ret&"$$"&li(i):else:ret=li(i):end if
			end if
		    next
		    PlayFromSort=ret
	     else
		    PlayFromSort=sPath
	     end if
End Function

Function PlayUrlSort(ByVal sPath,sData)
	if sPath="" or sData="" then PlayUrlSort="":exit function
	on error resume next
	  PlayUrlData=Split(sData,"$$$")
	  for i=0 to UBound(PlayUrlData)
		sDataa=sDataa&getPlayurlArray(sPath,"$$")(i)&"$$"&PlayUrlData(i)&"$$$"
	  next
	  IF Right(sDataa,3)="$$$" Then sDataa=Left(sDataa,Len(sDataa)-3) End IF
	  dim i,j,dd,dl,ff:dd=getPlayurlArray(sDataa,"$$$"):dl=UBound(dd)
	    if dl>0 then
		   dim ay:ay=From_Count
		   dim ul,ret:ul=From_Count:ReDim li(ul):ret=""
		   for i=0 to dl
			  ff=Split(dd(i),"$$"):j=getArrayElementID(ay,0,ff(0))
			    if ""&li(j)<>"" then
				  li(j)=li(j)&"$$$"&dd(i)
			    else
				  li(j)=Replace(Replace(dd(i),PlayFrom(j),""),"$$","")
			    end if
		    next
		    for i=0 to ul
			     if li(i)<>"" then
				 if ret<>"" then:ret=ret&"$$$"&li(i):else:ret=li(i):end if
			end if
		    next
		    PlayUrlSort=ret
	     else
		    PlayUrlSort=sData
	     end if
End Function


'**************************************************
'函数名：ShowPage
'作  用：显示“上一页 下一页”等信息
'参  数：sFileName  ----链接地址
'        TotalNumber ----总数量
'        MaxPerPage  ----每页数量
'        CurrentPage ----当前页
'        ShowTotal   ----是否显示总数量
'        ShowAllPages ---是否用下拉列表显示所有页面以供跳转。
'        strUnit     ----计数单位
'        ShowMaxPerPage  ----是否显示每页信息量选项框
'返回值：“上一页 下一页”等信息的HTML代码
'**************************************************
Function ShowPage(sfilename, totalnumber, MaxPerPage, CurrentPage, ShowTotal, ShowAllPages, strUnit, ShowMaxPerPage)
    Dim TotalPage, strTemp, strUrl, i

    If totalnumber = 0 Or MaxPerPage = 0 Or IsNull(MaxPerPage) Then
        ShowPage = ""
        Exit Function
    End If
    If totalnumber Mod MaxPerPage = 0 Then
        TotalPage = totalnumber \ MaxPerPage
    Else
        TotalPage = totalnumber \ MaxPerPage + 1
    End If
    If CurrentPage > TotalPage Then CurrentPage = TotalPage
        
    'strTemp = "<div class=""show_page"">"
    If ShowTotal = True Then
	  '下面去掉了显示总数据，如果启用，把第二行，前加'号，第一行，'号删除
        strTemp = "页次：<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>页 共" & totalnumber & "" & strUnit & "&nbsp;&nbsp;"
		'strTemp = "页次：<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>页&nbsp;&nbsp;"
    End If
    If ShowMaxPerPage = True Then
        strUrl = JoinChar(sfilename) & "MaxPerPage=" & MaxPerPage & "&"
    Else
        strUrl = JoinChar(sfilename)
    End If
    If CurrentPage = 1 Then
        strTemp = strTemp &"<span class=""PageBox"">首页</span> <span class=""PageBox"">上一页</span>"
    Else
        strTemp = strTemp & "<a href='" & strUrl & "page=1' title=""首页"" class=""PageBox"">首页</a> "
        strTemp = strTemp & "<a href='" & strUrl & "page=" & (CurrentPage - 1) & "' title=""上一页"" class=""PageBox"">上一页</a> "
    End If
    strTemp = strTemp & " <span>"
    If ShowAllPages = True Then
        Dim Jmaxpages
        If (CurrentPage - 4) <= 0 Or TotalPage < 6 Then
            Jmaxpages = 1
            Do While (Jmaxpages < 6)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                Else
                    If strUrl <> "" Then
                        strTemp = strTemp & "<a href=""" & strUrl & "page=" & Jmaxpages & """>" & Jmaxpages & "</a> "
                    End If
                End If
                If Jmaxpages = TotalPage Then Exit Do
                Jmaxpages = Jmaxpages + 1
            Loop
        ElseIf (CurrentPage + 4) >= TotalPage Then
            Jmaxpages = TotalPage - 5
            Do While (Jmaxpages <= TotalPage)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                Else
                    If strUrl <> "" Then
                        strTemp = strTemp & "<a href=""" & strUrl & "page=" & Jmaxpages & """>" & Jmaxpages & "</a> "
                    End If
                End If
                Jmaxpages = Jmaxpages + 1
            Loop
        Else
            Jmaxpages = CurrentPage - 3
            Do While (Jmaxpages < CurrentPage + 4)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                Else
                    If strUrl <> "" Then
                        strTemp = strTemp & "<a href=""" & strUrl & "page=" & Jmaxpages & """>" & Jmaxpages & "</a> "
                    End If
                End If
                Jmaxpages = Jmaxpages + 1
            Loop
        End If
    End If	
	strTemp = strTemp & "</span>"
    If CurrentPage >= TotalPage Then
        strTemp = strTemp & "<span  class=""PageBox"">下一页</span> <span class=""PageBox"">尾页</span>"
    Else
        strTemp = strTemp & " <a href='" & strUrl & "page=" & (CurrentPage + 1) & "' title=""下一页"" class=""PageBox"">下一页</a>"
        strTemp = strTemp & " <a href='" & strUrl & "page=" & TotalPage & "' title=""尾页"" class=""PageBox"">尾页</a>"
    End If
    If ShowMaxPerPage = True Then
        strTemp = strTemp & "&nbsp;<Input type='text' name='MaxPerPage' size='3' maxlength='4' value='" & MaxPerPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & JoinChar(sfilename) & "page=" & CurrentPage & "&MaxPerPage=" & "'+this.value;"">" & strUnit & "/页"
    Else
        strTemp = strTemp & "&nbsp;" & MaxPerPage & "" & strUnit & "/页"
    End If
    If ShowAllPages = True Then
            strTemp = strTemp & "&nbsp;&nbsp;转到第<Input type='text' name='page' size='3' maxlength='5' value='" & CurrentPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & strUrl & "page=" & "'+this.value;"">页"
    End If	
    'strTemp = strTemp & "</div>"
    ShowPage = strTemp
End Function

'**************************************************
'函数名：ShowPage
'作  用：显示“上一页 下一页”等信息
'参  数：sFileName  ----链接地址
'        TotalNumber ----总数量
'        MaxPerPage  ----每页数量
'        CurrentPage ----当前页
'        ShowTotal   ----是否显示总数量
'        ShowAllPages ---是否用下拉列表显示所有页面以供跳转。
'        strUnit     ----计数单位
'        ShowMaxPerPage  ----是否显示每页信息量选项框
'返回值：“上一页 下一页”等信息的HTML代码
'**************************************************
Function ShowPageCs(sfilename, totalnumber, MaxPerPage, CurrentPage, ShowTotal, ShowAllPages, strUnit, ShowMaxPerPage)
    Dim TotalPage, strTemp, strUrl, i

    If totalnumber = 0 Or MaxPerPage = 0 Or IsNull(MaxPerPage) Then
        ShowPageCs = ""
        Exit Function
    End If
    If totalnumber Mod MaxPerPage = 0 Then
        TotalPage = totalnumber \ MaxPerPage
    Else
        TotalPage = totalnumber \ MaxPerPage + 1
    End If
    If CurrentPage > TotalPage Then CurrentPage = TotalPage
        
    'strTemp = "<div class=""show_page"">"
    If ShowTotal = True Then
        'strTemp = "页次：<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>页 共" & totalnumber & "" & strUnit & "&nbsp;&nbsp;"
		strTemp = "页次：<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>页&nbsp;&nbsp;"
    End If
    If ShowMaxPerPage = True Then
        strUrl = JoinChar(sfilename) & "MaxPerPage=" & MaxPerPage & "&"
    Else
        strUrl = JoinChar(sfilename)
    End If
    If CurrentPage = 1 Then
        strTemp = strTemp &"<span class=""PageBox"">首页</span> <span class=""PageBox"">上一页</span>"
    Else
        strTemp = strTemp & "<a href='#' onClick=""LinkUrl('" & strUrl & "page=1')"" title=""首页"" class=""PageBox"">首页</a> "
        strTemp = strTemp & "<a href='#'onClick=""LinkUrl('" & strUrl & "page=" & (CurrentPage - 1) & "')"" title=""上一页"" class=""PageBox"">上一页</a> "
    End If
    strTemp = strTemp & " <span>"
    If ShowAllPages = True Then
        Dim Jmaxpages
        If (CurrentPage - 4) <= 0 Or TotalPage < 10 Then
            Jmaxpages = 1
            Do While (Jmaxpages < 10)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                Else
                    If strUrl <> "" Then
                        strTemp = strTemp & "<a href='#' onClick=""LinkUrl('" & strUrl & "page=" & Jmaxpages & "')"">" & Jmaxpages & "</a> "
                    End If
                End If
                If Jmaxpages = TotalPage Then Exit Do
                Jmaxpages = Jmaxpages + 1
            Loop
        ElseIf (CurrentPage + 4) >= TotalPage Then
            Jmaxpages = TotalPage - 8
            Do While (Jmaxpages <= TotalPage)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                Else
                    If strUrl <> "" Then
                        strTemp = strTemp & "<a href='#' onClick=""LinkUrl('" & strUrl & "page=" & Jmaxpages & "')"">" & Jmaxpages & "</a> "
                    End If
                End If
                Jmaxpages = Jmaxpages + 1
            Loop
        Else
            Jmaxpages = CurrentPage - 4
            Do While (Jmaxpages < CurrentPage + 5)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                Else
                    If strUrl <> "" Then
                        strTemp = strTemp & "<a href='#' onClick=""LinkUrl('" & strUrl & "page=" & Jmaxpages & "')"">" & Jmaxpages & "</a> "
                    End If
                End If
                Jmaxpages = Jmaxpages + 1
            Loop
        End If
    End If	
	strTemp = strTemp & "</span>"
    If CurrentPage >= TotalPage Then
        strTemp = strTemp & "<span  class=""PageBox"">下一页</span> <span class=""PageBox"">尾页</span>"
    Else
        strTemp = strTemp & " <a href='#' onClick=""LinkUrl('" & strUrl & "page=" & (CurrentPage + 1) & "')"" title=""下一页"" class=""PageBox"">下一页</a>"
        strTemp = strTemp & " <a href='#' onClick=""LinkUrl('" & strUrl & "page=" & TotalPage & "')"" title=""尾页"" class=""PageBox"">尾页</a>"
    End If
    If ShowMaxPerPage = True Then
        strTemp = strTemp & "&nbsp;<Input type='text' name='MaxPerPage' size='3' maxlength='4' value='" & MaxPerPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & JoinChar(sfilename) & "page=" & CurrentPage & "&MaxPerPage=" & "'+this.value;"">" & strUnit & "/页"
    Else
        strTemp = strTemp & "&nbsp;" & MaxPerPage & "" & strUnit & "/页"
    End If
    If ShowAllPages = True Then
            'strTemp = strTemp & "&nbsp;&nbsp;转到第<Input type='text' name='page' size='3' maxlength='5' value='" & CurrentPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & strUrl & "page=" & "'+this.value;"">页"
    End If	
    'strTemp = strTemp & "</div>"
    ShowPageCs = strTemp
End Function

'**************************************************
'函数名：ShowPage_Html
'作  用：显示“上一页 下一页”等信息
'参  数：strPath ----HTMl文件的路径
'        iType_Id  ----栏目ID
'        FileExt ----- 扩展名
'        sfilename  ---- 文件名
'        TotalNumber ----总数量
'        MaxPerPage  ----每页数量
'        ShowTotal   ----是否显示总数量
'        ShowAllPages ---是否用下拉列表显示所有页面以供跳转。有某些页面不能使用，否则会出现JS错误。
'        strUnit     ----计数单位
'返回值：“上一页 下一页”等信息的HTML代码
'**************************************************
Function ShowPage_Html(ByVal strPath, iType_Id, FileExt, sfilename, totalnumber, MaxPerPage, CurrentPage, ShowTotal, ShowAllPages, strUnit,Qcms)

    'Response.Write strPath&"<BR>"&iType_Id&"<BR>"&FileExt&"<BR>"&sfilename&"<BR>"&totalnumber&"<BR>"&MaxPerPage&"<BR>"&CurrentPage&"<BR>"&ShowTotal&"<BR>"&ShowAllPages&"<BR>"&strUnit&"<BR>"&Qcms
	'Response.End()
    Dim TotalPage, strTemp, strUrl, i

    If totalnumber = 0 Or MaxPerPage = 0 Or IsNull(MaxPerPage) Then
        ShowPage_Html = ""
        Exit Function
    End If
    If totalnumber Mod MaxPerPage = 0 Then
        TotalPage = totalnumber \ MaxPerPage
    Else
        TotalPage = totalnumber \ MaxPerPage + 1
    End If
    If CurrentPage > TotalPage Then CurrentPage = TotalPage
        
    'strTemp = "<div class=""show_page"">"
    If ShowTotal = True Then
        'strTemp = "页次：<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>页 共" & totalnumber & "" & strUnit & "&nbsp;&nbsp;"
		strTemp = "页次：<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>页&nbsp;&nbsp;"
    End If
	
    If Right(strPath, 1) = "/" Then
        strPath = Left(strPath, Len(strPath) - 1)
    End If
	
    If CurrentPage = 1 Then
        strTemp = strTemp &"<span class=""PageBox"">首页</span> <span class=""PageBox"">上一页</span>"
    Else
	    If iType_Id > 0 Then
            strTemp = strTemp & "<a href='" & strPath & "/"&Qcms &"_"& iType_Id &"_1"&FileExt&"' title=""首页"" class=""PageBox"">首页</a> "
			strTemp = strTemp & "<a href='" & strPath & "/"&Qcms &"_"& iType_Id &"_"& (CurrentPage - 1) &FileExt&"' title=""上一页"" class=""PageBox"">上一页</a> "
        Else
            strTemp = strTemp & "<a href='" & strPath & "/index" & FileExt & "' title=""首页"" class=""PageBox"">首页</a> "
			If CurrentPage = 2 Then
			strTemp = strTemp & "<a href='" & strPath & "/index" &FileExt&"' title=""上一页"" class=""PageBox"">上一页</a> "
			Else
			strTemp = strTemp & "<a href='" & strPath & "/index" & (CurrentPage - 1) &FileExt&"' title=""上一页"" class=""PageBox"">上一页</a> "
			End If
        End If
		
    End If
    strTemp = strTemp & " <span>"
    If ShowAllPages = True Then
        Dim Jmaxpages
        If (CurrentPage - 4) <= 0 Or TotalPage < 6 Then
            Jmaxpages = 1
            Do While (Jmaxpages < 6)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                ElseIf Jmaxpages = 1 Then           
				   If iType_Id > 0 Then
                       strTemp = strTemp & "<a href="""&strPath&"/"&Qcms &"_"&iType_Id &"_"&Jmaxpages&FileExt&""">" & Jmaxpages & "</a> "
                   Else
                       strTemp = strTemp & "<a href=""" & strPath & "/index"&FileExt & """>" & Jmaxpages & "</a> "
                   End If
  			   Else
			       If iType_Id > 0 Then
                       strTemp = strTemp & "<a href="""&strPath&"/"&Qcms &"_"&iType_Id &"_"&Jmaxpages&FileExt&""">" & Jmaxpages & "</a> "
                   Else
                       strTemp = strTemp & "<a href=""" & strPath & "/index" &Jmaxpages&FileExt & """>" & Jmaxpages & "</a> "
                   End If  
               End If
                If Jmaxpages = TotalPage Then Exit Do
                Jmaxpages = Jmaxpages + 1
            Loop
        ElseIf (CurrentPage + 4) >= TotalPage Then
            Jmaxpages = TotalPage - 5
            Do While (Jmaxpages <= TotalPage)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                Else
                   If iType_Id > 0 Then
                     strTemp = strTemp & "<a href="""&strPath&"/"&Qcms &"_"&iType_Id &"_"&Jmaxpages&FileExt&""">" & Jmaxpages & "</a> "
                   Else
                     strTemp = strTemp & "<a href=""" & strPath & "/index" &Jmaxpages&FileExt & """>" & Jmaxpages & "</a> "
                   End If 
                End If
                Jmaxpages = Jmaxpages + 1
            Loop
        Else
            Jmaxpages = CurrentPage - 3
            Do While (Jmaxpages < CurrentPage + 4)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                ElseIf Jmaxpages = 1 Then           
				   If iType_Id > 0 Then
                       strTemp = strTemp & "<a href="""&strPath&"/"&Qcms &"_"&iType_Id &"_"&Jmaxpages&FileExt&""">" & Jmaxpages & "</a> "
                   Else
                       strTemp = strTemp & "<a href=""" & strPath & "/index"&FileExt & """>" & Jmaxpages & "</a> "
                   End If
  			    Else
			       If iType_Id > 0 Then
                       strTemp = strTemp & "<a href="""&strPath&"/"&Qcms &"_"&iType_Id &"_"&Jmaxpages&FileExt&""">" & Jmaxpages & "</a> "
                   Else
                       strTemp = strTemp & "<a href=""" & strPath & "/index" &Jmaxpages&FileExt & """>" & Jmaxpages & "</a> "
                   End If  
               End If
                Jmaxpages = Jmaxpages + 1
            Loop
        End If
    End If	
	strTemp = strTemp & "</span>"
    If CurrentPage >= TotalPage Then
        strTemp = strTemp & "<span  class=""PageBox"">下一页</span> <span class=""PageBox"">尾页</span>"
    Else
         If iType_Id > 0 Then
            strTemp = strTemp & "<a href='" & strPath &"/"&Qcms &"_"& iType_Id &"_"& (CurrentPage + 1) &FileExt&"' title=""下一页"" class=""PageBox"">下一页</a> "
		    strTemp = strTemp & "<a href='" & strPath &"/"&Qcms &"_"& iType_Id &"_"&TotalPage&FileExt&"' title=""尾页"" class=""PageBox"">尾页</a> "
         Else
		    strTemp = strTemp &"<a href='"&strPath &"/index"&(CurrentPage+1) &FileExt&"' title=""下一页"" class=""PageBox"">下一页</a> "
		    strTemp = strTemp &"<a href='"&strPath &"/index"&TotalPage&FileExt&"' title=""尾页"" class=""PageBox"">尾页</a>"
         End If 
    End If
	If iType_Id > 0 Then Paget=2 Else Paget=1
	strTemp = strTemp&"<input type='input' name='page' size='4' class='bput' /><input type='button' value='跳转' onclick=""getPageGoUrl("&TotalPage&",'page',"&Paget&",'"&FileExt&"')"" class='btn' />"
	ShowPage_Html = strTemp
End Function
'**************************************************
'函数名：ShowPage_AspHtml
'作  用：显示“上一页 下一页”等信息
'参  数：strPath----文件路径
'        sfilename  ----栏目ID
'        TotalNumber ----总数量
'        MaxPerPage  ----每页数量
'        CurrentPage ----当前页
'        ShowTotal   ----是否显示总数量
'        ShowAllPages ---是否用下拉列表显示所有页面以供跳转。
'        strUnit     ----计数单位
'        ShowMaxPerPage  ----是否显示每页信息量选项框
'返回值：“上一页 下一页”等信息的HTML代码
'**************************************************
Function ShowPage_AspHtml(ByVal strPath, sfilename, totalnumber, MaxPerPage, CurrentPage, ShowTotal, ShowAllPages, strUnit, ShowMaxPerPage)
    Dim TotalPage, strTemp, strUrl, i

    If totalnumber = 0 Or MaxPerPage = 0 Or IsNull(MaxPerPage) Then
        ShowPage = ""
        Exit Function
    End If
    If totalnumber Mod MaxPerPage = 0 Then
        TotalPage = totalnumber \ MaxPerPage
    Else
        TotalPage = totalnumber \ MaxPerPage + 1
    End If
    If CurrentPage > TotalPage Then CurrentPage = TotalPage
    'strTemp = "<div class=""show_page"">"
    If ShowTotal = True Then
        strTemp = "页次：<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>页 共 <b>" & totalnumber & "</b> " & strUnit & "&nbsp;&nbsp;"
    End If
    If CurrentPage = 1 Then
        strTemp = strTemp & "<span style=""font-family:webdings;color:#999"" class=""PageBox"">9</span> <span style=""font-family:webdings;color:#999"" class=""PageBox"">7</span>"
    Else
        strTemp = strTemp & "<a href='" & strPath & "List_" & sfilename & "_1.html' title=""首页"" class=""PageBox"">首页</a> "
        strTemp = strTemp & "<a href='" & strPath & "List_" & sfilename & "_" & (CurrentPage - 1) & ".html' title=""上一页"" class=""PageBox"">上一页</a> "
    End If
    strTemp = strTemp & " <span>"
    If ShowAllPages = True Then
        Dim Jmaxpages
        If (CurrentPage - 4) <= 0 Or TotalPage < 10 Then
            Jmaxpages = 1
            Do While (Jmaxpages < 10)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                Else
                    strTemp = strTemp & "<a href=""" & strPath & "List_" & sfilename & "_" & Jmaxpages & ".html"">" & Jmaxpages & "</a> "
                End If
                If Jmaxpages = TotalPage Then Exit Do
                Jmaxpages = Jmaxpages + 1
            Loop
        ElseIf (CurrentPage + 4) >= TotalPage Then
            Jmaxpages = TotalPage - 8
            Do While (Jmaxpages <= TotalPage)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                Else
                    strTemp = strTemp & "<a href=""" & strPath & "List_" & sfilename & "_" & Jmaxpages & ".html"">" & Jmaxpages & "</a> "
                End If
                Jmaxpages = Jmaxpages + 1
            Loop
        Else
            Jmaxpages = CurrentPage - 4
            Do While (Jmaxpages < CurrentPage + 5)
                If Jmaxpages = CurrentPage Then
                    strTemp = strTemp & "<font color=""FF0000"" class=""PageCss"">" & Jmaxpages & "</font> "
                Else
                    strTemp = strTemp & "<a href=""" & strPath & "List_" & sfilename & "_" & Jmaxpages & ".html"">" & Jmaxpages & "</a> "
                End If
                Jmaxpages = Jmaxpages + 1
            Loop
        End If
    End If
	strTemp = strTemp & "</span>"	
    If CurrentPage >= TotalPage Then
        strTemp = strTemp & "<span style=""font-family:webdings;color:#999"" class=""PageBox"">8</span> <span style=""font-family:webdings;color:#999"" class=""PageBox"">:</span>"
    Else
        strTemp = strTemp & "<a href='" & strPath & "List_" & sfilename & "_" & (CurrentPage + 1) & ".html'  style=""font-family:webdings;"" title=""下一页"" class=""PageBox"">8</a> "
        strTemp = strTemp & "<a href='" & strPath & "List_" & sfilename & "_" & TotalPage & ".html' style=""font-family:webdings;"" title=""尾页"" class=""PageBox"">:</a>"
    End If
    'strTemp = strTemp & "&nbsp;页次：<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>页 "
    If ShowMaxPerPage = True Then
        strTemp = strTemp & "&nbsp;<Input type='text' name='MaxPerPage' size='3' maxlength='4' value='" & MaxPerPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & JoinChar(sfilename) & "page=" & CurrentPage & "&MaxPerPage=" & "'+this.value;"">" & strUnit & "/页"
    Else
        strTemp = strTemp & "&nbsp;" & MaxPerPage & "" & strUnit & "/页"
    End If	
    If ShowAllPages = True Then
            strTemp = strTemp & "&nbsp;&nbsp;转到第<Input type='text' name='page' size='3' maxlength='5' value='" & CurrentPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & strPath & "List_" & sfilename & "_'+this.value+'.html';"">页"
    End If	
    'strTemp = strTemp & "</div>"
    ShowPage_AspHtml = strTemp
End Function

'**************************************************
'函数名：JoinChar
'作  用：向地址中加入 ? 或 &
'参  数：strUrl  ----网址
'返回值：加了 ? 或 & 的网址
'**************************************************
Function JoinChar(ByVal strUrl)
    If strUrl = "" Then
        JoinChar = ""
        Exit Function
    End If
    If InStr(strUrl, "?") < Len(strUrl) Then
        If InStr(strUrl, "?") > 1 Then
            If InStr(strUrl, "&") < Len(strUrl) Then
                JoinChar = strUrl & "&"
            Else
                JoinChar = strUrl
            End If
        Else
            JoinChar = strUrl & "?"
        End If
    Else
        JoinChar = strUrl
    End If
End Function



'**************************************************
'函数名：GetSubStr
'作  用：截字符串，汉字一个算两个字符，英文算一个字符
'参  数：str   ----原字符串
'        strlen ----截取长度
'        bShowPoint ---- 是否显示省略号
'返回值：截取后的字符串
'**************************************************
Function GetSubStr(ByVal str, ByVal strlen, bShowPoint)
    If str = "" Then
        GetSubStr = ""
        Exit Function
    End If
    Dim l, t, c, i, strTemp
    str = Replace(Replace(Replace(Replace(str, "&nbsp;", " "), "&quot;", Chr(34)), "&gt;", ">"), "&lt;", "<")
    l = Len(str)
    t = 0
    strTemp = str
    strlen = QvodCms_CLng(strlen)
    For i = 1 To l
        c = Abs(Asc(Mid(str, i, 1)))
        If c > 255 Then
            t = t + 2
        Else
            t = t + 1
        End If
        If t >= strlen Then
            strTemp = Left(str, i)
            Exit For
        End If
    Next
    strTemp = Replace(Replace(Replace(Replace(strTemp, " ", "&nbsp;"), Chr(34), "&quot;"), ">", "&gt;"), "<", "&lt;")
    If strTemp <> str And bShowPoint = True Then
        strTemp = strTemp & ""
    End If
    GetSubStr = strTemp
End Function


'将调用的地址编码
Function bytes2BSTR(vIn)
Dim i,strReturn,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
'获取当前地址路径
Function keyurl()
keyurl="http://" & Request.ServerVariables("HTTP_HOST") & Mid(Request.ServerVariables("URL"),1,InStrRev(Request.ServerVariables("URL"),"/"))
End Function

'评论留言时间限制
Function GetTimeSpan(sessionName)
	dim lastTime : lastTime=session(sessionName)
	if isNul(lastTime) then lastTime=0
	GetTimeSpan=DateDiff("s",lasttime,now())
End Function

Sub SetSessionTime(sessionName,sessionValue)
	session(sessionName)=sessionValue
End Sub
%>