Esempio n. 1
0
 public ActionResult AjaxTopicOperation(FormCollection fm)
 {
     int topicID = Globals.SafeInt(fm["TopicId"], 0);
     int recommand = Globals.SafeInt(fm["Type"], 0);
     Maticsoft.BLL.SNS.GroupTopics topics = new Maticsoft.BLL.SNS.GroupTopics();
     Maticsoft.Model.SNS.GroupTopics model = new Maticsoft.Model.SNS.GroupTopics();
     model = topics.GetModel(topicID);
     if (recommand < 2)
     {
         if (topics.UpdateRecommand(topicID, recommand))
         {
             return base.Content("Ok");
         }
         return base.Content("No");
     }
     if (recommand != 2)
     {
         return null;
     }
     model.IsRecomend = 0;
     if (topics.DeleteEx(topicID))
     {
         return base.Content("Ok");
     }
     return base.Content("No");
 }
Esempio n. 2
0
 public void AjaxPostWeibo(FormCollection Fm)
 {
     UserBind bind = new UserBind();
     Maticsoft.BLL.SNS.Posts posts = new Maticsoft.BLL.SNS.Posts();
     Maticsoft.BLL.SNS.GroupTopics topics = new Maticsoft.BLL.SNS.GroupTopics();
     Maticsoft.BLL.SNS.GroupTopicReply reply = new Maticsoft.BLL.SNS.GroupTopicReply();
     if ((base.currentUser.UserType != "AA") && !string.IsNullOrWhiteSpace(Fm["MediaIds"]))
     {
         string mediaIDs = Fm["MediaIds"];
         string productName = Fm["ShareDes"];
         string str3 = Fm["ImageUrl"];
         string text1 = Fm["VideoRawUrl"];
         string url = Fm["Url"];
         string str5 = Fm["Type"];
         int targetId = Globals.SafeInt(Fm["TargetID"], 0);
         int postID = Globals.SafeInt(Fm["PostID"], 0);
         int topicID = Globals.SafeInt(Fm["TopicID"], 0);
         int num4 = Globals.SafeInt(Fm["AlumbID"], 0);
         int replyID = Globals.SafeInt(Fm["ReplyId"], 0);
         if (num4 > 0)
         {
             url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/Album/Details?AlbumID=", num4 });
         }
         if (postID > 0)
         {
             Maticsoft.Model.SNS.Posts model = posts.GetModel(postID);
             if (model != null)
             {
                 if (model.Type == 1)
                 {
                     str5 = "Photo";
                     targetId = model.TargetId;
                     if (string.IsNullOrEmpty(productName))
                     {
                         productName = "分享图片";
                     }
                 }
                 else if (model.Type == 2)
                 {
                     str5 = "Product";
                     targetId = model.TargetId;
                     if (string.IsNullOrEmpty(productName))
                     {
                         productName = model.ProductName;
                     }
                 }
                 else if (model.Type == 0)
                 {
                     str5 = "Weibo";
                     productName = string.IsNullOrEmpty(model.Description) ? "分享图片" : model.Description;
                 }
                 str3 = model.ImageUrl.Replace("{0}", "T116x170_");
             }
         }
         if (topicID > 0)
         {
             url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/Group/TopicReply?id=", topicID });
             Maticsoft.Model.SNS.GroupTopics topics2 = topics.GetModel(topicID);
             str3 = (topics2 != null) ? topics2.ImageUrl : "";
         }
         if (replyID > 0)
         {
             url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/Group/TopicReply?id=", topicID });
             Maticsoft.Model.SNS.GroupTopicReply reply2 = reply.GetModel(replyID);
             str3 = (reply2 != null) ? reply2.PhotoUrl : "";
         }
         if ((!string.IsNullOrEmpty(str3) && (str3.Split(new char[] { '|' }).Length > 2)) && (str5 != "Product"))
         {
             str3 = "http://" + Globals.DomainFullName + str3.Split(new char[] { '|' })[0];
         }
         if (str5 == "Weibo")
         {
             url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/User/Posts/", base.currentUser.UserID });
         }
         else if ((str5 == "Photo") || (str5 == "Product"))
         {
             url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/Detail/", str5, "/", targetId });
         }
         try
         {
             bind.SendWeiBo(base.currentUser.UserID, mediaIDs, productName, url, str3);
         }
         catch (Exception exception)
         {
             base.Response.Write(exception);
         }
     }
 }
