示例#1
0
        private void refreshTodayStats(ForumApp forum)
        {
            if (time.IsNextDay(forum.TodayTime) == false)
            {
                return;
            }

            int all = forum.TodayTopicCount + forum.TodayPostCount;

            if (all > forum.PeakPostCount)
            {
                forum.PeakPostCount = all;
            }

            forum.YestodayPostCount = forum.TodayTopicCount + forum.TodayPostCount;

            forum.TodayPostCount  = 0;
            forum.TodayTopicCount = 0;
            forum.TodayVisitCount = 0;
            forum.TodayTime       = DateTime.Now;

            forum.update();

            ForumBoard.updateBatch("set TodayTopics=0, TodayPosts=0", "AppId=" + forum.Id);
        }
示例#2
0
        private void updateSettings(ForumApp forum)
        {
            ForumSetting s = forum.GetSettingsObj();

            // 配置:隐藏头条新帖
            s.IsHideTop = 1;

            forum.Settings = Json.ToString(s);
            forum.update();
        }
示例#3
0
        public void SaveNotice()
        {
            String notice = ctx.PostHtml("Notice");

            ForumApp forum = ctx.app.obj as ForumApp;

            forum.Notice = notice;
            forum.update("Notice");

            echoRedirect(lang("opok"));
        }
示例#4
0
        public void Save()
        {
            ForumSetting s = ctx.PostValue <ForumSetting>();

            s.IsHideStats  = ctx.PostIsCheck("forumSetting.HideShowStats");
            s.IsHideTop    = ctx.PostIsCheck("forumSetting.IsHideTop");
            s.IsHideOnline = ctx.PostIsCheck("forumSetting.IsHideOnline");
            s.IsHideLink   = ctx.PostIsCheck("forumSetting.IsHideLink");

            ForumApp app = ctx.app.obj as ForumApp;

            app.Settings = JsonString.ConvertObject(s);
            app.update();

            echoRedirect(lang("opok"));
        }
示例#5
0
        public virtual void Save()
        {
            ForumSetting s = ctx.PostValue <ForumSetting>();

            s.IsHideStats  = ctx.PostIsCheck("forumSetting.HideShowStats");
            s.IsHideTop    = ctx.PostIsCheck("forumSetting.IsHideTop");
            s.IsHideOnline = ctx.PostIsCheck("forumSetting.IsHideOnline");
            s.IsHideLink   = ctx.PostIsCheck("forumSetting.IsHideLink");

            s.MetaDescription = strUtil.CutString(s.MetaDescription, 500);

            ForumApp app = ctx.app.obj as ForumApp;

            app.Settings = Json.ToString(s);
            app.update();

            echoRedirect(lang("opok"));
        }
        private void refreshTodayStats( ForumApp forum )
        {
            if (time.IsNextDay( forum.TodayTime ) == false) return;

            int all = forum.TodayTopicCount + forum.TodayPostCount;
            if (all > forum.PeakPostCount) {
                forum.PeakPostCount = all;
            }

            forum.YestodayPostCount = forum.TodayTopicCount + forum.TodayPostCount;

            forum.TodayPostCount = 0;
            forum.TodayTopicCount = 0;
            forum.TodayVisitCount = 0;
            forum.TodayTime = DateTime.Now;

            forum.update();

            ForumBoard.updateBatch( "set TodayTopics=0, TodayPosts=0", "AppId=" + forum.Id );
        }
示例#7
0
        private void updateSettings( ForumApp forum )
        {
            ForumSetting s = forum.GetSettingsObj();
            // 配置:隐藏头条新帖
            s.IsHideTop = 1;

            forum.Settings = Json.ToString( s );
            forum.update();
        }