<%@ page contentType="text/html; charset=GBK"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="gbase.init.*,gbase.db.*,java.sql.*,gbase.util.*"%>
<%
//CMS站点的发布上下文(虚拟目录）
WebConfig theWebConfig1=new WebConfig();
String cms_url=theWebConfig1.getCms_url(); //已包括“/”
String old_cms_url="";
if(cms_url.lastIndexOf("/")>0)
old_cms_url=cms_url.substring(0,cms_url.lastIndexOf("/"));

//参数:网站账号web_account
String web_account=request.getParameter("web_account")==null?"":request.getParameter("web_account");

//参数:要显示栏目的ID
String bar_id=request.getParameter("bar_id")==null?"":request.getParameter("bar_id");

//参数:行数
String str_page_size=request.getParameter("page_size")==null?"0":request.getParameter("page_size");
int page_size=Integer.parseInt(str_page_size);

//参数:标题字符数(汉字数)
String str_title_length=request.getParameter("title_length")==null?"0":request.getParameter("title_length");
int title_length=Integer.parseInt(str_title_length);

//参数:每行的高度
String str_row_height=request.getParameter("row_height")==null?"22":request.getParameter("row_height");
int row_height=Integer.parseInt(str_row_height);

//参数:是否显示添加日期列
String is_show_add_date_column=request.getParameter("is_show_add_date_column")==null?"true":request.getParameter("is_show_add_date_column");

//参数:是否显示所属栏目列
String is_show_bar_name_column=request.getParameter("is_show_bar_name_column")==null?"true":request.getParameter("is_show_bar_name_column");

//参数:打开方式　与html中<a>的target属性相同
String target=request.getParameter("target")==null?"_blank":request.getParameter("target");
%>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
<%
String id="";
String title="";
String bar_name="";
String create_date="";
String sql1="";
if(bar_id.equals("all"))
sql1="select a.title,a.id,b.id as bar_id,b.name as bar_name,a.create_date from web_titleinfo a,bar_menu b where a.bar_id=b.id and a.web_account=b.web_account and a.web_account='"+web_account+"' order by id desc";
else
sql1="select a.title,a.id,b.id as bar_id,b.name as bar_name,a.create_date from web_titleinfo a,bar_menu b where a.bar_id=b.id  and a.web_account=b.web_account and a.bar_id="+bar_id+" and a.web_account='"+web_account+"'  order by id desc";
PageManager thePageManager1 = new PageManager();
thePageManager1.setPageSize(page_size);
ResultSet rs1 = thePageManager1.gePageData(request, sql1);
while(rs1.next())
{
id=rs1.getString("id");
title=StringUtils.getStringLength(rs1.getString("title"),title_length);
bar_id=rs1.getString("bar_id");
bar_name=rs1.getString("bar_name");
create_date=rs1.getString("create_date");
%>
<tr>
  <td height=<%=row_height%> align="left"><FONT color=red>·</FONT> 
  <%if(is_show_bar_name_column.equals("true"))
  {
  out.print("<a href=/bar"+bar_id+"_1.html>["+bar_name+"]</a>");
  out.print(" ");
  }
  out.print("<a href=/"+bar_id+"/content"+id+".html>"+title+"</a>");
  %>
  </td>
  <td align="right">
  <%if(is_show_add_date_column.equals("true"))
  {
  out.print(create_date);
  }
  %>
  </td>
</tr>
<%}%> 
</table>


