📄 skin.asp
字号:
<%
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)&" WWS")
YCMS_Foot=YCMS_Print(tmp)
End Function
Function YCMS_Js(Tab,Num,CutLen)
Dim tmp,ShowPage
Select Case Tab
case"YCMS_News"
ShowPage="YCMS_ShowNews"
case"YCMS_Art"
ShowPage="YCMS_ShowArt"
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&"<ul class='list'>"
do while not rs.eof
tmp=tmp&"<li>"
If tab<>"YCMS_Book" Then
tmp=tmp&"<span>"&YCMS_time(rs("addtime"),6)&"</span>"
End if
tmp=tmp&"<a onclick='window.open(this.href);return false;' href='"&ShowPage&".asp?id="&rs("id")&"' title='"&rs("title")&"' style='color:"&rs("color")&"'>"&YCMS_cut(rs("title"),CutLen)&"</a>"
tmp=tmp&"</li>"
rs.movenext
Loop
tmp=tmp&"</ul>"
if rs.eof and rs.bof Then
tmp=tmp&"<ul class='list'><li>数据更新中……</li></ul>"
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_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&"<table border='0' width='100%' align='center'><tr>"
do while not rs.eof
tmp=tmp&"<td align='center' class='pic'>"
tmp=tmp&"<a href='"&ShowPage&".asp?id="&rs("id")&"' onclick='window.open(this.href);return false;' onfocus='this.blur()'><img src='"&rs("pic")&"' alt='人气值:"&rs("click")&"' onerror='this.src=""img/nopic.gif""' align='absmiddle' />"
tmp=tmp&"<div class='br'></div>"
tmp=tmp&"<a href='"&ShowPage&".asp?id="&rs("id")&"' onclick='window.open(this.href);return false;' style='color:"&rs("color")&"'>"&YCMS_cut(rs("title"),16)&"</a>"
tmp=tmp&"</td>"
rs.movenext
Loop
tmp=tmp&"</tr>"
if rs.eof and rs.bof then
tmp=tmp&"<img alt='' src='img/nopic.gif' class='pic' align='absmiddle' />"
end if
rs.close
set rs=Nothing
tmp=tmp&"</table>"
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&"<ul class='list'><li><i style='cursor:pointer;' title='IP:"&rs("ip")&";发布时间:"&rs("addtime")&"'>"&rs("adduser")&"说</i>:"&rs("content")&"</li></ul>"
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$","<span style='font-weight:bold;color:#f00;text-dicoration:underline;'>"&usersms("lovesms")&"</span><embed src='img/sms.swf' width='0' height='0'></embed>")
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&"<a id='toTop' href='#' onclick='return toTop();'>返回顶部</a>"
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&"<a href='"&menu_url&"'>"&menu_name&"</a>"
Else
menu_tmp=menu_tmp&"┊<a href='"&menu_url&"'>"&menu_name&"</a>"
End If
Else
If m=0 Then
menu_tmp=menu_tmp&"<a href='"&menu_url&"' target='o'>"&menu_name&"</a>"
Else
menu_tmp=menu_tmp&"┊<a href='"&menu_url&"' target='o'>"&menu_name&"</a>"
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&"</a>"
Else
menu_tmp=menu_tmp&"┊<a href='"&menu_url&"' target='o'>"&menu_name&"</a>"
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="<span style='color:#f00;font-weight:bold;'>在线</span>"
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&"<div class='space'></div>"
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 color='red'>没有上一条记录</font>"
else
tmp=tmp&" 上一条记录:<a href='"&page&".asp?id="&rs("id")&"'>"&rs("title")&"</a>"
End If
rs.close
Set rs=Nothing
tmp=tmp&"<div class='space'></div>"
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 color='red'>没有下一条记录</font>"
else
tmp=tmp&" 下一条记录:<a href='"&page&".asp?id="&rs("id")&"'>"&rs("title")&"</a>"
End If
rs.close
Set rs=Nothing
tmp=tmp&"<div class='space'></div>"
YCMS_NextData=tmp
End Function
Function YCMS_total(tab)
dim tmp,YC_count_pl
tmp=tmp&"<ul class='list'>"
tmp=tmp&"<li>全部统计:"&conn.execute("select count(*) from "&tab&" where ispass=1")(0)&"</li>"
tmp=tmp&"<li>待审更新:"&conn.execute("select count(*) from ["&tab&"] where ispass=0")(0)&"</li>"
tmp=tmp&"<li>今日更新:"&cint(conn.execute("select count(*) from ["&tab&"] where ispass=1 and addtime>=#"&date()&"#")(0))&"</li>"
tmp=tmp&"<li>昨日更新:"&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))&"</li>"
set rsclick=conn.execute("select sum(click) as myclick from ["&tab&"] where ispass=1")
tmp=tmp&"<li>总浏览数:"&rsclick("myclick")&"</li>"
set rsclick=nothing
tmp=tmp&"</ul>"
YCMS_total=tmp
End Function
Function YCMS_search(mode,searchclass)
Dim tmp
tmp=tmp&"<div class='br'></div>"
tmp=tmp&"<center>"
If mode=0 then
tmp=tmp&"<form name='Search' action='YCMS_Search.asp' method='post'>"
tmp=tmp&" 栏 目:<select name='jinzheclass' style='width:120px;' class='input'>"
tmp=tmp&"<option value='搜索新闻'>搜索新闻动态</option>"
tmp=tmp&"<option value='搜索文章'>搜索文章作品</option>"
tmp=tmp&"<option value='搜索下载'>搜索站内软件</option>"
tmp=tmp&"<option value='搜索图片'>搜索站内图片</option>"
tmp=tmp&"<option value='搜索娱乐'>搜索影音娱乐</option>"
tmp=tmp&"<option value='搜索留言'>搜索留言帖子</option>"
tmp=tmp&"</select>"
tmp=tmp&"<div class='br'></div>"
tmp=tmp&" 方 式:<select name='mode' style='width:120px;' class='input'>"
tmp=tmp&"<option value='按标题'>以标题来查询</option>"
tmp=tmp&"<option value='按内容'>以内容来查询</option>"
tmp=tmp&"</select>"
tmp=tmp&"<div class='br'></div>"
tmp=tmp&" 关键字:<input type='text' class='input' style='width:120px;' maxlength='30' name='keyword' size='16' />"
tmp=tmp&"<div class='br'></div>"
tmp=tmp&"<center><input type='submit' name='submit' value='搜 索' class='put' />"
tmp=tmp&" <input type='reset' name='reset' value='清 空' class='put' />"
tmp=tmp&"</center>"
tmp=tmp&"</form>"
else
tmp=tmp&"<form name='search' action='YCMS_Search.asp' method='post' align='center'>"
tmp=tmp&"<input type='hidden' name='jinzheclass' value='"&searchclass&"' />"
tmp=tmp&"<input type='hidden' name='mode' value='按标题' />"
tmp=tmp&"关键词:<input type='text' class='input' maxlength='30' name='keyword' size='16' />"
tmp=tmp&"<div class='br'></div>"
tmp=tmp&"<input type='submit' name='submit' value='搜 索' class='put' />"
tmp=tmp&" <input type='reset' name='reset' value='清 空' class='put' />"
End If
tmp=tmp&"</center>"
tmp=tmp&"<div class='br'></div>"
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&" <img alt='' src='img/+.gif' style='cursor:hand' onclick=""display('o"&rs("id")&"')"" />"
If CInt(Request.QueryString("bigclass"))=rs("id") then
tmp=tmp&"<font color='red'>"&rs("classname")&"</font>"
else
tmp=tmp&"<a href='"&url&".asp?bigclass="&rs("id")&"'>"&rs("classname")&"</a>"
End If
tmp=tmp&"<br />"
If not rs1.bof and not rs1.eof Then
tmp=tmp&"<div style='display:none' id='o"&rs("id")&"'>"
do while not rs1.eof
tmp=tmp&" <img src='img/+-.gif' /><img src='img/-.gif' align='absmiddle'> "
If CInt(Request.QueryString("class"))=rs1("id") then
tmp=tmp&"<font color='red'>"&rs1("classname")&"</font>"
else
tmp=tmp&"<a href='"&url&".asp?class="&rs1("id")&"'>"&rs1("classname")&"</a>"
End If
tmp=tmp&"<br />"
rs1.movenext
Loop
tmp=tmp&"</div>"
End If
rs1.close
set rs1=nothing
rs.movenext
loop
else
tmp=tmp&"<center>数据更新中...</center>"
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&"<ul class=""list"">"
do while not rstop.eof
tmp=tmp&"<li><a href='"&url&"?id="&rstop("id")&"' target='"&url&"' title='"&rstop("title")&"' style='color:"&rstop("color")&"'>"&rstop("title")&"</a></li>"
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&"<center>数据更新中...</center>"
End If
tmp=tmp&"</ul>"
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&"<ul class=""list"">"
do while not rsbest.eof
tmp=tmp&"<li><a href='"&url&"?id="&rsbest("id")&"' target='"&url&"' title='"&rsbest("title")&"' style='color:"&rsbest("color")&"'>"&rsbest("title")&"</a></li>"
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&"<center>数据更新中...</center>"
End If
tmp=tmp&"</ul>"
rsbest.close
set rsbest=Nothing
YCMS_best=tmp
End Function
Function ShowPage(allnum,pagenum,mypage,pages,bigclassid,classid)
If bigclassid<>"" Then
showpage="共有记录 <span style='color:#f00;'>"&allnum&"</span> 条 <script type='text/javascript'>showPageLink('?bigclass="&bigclassid&"&page=',"&mypage&","&pages&");</script>分 <span style='color:#f00;'>"&mypage&"</span>/"&pagenum&" 页,每页 <span style='color:#f00;'>"&pagenum&"</span> 条。"
ElseIf classid<>"" Then
showpage="共有记录 <span style='color:#f00;'>"&allnum&"</span> 条 <script type='text/javascript'>showPageLink('?class="&classid&"&page=',"&mypage&","&pages&");</script>分 <span style='color:#f00;'>"&mypage&"</span>/"&pagenum&" 页,每页 <span style='color:#f00;'>"&pagenum&"</span> 条。"
Else
showpage="共有记录 <span style='color:#f00;'>"&allnum&"</span> 条 <script type='text/javascript'>showPageLink('?page=',"&mypage&","&pages&");</script>分 <span style='color:#f00;'>"&mypage&"</span>/"&pagenum&" 页,每页 <span style='color:#f00;'>"&pagenum&"</span> 条。"
End if
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -