コード例 #1
0
        public void GetDirectoriesByDirectory(int directoryID, Dictionary <int, DiskDirectoryCollection> dirs, string space, string html)
        {
            foreach (int dID in dirs.Keys)
            {
                if (dID == directoryID)
                {
                    foreach (DiskDirectory d in dirs[dID])
                    {
                        int currentID = CurrentDirectory.DirectoryID;

                        bool   isCurrent = MenuTreeIDs(currentID).Contains(d.DirectoryID);
                        string url       = BbsRouter.GetUrl("my/disk/" + d.DirectoryID);


                        //string dirname = string.Format(html, "%className%", url, space, "%imgPath%", d.DirectoryName);
                        //string className = noselectedClass;
                        //string imgPath = noselectedImg;

                        if (isCurrent)
                        {
                            if (d.DirectoryID == currentID)
                            {
                                //className = selectedClass;
                            }

                            //imgPath = selectedImg;
                        }

                        GetDirectoriesByDirectory(d.DirectoryID, dirs, space + tempSpace, html);
                    }
                }
            }
        }
コード例 #2
0
ファイル: current.aspx.cs プロジェクト: zhangbo27/bbsmax
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (_Request.IsClick("getprize"))
            {
                int?missionID = _Request.Get <int>("missionid");

                if (missionID != null)
                {
                    MissionBO.Instance.GetMissionPrize(My, missionID.Value);

                    BbsRouter.JumpToCurrentUrl();
                }
            }
            else if (_Request.IsClick("abandon"))
            {
                int?missionID = _Request.Get <int>("missionid");

                if (missionID != null)
                {
                    MissionBO.Instance.AbandonMission(My, missionID.Value);

                    BbsRouter.JumpToCurrentUrl();
                }
            }

            int pageNumber = _Request.Get <int>("page", 1);
            int pageSize   = 5;

            m_MissionList = MissionBO.Instance.GetUserMissions(MyUserID, pageNumber, pageSize, out m_MissionCount);

            SetPager("pager1", null, pageNumber, pageSize, m_MissionCount);

            AddNavigationItem("任务", BbsRouter.GetUrl("mission/index"));
            AddNavigationItem("我的任务");
        }
コード例 #3
0
        public static string GetSystemForumUrlForPager(SystemForum systemForumType, string codeName)
        {
            return(BbsRouter.GetUrl(string.Format("systemforum/{0}/code-{1}/{2}", systemForumType.ToString(), codeName, "{0}")));
            //string forumUrl = UrlManager.GetFriendlyUrl("ShowSystemForum.html?type={0}&Codename={1}&page={2}", true);

            //return string.Format(forumUrl, systemForumType.ToString(), codeName, "{0}");
        }
コード例 #4
0
ファイル: club-create.aspx.cs プロジェクト: zhangbo27/bbsmax
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ClubName       = _Request.Get("ClubName", MaxLabs.WebEngine.Method.Post);
        m_ClubCategoryID = _Request.Get <int>("ClubCategoryID", MaxLabs.WebEngine.Method.Post, 0);

        if (_Request.IsClick("step2"))
        {
            MessageDisplay md = CreateMessageDisplay();

            using (ErrorScope es = new ErrorScope())
            {
                int newClubID = 0;

                if (ClubBO.Instance.CreateClub(MyUserID, m_ClubCategoryID, m_ClubName, out newClubID))
                {
                    BbsRouter.JumpTo("club/" + newClubID + "/setting");
                }
                else
                {
                    es.CatchError <ErrorInfo>(delegate(ErrorInfo error) {
                        md.AddError(error);
                    });

                    m_HasError = true;
                }
            }
        }

        m_ClubCategoryList = ClubBO.Instance.GetClubCategories();
    }
コード例 #5
0
        public static string GetForumUrl(string codeName, string action, int page)
        {
            return(BbsRouter.GetUrl(string.Format("{0}/{1}-{2}", codeName, action, page)));
            //string forumUrl = UrlManager.GetFriendlyUrl("ShowForum.html?codename={0}&action={1}&page={2}", true);

            //return string.Format(forumUrl, codeName, action, page);
        }
