居正

asp

16-10-28 14:32:23


文件载入 <!--#include file="inc/foot.asp" -->

 列表数据调用 <% list_id 9,7,20 %>

网站标题   <title><% = strWebsiteName %></title>


--------------------------------------------------------------

幻灯片

dim sql900

dim rstp

sql900="select top 4 a.Topic_ID,a.Subject,a.TutThumbnail ,a.Forum_ID,a.TutDescription from tblTopic as a left join  tblThread as b on a.Topic_ID=b.Topic_ID where a.Forum_ID in(1,2,3) and a.TutThumbnail<>'' order by a.Topic_ID desc"

sql900="select top 4 Topic_ID,Subject,TutThumbnail, TutDescription  from tblTopic  where  TutThumbnail<>'' and Forum_ID=61 order by Topic_ID desc"

set rstp=adoCon.execute(sql900)
do while not rstp.eof
    urls=urls&rstp("TutDescription")&"|"
    imgs=imgs&"/news/"&rstp("TutThumbnail")&"|" 'TutThumbnail
    texts=texts&rstp("Subject")&"|"
rstp.movenext

loop 


-----------------------------------------------------------------------------------


数据列表

function list_id(id,top,lens)
dim sql900
dim rslist,strIndexImage
sql900="select top "&top&" a.Topic_ID,a.Subject,b.Message_date,a.Forum_ID from tblTopic as a left join  tblThread as b on a.Topic_ID=b.Topic_ID where a.Forum_ID in("&id&") order by a.Topic_ID desc"
set rslist=adoCon.execute(sql900)
do while not rslist.eof
    strIndexImage=""
    if DateDiff("H",rslist("Message_date"),date()) <= 48 then
        strIndexImage = "<img border=""0"" src=""/images/new.gif"" alt=""新增内容"" align=""absmiddle"">"    
    end if
   
    'response.Write "  <tr><td ><a  href='page.asp?TID="&rslist("Topic_ID")&"' >"&InterceptString(rslist("Subject"),lens)&strIndexImage&"</a>"&month(rslist("Message_date"))&"-"&day(rslist("Message_date"))&"</td>  </tr>"
     rslist.movenext
loop 

end function 



-------------------------------------------------------------------------------------------






js控制图片大小
----------------------------------------------
<script >
var abc=document.getElementById("pnr");
var imgs=abc.getElementsByTagName("img");
for (var i=0,g;g=imgs[i];i++)
g.onload=function(){if (this.width>900){this.width=900}else{if (this.height>900)this.height=900}}
</script>


js 文章内容页点击图片  弹窗
--------------------------------
function FullwindowOpener(theFullwindowURL, FullwindowName) {

FullwindowFeatures = 'fullscreen,left=0,top=0,scrollbars=1,resizable=0,toolbar=0,location=0,status=0,menubar=0'
  window.open(theFullwindowURL, FullwindowName, FullwindowFeatures);
}


新版程序
---------------------------------------------------------------------------------------

后台上传 图片前台点击放大功能 



news/functions/functions_filters.asp   约220行

strTempHTMLMessage = "<img src=""" & strImageSrc & """"
替换
strTempHTMLMessage = "<img id='chkImg1' name='chkImg2' onclick=""FullwindowOpener('" & strImageSrc & "','Image');"" onmouseover=""this.style.cursor='hand'"" onmouseout=""this.style.cursor=''"" src=""" & strImageSrc & """"


约538行  注释
'strInputEntry = Replace(strInputEntry, "ON", "&#079;N", 1, -1, 0)
'strInputEntry = Replace(strInputEntry, "On", "&#079;n", 1, -1, 0)
'strInputEntry = Replace(strInputEntry, "on", "&#111;n", 1, -1, 1)




news/functions/functions_edit_post.asp   约67行 strMessage = Replace(strMessage, "<a href= """, "<a href=""", 1, -1, 1) 
下增加

'控制图片宽度增加下几行
strMessage = Replace(strMessage, " id='chkImg1' name='chkImg2'", "", 1, -1, 1)
strMessage = Replace(strMessage, " id=chkImg1", "", 1, -1, 1)
strMessage = Replace(strMessage, " name=chkImg2", "", 1, -1, 1)
strMessage = Replace(strMessage, " id='chkImg1'", "", 1, -1, 1)
strMessage = Replace(strMessage, " name='chkImg2'", "", 1, -1, 1)
' 结束 ===============