Esempio n. 3
0
 public ActionResult Topics(string keyword, string type, int? pageIndex)
 {
     ((dynamic) base.ViewBag).Title = "帖子搜索";
     keyword = InjectionFilter.Filter(keyword);
     new Maticsoft.BLL.SNS.Groups();
     Maticsoft.BLL.SNS.GroupTopics topics = new Maticsoft.BLL.SNS.GroupTopics();
     pageIndex = new int?((pageIndex.HasValue && (pageIndex.Value > 1)) ? pageIndex.Value : 1);
     int pageSize = 10;
     int startIndex = (pageIndex.Value > 1) ? (((pageIndex.Value - 1) * pageSize) + 1) : 0;
     int endIndex = pageIndex.Value * pageSize;
     int totalItemCount = 0;
     totalItemCount = topics.GetCountByKeyWord(keyword, -1);
     int? nullable = pageIndex;
     PagedList<Maticsoft.Model.SNS.GroupTopics> model = new PagedList<Maticsoft.Model.SNS.GroupTopics>(topics.SearchTopicByKeyWord(startIndex, endIndex, keyword, 0, type), nullable.HasValue ? nullable.GetValueOrDefault() : 1, pageSize, totalItemCount);
     if (base.Request.IsAjaxRequest())
     {
         return this.PartialView(base.CurrentThemeViewPath + "/Search/TopicList.cshtml", model);
     }
     ((dynamic) base.ViewBag).sequence = (type == "newreply") ? "newreply" : "newpost";
     return base.View(base.CurrentThemeViewPath + "/Search/Topic.cshtml", model);
 }
Esempio n. 4
0
 public ActionResult AJaxCreateTopic(FormCollection fm)
 {
     string str = InjectionFilter.Filter((fm["Title"] != null) ? fm["Title"].ToString() : "");
     string str2 = (fm["Des"] != null) ? fm["Des"].ToString() : "";
     long pid = Globals.SafeLong(fm["Pid"], (long) 0L);
     string imageUrl = "";
     if (pid == 0L)
     {
         imageUrl = (fm["ImageUrl"] != null) ? fm["ImageUrl"].ToString() : "";
     }
     int num2 = Globals.SafeInt(fm["GroupId"], 0);
     if (!string.IsNullOrEmpty(str) && !string.IsNullOrEmpty(str2))
     {
         Maticsoft.BLL.SNS.GroupTopics topics = new Maticsoft.BLL.SNS.GroupTopics();
         Maticsoft.Model.SNS.GroupTopics tModel = new Maticsoft.Model.SNS.GroupTopics {
             Title = str,
             Description = str2
         };
         string savePath = "/Upload/SNS/Images/Group/" + DateTime.Now.ToString("yyyyMMdd") + "/";
         string saveThumbsPath = "/Upload/SNS/Images/GroupThumbs/" + DateTime.Now.ToString("yyyyMMdd") + "/";
         tModel.ImageUrl = Maticsoft.BLL.SNS.Photos.MoveImage(imageUrl, savePath, saveThumbsPath);
         tModel.GroupID = num2;
         tModel.GroupName = "";
         tModel.CreatedDate = DateTime.Now;
         tModel.CreatedUserID = base.currentUser.UserID;
         tModel.CreatedNickName = base.currentUser.NickName;
         if ((tModel.TopicID = topics.AddEx(tModel, pid)) > 0)
         {
             return base.Content(tModel.TopicID.ToString());
         }
         if (tModel.TopicID == -2)
         {
             FormsAuthentication.SignOut();
             base.Session.Remove(Globals.SESSIONKEY_USER);
             base.Session.Clear();
             base.Session.Abandon();
         }
     }
     return base.Content("No");
 }
Esempio n. 5
0
 public PartialViewResult GroupTopic(int Top = 12, string ViewName = "_GroupTopic")
 {
     List<Maticsoft.Model.SNS.GroupTopics> recTopics = new Maticsoft.BLL.SNS.GroupTopics().GetRecTopics(Top);
     return this.PartialView(ViewName, recTopics);
 }