コード例 #6
0
        public static string GetThreadCatalogUrl(string codeName, int threadCatalogID, int page)
        {
            return(BbsRouter.GetUrl(string.Format("{0}/catalog-{1}-{2}", codeName, threadCatalogID, page)));
            //string catalogUrl = UrlManager.GetFriendlyUrl("ShowForum.html?codename={0}&ThreadCatalogID={1}&page={2}", true);

            //return string.Format(catalogUrl, codeName, threadCatalogID, page);
        }
コード例 #7
0
ファイル: index.aspx.cs プロジェクト: zhangbo27/bbsmax
        protected string GetDiskMenu(string space, string html, string selectedImg, string noselectedImg, string selectedClass, string noselectedClass, string dirNameStr, string rootNameStr)
        {
            tempSpace  = space;
            menuString = string.Empty;
            int dID = CurrentDirectory.DirectoryID;

            m_ParentDirectories = DiskBO.Instance.GetParentDiskDirectories(MyUserID, dID);
            DiskDirectory root = DiskBO.Instance.GetDiskRootDirectory(MyUserID);

            string rootstr = string.Empty;

            if (root == null || root.DirectoryID <= 0)
            {
                rootstr = string.Format(html, selectedClass, BbsRouter.GetUrl("app/disk/index") + "?directoryID=" + CurrentDirectory.DirectoryID + "&ViewMode=" + ViewMode, rootNameStr);// UrlHelper.GetDiskCenterUrl(), rootNameStr);

                return(rootstr);
            }

            rootstr = string.Format(html, ((root.DirectoryID == dID || dID == 0) ? selectedClass : noselectedClass), BbsRouter.GetUrl("app/disk/index") + "?ViewMode=" + ViewMode, rootNameStr);// UrlHelper.GetDiskCenterUrl(), rootNameStr);

            menuString += rootstr;

            html = string.Format(html, "{0}", "{1}", "{2}" + dirNameStr);

            GetDirectoriesByDirectory(root.DirectoryID, m_ParentDirectories, space,
                                      html, selectedImg, noselectedImg, selectedClass, noselectedClass);

            return(menuString);
        }
コード例 #8
0
ファイル: SpacePageBase.cs プロジェクト: zhangbo27/bbsmax
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (AllSettings.Current.SpaceSettings.AllowGuestAccess == false)
            {
                if (MyUserID <= 0)
                {
                    ShowError(new Errors.CustomError("", "您必须登录后才能访问用户空间"), BbsRouter.GetUrl("login"));
                }
            }

            if (EnableFunction == false)
            {
                BbsRouter.JumpTo("space/" + SpaceOwnerID);
            }


            if (SpaceOwner == null)
            {
                ShowError("用户空间不存在");
            }

            OnlineUserPool.Instance.Update(My, _Request, OnlineAction.ViewSpace, 0, 0, "");
        }
コード例 #9
0
ファイル: ImpressionNotify.cs プロジェクト: zhangbo27/bbsmax
 public ImpressionNotify(int relateUserID, int userID)
     : base(0, false)
 {
     this.RelateUserID = relateUserID;
     this.UserID       = userID;
     Url = BbsRouter.GetUrl("space/" + this.UserID) + "?implist=1#implist";
 }
コード例 #10
0
ファイル: PropSaledNotify.cs プロジェクト: zhangbo27/bbsmax
 public PropSaledNotify(int relateUserID, int propID, int propCount)
 {
     this.RelateUserID = relateUserID;
     this.PropID       = propID;
     this.PropCount    = propCount;
     this.Url          = BbsRouter.GetUrl("prop/my");
 }
