www.gusucode.com > 深度梦想整站系统(asp) 1.14.02源码程序 > soft/soft.asp

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
projectRootPath = "../"	'相对当前应用程序根的位置
%>
<!--#include file="../web.config.asp"-->
<!--#include file="../include/function.tag.article.asp"-->
<!--#include file="../include/function.tag.soft.asp"-->
<%
id=request.QueryString("id")
if (id="") or (not isNumeric(id)) then 
  response.Redirect("index.asp")
end if

'---do 软件下载--start------------------
urlID=request.QueryString("urlID")
if(urlID<>"" and (isNumeric(urlID) ) )then
	sql="select fid,fDownloadUrl,fHits,fdayHits,fweekHits,fmonthHits,flastHitTime,fCreateTime,fUpdateTime,fmonthHits from deep_Soft where fisView=1 and fisDeleted=0 and fid=" & id
	set rs=conn.execute(sql)
	if (rs.eof and rs.bof)then
		'response.Write("没有对应下载")
	else
	
		fid=rs("fid")
		fDownloadUrl=rs("fDownloadUrl")
		fHits	= rs("fHits")
		fdayHits		= rs("fdayHits")
		fweekHits	= rs("fweekHits")
		fmonthHits		= rs("fmonthHits")
		flastHitTime	= rs("flastHitTime")
		fCreateTime		= rs("fCreateTime")
		fUpdateTime	= rs("fUpdateTime")
		
		'阅读计数----start-------------
		if cstr(fid)<>request.Cookies("soft")("isHits") then
			  fHits=fHits+1
			  '今日
			  if datediff("D",flastHitTime,now())<=0 then
				  fdayHits=fdayHits+1
			  else
				  fdayHits=1
					SqlHitsClear="Update deep_Soft Set fDayHits=0, fLastHitTime= '" & now() & "' "
					conn.Execute(SqlHitsClear)
			  end if
			  '本周
			  if datediff("ww",flastHitTime,now())<=0 then
				  fweekHits=fweekHits+1
			  else
				  fweekHits=1
					SqlHitsClear="Update deep_Soft Set fWeekHits=0, fLastHitTime= '" & now() & "' "
					Conn.Execute(SqlHitsClear)
			  end If
			  '本月
			  if datediff("m",flastHitTime,now())<=0 then
				  fmonthHits=fmonthHits+1
			  else
				  fmonthHits=1			
					SqlHitsClear="Update deep_Soft Set fMonthHits=0, fLastHitTime= '" & now() & "' "
					Conn.Execute(SqlHitsClear)
			  end if
	
			  flastHitTime=now()
				SqlHitsClear="Update deep_Soft Set fHits="&fHits&",fDayHits="&fDayHits&",fWeekHits="&fWeekHits&",fMonthHits="&fMonthHits&"  where fisView=1 and fisDeleted=0 and fid=" & fid
				Conn.Execute(SqlHitsClear)
	
			response.Cookies("soft")("isHits")=fid
		end if	
		'阅读计数----end-------------
		call getDownloadUrl(fDownloadUrl,urlID)

	
	end if
	rs.close
	set rs=nothing
	call CloseConnDB()
	response.End()
end if
'---do 软件下载--end-------

'-----显示对应软件信息---------	  
sql="select fid,fclass_ID,ftitle,ftitleFontColor,fAuthor,fauthorUrl,fDemoUrl,fCopyFrom,fcontent,fkeyWord,fSoftLanguage,fSoftType,fCopyrightType,fplatform,fSoftSize,fStars,fDownloadUrl,fHits,fdayHits,fweekHits,fmonthHits,flastHitTime,fCreateTime,fUpdateTime,fmonthHits from deep_Soft where fisView=1 and fisDeleted=0 and fid=" & id
set rsArticle=conn.execute(sql)
if (rsArticle.eof and rsArticle.bof) then
  'response.Write("没有记录")
