<%@ Page Language="C#" %>

<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Text" %>
<%@ Register TagName="meta" TagPrefix="UC" Src="~/s/include/meta.ascx" %>
<%@ Register TagName="head" TagPrefix="UC" Src="~/s/include/head.ascx" %>
<%@ Register TagName="tip_bar" TagPrefix="UC" Src="~/s/include/tip_bar.ascx" %>
<%@ Register TagName="foot" TagPrefix="UC" Src="~/s/include/foot.ascx" %>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string ids = WM.RQ("ids");
            if (ids.Length == 0)
            {
                Response.Redirect("index.aspx?top=8&ids=6,7,8");
            }
            Bind1(ids);
        }
    }
    void Bind1(string ids)
    {
        string top = WM.RQ("top");
        if (!WMnum.IsNum(top)) top = "8"; else { if (Convert.ToInt32(top) > 100 || Convert.ToInt32(top) < 4)top = "8"; }

        string PageTitles = string.Empty;
        string temp = string.Empty;
        StringBuilder sb = new StringBuilder();
        string[] arr1 = ids.Split(',');
        foreach (string item in arr1)
        {
            temp = Literal1_Template.Text;
            string n = WMread.GetBy("n", "info_class", "id", item); if (n.Length == 0) continue;
            temp = temp.Replace("{name}", n).Replace("{id}", item);
            PageTitles += n + ",";

            string str = string.Empty;
            IDataReader rdr = (IDataReader)WMshow.Show("select top " + top + " id,title,thumbnail from info where classid=" + item + " and [enable]=" + WM.True + " and  thumbnail<>'' order by time desc,id desc");
            while (rdr.Read())
            {
                str += "<li style=\"width: 181px\"><a href=\"/news/" + rdr["id"].ToString() + ".htm\" target=\"_blank\"><img alt=\"" + Server.HtmlEncode(rdr["title"].ToString()) + "\" src=\"" + ZK.getProportionImage(rdr["thumbnail"].ToString(), "", 150, "", 120) + "\" />" + WM.cut(rdr["title"].ToString(), 28, "..") + "</a></li>";
            }
            temp = temp.Replace("{list}", str);

            sb.Append(temp);
        }
        Literal1.Text = sb.ToString();
        if (PageTitles.Length > 0) PageTitles = PageTitles.Substring(0, PageTitles.Length - 1);
        LiteralPageTitle.Text = PageTitles;
    }
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title>
        <asp:Literal ID="LiteralPageTitle" runat="server"></asp:Literal>_<%=ZK.config("sitetitle") %></title><meta name="keywords" content="<%=ZK.config("sitekeywords") %>" />
    <meta name="description" content="<%=ZK.config("sitedescription") %>" />
    <UC:meta ID="meta1" runat="server" />
</head>
<body>
    <div class="wrap"><a name="pagetop" id="pagetop"></a>
        <UC:head ID="head1" runat="server" />
        <UC:tip_bar ID="tip_bar1" runat="server" />
        <div class="box">
            <div class="hto">
                <div class="fl flow" style="width: 747px">
                    <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                    <asp:Literal ID="Literal1_Template" runat="server" Visible="false">
                    <div class="c1 mt5">
                        <div class="b">
                            <div class="fl"></div>
                            <div class="con">{name}</div>
                            <div class="fr"><a href="/news/pic.htm?classid={id}" target="_blank">查看更多</a></div>
                            <div class="clear"></div>
                        </div>
                        <div class="v">
                            <div class="ulimg3" style="margin-left: 10px">
                                <ul>
                                    
                                   {list}
                                </ul>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    </asp:Literal>
                </div>
                <div class="fr flow" style="width: 198px">
                    <div class="c1 mt5">
                        <div class="b">
                            <div class="fl"></div>
                            <div class="con" style="width: 120px">赞助商链接</div>
                            <div class="fr" style="width: 5px"></div>
                            <div class="clear"></div>
                        </div>
                        <div class="v"><%=ZK.config("SponsoredLinkLife") %>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <UC:foot ID="foot1" runat="server" />
    </div>
</body>
</html>