コード例 #11
0
ファイル: index.aspx.cs プロジェクト: zhangbo27/bbsmax
        public void GetDirectoriesByDirectory(int directoryID, Dictionary <int, DiskDirectoryCollection> dirs, string space, string html, string selectedImg, string noselectedImg, string selectedClass, string noselectedClass)
        {
            foreach (int dID in dirs.Keys)
            {
                if (dID == directoryID)
                {
                    foreach (DiskDirectory d in dirs[dID])
                    {
                        int currentID = CurrentDirectory.DirectoryID;

                        bool   isCurrent = MenuTreeIDs(currentID).Contains(d.DirectoryID);
                        string url       = BbsRouter.GetUrl("app/disk/index") + "?directoryID=" + d.DirectoryID + "&ViewMode=" + ViewMode;


                        string dirname   = string.Format(html, "%className%", url, space, "%imgPath%", d.DirectoryName);
                        string className = noselectedClass;
                        string imgPath   = noselectedImg;

                        if (isCurrent)
                        {
                            if (d.DirectoryID == currentID)
                            {
                                className = selectedClass;
                            }

                            imgPath = selectedImg;
                        }

                        menuString += dirname.Replace("%className%", className).Replace("%imgPath%", imgPath);
                        GetDirectoriesByDirectory(d.DirectoryID, dirs, space + tempSpace, html, selectedImg, noselectedImg, selectedClass, noselectedClass);
                    }
                }
            }
        }
コード例 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int?clubID   = _Request.Get <int>("id");
            int?notifyID = _Request.Get <int>("notifyid");

            if (clubID != null && notifyID != null)
            {
                Club club = ClubBO.Instance.GetClub(clubID.Value);

                if (club != null)
                {
                    m_ClubName = club.Name;

                    if (_Request.IsClick("join"))
                    {
                        ClubBO.Instance.AcceptClubInvite(club, My);

                        NotifyBO.Instance.DeleteNotify(My, notifyID.Value);

                        m_DisplayMessage = true;
                        m_Message        = "您已成功的加入群组“<a href=\"" + BbsRouter.GetUrl("club/" + clubID) + "\" target=\"_blank\">" + club.Name + "</a>”。";
                    }
                }
                else
                {
                    ShowError("群组不存在");
                }
            }
            else
            {
                ShowError("缺少必要参数");
            }
        }
コード例 #13
0
        public static string GetLastThreadUrl(string codeName, int threadID, string threadType, int lastPostID, int page, bool isLast)
        {
            string last = isLast ? ("last") : (lastPostID.ToString());

            return(BbsRouter.GetUrl(string.Format("{0}/{3}-{1}-{2}", codeName, threadID, page, threadType)) + "#" + last);
            //string threadUrl = UrlManager.GetFriendlyUrl("ShowThread.html?codename={0}&ThreadID={1}&page={2}", true);
            //return string.Format(threadUrl, codeName, threadID, page) + (isLast ? ("#last") : ("#" + lastPostID));
        }
コード例 #14
0
 //public static string GetThreadUrlForPager(string codeName, int threadID, int userID)
 //{
 //    return GetThreadUrlForPager(codeName,threadID,userID,1);
 //}
 public static string GetThreadUrlForPager(string codeName, int threadID, int userID, int listPage, string threadTypeString)
 {
     return(BbsRouter.GetUrl(string.Format("{0}/{4}-{1}-{2}-{3}", codeName, threadID, "{0}", listPage, threadTypeString)) + "?userid=" + userID);
     //return GetThreadUrl(codeName, threadID, listPage) + "?userid=" + userID + "&page={0}";
     //return BbsRouter.GetUrl(string.Format("showthread/{0}/tid-{1}/{2}/lp-{4}/uid-{3}", codeName, threadID, "{0}", userID, listPage));
     //string threadUrl = UrlManager.GetFriendlyUrl("ShowThread.html?codename={0}&ThreadID={1}&page={2}&userID={3}&listPage={4}", true);
     //return string.Format(threadUrl, codeName, threadID, "{0}", userID, listPage);
 }
