不知道是我笨还是科汛在这里偷了一点儿懒,对于不规则文章调用,没有提取文章标题的相关属性,所以导致不规则新闻调用只能是黑色字体,也不能加粗加斜,在后台添加文章时标题属性设置在不规则新闻中不起作用,但其它大型站点不规则新闻不光是标题字数不规则,连颜色也不规则,呵呵,怎么实现呢,还得感谢科汛为我们做好了模板,我们对其进行一个小手术就OK了,我只做了颜色,大家可以把加粗等属性也放进来,有了style属性什么都好说!
由于之间声明过从此不搞回复贴,所以这此就是完全展示了(光屁屁),如果觉得还有点用就顶一下,呵呵!
找到函数:KS_C_NotRule_A_L(大约是464行,如果没有改过这部分的话,主要修改部分用红色标识出来了),然后把函数用以下函数全部替换:
Function KS_C_NotRule_A_L(SqlStr,RowNumber, ShowNumPerRow, MoreLinkStr, OpenTypeStr, RowHeight, NavType, Nav, SplitPic, TitleCss,PrintType,DivID,DivClass,UlID,ULClass,LiID,LiClass)
On Error Resume Next
Dim I, FolderNameAndLinkStr, NaviStr,CommentStr
Dim RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
Dim PreArticleComment,PreArticleShowComment,PreArticleClassID,PreArticleInfoID
RS.Open SqlStr, Conn, 1, 1
If Not RS.EOF Then
Dim CurrTid,LinkStr,Title, TitleCssStr,EndStr,TitleColor
TitleCssStr = KSCMS.GetCss(TitleCss):RowHeight = KSCMS.GetRowHeight(RowHeight):NaviStr = KSCMS.GetNavi(NavType, Nav)
If Cint(PrintType)=2 Then
KS_C_NotRule_A_L ="<div"&KSCMS.GetCssID(DivID)&KSCMS.GetCss(DivCLass) &">" & vbCrLf & " <ul"&KSCMS.GetCssID(UlID)&KSCMS.GetCss(UlClass) &">" & vbCrLf & "<li"&KSCMS.GetCssID(LIID)&KSCMS.GetCss(LIClass)&">"
EndStr="</li>"
Else
KS_C_NotRule_A_L = "<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" align=""center"">" & vbCrLf & "<tr><td height=""" & RowHeight &""">" & vbCrLf
EndStr="</td></tr>"
End If
Dim II:ii=0:Dim CC:cc=0:Dim Row,str
RowNumber=Cint(RowNumber):ShowNumPerRow=Cint(ShowNumPerRow)
KS_C_NotRule_A_L= KS_C_NotRule_A_L & NaviStr
do while not RS.eof
CurrTid = Trim(RS("Tid"))
TitleColor=trim(RS("TitleFontColor"))
if TitleColor="" then TitleColor="Black"
Title=trim(RS("Title"))
LinkStr=TitleCssStr & " href=""" & KSCMS.GetInfoUrl(1,RS) & """" & OpenTypeStr & " title=""" & Title & """"
ii=ii + KSCMS.strLength(Title)
if ii>=ShowNumPerRow then
cc=ii - ShowNumPerRow:cc=KSCMS.strLength(Title) - cc:row=row+1:ii=0
IF row=RowNumber then
IF cc<=5 And PreArticleShowComment = 1 And PreArticleComment = 1 Then
KS_C_NotRule_A_L=KS_C_NotRule_A_L & "<a href=""" & DomainStr & "Comment.asp?ChannelID=1&Classid=" & PreArticleClassID & "&InfoID=" & PreArticleInfoID & """ target=""_blank"">" & KSCMS.GotTopic("评论",cc) & "</a>"&EndStr
Else
KS_C_NotRule_A_L=KS_C_NotRule_A_L & "<a" & LinkStr &" style=""color:"& TitleColor &""">"& KSCMS.GotTopic(Title,cc)&"</a>"&EndStr
End IF
KS_C_NotRule_A_L = KS_C_NotRule_A_L & (KSCMS.GetSplitPic(SplitPic, 1) & vbCrLf)
PreArticleComment=RS("Comment"):PreArticleShowComment=RS("ShowComment"):PreArticleClassID=CurrTid:PreArticleInfoID=RS("NewsID")
RS.movenext
Else
IF cc<=5 And PreArticleShowComment = 1 And PreArticleComment = 1 Then
KS_C_NotRule_A_L=KS_C_NotRule_A_L & "<a href=""" & DomainStr & "Comment.asp?ChannelID=1&Classid=" & PreArticleClassID & "&InfoID=" & PreArticleInfoID & """ target=""_blank"">" & KSCMS.GotTopic("评论",cc) &"</a>"&EndStr
else
KS_C_NotRule_A_L=KS_C_NotRule_A_L & "<a" & LinkStr &" style=""color:"& TitleColor &""">"& KSCMS.GotTopic(Title,cc)&"</a>"&EndStr
end if
KS_C_NotRule_A_L = KS_C_NotRule_A_L & (KSCMS.GetSplitPic(SplitPic, 1) & vbCrLf)
PreArticleComment=RS("Comment"):PreArticleShowComment=RS("ShowComment"):PreArticleClassID=CurrTid:PreArticleInfoID=RS("NewsID")
RS.movenext
If Not RS.EOF Then
If Cint(PrintType)=2 Then
KS_C_NotRule_A_L=KS_C_NotRule_A_L & "<li"&KSCMS.GetCssID(LIID)&KSCMS.GetCss(LIClass)&">" & NaviStr
else
KS_C_NotRule_A_L=KS_C_NotRule_A_L & "<td height=""" & RowHeight &""">" & NaviStr
end if
end if
End If
Else
KS_C_NotRule_A_L=KS_C_NotRule_A_L & "<a" & LinkStr &" style=""color:"& TitleColor &""">"& Title&"</a> "
ii=ii + 1
PreArticleComment=RS("Comment"):PreArticleShowComment=RS("ShowComment"):PreArticleClassID=CurrTid:PreArticleInfoID=RS("NewsID")
RS.movenext
End IF
if row>=RowNumber then exit do
loop
RS.close:Set RS=nothing
KS_C_NotRule_A_L = KS_C_NotRule_A_L & MoreLinkStr
If Cint(PrintType)=2 Then
KS_C_NotRule_A_L = KS_C_NotRule_A_L & ("</ul>" & vbCrLf &"</div>" & vbcrlf)
Else
KS_C_NotRule_A_L = KS_C_NotRule_A_L & ("</table>" & vbCrLf)
End if
Else
KS_C_NotRule_A_L = "":RS.Close:Set RS = Nothing
End If
End Function
效果:
此主题相关图片如下:
[此贴子已经被作者于2007-1-20 9:31:19编辑过]