makephotoindex.asp

来自「新闻发布系统」· ASP 代码 · 共 258 行

ASP
258
字号
<!--#include file = "conn.asp"-->
<!--#include file = "Fsmanage/admin_checkmana.asp"-->
<!--#include file = "Fsmanage/inc/function.asp"-->
<!--#include file = "Fsmanage/inc/ReplaceMake.asp"-->
<!--#include file = "Fsmanage/inc/Child.asp"-->
<%
'=========================================================
'产品目录:风讯产品N系列
'软件名称:风讯站点管理系统
'当前版本:2004.I.0225
'最新更新:2004.2.10
'=========================================================
'Copyright (C) 2002-2004 cooin.com. All rights reserved.
'网站: http://www.cooin.com  Foosun.net
'程序制作:轻风云(QQ:655071)
'Email:skeen@cooin.com,skeen@Foosun.net
'论坛支持:风讯在线论坛(http://bbs.cooin.com   http://bbs.foosun.net)
'=========================================================
if EnoughPopedom("makeindex")=1 then
Response.write"<script>alert(""[操作失败]\n\n你的权限不足!\n\n请与系统管理员联系获得足够的权限!"");location.href=""javascript:history.back()"";</script>"
Response.end
end if

function todays()
dim tmprs
tmprs=conn.execute("Select count(NewsID) from News Where year(date)=year(date()) and month(date)=month(date()) and day(date)=day(date()) and PicNews=true")
todays=tmprs(0)
set tmprs=nothing
if isnull(todays) then todays=0
end function

function gettipnum()
dim tmprs
tmprs=conn.execute("Select Count(NewsID) from News where PicNews=true")
gettipnum=tmprs(0)
set tmprs=nothing
if isnull(gettipnum) then gettipnum=0
end function
tj="图片数量:"&gettipnum()&"&nbsp;&nbsp;&nbsp;"
tj=tj&"今日图片:"&todays()&""
%>
<head>
<title>www.cooin.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href=../FsManage/css/css.css rel=stylesheet>
</head>
<%
  '获取绝对路径开始
   Copyright="\n\n Copyrights Foosun Computer System studios"
   Domain=Request.ServerVariables("SERVER_NAME")
   soFilePath=Request.ServerVariables("PATH_INFO")
   soFilePath=lcase(left(soFilePath,instrRev(soFilePath,"/")))
   totoln=len(soFilePath)
   soFilePath=lcase(left(soFilePath,totoln-1))
   soFilePath=lcase(left(soFilePath,instrRev(soFilePath,"/")))
   sowinpath=Domain&soFilePath  
  '获取绝对路径结束
    set rs=server.CreateObject("adodb.recordset")
	sql="Select * from News where PicNews=true order by date desc"
	rs.open sql,conn,1,1
	
    set rsc=server.CreateObject("adodb.recordset")
	sqlc="Select * from Newsclass order by id desc"
	rsc.open sqlc,conn,1,1
	
	set rss=server.CreateObject("adodb.recordset")
	sqls="Select * from Speical order by id desc"
	rss.open sqls,conn,1,1
	
  	set rs3=Server.CreateObject("adodb.recordset")
    sql3="Select * from Templet Where TempletType='photo'"
   	rs3.open sql3,conn,1,1
    
	spb="<font color=red><b>热点专题</b></font><br>"
	if not rss.eof then
	    while not rss.eof
	    spb=spb&"·<a href=../special/"&rss("Speicalen")&".html target=_blank>"&rss("SpeicalCn")&"</a><br>"
	    rss.movenext
		wend
	else
	spb=spb&"还没有专题"
	end if
	
''########读取点击打top图片
	Set rstop=Server.CreateObject("adodb.recordset")
    sqltop="select * from News where PicNews=true order by click desc"
    rstop.open sqltop,conn,1,1
    if rstop.eof then
    blst="·还没有TOP新闻"
    else
    do while not rstop.eof
    h=h+1
	if rstop("BiaotiNews")=true then
	blst=blst&"·<a href=../"&rstop("UBiaotiNews")&" target=_blank>"&CovtTitle(gotTopic(rstop("title"),22))&"</a><br>"
	else
    blst=blst&"·<a href=../"&rstop("lpath")&rstop("FileName")&".html target=_blank>"&CovtTitle(gotTopic(rstop("title"),22))&"</a><br>"
    end if
	if h>=10 then exit do
    rstop.movenext
    loop
    h=0
    end if
    rstop.close