コード例 #15
0
 /// <summary>
 /// 验证码图片地址
 /// </summary>
 /// <param name="type">动作类型或者验证码类型</param>
 /// <param name="isValidateCodeType">type 是否是“验证码类型”</param>
 /// <param name="id">
 /// 如果同一个页面 出现两个及两个以上相同动作的验证码
 /// 需要指定一个区别的标志(如: 输入框名字必须为 "{$inputName}id" id任意指定 不重复)
 /// 如果没有相同动作的验证码 则传null
 /// </param>
 /// <returns></returns>
 public static string GetValidateCodeImageUrl(string type, bool isValidateCodeType, string id)
 {
     if (id == null)
     {
         id = string.Empty;
     }
     return(BbsRouter.GetUrl(Consts.ValidateCode_ImageUrl, string.Format(Consts.ValidateCode_ImageUrlQuery, type, isValidateCodeType ? 1 : 0, id, DateTime.Now.Ticks)));
 }
コード例 #16
0
        protected string GetUrl(object diskDirctoryID)
        {
            UrlScheme scheme = BbsRouter.GetCurrentUrlScheme();

            scheme.AttachQuery("directoryID", diskDirctoryID.ToString());

            return(scheme.ToString(false));
        }
コード例 #17
0
        public static string GetThreadUrlForPagerExtParms(string codeName, int threadID, string threadTypeString, string extParms)
        {
            return(BbsRouter.GetUrl(string.Format("{0}/{4}-{1}-{2}-{3}", codeName, threadID, "{0}", 1, threadTypeString)) + "?extParms=" + System.Web.HttpContext.Current.Server.UrlEncode(extParms));

            //return BbsRouter.GetUrl(string.Format("showthread/{0}/tid-{1}/{2}/ext-{3}", codeName, threadID, "{0}", System.Web.HttpContext.Current.Server.UrlEncode(extParms)));
            //string threadUrl = UrlManager.GetFriendlyUrl("ShowThread.html?codename={0}&ThreadID={1}&page={2}&extParms={3}", true);
            //return string.Format(threadUrl, codeName, threadID, "{0}", System.Web.HttpContext.Current.Server.UrlEncode(extParms));
        }
コード例 #18
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            string url      = null;
            int    urlIndex = 0;

            int notifyID = 0;

            if (context.Request.QueryString["ui"] != null)
            {
                int.TryParse(context.Request.QueryString["ui"], out urlIndex);
            }


            if (int.TryParse(context.Request.QueryString["notifyID"], out notifyID))
            {
                AuthUser user   = User.Current;
                Notify   notify = NotifyBO.Instance.GetNotify(UserBO.Instance.GetCurrentUserID(), notifyID);

                if (notifyID < 0)
                {
                    NotifyBO.Instance.IgnoreSystemNotify(user.UserID, notifyID);
                }
                else
                {
                    if (notify != null && notify.UserID == user.UserID)  //本人,非管理员
                    {
                        NotifyBO.Instance.IgnoreNotifies(user, new int[] { notifyID });
                    }

                    if (notify != null)
                    {
                        switch (notify.TypeID)
                        {
                        case (int)FixNotifies.CommentNotify:
                            CommentNotify cn = new CommentNotify(notify);
                            url = cn.Url;
                            break;

                        default:
                            if (notify.Urls.Length > 0 && notify.Urls.Length >= urlIndex)
                            {
                                url = notify.Urls[urlIndex];
                            }
                            break;
                        }
                    }

                    if (notify != null && !string.IsNullOrEmpty(url))
                    {
                        context.Response.Redirect(url);
                    }
                    else
                    {
                        context.Response.Redirect(BbsRouter.GetIndexUrl());
                    }
                }
            }
        }
