草根站长是一个网站架设的学习平台,提供最新的网站制作与网站运营等教程
网站map 会员中心 论坛
当前位置: 主页 > CMS教程 > 风讯CMS教程 >

风讯Cms:专题图片新闻调用-风讯Cms教程

来源:网络整理更新时间:2012-08-26 16:06点击:

免费版测试通过。可以在首页、专题页调用当前专题中的图片新闻,可以选择是否居中、图片是否加边框等。只针对3.2.sp1,3.2以前的版本不可用。

一、标签图片spicnews.gif(放到\foosun\images\lable目录中,名字:spicnews.gif)



二、打开\foosun\editer\lableediter.asp增加:(红色部分)

<td> <div></div></td>
<td><div><img src="../images/lable/spicnews.gif" alt="专题图片"></div></td>
</tr>
</table></td>
</tr>
<%
end if
%>

下面:

case 'spicnews':
var returnvalue=openwindow('../funpages/frame.asp?filename=lablespicnews.asp&pagetitle=专题图片标签属性',336,240,window);
break;
default :
return '';
}
if (returnvalue!='') parent.frames["editer"].inserthtmlstr(returnvalue);
}
</script>

三、foosun\funpages目录中,增加文件lablespicnews.asp

点击浏览该文件

四、打开\foosun\admin\refresh\cls_refresh.asp

