<%@ 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_row_column=request.getParameter("row_column")==null?"22":request.getParameter("row_column");
int row_column=Integer.parseInt(str_row_column);

//参数:每个图片的宽度
String img_width=request.getParameter("img_width")==null?"":request.getParameter("img_width");

//参数:每个图片的高度
String img_height=request.getParameter("img_height")==null?"22":request.getParameter("img_height");

//参数:是否显示图片标题
String is_show_title=request.getParameter("is_show_title")==null?"22":request.getParameter("is_show_title");

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

//参数:是否滚动显示
String is_scroll=request.getParameter("is_scroll")==null?"false":request.getParameter("is_scroll");

//参数:滚动方向
String scroll_direction=request.getParameter("scroll_direction")==null?"left":request.getParameter("scroll_direction");

//参数:滚动速度
String scroll_speed=request.getParameter("scroll_speed")==null?"22":request.getParameter("scroll_speed");

//参数:滚动高度
String scroll_height=request.getParameter("scroll_height")==null?"300":request.getParameter("scroll_height");

//参数:滚动宽度
String scroll_width=request.getParameter("scroll_width")==null?"300":request.getParameter("scroll_width");

//参数:打开方式　与html中<a>的target属性相同
String target=request.getParameter("target")==null?"_blank":request.getParameter("target");

int row_height=22;
%>
<% if(is_scroll.equals("true")){ %>
	<!--BEGIN: 图片是否滚动显示-->
	<marquee onMouseOver="this.stop();" onMouseOut="this.start()" direction="<%=scroll_direction%>" scrollamount="<%=scroll_speed%>" height="<%=scroll_height%>" width="<%=scroll_width%>">
<% } %>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
<%
String id="";
String image_url="";
String image_url_link="";
String title="";
String sql1="";
if(bar_id.equals("all"))
sql1="select id,image_url,title,bar_id from web_imageinfo where web_account='"+web_account+"'  order by id desc";
else
sql1="select id,image_url,title,bar_id from web_imageinfo where bar_id="+bar_id+" and web_account='"+web_account+"'  order by id desc";
PageManager thePageManager1 = new PageManager();
thePageManager1.setPageSize(page_size*row_column);
ResultSet rs1 = thePageManager1.gePageData(request, sql1);
int img_i=0;
while(rs1.next())
{
id=rs1.getString("id");
title=StringUtils.getStringLength(rs1.getString("title"),title_length);
bar_id=rs1.getString("bar_id");
image_url=rs1.getString("image_url");
image_url_link="/"+bar_id+"/content"+rs1.getString("id")+".html";
img_i++;
%>

<%if(img_i%row_column==1){%><tr><%}%>
<td>
  <table width="96%"  border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
       <!--显示文章图片-->
	 <td height="1" align="center">
	   <a href="<%=image_url_link%>" target="<%=target%>"><img src="<%=image_url%>" <%if(!img_width.equals("0")){%>width="<%=img_width%>"<%}%> <%if(!img_height.equals("0")){%>height="<%=img_height%>"<%}%> border="0" alt="<%=title%>"></a>
	 </td>
    </tr>
    <tr>
	<td height="5"><img border="0" src="/cmsweb/images/spacer.gif" width="1" height="5"></td>
    </tr>
  </table>
  <%if(is_show_title.equals("true")){%>
  <table width="96%" height="20"  border="0" cellpadding="0" cellspacing="0">
    <tr>
      <!--显示文章标题-->
      <td align="center" valign="middle" height="<%=row_height%>">
	<a href="<%=image_url_link%>" target="<%=target%>"><%=title%></a>
      </td>
    </tr>
  </table>
  <%}%>
</td>
<td width="5"><img border="0" src="/cmsweb/images/spacer.gif" width="5"></td>
<%if(img_i%row_column==0){%></tr><%}%>
<%}%>
<%if(img_i%row_column!=0){%></tr><%}%>
</table>

<%if(is_scroll.equals("true")){%>
   </marquee>
   <!--END: 图片是否滚动显示-->
<%}%>