コード例 #19
0
        private void SaveSetting()
        {
            MessageDisplay msgDisplay = CreateMessageDisplay("executetime", "days");

            DeleteOperationLogJobSettings setting = new DeleteOperationLogJobSettings();

            string valueString = _Request.Get("executetime", Method.Post, string.Empty);
            int    value;

            if (!int.TryParse(valueString, out value))
            {
                msgDisplay.AddError("executetime", Lang_Error.Feed_FeedJobExecuteTimeFormatError);
            }
            else if (value < 0 || value > 23)
            {
                msgDisplay.AddError("executetime", Lang_Error.Feed_FeedJobInvalidExecuteTimeError);
            }
            else
            {
                setting.ExecuteTime = value;
            }


            setting.SaveLogDays   = _Request.Get <int>("SaveDays", Method.Post, 30);
            setting.DataClearMode = _Request.Get <JobDataClearMode>("DataClearMode", JobDataClearMode.Disabled);
            setting.SaveLogRows   = _Request.Get <int>("SaveRows", Method.Post, 10000);

            if (msgDisplay.HasAnyError())
            {
                return;
            }

            try
            {
                using (new ErrorScope())
                {
                    bool success = SettingManager.SaveSettings(setting);

                    if (!success)
                    {
                        CatchError <ErrorInfo>(delegate(ErrorInfo error)
                        {
                            msgDisplay.AddError(error);
                        });
                    }
                    else
                    {
                        string rawUrl = Request.RawUrl;

                        BbsRouter.JumpToUrl(rawUrl, "success=1");
                    }
                }
            }
            catch (Exception ex)
            {
                msgDisplay.AddError(ex.Message);
            }
        }
コード例 #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int?typeid = _Request.Get <int>("tid", Method.Get);

            if (typeid != null)
            {
                AdminImpressionRecordFilter filter = AdminImpressionRecordFilter.GetFromForm();

                filter.TypeID = typeid.Value;

                UrlScheme scheme = BbsRouter.GetCurrentUrlScheme();

                scheme.RemoveQuery("tid");
                scheme.AttachQuery("filter", filter.ToString());
                scheme.AttachQuery("page", "1");

                HttpContext.Current.Response.Redirect(scheme.ToString());
            }

            m_AdminForm = AdminImpressionRecordFilter.GetFromFilter("filter");

            if (_Request.IsClick("advancedsearch"))
            {
                SearchTypes();
            }
            else if (_Request.IsClick("deletechecked"))
            {
                DeleteChecked();
            }
            else if (_Request.IsClick("deletesearched"))
            {
                DeleteSearch();
            }

            using (ErrorScope es = new ErrorScope())
            {
                int pageNumber = _Request.Get <int>("page", 0);

                m_RecordListPageSize = m_AdminForm.PageSize;

                m_RecordList = ImpressionBO.Instance.GetImpressionRecordsForAdmin(My, m_AdminForm, pageNumber);

                if (m_RecordList != null)
                {
                    m_TotalRecordCount = m_RecordList.TotalRecords;
                }

                if (es.HasUnCatchedError)
                {
                    es.CatchError <ErrorInfo>(delegate(ErrorInfo error)
                    {
                        ShowError(error);
                    });
                }

                UserBO.Instance.WaitForFillSimpleUsers <ImpressionRecord>(m_RecordList, 0);
            }
        }
コード例 #21
0
        public SharePostNotify(int relateUserID, int targetID, int commentID, bool isReply, int spaceOwnerID)
            : base(commentID, isReply)
        {
            this.TargetID     = targetID;
            this.RelateUserID = relateUserID;
            this.SpaceOwnerID = spaceOwnerID;

            Url = BbsRouter.GetUrl("app/share");// (TargetID) + "#comment_" + CommentID + "_li";
        }
コード例 #22
0
        public static string GetArchiverIndexUrl()
        {
//#if V5
//            return Globals.AppRoot + "/archiver/default.aspx";
//#else
            return(BbsRouter.GetUrl("archiver/default"));
//#endif
            //return UrlManager.GetFriendlyUrl("Archiver_Default.html", true);
        }
コード例 #23
0
        public BoardCommentNotify(int relateUserID, int commentID, bool isReply, int spaceOwnerID)
            : base(commentID, isReply)
        {
            this.RelateUserID = relateUserID;
            this.TargetID     = spaceOwnerID;
            this.SpaceOwnerID = spaceOwnerID;

            Url = BbsRouter.GetUrl("space/board-list", "uid=" + SpaceOwnerID) + "#comment_" + CommentID + "_li";
        }
コード例 #24
0
        /// <summary>
        /// 获取搜索结果后确认跳转,后带搜索条件的参数
        /// </summary>
        /// <param name="formName">搜索条件网址参数名称</param>
        /// <param name="filterValue">序列化的搜索条件值</param>
        public void Apply(string filterParamName, string pageParamName)
        {
            UrlScheme scheme = BbsRouter.GetCurrentUrlScheme();

            scheme.AttachQuery(filterParamName, this.ToString());
            scheme.AttachQuery(pageParamName, "1");

            HttpContext.Current.Response.Redirect(scheme.ToString());
        }
