private void addNotificationToParent(MicroblogComment c, String microblogLink, int sentId) { if (c.ParentId == 0) { return; } MicroblogComment parent = MicroblogComment.findById(c.ParentId); int receiverId = parent.User.Id; if (c.User.Id == receiverId) { return; } if (receiverId == sentId) { return; } String commentTitle = strUtil.ParseHtml(parent.Content, 30); //String msg = c.User.Name + " 回复了你的微博评论 <a href=\"" + microblogLink + "\">" + commentTitle + "</a>"; String clink = "<a href=\"" + microblogLink + "\">" + commentTitle + "</a>"; String msg = string.Format(lang.get("replyMicroblog"), c.User.Name, clink); nfService.send(receiverId, typeof(User).FullName, msg, NotificationType.Comment); }
public virtual void InsertComment( MicroblogComment c, String microblogLink ) { saveComment( c ); long receiverId = addNotificationToRoot( c, microblogLink ); addNotificationToParent( c, microblogLink, receiverId ); }
public virtual void InsertComment(MicroblogComment c, String microblogLink) { saveComment(c); long receiverId = addNotificationToRoot(c, microblogLink); addNotificationToParent(c, microblogLink, receiverId); }
public virtual void InsertComment( MicroblogComment c, String microblogLink ) { saveComment( c ); copyCommentCountToFeed( c ); int receiverId = addNotificationToRoot( c, microblogLink ); addNotificationToParent( c, microblogLink, receiverId ); }
public virtual void InsertComment(MicroblogComment c, String microblogLink) { saveComment(c); copyCommentCountToFeed(c); int receiverId = addNotificationToRoot(c, microblogLink); addNotificationToParent(c, microblogLink, receiverId); }
public virtual void DeleteTrueBatch(string ids) { int[] arrIds = cvt.ToIntArray(ids); if (arrIds.Length == 0) { return; } MicroblogComment.deleteBatch("id in (" + ids + ")"); }
private void saveComment(Microblog tblog, String content) { MicroblogComment c = new MicroblogComment(); c.Root = tblog; c.Content = content; c.User = ctx.viewer.obj as User; c.Ip = ctx.Ip; commentService.InsertComment(c, to(new MicroblogController().Show, tblog.Id)); }
// 弹窗中的回复窗口 public void Reply(int id) { int parentId = ctx.GetInt("parentId"); set("c.ParentId", parentId); set("c.RootId", id); target(SaveComment, id); MicroblogComment c = commentService.GetById(parentId); String content = "//@" + c.User.Name + ":" + c.Content; set("content", content); }
private int addNotificationToRoot(MicroblogComment c, String microblogLink) { Microblog root = c.Root; int receiverId = root.User.Id; if (c.User.Id == receiverId) { return(0); } String blogTitle = strUtil.ParseHtml(root.Content, 30); String msg = c.User.Name + " " + lang.get("commentYour") + lang.get("microblog") + " <a href=\"" + microblogLink + "\">" + blogTitle + "</a>"; nfService.send(receiverId, typeof(User).FullName, msg, NotificationType.Comment); return(receiverId); }
private void addNotificationToParent(MicroblogComment c, string microblogLink, long sentId) { if (c.ParentId == 0) return; MicroblogComment parent = MicroblogComment.findById( c.ParentId ); long receiverId = parent.User.Id; if (c.User.Id == receiverId) return; if (receiverId == sentId) return; String commentTitle = strUtil.ParseHtml( parent.Content, 30 ); //String msg = c.User.Name + " 回复了你的微博评论 <a href=\"" + microblogLink + "\">" + commentTitle + "</a>"; String clink = "<a href=\"" + microblogLink + "\">" + commentTitle + "</a>"; String msg = string.Format( lang.get( "replyMicroblog" ), c.User.Name, clink ); nfService.send( receiverId, typeof( User ).FullName, msg, NotificationType.Comment ); }
public void commentForm(int id) { target(SaveReply); set("c.RootId", id); set("viewer.PicSmall", ctx.viewer.obj.PicSmall); int parentPanelId = ctx.GetInt("parentPanelId"); if (parentPanelId <= 0) { parentPanelId = id; } set("parentPanelId", parentPanelId); MicroblogComment c = ctx.GetItem("lastComment") as MicroblogComment; int parentId = c == null ? 0 : c.Id; set("c.ParentId", parentId); }
private int saveCommentPrivate(String content) { int rootId = ctx.PostInt("rootId"); int parentId = ctx.PostInt("parentId"); Microblog blog = microblogService.GetById(rootId); MicroblogComment c = new MicroblogComment(); c.Root = blog; c.ParentId = parentId; c.User = (User)ctx.viewer.obj; c.Ip = ctx.Ip; c.Content = content; String microblogLink = Link.To(blog.User, new MicroblogController().Show, blog.Id); commentService.InsertComment(c, microblogLink); return(rootId); }
public void Delete(int id) { if (hasPermission() == false) { echoText(lang("exNoPermission")); return; } MicroblogComment c = MicroblogComment.findById(id); if (c == null) { echoText(lang("exDataNotFound")); return; } c.delete(); echoAjaxOk(); }
private void copyCommentCountToFeed( MicroblogComment c ) { feedService.SetCommentCount( c.Root ); }
public virtual List <MicroblogComment> GetTop(long id, int count) { return(MicroblogComment.find("RootId=" + id).list(count)); }
private void copyCommentCountToFeed(MicroblogComment c) { feedService.SetCommentCount(c.Root); }
private static void saveComment(MicroblogComment c) { db.insert(c); }
private int saveCommentPrivate( String content ) { int rootId = ctx.PostInt( "rootId" ); int parentId = ctx.PostInt( "parentId" ); Microblog blog = microblogService.GetById( rootId ); MicroblogComment c = new MicroblogComment(); c.Root = blog; c.ParentId = parentId; c.User = (User)ctx.viewer.obj; c.Ip = ctx.Ip; c.Content = content; String microblogLink = Link.To( blog.User, new MicroblogController().Show, blog.Id ); commentService.InsertComment( c, microblogLink ); return rootId; }
public virtual DataPage <MicroblogComment> GetComments(int id, int pageSize) { return(MicroblogComment.findPage("RootId=" + id, pageSize)); }
public List <MicroblogComment> GetTop(int id, int count) { return(MicroblogComment.find("RootId=" + id).list(count)); }
public DataPage <MicroblogComment> GetPageByUser(int ownerId, int pageSize) { return(MicroblogComment.findPage("UserId=" + ownerId)); }
public virtual MicroblogComment GetById(int id) { return(MicroblogComment.findById(id)); }
private void saveComment( Microblog tblog, String content ) { MicroblogComment c = new MicroblogComment(); c.Root = tblog; c.Content = content; c.User = ctx.viewer.obj as User; c.Ip = ctx.Ip; commentService.InsertComment( c, to( new MicroblogController().Show, tblog.Id ) ); }
private static void saveComment( MicroblogComment c ) { db.insert( c ); }
private long addNotificationToRoot( MicroblogComment c, String microblogLink ) { Microblog root = c.Root; long receiverId = root.User.Id; if (c.User.Id == receiverId) return 0; String blogTitle = strUtil.ParseHtml( root.Content, 30 ); String msg = c.User.Name + " " + lang.get( "commentYour" ) + lang.get( "microblog" ) + " <a href=\"" + microblogLink + "\">" + blogTitle + "</a>"; nfService.send( receiverId, typeof( User ).FullName, msg, NotificationType.Comment ); return receiverId; }
public virtual DataPage <MicroblogComment> GetSysPage(int pageSize) { return(MicroblogComment.findPage("", pageSize)); }