else

	fid		= rsArticle("fid")
	fclass_ID	= rsArticle("fclass_ID")
	ftitle		= rsArticle("ftitle")
	ftitleFontColor		= rsArticle("ftitleFontColor")	
	fAuthor		= rsArticle("fAuthor")
	fauthorUrl=rsArticle("fauthorUrl")
	fDemoUrl=rsArticle("fDemoUrl")
	fCopyFrom	= rsArticle("fCopyFrom")
	fcontent		= rsArticle("fcontent")
	fkeyWord	= rsArticle("fkeyWord")
	fSoftLanguage=rsArticle("fSoftLanguage")
	fSoftType=rsArticle("fSoftType")
	fCopyrightType=rsArticle("fCopyrightType")
	fplatform=rsArticle("fplatform")
	fSoftSize=rsArticle("fSoftSize")
	fStars=rsArticle("fStars")
	fDownloadUrl=rsArticle("fDownloadUrl")
	fHits	= rsArticle("fHits")
	fdayHits		= rsArticle("fdayHits")
	fweekHits	= rsArticle("fweekHits")
	fmonthHits		= rsArticle("fmonthHits")
	flastHitTime	= rsArticle("flastHitTime")
	fCreateTime		= rsArticle("fCreateTime")
	fUpdateTime	= rsArticle("fUpdateTime")
	
end if
rsArticle.close
set rsArticle=nothing


tmpStrHTML=""
for i= 1 to fStars
	tmpStrHTML=tmpStrHTML & "★"
next
fStars=tmpStrHTML

fDownloadUrl=showDownloadUrls(fDownloadUrl)



dim oDeepTemplate
set oDeepTemplate=new Deep_Template
	oDeepTemplate.templates_dir=projectRootPath & "themes/"&site_theme&"/"
	'template=oDeepTemplate.readTemplateFile("index.htm")
	oDeepTemplate.readTemplateFile("soft.template.html")	'调入文件
	'response.Write(oDeepTemplate.template)
	'template=replace(template,"../base.css","themes/base.css")
	'template=replace(template,"theme.css","themes/"&site_skin&"/theme.css")
	'oDeepTemplate.replaceTag "../base.css", projectRootPath & "themes/base.css"
	oDeepTemplate.replaceText "theme.css",projectRootPath & "themes/"&site_theme&"/theme.css"
		oDeepTemplate.replaceText "src=""./js/","src=""../themes/"&site_theme&"/js/"

	do_replace_siteConfig(oDeepTemplate)	'替换网站基本配置信息标签
	
	'导航
	call do_replace_Channel()
	'广告
	call do_replace_AD()
	'response.Write( oDeepTemplate.template )
	'oDeepTemplate.replaceTag "article_ppt",getHTML_article_ppt(5)
	'oDeepTemplate.replaceTag "article_new",getHTML_article_new(10)
	'oDeepTemplate.replaceTag "article_sideBar",getHTML_articleList(2,8)
	
	
	oDeepTemplate.replaceTag "friendLink",getHTML_friendLink
	oDeepTemplate.replaceTag "siteInfoStatistic",getHTML_siteInfoStatistic
	
	'---下载内容--------------------
	strSiteNavClassList = siteNavClassList("softClass.asp",fclass_ID,"select fclass_ID,fparentID,fclassName from deep_SoftClass where fisView=1 and fclass_ID=") 
	oDeepTemplate.replaceTag "siteNavBar",strSiteNavClassList
	
	'oDeepTemplate.replaceTag "channel_contentTitle",fcontentTitle
	'oDeepTemplate.replaceTag "channel_content",fcontent

	oDeepTemplate.replaceTag "soft_title",ftitle	
	oDeepTemplate.replaceTag "soft_titleFontColor",ftitleFontColor		
	oDeepTemplate.replaceTag "soft_Author",fAuthor	
	oDeepTemplate.replaceTag "soft_authorUrl",fauthorUrl
	oDeepTemplate.replaceTag "soft_DemoUrl",fDemoUrl
	oDeepTemplate.replaceTag "soft_CopyFrom",fCopyFrom
	oDeepTemplate.replaceTag "soft_content",fcontent
	oDeepTemplate.replaceTag "soft_keyWord",fkeyWord
	oDeepTemplate.replaceTag "soft_SoftLanguage",fSoftLanguage
	oDeepTemplate.replaceTag "soft_SoftType",fSoftType
	oDeepTemplate.replaceTag "soft_CopyrightType",fCopyrightType
	oDeepTemplate.replaceTag "soft_platform",fplatform
	oDeepTemplate.replaceTag "soft_SoftSize",fSoftSize

	oDeepTemplate.replaceTag "soft_Stars",fStars
	oDeepTemplate.replaceTag "soft_DownloadUrl",fDownloadUrl
	
	oDeepTemplate.replaceTag "soft_Hits",fHits
	oDeepTemplate.replaceTag "soft_dayHits",fdayHits	
	oDeepTemplate.replaceTag "soft_weekHits",fweekHits	
	oDeepTemplate.replaceTag "soft_monthHits",fmonthHits	
	'oDeepTemplate.replaceTag "article_lastHitTime",flastHitTime	
	oDeepTemplate.replaceTag "soft_CreateTime",fCreateTime	
	oDeepTemplate.replaceTag "soft_UpdateTime",fUpdateTime	

	'------------------------

	oDeepTemplate.display()	'显示
	