''########最新图片
	Set rsn=Server.CreateObject("adodb.recordset")
	sqln="select top 10  * from News where PicNews=true order by newsid desc"
    rsn.open sqln,conn,1,1
    if rsn.eof then
    blsn="·还没有最新图片"
    else
    do while not rsn.eof
    h=h+1
	if rsn("BiaotiNews")=true then
	blsn=blsn&"·<a href=../"&rsn("UBiaotiNews")&" target=_blank>"&rsn("title")&"</a><br>"
	else
    blsn=blsn&"·<a href=../"&rsn("lpath")&rsn("FileName")&".html target=_blank>"&CovtTitle(gotTopic(rsn("title"),22))&"</a><br>"
    end if
	if h>=10 then exit do
    rsn.movenext
    loop
    h=0
    end if
    rsn.close
  
  ''########读取本类推荐TOP10
    Set rstr=Server.CreateObject("adodb.recordset")
    sqltr="select * from News where Recommend=true and PicNews=true order by Newsid desc"
    rstr.open sqltr,conn,1,1
    if rstr.eof then
    blsr="·还没有推荐图片新闻"
    else
    do while not rstr.eof
    h=h+1
	if rstr("BiaotiNews")=true then
	blsr=blsr&"·<a href=../"&rstr("UBiaotiNews")&" target=_blank>"&CovtTitle(gotTopic(rstr("title"),22))&"</a><br>"
	else
    blsr=blsr&"·<a href=../"&rstr("lpath")&rstr("FileName")&".html target=_blank>"&CovtTitle(gotTopic(rstr("title"),22))&"</a><br>"
    end if
	if h>=10 then exit do
    rstr.movenext
    loop
    h=0
    end if
    rstr.close
	'图片分类
	set rsm = server.createobject("adodb.recordset")
        sqlm = "select * from newsclass order by RootID asc,orders asc"
        rsm.open sqlm,conn,1,1
		if rsm.recordcount=0 then
        lcm="<font color=red>还没有图片新闻栏目</font>"
        end if
		lcm="<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=1></td></tr></table>"
        while not rsm.eof
           if rsm("ParentID")=0 then
           end if
           for i=1 to rsm("depth")
           lcm=lcm&"&nbsp;<font color=""#97C893"">│</font>"
           next
           if rsm("Child")<>0 then
		   lcm=lcm&"&nbsp;<font color=""#97C893"">├</font> "
		   lcm=lcm&"<img src=../Fsmanage/pic/NewsPr.gif>"
           lcm=lcm&"<A href="&rsm("classen")&"/ target=_blank>"&rsm("classcn")&"</a></b>"
           lcm=lcm&"<br>"
		   else
		   lcm=lcm&"&nbsp;<font color=""#97C893"">├</font>&nbsp;<img src=../Fsmanage/pic/NewsPr1.gif><A href="&rsm("classen")&"/ target=_blank>"&rsm("classcn")&"</A><br>"
		   end if
      rsm.movenext
    wend
    rsm.close
