在文章內(nèi)容中,我發(fā)現(xiàn)前端時間大家在討論文章顯示內(nèi)容畫中畫的功能,實(shí)際上這個功能對于本人是沒有什么用的,因?yàn)楸救耸菍慗AVA的,對于ASP這種東西我也不是太懂!!!但是本著學(xué)習(xí)風(fēng)訊的態(tài)度,本著貢獻(xiàn)的態(tài)度,就草草的寫了一個實(shí)現(xiàn)出來,希望大家不要笑話我!!!假如有什么不對的地方或者代碼可以寫的更漂亮的地方,希望大家給予我修改一下,同時告訴大家,這種實(shí)現(xiàn),我已經(jīng)在風(fēng)訊的治理控制臺上,增加了相應(yīng)的控制畫中畫的代碼,并且可以控制畫中畫顯示的日期長短!!!!你也可以根據(jù)你的需要來不停的修改畫中畫顯示的方式。
在此也非常感謝風(fēng)訊,那個我曾經(jīng)學(xué)習(xí)過7年城市中能夠出這么好的東西,表示敬佩!!!
我今天就首先上圖片,等晚上,網(wǎng)速上來,我在發(fā)修改代碼!!!!
此主題相關(guān)圖片如下:

大家可以完善的地方:
主要是要分析文章找到適當(dāng)?shù)牟迦氘嬛挟嫃V告的位置,就是再那個字符后面插入的問題,你仔細(xì)看看我上面的圖片,就會發(fā)現(xiàn)是斷了句子的,這個不好,最好的方式是增加我下面代碼中分析功能的那個函數(shù)的分析功能,智能判定假如不是新的行,就繼續(xù)下移一個插入字符,直到找到新的行位置,再插入,比較好
程序代碼的更改是比較簡單的,大家多看看,我很少上來,假如有什么問題,希望大家在這個帖子后面說明
Demo地址http://www.passatclub.com.cn
1。找到Manage/Admin/Refresh/Function.asp這個文件
2。找到Function GetNewsContent(TempletContent,NewsRecordSet,NewsContent) 這個函數(shù),大約在282行左右,不一定,因?yàn)槲腋牧撕芏嗟娘L(fēng)訊的東西。
3。修改后的代碼如下;
Function GetNewsContent(TempletContent,NewsRecordSet,NewsContent)
TempletContent = Replace(TempletContent,"{News_Title}",NewsRecordSet("Title"))
if Not IsNull(NewsRecordSet("SubTitle")) then
TempletContent = Replace(TempletContent,"{News_SubTitle}",NewsRecordSet("SubTitle"))
else
TempletContent = Replace(TempletContent,"{News_SubTitle}","")
end if
if Not IsNull(NewsRecordSet("Author")) then
TempletContent = Replace(TempletContent,"{News_Author}",NewsRecordSet("Author"))
else
TempletContent = Replace(TempletContent,"{News_Author}","")
end if
'====================================================開始
'分析文章內(nèi)容,插入廣告代碼,todo:將在數(shù)據(jù)中設(shè)置一個字段來設(shè)置是否文章中包含廣告內(nèi)容
Dim LeftContent,MidAdContent,RightContent,ModifyContent,headlen,tempStr,headAdStr,tailAdStr
'截取字符串
if len(NewsContent)<400 then
headlen=len(NewsContent)/2
else
headlen=400
end if
tempStr=NewsContent
LeftContent=InterceptString(tempStr,headlen)
'獲取實(shí)際的截取的長度
RightContent=Right(NewsContent,Len(NewsContent)-Len(LeftContent))
headAdStr="<table border=0 cellspacing=0 cellpadding=0 align=left><tr><td><div id=""embedAd"" name=""embedAd"" style=""DISPLAY:""><!--畫中畫廣告開始--><table border=0 cellspacing=0 cellpadding=0 style=""margin-top:5px;margin-bottom:3px;margin-left:7px;margin-right:8px""><tr><td><!--畫中畫開始-->"
tailAdStr="<!--畫中畫開始--></td></tr></table></td></tr></table><!--畫中畫廣告結(jié)束--></div>"