?%
Function YCMS_Head()
Dim tmp
tmp=YCMS_skin(5)
tmp=Replace(tmp,"$title$",webset(0)&"?&title)
tmp=Replace(tmp,"{$headmenu$}",YCMS_menu("head"))
If YCMS_logined() Then
tmp=Replace(tmp,"{$login$}",YCMS_logins())
Else
tmp=Replace(tmp,"{$login$}",YCMS_skin(27))
End If
YCMS_Head=YCMS_Print(tmp)
End Function
Function YCMS_Foot()
Dim tmp
tmp=YCMS_skin(6)
tmp=Replace(tmp,"{$footmenu$}",YCMS_menu("foot"))
tmp=Replace(tmp,"$number$",webset(4))
tmp=Replace(tmp,"$copyright$",webset(14)&e("+sgxu@Ut|jwji%G~%^HRX"))
YCMS_Foot=YCMS_Print(tmp)
End Function
Function YCMS_Js(Tab,Num,ShowType,CutLen)
Dim tmp,ShowPage
Select Case Tab
case"YCMS_News"
ShowPage="YCMS_ShowNews"
case"YCMS_Art"
ShowPage="YCMS_ShowArt"
case"YCMS_Art1"
ShowPage="YCMS_ShowArt1"
case"YCMS_Art2"
ShowPage="YCMS_ShowArt2"
case"YCMS_Art3"
ShowPage="YCMS_ShowArt3"
case"YCMS_Dj"
ShowPage="YCMS_ShowDj"
case"YCMS_Pic"
ShowPage="YCMS_ShowPic"
case"YCMS_Down"
ShowPage="YCMS_ShowDown"
case"YCMS_Book"
ShowPage="YCMS_ShowBook"
End Select
Set rs=conn.execute("SELECT top "&Num&" * FROM ["&Tab&"] where ispass=1 ORDER BY id DESC")
tmp=tmp&"
"
do while not rs.eof
tmp=tmp&"- "
Select Case ShowType
Case "click"
tmp=tmp&""&rs("click")&""
Case "addtime"
tmp=tmp&""&YCMS_time(rs("addtime"),1)&""
Case "adduser"
tmp=tmp&""&rs("adduser")&""
Case Else
tmp=tmp&""
End Select
tmp=tmp&""&YCMS_cut(rs("title"),CutLen)&""
tmp=tmp&"
"
rs.movenext
Loop
tmp=tmp&"
"
if rs.eof and rs.bof Then
tmp=tmp&""
end if
rs.close
Set rs=Nothing
YCMS_Js=tmp
End Function
Function YCMS_pic(tab,num)
Dim tmp,ShowPage
Select Case tab
case"YCMS_news"
ShowPage="YCMS_ShowNews"
case"YCMS_art"
ShowPage="YCMS_ShowArt"
case"YCMS_art1"
ShowPage="YCMS_ShowArt1"
case"YCMS_art2"
ShowPage="YCMS_ShowArt2"
case"YCMS_art3"
ShowPage="YCMS_ShowArt3"
case"YCMS_dj"
ShowPage="YCMS_ShowDj"
case"YCMS_pic"
ShowPage="YCMS_ShowPic"
case"YCMS_down"
ShowPage="YCMS_ShowDown"
End Select
If tab="YCMS_pic" Then
set rs=conn.execute("select top "&num&" * from ["&tab&"] where ispass=1 order by id DESC")
Else
set rs=conn.execute("select top "&num&" * from ["&tab&"] where pic<>'' and ispass=1 order by id DESC")
End if
tmp=tmp&""
YCMS_pic=tmp
End Function
Function YCMS_pl(pltab,plid)
Dim tmp,num
tmp=YCMS_skin(23)
tmp=Replace(tmp,"$pltab$",pltab)
tmp=Replace(tmp,"$plid$",plid)
tmp=Replace(tmp,"$content$",YCMS_pl2(pltab,plid))
YCMS_pl=tmp
End Function
Function YCMS_pl2(pltab,plid)
Dim tmp
Set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [YCMS_pl] where pltab='"&pltab&"' and plid="&CInt(plid)&" order by id desc",conn,1,1
Do While Not rs.eof
tmp=tmp&"- "&rs("adduser")&"?/i>?&rs("content")&"
"
rs.movenext
Loop
rs.close
Set rs=Nothing
YCMS_pl2=tmp
End Function
Function YCMS_logins()
Dim tmp
tmp=YCMS_skin(28)
Set rsuser=conn.execute("select * from [YCMS_user] where id="&userid)
tmp=Replace(tmp,"$userface$",rsuser("user_face"))
tmp=Replace(tmp,"$username$",rsuser("user_name"))
tmp=Replace(tmp,"$userpoint$",rsuser("user_point"))
Select Case useradmin
Case 1
tmp=Replace(tmp,"$useradmin$","普通用?)
Case 2
tmp=Replace(tmp,"$useradmin$","高级用户")
Case 3
tmp=Replace(tmp,"$useradmin$","管理?)
Case Else
tmp=Replace(tmp,"$useradmin$","非法用户")
End Select
tmp=Replace(tmp,"$userlogintime$",rsuser("user_login_time"))
set usersms=conn.execute("Select count(*) as lovesms From [YCMS_sms] where to_user='"&username&"' and ok=0")
If usersms("lovesms")<>0 Then
tmp=Replace(tmp,"$usersms$",""&usersms("lovesms")&"")
Else
tmp=Replace(tmp,"$usersms$","0")
End If
Set usersms=Nothing
Set rsuser=Nothing
YCMS_logins=tmp
End Function
Function YCMS_menu(menuput)
dim menu_tmp,m
Set goxml=Server.CreateObject("Microsoft.XMLDOM")
goxml.load(Server.MapPath("inc/menu.xml"))
Set goroot=goxml.documentElement.selectSingleNode("menu")
m=0
If menuput="foot" Then
menu_tmp=menu_tmp&"返回顶部"
End if
for each child in goroot.childNodes
set childmenu=goroot.childnodes.item(m)
Dim menu_mode,menu_open,menu_title,menu_url
menu_mode=childmenu.getAttributeNode("mode").nodeValue
menu_open=childmenu.getAttributeNode("open").nodeValue
menu_name=childmenu.getAttributeNode("name").nodeValue
menu_url=goroot.childNodes.item(m).text
If menuput="head" Then
If menu_mode=0 then
If menu_open=0 Then
If m=0 Then
menu_tmp=menu_tmp&""&menu_name&""
Else
menu_tmp=menu_tmp&"?a href='"&menu_url&"'>"&menu_name&""
End If
Else
If m=0 Then
menu_tmp=menu_tmp&""&menu_name&""
Else
menu_tmp=menu_tmp&"?a href='"&menu_url&"' target='o'>"&menu_name&""
End If
End If
End If
Else
If menu_mode=1 then
If menu_open=0 Then
menu_tmp=menu_tmp&"?a href='"&menu_url&"'>"&menu_name&""
Else
menu_tmp=menu_tmp&"?a href='"&menu_url&"' target='o'>"&menu_name&""
End If
End If
End If
set childmenu=nothing
m=m+1
next
set goroot=nothing
set goxml=nothing
YCMS_menu=menu_tmp
End Function
Function YCMS_isonline(username)
Set rsisonline=conn.execute("select UserName from [YCMS_online] where UserName='"&username&"'")
If Not(rsisonline.eof And rsisonline.bof) then
YCMS_isonline="在线"
Else
YCMS_isonline="离线"
End If
rsisonline.close
Set rsisonline=Nothing
End Function
Function YCMS_booktotal(username)
Dim booksubject,bookreply
booksubject=CInt(conn.execute("select count(*) from [YCMS_book] where adduser='"&username&"'")(0))
bookreply=CInt(conn.execute("select count(*) from [YCMS_bookreply] where adduser='"&username&"'")(0))
YCMS_booktotal=CInt(booksubject+bookreply)
End Function
Function showtitle(tab,byid)
set rs=conn.execute("select title from ["&tab&"] where id="&byid)
showtitle=rs("title")
rs.close
set rs=nothing
end Function
Function YCMS_NextData(tab,page,id)
Dim tmp
tmp=tmp&""
sql="select top 1 id,title,ispass from "&tab&" where ispass=1 and id<"&id&" order by id desc"
set rs=conn.execute(sql)
If rs.eof and rs.bof Then
tmp=tmp&" 上一条记录:没有上一条记?/font>"
else
tmp=tmp&" 上一条记录:"&rs("title")&""
End If
rs.close
Set rs=Nothing
tmp=tmp&""
sql="select top 1 id,title,ispass from "&tab&" where ispass=1 and id>"&id&""
set rs=conn.execute(sql)
If rs.eof and rs.bof Then
tmp=tmp&" 下一条记录:没有下一条记?/font>"
else
tmp=tmp&" 下一条记录:"&rs("title")&""
End If
rs.close
Set rs=Nothing
tmp=tmp&""
YCMS_NextData=tmp
End Function
Function YCMS_total(tab)
dim tmp,YC_count_pl
tmp=tmp&""
tmp=tmp&"- 全部统计?&conn.execute("select count(*) from "&tab&" where ispass=1")(0)&"
"
tmp=tmp&"- 待审更新?&conn.execute("select count(*) from ["&tab&"] where ispass=0")(0)&"
"
tmp=tmp&"- 今日更新?&cint(conn.execute("select count(*) from ["&tab&"] where ispass=1 and addtime>=#"&date()&"#")(0))&"
"
tmp=tmp&"- 昨日更新?&cint(conn.execute("select count(*) from ["&tab&"] where ispass=1 and addtime>=#"&date()-1&"#")(0)-conn.execute("select count(*) from ["&tab&"] where ispass=1 and addtime>=#"&date()&"#")(0))&"
"
set rsclick=conn.execute("select sum(click) as myclick from ["&tab&"] where ispass=1")
tmp=tmp&"- 总浏览数?&rsclick("myclick")&"
"
set rsclick=nothing
tmp=tmp&"
"
YCMS_total=tmp
End Function
Function YCMS_search(mode,searchclass)
Dim tmp
tmp=tmp&""
tmp=tmp&""
If mode=0 then
tmp=tmp&""
else
tmp=tmp&""
tmp=tmp&""
YCMS_search=tmp
End Function
Function YCMS_class(tab,url)
Dim tmp
set rs=conn.execute("select id,classname from "&tab&" where classid=0")
If not rs.bof and not rs.eof then
do while not rs.eof
set rs1=server.CreateObject("adodb.recordset")
sql1="select id,classname from ["&tab&"] where classid="&rs("id")
rs1.open sql1,conn,1,1
tmp=tmp&"
"
If CInt(Request.QueryString("bigclass"))=rs("id") then
tmp=tmp&""&rs("classname")&""
else
tmp=tmp&""&rs("classname")&""
End If
tmp=tmp&"
"
If not rs1.bof and not rs1.eof Then
tmp=tmp&""
do while not rs1.eof
tmp=tmp&"


"
If CInt(Request.QueryString("class"))=rs1("id") then
tmp=tmp&"
"&rs1("classname")&""
else
tmp=tmp&"
"&rs1("classname")&""
End If
tmp=tmp&"
"
rs1.movenext
Loop
tmp=tmp&"
"
End If
rs1.close
set rs1=nothing
rs.movenext
loop
else
tmp=tmp&"数据更新?.."
End If
rs.close
Set rs=Nothing
YCMS_class=tmp
End Function
Function YCMS_click(tab,url)
Dim tmp,sql,n
If Request.QueryString("class")<>"" then
sql="select id,color,title,click,addtime,classid,adduser from ["&tab&"] where classid="&Request.QueryString("class")&" and ispass=1 order by click DESC"
else
sql="select id,color,title,click,addtime,classid,adduser from ["&tab&"] where ispass=1 order by click DESC"
End If
set rstop=server.createobject("adodb.recordset")
rstop.open sql,conn,1,1
n=0
tmp=tmp&""
do while not rstop.eof
tmp=tmp&"- "&rstop("title")&"
"
n=n+1
If n=CInt(webset(8)) then exit do End If
rstop.movenext
loop
If rstop.eof and rstop.bof then
tmp=tmp&"数据更新?.."
End If
tmp=tmp&"
"
rstop.close
set rstop=Nothing
YCMS_click=tmp
End Function
Function YCMS_best(tab,url)
Dim tmp,sql,n
If Request.QueryString("class")<>"" then
sql="select id,color,title,click,addtime,classid,isbest,adduser from ["&tab&"] where isbest=1 and classid="&Request.QueryString("class")&" and ispass=1 order by id DESC"
else
sql="select id,color,title,click,addtime,classid,isbest,adduser from ["&tab&"] where isbest=1 and ispass=1 order by id DESC"
End If
set rsbest=server.createobject("adodb.recordset")
rsbest.open sql,conn,1,1
n=0
tmp=tmp&""
do while not rsbest.eof
tmp=tmp&"- "&rsbest("title")&"
"
n=n+1
If n=CInt(webset(9)) then exit do End If
rsbest.movenext
loop
If rsbest.eof and rsbest.bof then
tmp=tmp&"数据更新?.."
End If
tmp=tmp&"
"
rsbest.close
set rsbest=Nothing
YCMS_best=tmp
End Function
Function showpage()
showpage="共有记录 "&rs.recordcount&" ?nbsp;?nbsp;"&mypage&"/"&rs.pagecount&" 页,每页 "&rs.pagesize&" 条?
End Function
%>