'图片分类结束
	
        sfso=rs3("TempletContent")
		sfso=replace(sfso,"[Lastnews]",blsn)
		sfso=replace(sfso,"[pclass]",lcm)
		sfso=replace(sfso,"[recommendnews]",blsr)
        sfso=replace(sfso,"[newssearch]","<script src=../JS/search.js></script>")
		sfso=replace(sfso,"[special]",spb)
		sfso=replace(sfso,"[topnews]",blst)
		sfso=replace(sfso,"[Dnews]",blsd)
		sfso=replace(sfso,"[tongji]",tj)
        Set rsnc=Server.CreateObject("adodb.recordset")
        sqlnc="select * from Newsclass where Child=0 order by id desc"
        rsnc.open sqlnc,conn,1,1
        while not rsnc.eof
        set rsmall = server.createobject("adodb.recordset")
        rsmallsql = "select * from news where classen='"&rsnc("classen")&"' and PicNews=true order by newsid desc"
        rsmall.open rsmallsql,conn,1,1
        slcc="<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=1></td></tr></table>"
		slcc=slcc&"<table width=100% border=0 cellspacing=0 cellpadding=0><tr>"
        for i=1 to rsnc("PicNumsite")
        if rsmall.eof then exit for
		   if rsmall("BiaotiNews")=true then
		   slcc=slcc&"<td align='center'><A href=../"&rsmall("UBiaotiNews")&" target=_blank> <img src="&rsmall("PicNewsa")&" width='100' height='100' border=0><br>·"&CovtTitle(gotTopic(rsmall("title"),16))&"</A>.<font color=blue>[标]</font><br>"
		   else
           slcc=slcc&"<td align='center'><A href=../"&rsmall("lpath")&rsmall("Filename")&".html target=_blank> <img src="&rsmall("PicNewsa")&" width='100' height='100' border=0><br>·"&CovtTitle(gotTopic(rsmall("title"),16))&".</A><br>"
		   end if
		if trim(rsnc("NewsBg"))<>"" then
		slcc=slcc&"<table width=100% border=0 cellspacing=0 cellpadding=0 background="&rsnc("NewsBg")&"><tr><td height=2></td></tr></table>"
		else
		slcc=slcc&"<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=1></td></tr></table>"
		end if
		slcc=slcc&"</td>"
        rsmall.movenext
        next
		slcc=slcc&"</tr></table>"
        sfso=replace(sfso,"["&rsnc("classen")&"]",slcc)
        rsnc.movenext
        wend
	'大类标签开始
	Set rsb=Server.CreateObject("adodb.recordset")
    sqlb="Select * from newsClass where ParentID=0"
    rsb.open sqlb,conn,1,1
	do while not rsb.eof
    set rsb1=Server.CreateObject("adodb.recordset")
    childtemp=getchild(rsb("id"))
    sqlb1="Select * from news Where ClassCN in ("&childtemp&") and PicNews=true order by Newsid Desc"
    rsb1.open sqlb1,conn,1,1     
	slcb="<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=1></td></tr></table>"
	slcb=slcb&"<table width=100% border=0 cellspacing=0 cellpadding=0><tr>"
    for i=1 to rsb("PicNumsite")
      if rsb1.eof then exit for
		    if rsb1("BiaotiNews")=true then
			  slcb=slcb&"<td align='center'><a href=../"&rsb1("UBiaotiNews")&" target=_blank> <img src="&rsb1("PicNewsa")&" width='100' height='100' border=0><br>"&CovtTitle(gotTopic(rsb1("title"),16))&".</a>"
			else
		      slcb=slcb&"<td align='center'><a href=../"&rsb1("lpath")&rsb1("FileName")&".html target=_blank> <img src="&rsb1("PicNewsa")&" width='100' height='100' border=0><br>"&CovtTitle(gotTopic(rsb1("title"),16))&".</a>"
			  end if
		if trim(rsb("NewsBg"))<>"" then
		slcb=slcb&"<table width=100% border=0 cellspacing=0 cellpadding=0 background="&rsb("NewsBg")&"><tr><td height=2></td></tr></table>"
		else
		slcb=slcb&"<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=1></td></tr></table>"
		end if
		slcb=slcb&"</td>"
      rsb1.movenext
    next
	slcb=slcb&"</tr></table>"
	    sfso=replace(sfso,"["&rsb("classen")&"]",slcb)
    rsb.movenext
    loop
    rsb.close
    rsb1.close
    set rsb=nothing
    set rsb1=nothing
	'大类标签结束
		sfso=replace(sfso,"[navigation]","<script src=../codejs/Navigation.js></script>")
		Set fso = Server.CreateObject("Scripting.FileSystemObject")
        Set fout = fso.CreateTextFile(Server.MapPath("Photo")&"/Index.htm")
        fout.Write sfso
        fout.close
    rs.close
	set rs=nothing
	set rss=nothing
	set rsc=nothing
	set rsp=nothing    
   Response.write"<script>alert(""图片首页成功!\n\n文件名为:Index.htm"");location.href=""javascript:history.back()"";</script>"
   Response.end
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?