Example #1
0
        public virtual String getPreNextHtml(PhotoPost post)
        {
            PhotoPost prev = postService.GetPre(post);
            PhotoPost next = postService.GetNext(post);

            String prenext;

            if (prev == null && next == null)
            {
                prenext = "";
            }
            else if (prev == null)
            {
                prenext = "<a href=\"" + PhotoLink.ToPost(next.Id) + "\">" + alang("nextPhoto") + "</a> ";
            }
            else if (next == null)
            {
                prenext = "<a href=\"" + PhotoLink.ToPost(prev.Id) + "\">" + alang("prevPhoto") + "</a> ";
            }
            else
            {
                prenext = "<a href=\"" + PhotoLink.ToPost(prev.Id) + "\">" + alang("prevPhoto") + "</a> | <a href=\"" + PhotoLink.ToPost(next.Id) + "\">" + alang("nextPhoto") + "</a>";
            }
            return(prenext);
        }
Example #2
0
        public virtual void Post(long id)
        {
            PhotoPost x = ctx.Get <PhotoPost>();

            postService.AddtHits(x);

            ctx.Page.Title    = x.Title;
            ctx.Page.Keywords = x.Tag.TextString;

            User owner = x.Creator;

            if (ctx.viewer.IsFollowing(owner.Id))
            {
                set("lblFollow", "已经关注");
                set("clsFollow", "btnUnFollow");
            }
            else
            {
                set("lblFollow", "关注");
                set("clsFollow", "btnFollow");
            }

            Boolean isLiked = likeService.IsLiked(ctx.viewer.Id, id);

            List <long> ids = new List <long>();

            if (isLiked)
            {
                ids.Add(id);
            }

            PhotoBinder.BindPostSingleFull(ctx, base.utils.getCurrentView(), x, ids);
            set("lnkPrevNext", getPreNextHtml(x));

            bindAlbumPosts(x);
            bindOtherPosts();

            String commentUrl = t2(new wojilu.Web.Controller.Open.CommentController().List)
                                + "?url=" + PhotoLink.ToPost(x.Id)
                                + "&dataType=" + typeof(PhotoPost).FullName
                                + "&dataTitle=" + x.Title
                                + "&dataUserId=" + x.Creator.Id
                                + "&dataId=" + x.Id
                                + "&appId=" + x.AppId;

            set("thisUrl", commentUrl);
        }