点击进入知科官方网站
查看: 2840  |  回复: 1
 
 
Official服务
积分:16745
注册时间:2012-01-02
最后登录:2015-09-24
发送短消息
发表于 2014-03-07 21:15
 
效果预览:
 
 
 
 
 
方法:
一、下载并打开/index/5/index.aspx文件
 
二、把以下这段:
                                 <%=本期团购()%>
                                    <script type="text/javascript">
                                        var tms = [];var day = [];var hour = [];var minute = [];var second = [];
                                        function takeCount(){if(document.getElementById("tuan_d1"))setTimeout("takeCount()", 1000);
                                        for (var i = 0, j = tms.length; i < j; i++){tms[i] -= 1000;
                                        var days = Math.floor(tms[i] / (1000 * 60 * 60 * 24));var hours = Math.floor(tms[i] / (1000 * 60 * 60)) % 24;var minutes = Math.floor(tms[i] / (1000 * 60)) % 60;var seconds = Math.floor(tms[i] / 1000) % 60;
                                        if (days < 0)days = 0;if (hours < 0)hours = 0;if (minutes < 0)minutes = 0;if (seconds < 0)seconds = 0;
                                        document.getElementById(day[i]).innerHTML = days;document.getElementById(hour[i]).innerHTML = hours;document.getElementById(minute[i]).innerHTML = minutes;document.getElementById(second[i]).innerHTML = seconds;}}
                                        if(document.getElementById("tuan_d1"))setTimeout("takeCount()", 1000);
                                        tms[tms.length] = "<asp:Literal ID="Literal2_" runat="server"></asp:Literal>";
                                        day[day.length] = "tuan_d1";
                                        hour[hour.length] = "tuan_h1";
                                        minute[minute.length] = "tuan_m1";
                                        second[second.length] = "tuan_s1";
                                    </script>
替换为:
<%=ZK.BindEasy("select top 1 * from party where enable=1 order by tj desc,time desc,id desc", "<div class='son4'></div><div class='son1'><a href='/party/view.aspx?id={{id}}' target='_blank'>{{title}}</a></div><div class='son2'><a href='/party/view.aspx?id={{id}}' target='_blank'><img alt='{{#title}}' src='{{thumbnail}}' /></a></div><div class='son3'><a href='/party'>进入活动频道&raquo;</a></div>", "title", 32, "..", "time", "yyyy-MM-dd")%>
 
 
 
Official服务
积分:16745
注册时间:2012-01-02
最后登录:2015-09-24
发送短消息
回复于 2014-06-21 21:57
1楼
/index/5/index.aspx.cs 这个文件里的这段代码可以删除掉  
 
protected string 本期团购()
    {
        IDataReader rdr = (IDataReader)WMshow.Show("select top 1 id,shorttitle,endtime,thumbnail from tuan where enable=1 and thumbnail<>'' and starttime<" + WM.sqlnow + " and endtime >" + WM.sqlnow + " order by time desc,id desc");
        string temp = "";
        if (rdr.Read())
        {
            temp = "<div class=\"son4\"></div><div class=\"son1\"><a href=\"/tuan/" + rdr["id"].ToString() + ".htm\" target=\"_blank\">" + WM.cut(rdr["shorttitle"].ToString().Trim(), 32, "..") + "</a></div><div class=\"son2\"><a href=\"/tuan/" + rdr["id"].ToString() + ".htm\" target=\"_blank\"><img alt=\"" + Server.HtmlEncode(rdr["shorttitle"].ToString().Trim()) + "\" src=\"" + ZK.getProportionImage(WMcompare.IsEmpty(rdr["thumbnail"].ToString(), "/skin/public/none.gif"), "", 220, "", 195) + "\" /></a></div><div class=\"son3\">剩余:<span id=\"tuan_d1\">0</span> 天 <span id=\"tuan_h1\">0</span> 时 <span id=\"tuan_m1\">0</span> 分 <span id=\"tuan_s1\">0</span> 秒</div>";
            Literal2_.Text = (Convert.ToInt64(WMtime.DateDiff(DateTime.Now, Convert.ToDateTime(rdr["endtime"].ToString())).TotalSeconds) * 1000).ToString();
        }
        rdr.Close(); rdr.Dispose();
        return temp;
    }
回复帖子