Ejemplo n.º 1
0
        public static void ParsePostListExtraInfo(PostpramsInfo postpramsInfo, List<Attachment> attachList, bool isModer, List<Post> postList)
        {
            int hide = postpramsInfo.Hide;
            int allowGetAttachValue = Posts.GetAllowGetAttachValue(postpramsInfo);
            var guest = UserGroup.Guest;
            //var topicInfo = postpramsInfo.Topicinfo;
            //if (postpramsInfo.Topicinfo == null) topicInfo = Topic.FindByID(postpramsInfo.Tid);
            var topicInfo = Topic.FindByID(postpramsInfo.Tid);

            string stringarray = string.Empty;
            if (topicInfo.Special == 4 && !guest.AllowDiggs)
            {
                stringarray = Debatedigg.GetUesrDiggs(postpramsInfo.Tid, postpramsInfo.CurrentUserid);
            }
            foreach (var pi in postList)
            {
                Posts.LoadPostMessage(postpramsInfo, attachList, isModer, allowGetAttachValue, hide, pi);
                if (topicInfo.Special == 4)
                {
                    if (guest.AllowDiggs)
                    {
                        pi.Digged = Debates.IsDigged(pi.ID, postpramsInfo.CurrentUserid);
                    }
                    else
                    {
                        pi.Digged = Utils.InArray(pi.ID.ToString(), stringarray);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public static bool IsDigged(int pid, int userid)
 {
     if (!UserGroup.Guest.AllowDiggs)
     {
         //return !DatabaseProvider.GetInstance().AllowDiggs(pid, userid);
         return(Debatedigg.FindByPidAndUid(pid, userid) != null);
     }
     if (Utils.StrIsNullOrEmpty(Utils.GetCookie("debatedigged")))
     {
         return(false);
     }
     string[] array = Utils.GetCookie("debatedigged").Split(',');
     for (int i = 0; i < array.Length; i++)
     {
         string expression = array[i];
         if (pid == expression.ToInt(0))
         {
             return(true);
         }
     }
     return(false);
 }