private sub analyze_lable(f_lable_cont)
dim i
m_label_para_name_array = array(_
array("freelable","freelableid","querynum","colspan","rowspan","colnum","rownum"),_
array("spicnews","specialliststr","newsnumberstr","showtitlestr","openmodestr","titlenumberstr","rownumstr","picwidthstr","picheightstr","cssfilestr","rowspacestr","picmodestr","titlemodestr","isbkstr","bkcolorstr","bgcolorstr","bgimgstr"),_
array("selfclass","classename","newslistnumberstr","titlenumberstr","compatpicstr","navipicstr","daterulestr","daterightstr","rowheightstr","rownumberstr","showclasscnnamestr","morelinktypestr","morelinkcontentstr","cssstylestr","opentypestr","datecssstylestr","txtnavistr","isincludechildtf"),_

下面:

'==============2006-06-07=======================================================================
case "spicnews" : if ubound(m_prar_cont_array) = 16 then : select_function = spicnews(m_prar_cont_array(1),m_prar_cont_array(2),m_prar_cont_array(3),m_prar_cont_array(4),m_prar_cont_array(5),m_prar_cont_array(6),m_prar_cont_array(7),m_prar_cont_array(8),m_prar_cont_array(9),m_prar_cont_array(10),m_prar_cont_array(11),m_prar_cont_array(12),m_prar_cont_array(13),m_prar_cont_array(14),m_prar_cont_array(15),m_prar_cont_array(16)) : else : select_function = "" : exit function : end if|||
'================================================================================================
case "unrulenews"
if ubound(m_prar_cont_array) = 3 then redim preserve m_prar_cont_array(4) : m_prar_cont_array(4) = "0"
if ubound(m_prar_cont_array) = 4 then : select_function = get_no_rule_newslist_content(m_prar_cont_array(1),m_prar_cont_array(2),m_prar_cont_array(3),m_prar_cont_array(4)) : else : select_function = "" : exit function : end if
case "rss" : select_function = rss : exit function
case else : select_function = "" : exit function
end select
end function

五、\foosun\admin\refresh\refreshfunction.asp 增加两个函数:

'===================2006-06-07===============================================================================
function getmodestr(modestr)
select case modestr
case "1"
modestr = "align=""left"""
case "2"
modestr = "align=""center"""
case "3"
modestr = "align=""right"""
case else
modestr = ""
end select
getmodestr=modestr
end function

'专题图片
function spicnews(specialliststr,newsnumberstr,showtitlestr,openmodestr,titlenumberstr,rownumstr,picwidthstr,picheightstr,cssfilestr,rowspacestr,picmodestr,titlemodestr,isbkstr,bkcolorstr,bgcolorstr,bgimgstr)
titlenumberstr = gettitlenumberstr(titlenumberstr)
openmodestr = getopentypestr(openmodestr)
cssfilestr = getcssstylestr(cssfilestr)
picmodestr = getmodestr(picmodestr)
titlemodestr = getmodestr(titlemodestr)
dim divw,divh,imgt
divw = cint(cint(picwidthstr) cint(rowspacestr))
divh = cint(cint(picheightstr) cint(rowspacestr))
imgt = cint(cint(rowspacestr)/2)
dim tempbk,tempbg,tempb
if isbkstr = "1" then
if bkcolorstr <> "" then
tempbk = "<divborder-style:double;border-width:3pt; border-color: " & bkcolorstr & ";width:" & divw & "; height:" & divh & ";text-align:center;"">"
else
tempbk = "<divborder-style:double;border-width:3pt; border-color:#000000;width:" & divw & "; height:" & divh & ";text-align:center;"">"
end if
else
tempbk = ""
end if
if bgcolorstr <> "" and bgimgstr <> "" then
tempbg = "<divbackground-color:" & bgcolorstr & "; background-image:url(" & bgimgstr & ");width:" & divw & "; height:" & divh & ";text-align:center;"">"
elseif bgcolorstr = "" and bgimgstr <> "" then
tempbg = "<divbackground-image:url(" & bgimgstr & ");width:" & divw & "; height:" & divh & ";text-align:center;"">"
elseif bgcolorstr <> "" and bgimgstr = "" then
tempbg = "<divbackground-color:" & bgcolorstr & ";width:" & divw & "; height:" & divh & ";text-align:center;"">"|||
else
tempbg = ""
end if
if tempbk <> "" and tempbg <> "" then
tempb = "</div></div>"
elseif tempbk = "" or tempbg = "" then
tempb = "</div>"
else
tempb = ""
end if

dim spicnewssql,spicnewsobj,i,titlestr,tempdomain
if specialliststr = "" then
select case fun_refresh_type
case "index"
spicnewssql = "select top " & newsnumberstr & " * from fs_news where picnewstf = 1 and deltf = 0 and specialid is not null order by newsid desc"
case "special"
spicnewssql = "select top " & newsnumberstr & " * from fs_news where picnewstf = 1 and deltf = 0 and specialid like '" & fun_refresh_id & "' order by newsid desc"
case else
spicnewssql = ""
end select
else
spicnewssql = "select top " & newsnumberstr & " * from fs_news where picnewstf = 1 and deltf = 0 and specialid like '" & specialliststr & "' order by newsid desc"
end if
if spicnewssql <> "" then
set spicnewsobj = conn.execute(spicnewssql)
if not spicnewsobj.eof then
spicnews = "<table cellpadding=""0"" cellspacing=""" & rowspacestr & """0""100%"">" & chr(13) & chr(10)
do while not spicnewsobj.eof
spicnews = spicnews & "<tr>" & chr(13) & chr(10)
titlestr = "<tr>"
for i = 1 to rownumstr
if showtitlestr = "1" then
titlestr = titlestr & "<td " & titlemodestr & ">" & chr(13) & chr(10) & "<a " & openmodestr & cssfilestr & " href=""" & getonenewslinkurl(spicnewsobj("newsid")) & """ title="""& spicnewsobj("title")&""">" & gottopic(spicnewsobj("title"),titlenumberstr) & "</a></td>" & chr(13) & chr(10)
else
titlestr = ""
end if
if left(spicnewsobj("picpath"),4)="http" then tempdomain="" else tempdomain=getconfig(0)
spicnews = spicnews & "<td " & picmodestr & ">" & chr(13) & chr(10) & tempbk & chr(13) & chr(10) & tempbg & chr(13) & chr(10) & "<a " & openmodestr & cssfilestr & " href=""" & getonenewslinkurl(spicnewsobj("newsid")) & """ title="""& spicnewsobj("title")&""">" & "<img0"" src=""" & tempdomain & spicnewsobj("picpath") & """" & picwidthstr & """" & picheightstr & """margin-top: expression(" & imgt & ");"">" & "</a>" & tempb & "</td>" & chr(13) & chr(10)9 7 3||| 1 2 4 8 :

相关搜索:

本站推荐