新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 软件开发 > .Net开发 > Asp.net教程 > 正文:是不是这个?

是不是这个?

新客网 XKER.COM 2003-07-12 来源: 收藏本文
        /// <summary>
        /// 贴子列表
        /// </summary>
        /// <author>jackson</author>
        /// <date>2001-07-01 15:14</date>
        /// <param name="cool">是否为Cool贴。</param>
        /// <param name="id">贴子的id号。</param>
        /// <param name="layer">贴子的层次顺序号。</param>
        /// <param name="emote">表情图标索引号。</param>
        /// <param name="title">贴子的标题。</param>
        /// <param name="author">作者。</param>
        /// <param name="y">年。</param>
        /// <param name="m">月。</param>
        /// <param name="d">日。</param>
        /// <param name="t">时间。</param>
        /// <param name="h">贴子的点击数。</param>
        /// <param name="l">贴子的长度。</param>
        /// <param name="c">回复数(子贴数)。</param>
        /// <param name="n">是否为新贴,如果为true则加入图像new.gif:)。</param>
        public void BBSList(bool cool, int id, int layer, int emote, string title, string author, int y, int m, int d, string t, int h, int l, int c, bool n)
        {
            if ( layer != 1 )                        //定制主题贴及一般贴背景,等于“1”为主题贴!
            {
                Response.Write("<tr BGCOLOR=#f0f0f0>");
            }
            else
            {
                Response.Write("<tr BGCOLOR=#d8d3cd>");
            }
            Response.Write("    <td align=center>" + (c>0?"<font color=red>+" + c.ToString()+"</font>":id.ToString())+"</td>");     //如果有子贴,则显示所有子贴数量,否则显示此贴ID
            Response.Write("    <td >");

            /*************缩进子贴**************/
            Response.Write("<li " + ((layer>1)?"type=square;": "") + " style='" + ((layer == 1)?"color:navy;":"")+ "text-indent:0; margin-left:"+(layer*20)+"; margin-top:0'>" );
            Response.Write("<img src=images/mood" + emote + ".gif>");
            Response.Write("        <a class=title href=showAnnounce.aspx?id="+id+">" + title + "</a>");
            if(l == 0)
            {
                Response.Write("<font color=black>(空");
            }
            else
            {
                Response.Write("<font color=black>(" + l + "字节");
            }

            Response.Write(",读" + (h>=50?"<font color=red>":"<font color=black>") + h + "</font>" + "次)</font>");
            
            if(cool)
            {
                Response.Write("<img src=images/cool.gif border=0>");
            }
            else
            {
                Response.Write(" ");
            }
            if(n) Response.Write("<img src=images/new.gif>");

            Response.Write("</li></td><td nowrap  >");
            Response.Write("        <a class=author target=_blank href="+author+">" + username(author) + "</a>");
            Response.Write("    </td>");
            Response.Write("    <td nowrap>");
            
            DateTime nowDate = DateTime.Now;
            if( y== nowDate.Year && m == nowDate.Month && d == nowDate.Day)
            {
                Response.Write("今天 ");
            }
            else
            {
                if(y==nowDate.Year && m==nowDate.Month && d==nowDate.Day - 1)
                {
                    Response.Write("昨天 ");
                }
                else
                {
                    Response.Write(y + "-" + m + "-" + d);
                }
            }
            Response.Write(" " + t);
            Response.Write("    </td>");
            Response.Write("</tr>");
            Response.Write("");
        }
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