Example #1
0
 public void BindData()
 {
     this.smilesgrid.AllowCustomPaging = false;
     this.smilesgrid.TableHeaderName   = "论坛表情列表";
     //this.smilesgrid.BindData(Smilies.GetSmilieByType(DNTRequest.GetInt("typeid", 0)));
     this.smilesgrid.BindData <Smilie>(Smilie.FindAllByType(DNTRequest.GetInt("typeid", 0)));
 }
Example #2
0
        private void SmilesGridBind()
        {
            string text          = Smilie.ClearEmptySmiliesType();
            var    smilesDirList = this.GetSmilesDirList();
            var    array         = smilesDirList;

            for (int i = 0; i < array.Length; i++)
            {
                var directoryInfo = array[i];
                this.dirList.Add(directoryInfo.Name);
            }
            string text2 = "";

            foreach (var sm in Smilie.GetSmiliesTypes())
            {
                this.dirList.Remove(sm.Url);
                text2 = text2 + sm.Code + ",";
            }
            this.smilesgrid.TableHeaderName = "论坛表情列表";
            //this.smilesgrid.BindData(Smilies.GetSmilies());
            smilesgrid.BindData <Smilie>(Smilie.FindAllWithCache());
            this.ViewState["dir"]     = text2;
            this.ViewState["dirList"] = this.dirList;
            if (text != "")
            {
                base.RegisterStartupScript("", "<script>alert('" + text + " 为空,已经被移除!');</script>");
            }
        }
Example #3
0
 private void AddSmileInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         var typeid = WebHelper.RequestInt("typeid");
         var sm     = Smilie.FindByID(typeid);
         AdminForums.CreateSmilies(int.Parse(this.displayorder.Text), typeid, this.code.Text, sm.Url + "/" + this.url.UpdateFile(), this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
         base.RegisterStartupScript("PAGE", "window.location.href='forum_smilegrid.aspx?typeid=" + typeid + "';");
     }
 }
Example #4
0
        private void GetSmilies()
        {
            if (ForumUtils.IsCrossSitePost())
            {
                return;
            }

            Response.Clear();
            ResponseText("{" + Smilie.GetSmiliesCache() + "}", true);
        }
Example #5
0
 private void BindFilesList()
 {
     try
     {
         this.fileinfoList.Text = "";
         var typeid = WebHelper.RequestInt("typeid");
         var sm     = Smilie.FindByID(typeid);
         if (sm != null)
         {
             this.fileList = this.GetSmilesFileList(sm.Url);
             string url = sm.Url;
             //var smilieByType = Smilies.GetSmilieByType(typeid);
             var list = Smilie.FindAllByType(sm.ID);
             foreach (var sm2 in list)
             {
                 var viewState = this.ViewState;
                 viewState["code"] = viewState["code"] + "" + sm2.Code + ",";
                 this.fileList.Remove(sm2.Url.Replace(url + "/", ""));
             }
             this.fileList.Remove("Thumbs.db");
             int num = 1;
             foreach (string text in this.fileList)
             {
                 Literal expr_12C = this.fileinfoList;
                 expr_12C.Text += "<tr class='mouseoutstyle' onmouseover='this.className=\"mouseoverstyle\"' onmouseout='this.className=\"mouseoutstyle\"'>\n";
                 Literal expr_147 = this.fileinfoList;
                 object  text2    = expr_147.Text;
                 expr_147.Text = text2 + "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;'><input type='checkbox' id='id" + num + "' name='id" + num + "' value='" + num + "'/></td>\n";
                 Literal expr_1B4 = this.fileinfoList;
                 object  text3    = expr_1B4.Text;
                 expr_1B4.Text = text3 + "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;'><input type='text' id='code" + num + "' name='code" + num + "' value=':" + url + (list.Count + num) + ":' class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" /></td>\n";
                 Literal expr_233 = this.fileinfoList;
                 object  text4    = expr_233.Text;
                 expr_233.Text = text4 + "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;'><input type='text' id='order" + num + "' name='order" + num + "' value='" + num + "' class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" size='4' /></td>\n";
                 Literal expr_2A0 = this.fileinfoList;
                 object  text5    = expr_2A0.Text;
                 expr_2A0.Text = text5 + "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;'><input type='hidden' name='url" + num + "' value='" + url + "/" + text + "' />" + url + "/" + text + "</td>\n";
                 Literal expr_323 = this.fileinfoList;
                 expr_323.Text = expr_323.Text + "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;'>" + this.PicStr(sm.Url + "/" + text) + "</td>\n";
                 Literal expr_35B = this.fileinfoList;
                 expr_35B.Text += "</tr>\n";
                 num++;
             }
             if (this.fileList.Count == 0)
             {
                 this.SubmitButton.Visible = false;
             }
         }
     }
     catch (IOException ex)
     {
         base.RegisterStartupScript("", "<script>alert('" + ex.Message + "');window.location.href='forum_smiliemanage.aspx';</script>");
     }
 }
