예제 #1
0
        //图文模块
        private void digg_photo_add(HttpContext context)
        {
            string channel_type = DTRequest.GetFormString("channel_type");
            string digg_type    = DTRequest.GetFormString("digg_type");
            int    id           = DTRequest.GetFormInt("id");

            BLL.photo bll = new BLL.photo();
            if (!bll.Exists(id))
            {
                context.Response.Write("{msg:0, msgbox:\"信息不存在或已删除!\"}");
                return;
            }
            if (digg_type == "good")
            {
                bll.UpdateField(id, "digg_good=digg_good+1");
            }
            else
            {
                bll.UpdateField(id, "digg_act=digg_act+1");
            }
            Model.photo model = bll.GetModel(id);
            context.Response.Write("{msg:1, digggood:" + model.digg_good + ", diggact:" + model.digg_act + ", msgbox:\"成功顶或踩了一下!\"}");
            Utils.WriteCookie(DTKeys.COOKIE_DIGG_KEY, channel_type + id.ToString(), id.ToString(), 8640);
            return;
        }
예제 #2
0
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     id = DTRequest.GetQueryInt("id");
     BLL.photo bll = new BLL.photo();
     if (!bll.Exists(id))
     {
         HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
         return;
     }
     model = bll.GetModel(id);
     //浏览数+1
     bll.UpdateField(id, "click=click+1");
     //跳转URL
     if (model.link_url != null)
         model.link_url = model.link_url.Trim();
     if (!string.IsNullOrEmpty(model.link_url))
     {
         HttpContext.Current.Response.Redirect(model.link_url);
     }
 }
예제 #3
0
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     id = DTRequest.GetQueryInt("id");
     BLL.photo bll = new BLL.photo();
     if (!bll.Exists(id))
     {
         HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
         return;
     }
     model = bll.GetModel(id);
     //浏览数+1
     bll.UpdateField(id, "click=click+1");
     //跳转URL
     if (model.link_url != null)
     {
         model.link_url = model.link_url.Trim();
     }
     if (!string.IsNullOrEmpty(model.link_url))
     {
         HttpContext.Current.Response.Redirect(model.link_url);
     }
 }
 //图文模块
 private void digg_photo_add(HttpContext context)
 {
     string channel_type = DTRequest.GetFormString("channel_type");
     string digg_type = DTRequest.GetFormString("digg_type");
     int id = DTRequest.GetFormInt("id");
     BLL.photo bll = new BLL.photo();
     if (!bll.Exists(id))
     {
         context.Response.Write("{msg:0, msgbox:\"信息不存在或已删除!\"}");
         return;
     }
     if (digg_type == "good")
     {
         bll.UpdateField(id, "digg_good=digg_good+1");
     }
     else
     {
         bll.UpdateField(id, "digg_act=digg_act+1");
     }
     Model.photo model = bll.GetModel(id);
     context.Response.Write("{msg:1, digggood:" + model.digg_good + ", diggact:" + model.digg_act + ", msgbox:\"成功顶或踩了一下!\"}");
     Utils.WriteCookie(DTKeys.COOKIE_DIGG_KEY, channel_type + id.ToString(), id.ToString(), 8640);
     return;
 }