處理圖片、文章的程式

來源:互聯網
上載者:User
程式 剛寫的,能執行但沒有整理,如果看例子就看WWW.HIFI-CHINA.COM中的顯示的文章。圖片做到隨機定位,切滿足不同的對齊、邊框、圖注要求。並帶有UBB支援模組,但在這裡去掉了:)

<SCRIPT LANGUAGE=VBscript RUNAT=Server>

function getarticle(articleid,showtitle,prubb)
showpicture=true
articletext=""
set articledbc = server.createobject("adodb.command")
set ars = server.createobject("adodb.recordset")
ars.open "select * from article_comm where article_id=" & articleid,session("ds"),1,1
if not ars.eof then
article_id=ars("article_id")
article_title=rtrim(ars("title"))
article_comm=server.htmlencode(ars("comm"))
article_date=datevalue(ars("adddate"))
ars.close
articledbc.ActiveConnection=session("ds")
articledbc.commandtext="UPDATE article_comm SET showcounter = showcounter + 1, lastread = GETDATE() WHERE (article_id = " & article_id & ")"
articledbc.execute
if showpicture then
ars.open "SELECT article_pic.article_id, article_pic.pic_id, article_pic.loctrate, article_pic.align,  article_pic.show_sq, article_pic.style, PicLab.picurl, PicLab.pic_sq, PicLab.pic_comm,  PicLab.pic_linkout FROM article_pic INNER JOIN PicLab ON article_pic.pic_id = PicLab.pic_id where (article_id = " & article_id & ") order by loctrate",session("ds"),1,1
dim addpic()
dim toarticle()
redim addpic(ars.recordcount -1)
redim toarticle(ars.recordcount)

for i = 1 to ars.recordcount
addpictemp=""

    thepoint=clng(cdbl(ars("loctrate"))* (1-lastloctrate) * len(article_comm))
    lastloctrate=cdbl(ars("loctrate"))
    toarticle(i-1)=left(article_comm,thepoint)
    article_comm=right(article_comm,len(article_comm)-thepoint)
    select case ars("align")
    case 0
addpictemp= addpictemp + "<div align=""center"">"
addpictemp= addpictemp + "<center>"
addpictemp= addpictemp + "<table border=""0"" cellpadding=""0"" cellspacing=""0"" "
if ars("style")=2 then
addpictemp= addpictemp + "style=""border-collapse: collapse; border-style: solid; border-width: 1"" bordercolor=""#111111"" "
end if
addpictemp= addpictemp + ">"
addpictemp= addpictemp + "<tr>"
addpictemp= addpictemp + "<td width=""100%"">"
addpictemp= addpictemp + "<div align=""center"">"
addpictemp= addpictemp + "<center>"
addpictemp= addpictemp + "<table  width=""32"" height=""32"" cellpadding=""0"" cellspacing=""0"" "
if ars("style")=0 then
addpictemp= addpictemp + "style=""border-collapse: collapse; border-style: solid; border-width: 1"" bordercolor=""#111111"" "
end if
addpictemp= addpictemp + ">"
addpictemp= addpictemp + "<tr>"
addpictemp= addpictemp + "<td align=""center"">"
addpictemp= addpictemp + "<img border=""0"" "

if ars("show_sq") =2 or ars("show_sq") =3 then
addpictemp= addpictemp + " title=""" + server.htmlencode(ars("pic_comm")) +""" "
end if
addpictemp= addpictemp +" src="""
addpictemp= addpictemp + SESSION("Image_lab") +"/"+rtrim(ars("picurl"))
addpictemp= addpictemp + """ ></td>"
addpictemp= addpictemp + "</tr>"
addpictemp= addpictemp + "</table>"
addpictemp= addpictemp + "</center>"
addpictemp= addpictemp + "</div>"
addpictemp= addpictemp + "</td>"
addpictemp= addpictemp + "</tr>"
if ars("show_sq") =1 or ars("show_sq") =3 then
addpictemp= addpictemp + "<tr>"
addpictemp= addpictemp + "<td width=""100%"" nowrap align=""center"" valign=""top"" >"
addpictemp= addpictemp +"<font size=""2"" color=&q



相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。