Example #6
0
        public static void UpdateSmilies(int id, int displayOrder, int type, string code, string url, int adminUid, string adminUserName, int adminUserGruopId, string adminUserGroupTitle, string adminIp)
        {
            //BBX.Data.Smilies.UpdateSmilies(id, displayOrder, type, code);
            var sm = Smilie.FindByID(id);

            sm.DisplayOrder = displayOrder;
            sm.Type         = type;
            sm.Code         = code;
            sm.Update();

            ResetCacheObjectAboutSmilies();
            AdminVisitLog.InsertLog(adminUid, adminUserName, adminUserGruopId, adminUserGroupTitle, adminIp, "表情文件修改", code);
        }
Example #7
0
        public static Smilie[] GetSmiliesListWithInfo()
        {
            var cacheService = XCache.Current;
            var array        = cacheService.RetrieveObject(CacheKeys.FORUM_UI_SMILIES_LIST_WITH_INFO) as Smilie[];

            if (array == null)
            {
                //array = BBX.Data.GetSmiliesListWithoutType();
                array = Smilie.FindAllWithCache().ToList().Where(e => e.Type != 0).ToArray();
                XCache.Add(CacheKeys.FORUM_UI_SMILIES_LIST_WITH_INFO, array);
                ResetRegexSmilies(array);
            }
            return(array);
        }
Example #8
0
        //public static SmiliesInfo GetSmiliesTypeById(int smiliesId)
        //{
        //    var smiliesTypesInfo = BBX.Data.GetSmiliesTypesInfo();
        //    var array = smiliesTypesInfo;
        //    for (int i = 0; i < array.Length; i++)
        //    {
        //        var smiliesInfo = array[i];
        //        if (smiliesInfo.Id == smiliesId)
        //        {
        //            return smiliesInfo;
        //        }
        //    }
        //    return null;
        //}
        //public static SmiliesInfo GetSmiliesById(int smiliesId)
        //{
        //    var smiliesListWithInfo = GetSmiliesListWithInfo();
        //    var array = smiliesListWithInfo;
        //    for (int i = 0; i < array.Length; i++)
        //    {
        //        var smiliesInfo = array[i];
        //        if (smiliesInfo.Id == smiliesId)
        //        {
        //            return smiliesInfo;
        //        }
        //    }
        //    return null;
        //}
        //public static DataTable GetSmiliesTypes()
        //{
        //    return BBX.Data.GetSmiliesTypes();
        //}
        //public static DataTable GetSmilieByType(int typeId)
        //{
        //    if (typeId <= 0)
        //    {
        //        return new DataTable();
        //    }
        //    return BBX.Data.GetSmiliesInfoByType(typeId);
        //}
        //public static string ClearEmptySmiliesType()
        //{
        //    string text = "";
        //    DataTable smiliesTypes = BBX.Data.GetSmiliesTypes();
        //    foreach (DataRow dataRow in smiliesTypes.Rows)
        //    {
        //        if (BBX.Data.GetSmiliesInfoByType(int.Parse(dataRow["id"].ToString())).Rows.Count == 0)
        //        {
        //            text = text + dataRow["code"].ToString() + ",";
        //            BBX.Data.DeleteSmilies(dataRow["id"].ToString());
        //        }
        //    }
        //    return text.TrimEnd(',');
        //}
        //public static int GetMaxSmiliesId()
        //{
        //    return BBX.Data.GetMaxSmiliesId();
        //}
        //public static DataTable GetSmilies()
        //{
        //    return BBX.Data.GetSmilies();
        //}
        public static bool IsExistSameSmilieCode(string code, int currentid)
        {
            //foreach (DataRow dataRow in BBX.Data.GetSmiliesListDataTable().Rows)
            //{
            //    if (dataRow["code"].ToString() == code && dataRow["id"].ToString() != currentid.ToString())
            //    {
            //        return true;
            //    }
            //}
            //return false;

            var sm = Smilie.FindByCode(code);

            return(sm != null && sm.ID != currentid);
        }
Example #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         string arg    = "";
         var    typeid = WebHelper.RequestInt("typeid");
         //foreach (var sm in Smilie.FindAllWithCache())
         //{
         //    if (sm.ID == typeid)
         //    {
         //        arg = sm.Url;
         //    }
         //}
         var sm = Smilie.FindByID(typeid);
         if (sm != null)
         {
             arg = sm.Url;
         }
         this.url.UpFilePath = base.Server.MapPath(string.Format("../../editor/images/smilies/{0}/", arg));
     }
 }