コード例 #25
0
ファイル: friends.aspx.cs プロジェクト: zhangbo27/bbsmax
        private void Query()
        {
            int    groupID   = _Request.Get <int>("groupid", -1);
            string queryName = _Request.Get("queryname");

            BbsRouter.JumpTo("friends/group-" + groupID + "/" + queryName);

            //Response.Redirect("~/max-templates/default/friends.aspx?groupid=" + groupID + "&queryname=" + queryName + "");
        }
コード例 #26
0
        public static string GetLastThreadUrl(string codeName, int threadID, string threadType, int lastPostID, int page, string searthText, bool isLast)
        {
            string last = isLast ? ("last") : (lastPostID.ToString());

            return(BbsRouter.GetUrl(string.Format("{0}/{3}-{1}-{2}", codeName, threadID, page, threadType)) + "?SearchText=" + searthText + "#" + last);
            //return BbsRouter.GetUrl(string.Format("showthread/{0}/tid-{1}/{2}/keyword-{3}", codeName, threadID, page, searthText)) + "?#" + last;
            //string threadUrl = UrlManager.GetFriendlyUrl("ShowThread.html?codename={0}&ThreadID={1}&page={2}&SearchText={3}", true);
            //return string.Format(threadUrl, codeName, threadID, page, searthText) + (isLast ? ("#last") : ("#" + lastPostID));
        }
コード例 #27
0
        public static string GetArchiverThreadUrlForPager(string codeName, int threadID)
        {
//#if V5
//            return Globals.AppRoot + "/archiver/showthread.aspx?codename=" + codeName + "&threadid=" + threadID + "&page={0}";
//#else
            return(BbsRouter.GetUrl(string.Format("archiver/{0}/thread-{1}-{2}", codeName, threadID, "{0}")));
            //string threadUrl = UrlManager.GetFriendlyUrl("Archiver_ShowThread.html?codename={0}&ThreadID={1}&page={2}", true);
            //return string.Format(threadUrl, codeName, threadID, "{0}");
//#endif
        }
コード例 #28
0
        //--------------------------------------------------------------------------------
        public static string GetArchiverForumUrl(string codeName)
        {
//#if V5
//            return Globals.AppRoot + "/archiver/showforum.aspx?codename=" + codeName;
//#else
            // return GetArchiverForumUrl(codeName, 1);
            return(BbsRouter.GetUrl(string.Format("archiver/{0}/list-{1}", codeName, 1)));
//#endif
            //return string.Format(UrlManager.GetFriendlyUrl("Archiver_ShowForum.html?codename={0}", true), codeName);
        }
コード例 #29
0
 public RecoverPasswordEmail(string toEmail, string username, string serial)
     : base(
         toEmail,
         AllSettings.Current.RecoverPasswordSettings.EmailTitle,
         AllSettings.Current.RecoverPasswordSettings.EmailContent
         )
 {
     this.Render.RegisterVariable("username", username);
     this.Render.RegisterVariable("url", Globals.SiteRoot + BbsRouter.GetUrl("recoverpassword", "serial=" + serial));  //Globals.AbsoluteWebRoot + "recoverpassword.aspx?serial=" + serial);
 }
コード例 #30
0
        public static string GetThreadManageLogsUrl(string codeName, int searchType, string keyWord)
        {
            return(BbsRouter.GetUrl("threadmanagelogs") + "?codename=" + codeName + "&searchType=" + searchType + "&keyWord=" + keyWord);

            //return BbsRouter.GetUrl(string.Format("threadmanagelogs/{0}/{1}/{2}",codeName,searchType,keyWord));

            //string url = UrlManager.GetFriendlyUrl("ThreadManageLogs.html?codename={0}&searchType={1}&keyWord={2}");

            //return string.Format(url, codeName, searchType.ToString(), keyWord);
        }