简简单单几个步骤让你在后台增加flash幻灯功能并且开关控制是否调用子栏目
声明:这个帖子借鉴了前人发布的2个帖子,感谢前人的努力
1、(52楼修正)FLASH幻灯新闻的又一解决方案,仿新浪的!后台可控制(文件已提供)(作者:lostID)
http://bbs.foosun.net/dispbbs.asp?BoardID=22&ID=16201&replyID=&skin=1
2、Flash幻灯片功能(作者:freewilly)
http://bbs.foosun.net/dispbbs.asp?boardID=22&ID=23208&page=1
一、打开foosun/admin/refreshfunction.asp在<%%>之内的最后加上下面的代码
'Flash幻灯
Function FlashNews(ClassListStr,NewsNumberStr,TitleNumberStr,PicWidthStr,PicHeightStr,BGcolor,txtheight,SoonClassStr)
Dim FilterSql,RsFilterObj,FlashStr,ImagesStr,TxtStr,TxtFirst,ClassSaveFilePath,LinkStr
TitleNumberStr = GetTitleNumberStr(TitleNumberStr)
'if ClassListStr <> "" then
' FilterSql = "Select Top " & NewsNumberStr & " *,FS_NewsClass.FileExtName as ClassFileExtName,FS_News.FileExtName as NewsFileExtName from FS_News,FS_NewsClass where FS_News.Classid=FS_NewsClass.Classid and FS_News.DelTF=0 and FS_News.FilterNews=1 and FS_News.AuditTF=1 and FS_NewsClass.ClassEName='" & ClassListStr & "' order by FS_News.ID Desc"
'else
' FilterSql = "Select Top " & NewsNumberStr & " *,FS_NewsClass.FileExtName as ClassFileExtName,FS_News.FileExtName as NewsFileExtName from FS_News,FS_NewsClass where FS_News.Classid=FS_NewsClass.Classid and FS_News.DelTF=0 and FS_News.FilterNews=1 and FS_News.AuditTF=1 order by FS_News.ID Desc"
'end if
'开始修改
dim TemppID,TemppSql,EndClassIDList'定义变量
'指定了调用的栏目
if ClassListStr <> "" then
'增加对子类幻灯新闻的调用
If SoonClassStr="1" then
TemppSql="select ClassID from FS_NewsClass where ClassEName='" & ClassListStr & "'"
Set TemppID=conn.execute(TemppSql)
EndClassIDList= "'" & TemppID(0) & "'" & AllChildClassIDStrList(TemppID(0))
Else
TemppSql="select ClassID from FS_NewsClass where ClassEName='" & ClassListStr & "'"
Set TemppID=conn.execute(TemppSql)
EndClassIDList="'" & TemppID(0) & "'"
End if
if EndClassIDList <> "" then
FilterSql = "Select Top " & NewsNumberStr & " *,FS_NewsClass.FileExtName as ClassFileExtName,FS_News.FileExtName as NewsFileExtName from FS_News,FS_NewsClass where FS_News.Classid=FS_NewsClass.Classid and FS_News.DelTF=0 and FS_News.FilterNews=1 and FS_News.AuditTF=1 and FS_News.ClassID in(" & EndClassIDList & ") order by FS_News.ID Desc"
else
FilterSql = "Select Top " & NewsNumberStr & " *,FS_NewsClass.FileExtName as ClassFileExtName,FS_News.FileExtName as NewsFileExtName from FS_News,FS_NewsClass where FS_News.Classid=FS_NewsClass.Classid and FS_News.DelTF=0 and FS_News.FilterNews=1 and FS_News.AuditTF=1 and FS_NewsClass.ClassEName='" & ClassListStr & "' order by FS_News.ID Desc"
end if
'调用全站图片幻灯新闻
else
EndClassIDList=""'归零
FilterSql = "Select Top " & NewsNumberStr & " *,FS_NewsClass.FileExtName as ClassFileExtName,FS_News.FileExtName as NewsFileExtName from FS_News,FS_NewsClass where FS_News.Classid=FS_NewsClass.Classid and FS_News.DelTF=0 and FS_News.FilterNews=1 and FS_News.AuditTF=1 order by FS_News.ID Desc"
end if
'修改结束
Set RsFilterObj = Conn.Execute(FilterSql)
TxtFirst=""
If not RsFilterObj.Eof then
Dim Temp_Num
Temp_Num = 0
Do While Not RsFilterObj.Eof
Temp_Num = Temp_Num + 1
RsFilterObj.MoveNext
Loop
RsFilterObj.MoveFirst
If Temp_Num <=1 then
Set RsFilterObj = Nothing
FlashNews = "至少需要两条幻灯新闻才能正确显示幻灯效果"
Set RsFilterObj = Nothing
Exit Function
End If
do while Not RsFilterObj.Eof
if RsFilterObj("SaveFilePath") = "/" then
ClassSaveFilePath = RsFilterObj("SaveFilePath")
else
ClassSaveFilePath = RsFilterObj("SaveFilePath") & "/"
end if
if (Not IsNull(RsFilterObj("PicPath"))) And (RsFilterObj("PicPath") <> "") then
if ImagesStr = "" then
If Instr(1,LCase(RsFilterObj("PicPath")),"http://") <> 0 then
ImagesStr = RsFilterObj("PicPath")
Else
ImagesStr = AvailableDoMain & RsFilterObj("PicPath")
End If
TxtStr = GotTopic(RsFilterObj("title"),TitleNumberStr)
'TxtFirst = RsFilterObj("title") 我觉得这句好象没什么用,所以注释掉了
LinkStr = GetOneNewsLinkURL(RsFilterObj("NewsID"))
else
If Instr(1,LCase(RsFilterObj("PicPath")),"http://") <> 0 then
ImagesStr = ImagesStr &"|"& RsFilterObj("PicPath")
Else
ImagesStr = ImagesStr &"|"& AvailableDoMain & RsFilterObj("PicPath")
End If
TxtStr = TxtStr &"|"&GotTopic(RsFilterObj("title"),TitleNumberStr)
LinkStr = LinkStr & "|" & GetOneNewsLinkURL(RsFilterObj("NewsID"))
end if
end if
RsFilterObj.MoveNext
loop
FlashStr="<script type=""text/javascript"">"& Chr(13)
FlashStr=FlashStr&"<!--"& Chr(13)
FlashStr=FlashStr&"var focus_width="&PicWidthStr& Chr(13)
FlashStr=FlashStr&"var focus_height="&PicHeightStr& Chr(13)
FlashStr=FlashStr&"var text_height="&txtheight& Chr(13)
FlashStr=FlashStr&"var swf_height = focus_height+text_height"& Chr(13)
FlashStr=FlashStr&"var pics='"&ImagesStr&"'"&Chr(13)
FlashStr=FlashStr&"var links='"&LinkStr &"'"&Chr(13)
FlashStr=FlashStr&"var texts='"&TxtStr&"'"&Chr(13)
FlashStr=FlashStr&" document.write('<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" width=""'+ focus_width +'"" height=""'+ swf_height +'"">');"&Chr(13)
FlashStr=FlashStr&"document.write('<param name=""allowScriptAccess"" value=""sameDomain""><param name=""movie"" value=""Templets/images/top.swf""><param name=""quality"" value=""high""><param name=""bgcolor"" value="&BGcolor&">');"&Chr(13)
FlashStr=FlashStr&"document.write('<param name=""menu"" value=""false""><param name=wmode value=""opaque"">');"&Chr(13)
FlashStr=FlashStr&" document.write('<param name=""FlashVars"" value=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"">');"&Chr(13)
FlashStr=FlashStr&"document.write('<embed src=""Templets/images/top.swf"" wmode=""opaque"" FlashVars=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"" menu=""false"" bgcolor="&BGcolor&" quality=""high"" width=""'+ focus_width +'"" height=""'+ swf_height +'"" allowScriptAccess=""sameDomain"" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" />');"&Chr(13)
FlashStr=FlashStr&"document.write('</object>');"&Chr(13)
FlashStr=FlashStr&"//-->"& Chr(13)
FlashStr=FlashStr&"</script>"
else
FlashStr="没有幻灯图片"
end if
RsFilterObj.Close
Set RsFilterObj = Nothing
FlashNews= FlashStr
End Function
二、打开foosun/refresh/selectfunction.asp
找到
Case "filternews"
if UBound(ParaArray) = 10 then
GetLableContent = FilterNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10))
else
GetLableContent = ""
Exit Function
end if
在上面的后面增加
Case "flashnews"
if UBound(ParaArray) = 8 then
GetLableContent = FlashNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8))
else
GetLableContent = ""
Exit Function
end if
我的热点新闻,有12个如果你在生成的图片新闻的时候出现问题,请把12改成11,最好在foosun/admin/refreshfunction.asp
'热点新闻
Function HotNews(ClassEName,SoonClassStr,NewNumberStr,TitleNumberStr,RowNumberStr,NaviPicStr,CompatPicStr,OpenTypeStr,CSSStyleStr,RowHeightStr,TxtNaviStr,HotDays)
数下()之间变量的个数!我忘记我是改的谁的东西了,这个里面多出来一个,本来我在下面的数字是11,发布的时候出了错,后来我一数居然是12个,改过来就好了。
Case "hotnews"
if UBound(ParaArray) = 12 then
GetLableContent = HotNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11),ParaArray(12))
else
GetLableContent = ""
Exit Function
end if
另外两个页面为了方便大家使用,已经改了好放在压缩包里,selectfunction.asp也在压缩包里,直接覆盖原来的就能使用了(请做好备份)。
不知道为什么如果你把那个标签作成自定义标签,那么前台将什么也不显示,调用的时候直接把他在线插到模板中就可以了,或者手动格式如下:
{%=FlashNews("栏目名称","新闻数量","标题字数","图片宽","图片高","背景颜色可空","文本高度","是否调用子类")%}
ps:发图片新闻的时候最好不要使用GIF格式的,会有问题!利用这样的方法同样可以修改图片、焦点等新闻是否调用子栏目;第一次发这样的帖子,如果有问题请在帖子后面说明,没有问题的请多多支持我!
刚忘记上传了![em07]
[此贴子已经被作者于2006-4-29 21:39:19编辑过]
哈哈 沙发 收藏
以前用前人的还成功,看起来你的这个比较完善!
[此贴子已经被作者于2006-4-29 21:40:34编辑过]
感谢楼上的支持!
我的这个不能加精吗?
有没有存储版的呀
有没有的呀
没有使用这样的版本,所有不会弄,应该在存储版上可以用的吧
不好意思 现在才看到 把你的问题贴出来
不是很懂你的意思!?
生成首页错误
无法显示网页 |
| 您要访问的网页有问题,无法显示。 |
那就不好意思了!因为我使用的是免费版,您可以自己手动根据这样的思路进行修改
================================================
if EndClassIDList <> "" then
FilterSql = "Select Top " & NewsNumberStr & " *,FS_NewsClass.FileExtName as ClassFileExtName,FS_News.FileExtName as NewsFileExtName from FS_News,FS_NewsClass where FS_News.Classid=FS_NewsClass.Classid and FS_News.DelTF=0 and FS_News.FilterNews=1 and FS_News.AuditTF=1 and FS_News.ClassID in(" & EndClassIDList & ") order by FS_News.ID Desc"
=================================================
楼主能否说说上面的作用?还有EndClassIDList这个变量是什么来的?最后栏目列表?
[此贴子已经被作者于2006-5-19 17:39:07编辑过]
[em07]
好东西
楼主麻烦把selectfunction.asp页面修改的部分用红色标出来贴上去,因为这个页面我装其它插件的时候修改过,所以不是原来的,小弟先谢过了!我的是存储过程的.
楼主麻烦把selectfunction.asp页面修改的部分用红色标出来贴上去,因为这个页面我装其它插件的时候修改过,所以不是原来的,小弟先谢过了!我的是存储过程的.
打开foosun/refresh/selectfunction.asp
找到
Case "filternews"
if UBound(ParaArray) = 10 then
GetLableContent = FilterNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10))
else
GetLableContent = ""
Exit Function
end if
在上面的后面增加
Case "flashnews"
if UBound(ParaArray) = 8 then
GetLableContent = FlashNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8))
else
GetLableContent = ""
Exit Function
end if
我的热点新闻,有12个如果你在生成的图片新闻的时候出现问题,请把12改成11,最好在foosun/admin/refreshfunction.asp
'热点新闻
Function HotNews(ClassEName,SoonClassStr,NewNumberStr,TitleNumberStr,RowNumberStr,NaviPicStr,CompatPicStr,OpenTypeStr,CSSStyleStr,RowHeightStr,TxtNaviStr,HotDays)
数下()之间变量的个数!我忘记我是改的谁的东西了,这个里面多出来一个,本来我在下面的数字是11,发布的时候出了错,后来我一数居然是12个,改过来就好了。
Case "hotnews"
if UBound(ParaArray) = 12 then
GetLableContent = HotNews(ParaArray(1),ParaArray(2),ParaArray(3),ParaArray(4),ParaArray(5),ParaArray(6),ParaArray(7),ParaArray(8),ParaArray(9),ParaArray(10),ParaArray(11),ParaArray(12))
else
GetLableContent = ""
Exit Function
end if
另外两个页面为了方便大家使用,已经改了好放在压缩包里,selectfunction.asp也在压缩包里,直接覆盖原来的就能使用了(请做好备份)。
不知道为什么如果你把那个标签作成自定义标签,那么前台将什么也不显示,调用的时候直接把他在线插到模板中就可以了,或者手动格式如下:
{%=FlashNews("栏目名称","新闻数量","标题字数","图片宽","图片高","背景颜色可空","文本高度","是否调用子类")%}
ps:发图片新闻的时候最好不要使用GIF格式的,会有问题!