Example #10
0
 protected void DelRec_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         string[] array = Request["id"].Split(',');
         if (this.smilesgrid.Items.Count == array.Length)
         {
             base.RegisterStartupScript("", "<script>alert('请至少保留一组默认表情,或者添加一组新表情后,再删除本组表情!');window.location.href='forum_smiliemanage.aspx';</script>");
             return;
         }
         string[] array2 = array;
         for (int i = 0; i < array2.Length; i++)
         {
             string text = array2[i];
             AdminForums.DeleteSmilies(text, this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
             this.smilesgrid.EditItemIndex = -1;
             this.SmilesGridBind();
             Smilie.FindAllByType(int.Parse(text)).Delete();
         }
         base.RegisterStartupScript("", "<script>window.location.href='forum_smiliemanage.aspx';</script>");
     }
 }
Example #11
0
 public void SubmitButton_Click(object sender, EventArgs e)
 {
     for (int i = 1; i <= this.dirList.Count; i++)
     {
         if (DNTRequest.GetFormString("id" + i) != null && DNTRequest.GetFormString("id" + i) != "")
         {
             AdminForums.CreateSmilies(DNTRequest.GetInt("order" + i, 0), 0, DNTRequest.GetFormString("group" + i), DNTRequest.GetFormString("url" + i), this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
             int       type           = Smilie.GetMaxSmiliesId() - 1;
             int       num            = 1;
             string    formString     = DNTRequest.GetFormString("url" + i);
             ArrayList smilesFileList = this.GetSmilesFileList(DNTRequest.GetFormString("url" + i));
             foreach (string text in smilesFileList)
             {
                 if (!(text.ToLower() == "thumbs.db"))
                 {
                     AdminForums.CreateSmilies(num, type, ":" + formString + num + ":", formString + "/" + text, this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
                     num++;
                 }
             }
         }
     }
     base.RegisterStartupScript("", "<script>window.location.href='forum_smiliemanage.aspx';</script>");
 }
Example #12
0
 public static void DeleteSmilies(string idList, int adminUid, string adminUserName, int adminUserGruopId, string adminUserGroupTitle, string adminIp)
 {
     Smilie.DeleteSmilies(idList);
     ResetCacheObjectAboutSmilies();
     AdminVisitLog.InsertLog(adminUid, adminUserName, adminUserGruopId, adminUserGroupTitle, adminIp, "表情文件删除", "ID:" + idList);
 }
Example #13
0
        //public static void SetForumsStatus()
        //{
        //    //DataTable mainForum = BBX.Data.Forums.GetMainForum();
        //    //foreach (DataRow dataRow in mainForum.Rows)
        //    foreach (var f in XForum.FindAllWithCache().ToList().OrderBy(e => e.DisplayOrder))
        //    {
        //        if (f.Layer != 0) continue;

        //        ChildNode = "0";
        //        //string fidlist = ("," + FindChildNode(f.ID)).Replace(",0,", "");
        //        if (!f.Visible)
        //        {
        //            // 设置子孙状态都是0
        //            //BBX.Data.Forums.UpdateStatusByFidlist(fidlist);
        //            foreach (var item in f.AllChilds)
        //            {
        //                item.Visible = false;
        //                item.Update();
        //            }
        //        }
        //        else //if (f.Status == 1)
        //        {
        //            // 设置子孙状态都是1
        //            //BBX.Data.Forums.UpdateStatusByFidlistOther(fidlist);
        //            foreach (var item in f.AllChilds)
        //            {
        //                item.Visible = true;
        //                item.Update();
        //            }
        //        }
        //        //else
        //        //{
        //        //    //BBX.Data.Forums.SetStatusInForum(4, f.ID);
        //        //    f.Status = 4;
        //        //    f.Update();

        //        //    int num = 5;
        //        //    foreach (var item in f.AllChilds)
        //        //    {
        //        //        item.Status = num++;
        //        //        item.Update();
        //        //    }
        //        //}
        //    }
        //}

        //public static bool BatchSetForumInf(IXForum forumInfo, BatchSetParams bsp, string fidlist)
        //{
        //    return BBX.Data.Forums.BatchSetForumInf(forumInfo, bsp, fidlist);
        //}

        //public static DataTable GetMaxDisplayOrder(int fid)
        //{
        //	return BBX.Data.Forums.GetMaxDisplayOrder(fid);
        //}

        //public static int GetMaxDisplayOrder()
        //{
        //	return BBX.Data.Forums.GetMaxDisplayOrder();
        //}

        //public static void UpdateForumsDisplayOrder(int currentdisplayorder)
        //{
        //	BBX.Data.Forums.UpdateForumsDisplayOrder(currentdisplayorder);
        //}

        //public static void SetSubForumCount(int fid)
        //{
        //	BBX.Data.Forums.SetSubForumCount(fid);
        //}

        public static void CreateSmilies(int displayOrder, int type, string code, string url, int adminUid, string adminUserName, int adminUserGruopId, string adminUserGroupTitle, string adminIp)
        {
            Smilie.Add(type, code, url, displayOrder);
            ResetCacheObjectAboutSmilies();
            AdminVisitLog.InsertLog(adminUid, adminUserName, adminUserGruopId, adminUserGroupTitle, adminIp, "表情文件添加", code);
        }