<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/cms4j" prefix="cms4j" %>
<%@ page import = "cn.com.dekn.cms.util.*,cn.com.dekn.common.util.*" %>
<%
//网站群节点ID
String NODE_ID = ParamUtil.getStrParam(request,"NODE_ID","root");
//网站群节点参数
String CLUSTER_URL_PARAM = "";
if(null != request.getParameter("cluster_node_id")){
	CLUSTER_URL_PARAM = "cluster_node_id=" + StrUtil.encodeHTML(request.getParameter("cluster_node_id").toString());
}
%>
<%
/***********************************
* TAG参数初始化
***********************************/
//要显示栏目的ID
String CLASS_ID = 		ParamUtil.getStrParam(request,"CLASS_ID","");
//过滤属性
String FILTER = 		ParamUtil.getStrParam(request,"FILTER",""); 
//排序属性
String ORDER = 	ParamUtil.getStrParam(request,"ORDER",""); 
//显示的范围，可以是现有文章，回收站中的文章，全部
String SCOPE = 	ParamUtil.getStrParam(request,"SCOPE",""); 
//指定显示哪一篇文章
String ARTICLE_ID = 	ParamUtil.getStrParam(request,"ARTICLE_ID",""); 
//显示哪一个专题
String SPECIAL_ID = 	ParamUtil.getStrParam(request,"SPECIAL_ID",""); 
//搜索关键字
String KEY = 	ParamUtil.getStrParam(request,"KEY","");
KEY = Convert.convertEncode(KEY);
//搜索关键字
String SEARCH = 		ParamUtil.getStrParam(request,"SEARCH","");
//搜索类型
String SEARCH_TYPE = 	ParamUtil.getStrParam(request,"SEARCH_TYPE","");
//添加人
String ADD_USER = 		ParamUtil.getStrParam(request,"ADD_USER","");
//栏目的状态(默认显示状态为USE的)
String CLASS_STATE = 	ParamUtil.getStrParam(request,"CLASS_STATE","use");
//栏目的显示方式（all 为显示所有； show 为显示“在导航中显示的” hidden为显示“在导航中不显示的”
String CLASS_SHOW = 	ParamUtil.getStrParam(request,"CLASS_SHOW","all");
//文章日期范围（all 显示所有；now 显示文章所设置的日期范围内； expire 显示过期的；notbegin 显示未开始的
String DATE = 	ParamUtil.getStrParam(request,"DATE","now");
//排除
String EXCLUDE = 		ParamUtil.getStrParam(request,"EXCLUDE","");
//排除2
String EXCLUDE2 = 		ParamUtil.getStrParam(request,"EXCLUDE2","");
//指定的相关文章，各文章ID之间用|分隔
String BIND_KEY_ARTICLE_ID = ParamUtil.getStrParam(request,"BIND_KEY_ARTICLE_ID","");
//指定显示第几页的数据
int PN = ParamUtil.getIntParam(request,"PN",0);
//行数
String PAGE_SIZE = ParamUtil.getStrParam(request,"PAGE_SIZE","10"); 
/***********************************
* 显示特性参数初始化
***********************************/
//新闻标题长度
int TITLE_LENGTH = ParamUtil.getIntParam(request,"TITLE_LENGTH",24);
//标题长度超出时显示的字符
String TITLE_OUT_STR = ParamUtil.getStrParam(request,"TITLE_OUT_STR","");
//每行的高度
String ROW_HEIGHT = ParamUtil.getStrParam(request,"ROW_HEIGHT","22");
//“今日最新”图片地址
String IS_NEW_IMG = ParamUtil.getStrParam(request,"IS_NEW_IMG","images/new.gif");
//文章标题前的图片(普通文章）
String ARTICLE_FRONT_IMG_COMMON = ParamUtil.getStrParam(request,"ARTICLE_FRONT_IMG_COMMON","");
//文章标题前的图片(热点文章）
String ARTICLE_FRONT_IMG_HOT = ParamUtil.getStrParam(request,"ARTICLE_FRONT_IMG_HOT","");
//文章标题前的图片(推荐文章）
String ARTICLE_FRONT_IMG_COMMEND = ParamUtil.getStrParam(request,"ARTICLE_FRONT_IMG_COMMEND","");
//文章标题前的图片(固顶文章）
String ARTICLE_FRONT_IMG_TOP = ParamUtil.getStrParam(request,"ARTICLE_FRONT_IMG_TOP","");
//显示添加日期的格式
String ADD_DATE_FORMAT = ParamUtil.getStrParam(request,"ADD_DATE_FORMAT","MM-dd");
//打开方式　与html中<a>的target属性相同
String TARGET = ParamUtil.getStrParam(request,"TARGET","");
//显示文章的默认页面
String SHOW_ARTICLE_PAGE = ParamUtil.getStrParam(request,"SHOW_ARTICLE_PAGE","");
/***********************************
* 元素隐显参数初始化
***********************************/
//是否显示添加日期列
boolean IS_SHOW_ADD_DATE_COLUMN = ParamUtil.getBooleanParam(request,"IS_SHOW_ADD_DATE_COLUMN","true");
//是否显示所属栏目列
boolean IS_SHOW_CLASS_NAME_COLUMN = ParamUtil.getBooleanParam(request,"IS_SHOW_CLASS_NAME_COLUMN","true");
//是否查看翻页
boolean IS_SHOW_PAGE = ParamUtil.getBooleanParam(request,"IS_SHOW_PAGE","false");
//是否在标题的后面直接显示 new 图标，但不显示日期
boolean IS_SHOW_NEW_ICON_IN_TITLE = ParamUtil.getBooleanParam(request,"IS_SHOW_NEW_ICON_IN_TITLE","false");
//是否在标题的直接显示 new 图标，且显示日期
boolean IS_SHOW_NEW_ICON_AND_DATE_IN_TITLE = ParamUtil.getBooleanParam(request,"IS_SHOW_NEW_ICON_AND_DATE_IN_TITLE","false");
//是否在日期处显示 new 图标（如果是今天添加的新闻）
boolean IS_SHOW_NEW_ICON_IN_DATE = true;
if(null != request.getParameter("IS_SHOW_NEW_ICON_IN_DATE") && request.getParameter("IS_SHOW_NEW_ICON_IN_DATE").equalsIgnoreCase("false")){
	IS_SHOW_NEW_ICON_IN_DATE = false;
}
if(IS_SHOW_NEW_ICON_IN_TITLE){	//如果在标题处显示new了，就不再日期处再显示
	IS_SHOW_NEW_ICON_IN_DATE = false;
}
/***********************************
* CSS样式 参数初始化
***********************************/
//CSS样式
String CSS = ParamUtil.getStrParam(request,"CSS","");
//标题CSS样式
String CSS_TITLE = ParamUtil.getStrParam(request,"CSS_TITLE","");
//栏目CSS样式
String CSS_CLASS = ParamUtil.getStrParam(request,"CSS_CLASS","");
//分页CSS样式
String CSS_PAGE = ParamUtil.getStrParam(request,"CSS_PAGE","");
/***********************************
* 其它变量
***********************************/
int titleLength = TITLE_LENGTH;
%>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top"> 
      <!--BEGIN:设置文章显示条件-->
	  <% int articleCount = 0; %>
      <cms4j:article page_size="<%=PAGE_SIZE%>" class_id="<%=CLASS_ID%>" filter="<%=FILTER%>" order="<%=ORDER%>" scope="<%=SCOPE%>" article_id="<%=ARTICLE_ID%>" special_id="<%=SPECIAL_ID%>" key="<%=KEY%>" search="<%=SEARCH%>" search_type="<%=SEARCH_TYPE%>" node_id="<%=NODE_ID%>" pn="<%=PN%>" add_user="<%=ADD_USER%>" class_state="<%=CLASS_STATE%>" class_show="<%=CLASS_SHOW%>" date="<%=DATE%>" exclude="<%=EXCLUDE%>" exclude2="<%=EXCLUDE2%>" bind_key_article_id="<%=BIND_KEY_ARTICLE_ID%>"> 
	  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
				<!--BEGIN:显示文章-->
				<cms4j:article_list>
				    <% articleCount++ ; %>
					<tr class="<%=CSS%>">
					  <!--文章前显示的小图标-->
					  <td width="30" height="<%=ROW_HEIGHT%>" align="center" valign="top"><%=articleCount%>.&nbsp;</td>	  
          <td width="859"> 
            <% if(IS_SHOW_CLASS_NAME_COLUMN){ %>
            <!--文章所属栏目(条件控制)-->
            <span class="<%=CSS_CLASS%>">[</span><a href="<cms4j:class id="<%=article_info.getARTICLE_CLASS_ID()%>"><%=class_info.getLinkURL("ShowClass.jsp","ShowClassList.jsp","id","")%></cms4j:class>"><span class="<%=CSS_CLASS%>"><%=article_info.getCLASS_NAME()%></span></a><span class="<%=CSS_CLASS%>">]</span>
            <% 
				titleLength = TITLE_LENGTH - (StrUtil.getLength(article_info.getCLASS_NAME())/2);
			} 	
			%>
            <!--文章标题-->
            <a href="<%=request.getContextPath()%><%=article_info.getURL(SHOW_ARTICLE_PAGE,CLUSTER_URL_PARAM)%>" target="<%=TARGET%>"><span class="<%=CSS_TITLE%>" title="<%=article_info.getTITLE()%>"><%=article_info.getTITLE(titleLength,TITLE_OUT_STR,"","","")%></span></a> 
			<%if(IS_SHOW_NEW_ICON_IN_TITLE){%>
				<%=article_info.isNewImg(IS_NEW_IMG)%>
			<%}else if(IS_SHOW_NEW_ICON_AND_DATE_IN_TITLE){%>
				<%=article_info.getADD_DATE_FORMATED(ADD_DATE_FORMAT,true,true,IS_NEW_IMG)%>
			<%}%>
          </td>
					  <% if(IS_SHOW_ADD_DATE_COLUMN){ %>
					  	<!--文章添加日期(条件控制)-->   	
          <td width="77" align="right"> <font><nobr><%=article_info.getADD_DATE_FORMATED(ADD_DATE_FORMAT,true,IS_SHOW_NEW_ICON_IN_DATE,IS_NEW_IMG)%></nobr></font>&nbsp; 
          </td>
					  <% } %>
					</tr><tr><td height="1" colspan="3"></td></tr>
				</cms4j:article_list>
				<!--END:显示文章-->
			</table>
			<% if(articleCount <= 0) { %>
				<span class="<%=CSS_TITLE%>">暂无符合条件的文章</span>
			<% } %>
			<% if(IS_SHOW_PAGE) {%>
				<!--BEGIN: 翻页(条件控制)-->
				<jsp:include page="../page/page_1.jsp">
					<jsp:param name="CSS" value="<%=CSS_PAGE%>"></jsp:param>
				</jsp:include>
				<!--END: 翻页-->
			<% } %>
		</cms4j:article>
		<!--结束：文章列表-->
	  </td>
	</tr>
</table>

