www.gusucode.com > 深度梦想整站系统(asp) 1.14.02源码程序 > include/function.tag.article.asp
<% '┌──────────────────── 深度空间 深度学习 ──┐ '│过程名:getHTML_articleList '│作 用:显示对应分类的文章列表 {$article(2,8)}公告 '│参 数:iPlace 显示位置 ,topCount 显示条数 , moduleDir 模块文件夹名 '│说 明:需在文章头部包含 此过程自动添加 '│日 期:2009-6-26 '└──────────────────── www.deepstudy.cn ──┘ function getHTML_articleList(iPlace,topCount,moduleDir) dim sql,rs,strHTML : strHTML="" '文章分类 sql="select fclass_ID,ftip,fclassName from deep_ArticleClass where fisView=1 and fplace="&iPlace&" order by forderId,fclass_ID" set rsArticleClass=conn.execute(sql) if (rsArticleClass.eof and rsArticleClass.bof) then 'response.Write("没有文章分类") else while (not rsArticleClass.eof) strHTML = strHTML & "<dl>" strHTML = strHTML & "<dt><a href='"&moduleDir&"articleClass.asp?id="& rsArticleClass("fclass_ID") &"' target=""_blank"" title='"& rsArticleClass("ftip")&"'>"& rsArticleClass("fclassName") &"</a></dt>" strHTML = strHTML & "<dd><ul>" '文章列表 top 8 if(isNumeric(topCount))then sql_article="select top "&topCount&" fid,fTitle,fAuthor,fHits,fdayHits,fweekHits,fmonthHits,fUpdateTime,fisIncludePic from deep_Article where fisDeleted=0 and fisView=1 and fclass_ID="&rsArticleClass("fclass_ID")&" order by fisOnTop desc,fUpdateTime desc,fid" else sql_article="select fid,fTitle,fAuthor,fHits,fdayHits,fweekHits,fmonthHits,fUpdateTime,fisIncludePic from deep_Article where fisDeleted=0 and fisView=1 and fclass_ID="&rsArticleClass("fclass_ID")&" order by fisOnTop desc,fUpdateTime desc,fid" end if set rsArticle=conn.execute(sql_article) if (rsArticle.eof and rsArticle.bof) then 'response.Write("没有对应内容") strHTML = strHTML & "没有对应内容" else while (not rsArticle.eof) 'strHTML = strHTML & "<li class='ellipsis'><a href='article.asp?id="& rsArticle("fid") &"' target='_blank' title='"& rsArticle("fTitle") &"时间:"& rsArticle("fUpdateTime")&"'>"& rsArticle("fTitle")&"</a></li>" strHTML=strHTML& "<li class='ellipsis'>" if(rsArticle("fisIncludePic")=1)then strHTML=strHTML& "<span class='cRed'>(图文)</span>" end if strHTML=strHTML& "<a href='"&moduleDir&"article.asp?id="& rsArticle("fid") &"' target='_blank' title='"& rsArticle("fTitle") &vbcrlf&"作者:"& rsArticle("fAuthor")&vbcrlf &"时间:"& rsArticle("fUpdateTime")&vbcrlf &"浏览次数:今日:"&rsArticle("fdayHits")&" 本周:"&rsArticle("fweekHits")&" 本月:"&rsArticle("fmonthHits")&" 总计:"& rsArticle("fHits")& "'>" strHTML=strHTML& rsArticle("fTitle")& "</a></li>" rsArticle.MoveNext wend end if rsArticle.close set rsArticle=nothing strHTML = strHTML & "<li class=""more""><a href='"&moduleDir&"articleClass.asp?id="& rsArticleClass("fclass_ID")&"' target='_blank' title='点击查看更多["&rsArticleClass("fclassName") &"]'>更多..</a></li>" strHTML = strHTML & "</ul></dd><dd class='last'></dd></dl>" rsArticleClass.moveNext wend end if rsArticleClass.close set rsArticleClass=nothing getHTML_articleList = strHTML end function '┌──────────────────── 深度空间 深度学习 ──┐ '│过程名:getHTML_article_new '│作 用:显示首页对应最新的文章列表 '│参 数:topCount 显示条数 , moduleDir 模块文件夹名 '│说 明:需在文章头部包含 此过程自动添加 '│日 期:2009-6-27 '└──────────────────── www.deepstudy.cn ──┘ function getHTML_article_new(topCount,moduleDir) dim sql,rs,strHTML : strHTML="" sql="select top "&topCount&" fid,fTitle,fAuthor,fHits,fdayHits,fweekHits,fmonthHits,fUpdateTime,fisIncludePic from deep_Article where fisDeleted=0 and fisView=1 order by fisOnTop desc,fUpdateTime desc,fid desc" set rs=conn.execute(sql) if(rs.eof and rs.bof)then ' else strHTML=strHTML& "<ul>" while (not rs.eof) strHTML=strHTML& "<li class='ellipsis'>" if(rs("fisIncludePic")=1)then strHTML=strHTML& "<span class='cRed'>(图文)</span>" end if strHTML=strHTML& "<a href='"&moduleDir&"article.asp?id="& rs("fid") &"' target='_blank' title='"& rs("fTitle") &vbcrlf&"作者:"& rs("fAuthor")&vbcrlf &"时间:"& rs("fUpdateTime")&vbcrlf &"浏览次数:今日:"&rs("fdayHits")&" 本周:"&rs("fweekHits")&" 本月:"&rs("fmonthHits")&" 总计:"& rs("fHits")& "'>" strHTML=strHTML& rs("fTitle")& "</a></li>" rs.moveNext wend strHTML=strHTML& "</ul>" end if rs.close set rs=nothing getHTML_article_new=strHTML end function '┌──────────────────── 深度空间 深度学习 ──┐ '│过程名:getHTML_article_new_tip '│作 用:显示首页对应最新的文章列表(有提示简介) '│参 数:topCount 显示条数 , moduleDir 模块文件夹名 '│说 明:需在文章头部包含 此过程自动添加 '│日 期:2009-7-26 '└──────────────────── www.deepstudy.cn ──┘ function getHTML_article_new_tip(topCount,moduleDir) dim sql,rs,strHTML : strHTML="" 'sql="select top "&topCount&" fid,fTitle,fAuthor,fHits,fdayHits,fweekHits,fmonthHits,fUpdateTime,fisIncludePic,ftip from deep_Article where fisDeleted=0 and fisView=1 order by fisOnTop desc,fUpdateTime desc,fid desc" sql="select top "&topCount&" a.fid as fid,a.fTitle as fTitle,a.fAuthor as fAuthor,a.fHits as fHits,a.fdayHits as fdayHits,a.fweekHits as fweekHits,a.fmonthHits as fmonthHits,a.fUpdateTime as fUpdateTime,a.fisIncludePic as fisIncludePic,a.ftip as ftip,b.fclass_ID as fclass_ID,b.fclassName as fclassName from deep_Article a,deep_ArticleClass b where a.fisDeleted=0 and a.fisView=1 and a.fclass_ID=b.fclass_ID order by a.fisOnTop desc,a.fUpdateTime desc,a.fid desc" set rs=conn.execute(sql) if(rs.eof and rs.bof)then ' else strHTML=strHTML& "<ul>" while (not rs.eof) strHTML=strHTML& "<li class='ellipsis'>" strHTML=strHTML& "[<a href='"&moduleDir&"articleClass.asp?id=" & rs("fclass_ID") &"' target='_blank' title='点击查看更多["&rs("fClassName")&"]信息'>"&rs("fClassName")&"</a>] " if(rs("fisIncludePic")=1)then strHTML=strHTML& "<span class='cRed'>(图文)</span>" end if strHTML=strHTML& "<a href='"&moduleDir&"article.asp?id="& rs("fid") &"' target='_blank' title='"& rs("fTitle") &vbcrlf&"作者:"& rs("fAuthor")&vbcrlf &"时间:"& rs("fUpdateTime")&vbcrlf &"浏览次数:今日:"&rs("fdayHits")&" 本周:"&rs("fweekHits")&" 本月:"&rs("fmonthHits")&" 总计:"& rs("fHits")& "' class='title'>" strHTML=strHTML& rs("fTitle")& "</a></li>" strHTML=strHTML& "<li class='tip'>"&rs("ftip") &"</li>" rs.moveNext wend strHTML=strHTML& "</ul>" end if rs.close set rs=nothing getHTML_article_new_tip=strHTML end function '┌──────────────────── 深度空间 深度学习 ──┐ '│过程名:getHTML_article_elite '│作 用:显示首页对应推荐的文章列表 '│参 数:topCount 显示条数 , moduleDir 模块文件夹名 '│说 明:需在文章头部包含 此过程自动添加 '│日 期:2009-6-27 '└──────────────────── www.deepstudy.cn ──┘ function getHTML_article_elite(topCount,moduleDir) dim sql,rs,strHTML : strHTML="" sql="select top "&topCount&" fid,fTitle,fAuthor,fHits,fdayHits,fweekHits,fmonthHits,fUpdateTime,fisIncludePic from deep_Article where fisDeleted=0 and fisView=1 and fisElite=1 order by fisOnTop desc,fUpdateTime desc,fid desc" set rs=conn.execute(sql) if(rs.eof and rs.bof)then ' else strHTML=strHTML& "<ul>" while (not rs.eof) strHTML=strHTML& "<li class='ellipsis'>" if(rs("fisIncludePic")=1)then strHTML=strHTML& "<span class='cRed'>(图文)</span>" end if strHTML=strHTML& "<a href='"&moduleDir&"article.asp?id="& rs("fid") &"' target='_blank' title='"& rs("fTitle") &vbcrlf&"作者:"& rs("fAuthor")&vbcrlf &"时间:"& rs("fUpdateTime")&vbcrlf &"浏览次数:今日:"&rs("fdayHits")&" 本周:"&rs("fweekHits")&" 本月:"&rs("fmonthHits")&" 总计:"& rs("fHits")& "'>" strHTML=strHTML& rs("fTitle")& "</a></li>" rs.moveNext wend strHTML=strHTML& "</ul>" end if rs.close set rs=nothing getHTML_article_elite=strHTML end function '┌──────────────────── 深度空间 深度学习 ──┐ '│过程名:getHTML_article_ppt '│作 用:显示首页对应flash幻灯 '│参 数:topCount 显示条数 , moduleDir 模块文件夹名 '│说 明:需在文章头部包含 此过程自动添加 '│日 期:2009-6-27 '└──────────────────── www.deepstudy.cn ──┘ function getHTML_article_ppt(topCount,moduleDir) dim sql,rs,strHTML : strHTML="" lhp_pics = "" lhp_links = "" lhp_texts = "" sql= "Select top "&topCount&" fid,fDefaultPicUrl,fTitle from deep_Article where fisIncludePic=1 and fisView=1 and fDefaultPicUrl like '%.jpg' order by fUpdateTime DESC,fid desc" Set rsPicLHP=conn.execute(sql) if rsPicLHP.Eof and rsPicLHP.Bof then lhp_pics = projectRootPath & "flash/NoPicture.jpg" lhp_links = "http://www.itstudy.cn" lhp_texts = "暂无图片新闻" else pic_n=1 while (Not rsPicLHP.Eof) lhp_pics = lhp_pics & rsPicLHP("fDefaultPicUrl") lhp_links =lhp_links & moduleDir & "article.asp?id=" & rsPicLHP("fid") lhp_texts =lhp_texts & Left(rsPicLHP("fTitle"),30) if (pic_n <> rsPicLHP.RecordCount) then lhp_pics =lhp_pics & "|" lhp_links =lhp_links & "|" lhp_texts =lhp_texts & "|" end if pic_n=pic_n+1 rsPicLHP.MoveNext Wend end if rsPicLHP.close Set rsPicLHP = Nothing if(right(lhp_pics,1)="|")then lhp_pics =left(lhp_pics ,len(lhp_pics)-1) lhp_links =left(lhp_links,len(lhp_links)-1) lhp_texts =left(lhp_texts,len(lhp_texts)-1) end if strHTML=strHTML&"<script type='text/javascript'>" strHTML=strHTML&" var focus_file='flash/focus.swf';" strHTML=strHTML&" var focus_width=265;" strHTML=strHTML&" var focus_height=200;" strHTML=strHTML&" var text_height=30;" strHTML=strHTML&" var swf_height = focus_height+text_height;" strHTML=strHTML&" var pics='"&lhp_pics&"';" strHTML=strHTML&" var links='"&lhp_links&"';" strHTML=strHTML&" var texts='"&lhp_texts&"';" strHTML=strHTML& "document.write('<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" width=""'+ focus_width +'"" height=""'+ swf_height +'"">');" strHTML=strHTML&"document.write('<param name=""allowScriptAccess"" value=""sameDomain""><param name=""movie"" value=""'+focus_file+'""><param name=""quality"" value=""high""><param name=""bgcolor"" value=""#ffffff"">');" strHTML=strHTML&"document.write('<param name=""menu"" value=""false""><param name=wmode value=""opaque"">');" strHTML=strHTML&"document.write('<param name=""FlashVars"" value=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"">');" strHTML=strHTML&"document.write('<embed src=""'+focus_file+'"" wmode=""opaque"" FlashVars=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"" menu=""false"" bgcolor=""#ffffff"" quality=""high"" width=""'+ focus_width +'"" height=""'+ swf_height +'"" allowScriptAccess=""sameDomain"" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" />');" strHTML=strHTML&"document.write('</object>');" strHTML=strHTML&"</script>" getHTML_article_ppt=strHTML end function '┌──────────────────── 深度空间 深度学习 ──┐ '│过程名:getHTML_articleClass '│作 用:对应分类 子类的文章列表 '│参 数:iPlace 显示位置 ,topCount 显示条数 css1 css2 kuai 块名 列 每列 个数 '│说 明:需在文章头部包含 此过程自动添加 '│日 期:2009-6-27 '└──────────────────── www.deepstudy.cn ──┘ function getHTML_articleClass(class_ID,topCount,css1,css2,kuai,lie) dim sql,sql2,rs,rs2,strHTML : strHTML="" dim ge sql="select fclass_ID,ftip,fclassName from deep_ArticleClass where fisView=1 and fparentID=0 and fclass_ID="&class_ID&" order by forderId,fclass_ID" set rs=conn.execute(sql) if(rs.eof and rs.bof)then ' else 'kuai=0 ge=0 while(not rs.eof) kuai=kuai+1 if (kuai>3)then kuai=0 end if strHTML=strHTML&"<div class='"&css1&" bg-t-"&kuai&"'>" strHTML=strHTML&"<div class='"&css1&" bg-t-"&kuai&"-1'>"&rs("fclassName")&"</div>" strHTML=strHTML&"<div class='"&css1&" dl-d'>" sql2="select fclass_ID,ftip,fclassName from deep_ArticleClass where fisView=1 and fparentID="&rs("fclass_ID")&" order by forderId,fclass_ID" set rs2=conn.execute(sql2) if(rs2.eof and rs2.bof)then else while(not rs2.eof) ge=ge+1 if ((ge mod lie)=0) then strHTML=strHTML&"<div class='"&css2&" last'>" else strHTML=strHTML&"<div class='"&css2&"'>" end if 'strHTML=strHTML&"<dl>" 'strHTML=strHTML&"<dt>"&rs2("fclassName")&"</dt>" 'strHTML=strHTML&"<dd>JSP编程JSP编程</dd>" 'strHTML=strHTML&"</dl>" strHTML = strHTML & "<dl>" strHTML = strHTML & "<dt><a href='articleClass.asp?id="& rs2("fclass_ID") &"' target=""_blank"" title='"& rs2("ftip")&"'>"& rs2("fclassName") &"</a></dt>" strHTML = strHTML & "<dd><ul>" '文章列表 top 8 sql_article="select top "&topCount&" fid,fTitle,fAuthor,fHits,fdayHits,fweekHits,fmonthHits,fUpdateTime,fisIncludePic from deep_Article where fisDeleted=0 and fisView=1 and fclass_ID="&rs2("fclass_ID")&" order by fisOnTop desc,fUpdateTime desc,fid desc" set rsArticle=conn.execute(sql_article) if (rsArticle.eof and rsArticle.bof) then 'response.Write("没有对应内容") strHTML = strHTML & "没有对应内容" else while (not rsArticle.eof) strHTML = strHTML & "<li class='ellipsis'>" if(rsArticle("fisIncludePic")=1)then strHTML=strHTML& "<span class='cRed'>(图文)</span>" end if strHTML = strHTML & "<a href='article.asp?id="& rsArticle("fid") &"' target='_blank' title='"& rsArticle("fTitle") &vbcrlf&"作者:"& rsArticle("fAuthor")&vbcrlf &"时间:"& rsArticle("fUpdateTime")&vbcrlf &"浏览次数:今日:"&rsArticle("fdayHits")&" 本周:"&rsArticle("fweekHits")&" 本月:"&rsArticle("fmonthHits")&" 总计:"& rsArticle("fHits")& "'>"& rsArticle("fTitle")&"</a></li>" rsArticle.MoveNext wend end if rsArticle.close set rsArticle=nothing strHTML = strHTML & "<li class=""more""><a href='articleClass.asp?id="& rs2("fclass_ID")&"' target='_blank' title='点击查看更多["&rs2("fclassName") &"]'>更多..</a></li>" strHTML = strHTML & "</ul></dd></dl>" strHTML=strHTML&"</div>" rs2.moveNext wend end if rs2.close set rs2=nothing strHTML=strHTML&"</div>" strHTML=strHTML&"</div>" rs.moveNext wend end if rs.close set rs=nothing getHTML_articleClass=strHTML end function '┌──────────────────── 深度空间 深度学习 ──┐ '│过程名:getHTML_articleClass '│作 用:对应分类 子类的文章列表 '│参 数:class_ID 对应分类id iPageSize 每页文章列表数 '│说 明:需在文章头部包含 此过程自动添加 '│日 期:2009-6-27 '└──────────────────── www.deepstudy.cn ──┘ function getHTML_articleClassList(class_ID,iPageSize) dim sql,sql2,rs,rs2,pSize,strHTML : strHTML="" dim ge sql="select fclass_ID,ftip,fclassName from deep_ArticleClass where fisView=1 and fclass_ID="&class_ID&" order by forderId,fclass_ID" set rs=conn.execute(sql) if(rs.eof and rs.bof)then ' else strHTML = strHTML & "<dl class='dl-countent'>" strHTML = strHTML & "<dt>"& rs("fclassName") &"</dt>" strHTML = strHTML & "<dd>" '文章列表 top 8 '--- 1 分页初始化 ----- Dim oPageMsSQL Set oPageMsSQL=new Deep_Page oPageMsSQL.pageSize=iPageSize '定义每页显示记录数 默认10条 oPageMsSQL.getConnection(conn) '当前页 if (Request.QueryString("page") <>"") then oPageMsSQL.currentPage=CInt(Request.QueryString("page")) End if 'sql="select * from tArticle" 'PageSQL( tableName, dataKeyField, wordField, whereCondition, orderByField) sql_article=oPageMsSQL.PageSQL( "deep_Article", "fid", "fid,fTitle,fAuthor,fHits,fdayHits,fweekHits,fmonthHits,fUpdateTime,fisIncludePic","fisDeleted=0 and fisView=1 and fclass_ID="&rs("fclass_ID") ,"fisOnTop desc,fUpdateTime desc,fid desc") '-----1 end------ Set rsArticle=conn.execute(sql_article) 'set rsArticle=server.CreateObject("adoDb.recordSet") 'sql_article="select fid,fTitle,fAuthor,fHits,fdayHits,fweekHits,fmonthHits,fUpdateTime,fisIncludePic from deep_Article where fisDeleted=0 and fisView=1 and fclass_ID="&rs("fclass_ID")&" order by fisOnTop desc,fUpdateTime desc,fid desc" 'rsArticle.open sql_article,conn,1,1 if (rsArticle.eof and rsArticle.bof) then 'response.Write("没有对应内容") strHTML = strHTML & "没有对应内容" else strHTML = strHTML & "<ul class='classList'>" 'pSize=iPageSize '每页显示记录数 '--- 1 分页初始化 ----- 'call pageInit(rsArticle,pSize ,currentPage,pageSize) do while (not rsArticle.eof) '--- 2 循环处设界 ----- 'if (pageSize<=0)then exit do end if 'pageSize=PageSize-1 'strHTML = strHTML & "<li><a href='article.asp?id="& rsArticle("fid") &"' target='_blank' title='"& rsArticle("fTitle") &"时间:"& rsArticle("fUpdateTime")&"'>"& rsArticle("fTitle")&"</a></li>" strHTML=strHTML& "<li>" if(rsArticle("fisIncludePic")=1)then strHTML=strHTML& "<span class='cRed'>(图文)</span>" end if strHTML=strHTML& "<a href='article.asp?id="& rsArticle("fid") &"' target='_blank' title='"& rsArticle("fTitle") &vbcrlf&"作者:"& rsArticle("fAuthor")&vbcrlf &"时间:"& rsArticle("fUpdateTime")&vbcrlf &"浏览次数:今日:"&rsArticle("fdayHits")&" 本周:"&rsArticle("fweekHits")&" 本月:"&rsArticle("fmonthHits")&" 总计:"& rsArticle("fHits")& "'>" strHTML=strHTML& rsArticle("fTitle")& "</a></li>" rsArticle.MoveNext loop strHTML = strHTML & "</ul>" '--- 3 分页显示 ----- 'strHTML = strHTML & pagination(rsArticle ,currentPage) end if rsArticle.close set rsArticle=nothing '--- 2 分页导航 显示 ----- strHTML = strHTML & oPageMsSQL.PageNavigateUrl() Set oPageMsSQL=Nothing '-----2 end------ 'strHTML = strHTML & "<li class=""more""><a href='articleClass.asp?id="& rs("fclass_ID")&"' target='_blank' title='点击查看更多["&rs("fclassName") &"]'>更多..</a></li>" strHTML = strHTML & "</dd></dl>" end if rs.close set rs=nothing getHTML_articleClassList=strHTML end function %>