您当前位置:首页 > 文章中心 > SCSCMS

scscms插件-四列内容排版

稿件来源: 阳光企业网站管理系统   撰稿作者: 太阳光   发表日期: 2010-11-03   阅读次数: 150   查看权限: 游客查看

系统默认是没有四列全屏排版的DIV,应网友要求现开发一个.

先查看效果:http://www.scscms.com/scscms/scs_four.asp

第一步:在inc/scs_function.asp插入函数

'**************************************************
'函 数 名:Scs_four(str,cat_id)
'作    用:四列内容排版
'参    数:str类型:可选news,Article,software,media等等 cat_id:分类ID集,请使用四的倍数,如"1,2,3,4"或者"1,2,3,4,5,6,7,8",具体的数字从网站分类列表中查找
'**************************************************
Function Scs_four(str,cat_id)
Dim F_List,arr_cat
	arr_cat=Split(cat_id,",")
	For i=0 To UBound(arr_cat)
		If i Mod 4=0 Then
			F_List=F_List&"<div class='space'></div><div class=""four_column"" style=""border-left:1px solid #A8BEC9;"">"
		Else
			F_List=F_List&"<div class=""four_column"">"
		End If
	F_List=F_List&"<div class=""div_title0""><div class=""head_title0"">&nbsp;</div><a href=""/"&str&"/default.asp?cat_id="&arr_cat(i)&""">"&Get_Cat_Name(arr_cat(i))&"</a></div><ul class=""maindiv_ul"">"
	s_Sql="Select Top 10 "&str&"_id,"&str&"_title,"&str&"_date,"&str&"_count,web_url From [Scs_"&str&"] where cat_id in ("&arr_cat(i)&ReadSubId(arr_cat(i))&") Order By "&str&"_id Desc"
	Set s_Rs=Server.Createobject("adodb.recordset")
	s_Rs.open s_Sql,Conn,1,1
	If s_Rs.bof And s_Rs.eof Then
		F_List=F_List&"<li class=""disable_font"">更新之中……</li>"
	Else 
	Do While Not s_Rs.Eof
		F_List=F_List&"<li><img src=""/images/ico/li.gif"" width=18 height=10 align=""absmiddle""><a href="""&s_Rs(4)&""" title=""标题:"&scscms.clear_html("<[^>]*>",s_Rs(1))&"&#10;点击:"&s_Rs(3)&""">"&s_Rs(1)&"</a>"
		If DateDiff("d",s_Rs(2),Now())<CInt(newtime) Then F_List=F_List&"<img src=""/images/ico/new.gif"" width=30 height=10>"
	    F_List=F_List&"</li>"
	    s_Rs.MoveNext
	Loop
	End If 
	s_Rs.Close:Set s_Rs=Nothing
		F_List=F_List&"</ul></div>"
	Next
Scs_four=F_List
End Function

第二步:在images/xzy_css.css文件中插入代码

.four_column{
	width:243px;height:228px;
	float:left;
	border:1px solid #A8BEC9;
	border-width:0 1px 1px 0;
}

 

第三步:在需要的地方调用代码

<%=Scs_four("software","36,39,44,48")%>
'或者:
<%=Scs_four("article","5,12,18,19,20,21,23,35")%>
'或者:
<%
Response.write Scs_four("software","36,39,44,48")
Response.write Scs_four("article","5,12,18,19,20,21,23,35")
%>

关键词: scscms,插件开发,四列内容   编辑时间: 2010-11-03

  • 感到高兴

    1

    高兴
  • 感到支持

    0

    支持
  • 感到搞笑

    0

    搞笑
  • 感到不解

    0

    不解
  • 感到谎言

    0

    谎言
  • 感到枪稿

    0

    枪稿
  • 感到震惊

    0

    震惊
  • 感到无奈

    0

    无奈
  • 感到无聊

    0

    无聊
  • 感到反对

    0

    反对
  • 感到愤怒

    0

    愤怒
100%(2)
0%(0)
共有0 条评论 发言请遵守【相关规定

网友评论

会员头像
发 表同步腾讯微博    验证码:  点击更新请先登陆
  • 暂无评论
关闭模块文章图片 article Pictrue
  • 我的妈妈爸爸
  • 基于koa2+mysql+vue2.0+Element阳光内容管理系统
  • 代码覆盖率工具 Istanbul 入门教程
  • 全栈工程师的武器——MEAN
  • 9款超炫的 CSS3 复选框(Checkbox)
  • 微信开发在线翻译功能
  • CSS3那些不为人知的高级属性
  • 给easyui的datebox添加清空事件
  • flash写字效果
  • kendoUI系列教程之DropDownList下拉菜单
  • kendoUI系列教程之datetimepicker日期时间选择
  • kendoUI系列教程之datepicker日期选择
  • kendoUI系列教程之combobox下拉列表框
  • kendoUI系列教程之colorpicker
  • kendoUI系列教程之calendar日历表
  • kendoUI系列教程之autocomplete自动补齐