set oDeepTemplate=nothing

call CloseConnDB()

'┌──────────────────── 深度空间 深度学习 ──┐
'│过程名:下载列表
'│作  用:定义 信息常量,方便调用                    
'│参  数:无
'│说  明:需在文章头部包含 此过程自动添加 	
'│日  期:2009-7-1	2009-7-2
'└──────────────────── www.deepstudy.cn ──┘
function showDownloadUrls(DownloadUrls)
    Dim arrDownloadUrls, arrUrls, iTemp,strHTML : strHTML=""
	if(fDownloadUrl<>"")then
		DownloadUrls = Replace(DownloadUrls,  "&nbsp;", " ")
		arrDownloadUrls = Split(DownloadUrls, "$$$")
		For iTemp = 0 To UBound(arrDownloadUrls)
			arrUrls = Split(arrDownloadUrls(iTemp), "|")
			If UBound(arrUrls) >= 1 Then
				'If Left(arrUrls(1), 1) <> "/" And InStr(arrUrls(1), "://") <= 0 Then
					'strHTML=strHTML & "<a href='" & projectRootPath & site_upFilesDir & "soft/" & arrUrls(1) & "' target='_blank'>" & arrUrls(0) & "</a><br />"
				'Else
					'strHTML=strHTML &  "<a href='" & arrUrls(1) & "' target='_blank'>" & arrUrls(0) & "</a><br />"
				'End If
				strHTML=strHTML &  "<a href='?id="& id &"&urlID="& iTemp & "' target='_blank'>" & arrUrls(0) & "</a><br />"
				
			End If
		Next
	end if
	showDownloadUrls=strHTML
End function

'┌──────────────────── 深度空间 深度学习 ──┐
'│过程名:getDownloadUrl
'│作  用:下载url                    
'│参  数:无
'│说  明:需在文章头部包含 此过程自动添加 	
'│日  期:2009-7-7	2009-7-12
'└──────────────────── www.deepstudy.cn ──┘
sub getDownloadUrl(DownloadUrls,urlID)
    Dim arrDownloadUrls, arrUrls
	if(fDownloadUrl<>"")then
		DownloadUrls = Replace(DownloadUrls,  "&nbsp;", " ")
		arrDownloadUrls = Split(DownloadUrls, "$$$")
		'For iTemp = 0 To UBound(arrDownloadUrls)
			arrUrls = Split(arrDownloadUrls(urlID), "|")
			If UBound(arrUrls) >= 1 Then
			
			
				If Left(arrUrls(1), 1) <> "/" And InStr(arrUrls(1), "://") <= 0 Then
					'response.write( site_upFilesDir & "soft/" & arrUrls(1) )
					response.Redirect( site_upFilesDir & "soft/" & arrUrls(1) )
				Else
					'response.write(arrUrls(1) )
					response.Redirect(arrUrls(1) )

				End If
			
			End If
		'Next
	end if
	'showDownloadUrls=strHTML
End sub

%>