예제 #1
0
        /// <summary>
        /// 查询条件
        /// </summary>
        //public string condition = "";
        #endregion

        protected override void ShowPage()
        {
            // 得到公告
            announcementlist  = Announcements.GetSimplifiedAnnouncementList(nowdatetime, "2999-01-01 00:00:00");
            announcementcount = 0;
            if (announcementlist != null)
            {
                announcementcount = announcementlist.Rows.Count;
            }

            inforumad = "";

            floatad  = Advertisements.GetFloatAd("indexad", 0);
            doublead = Advertisements.GetDoubleAd("indexad", 0);
            mediaad  = Advertisements.GetMediaAd(templatepath, "indexad", 0);

            if (config.Enablemall <= 1) //开启普通模式
            {
                AddErrLine("当前页面只有在开启商城(高级)模式下才可访问");
                return;
            }

            new_goodsinfocoll = Goods.GetGoodsInfoList(3, 1, "", "goodsid", 1);

            sec_hand_goodsinfocoll = Goods.GetGoodsInfoList(9, 1, DatabaseProvider.GetInstance().GetGoodsQualityCondition((int)MallUtils.OperaCode.Equal, 2), "goodsid", 1);

            one_yuan_goodsinfocoll = Goods.GetGoodsInfoList(9, 1, DatabaseProvider.GetInstance().GetGoodsPriceCondition((int)MallUtils.OperaCode.Equal, 1), "goodsid", 1);

            recommend_goodsinfocoll = Goods.GetGoodsInfoList(10, 1, DatabaseProvider.GetInstance().GetGoodsRecommendCondition((int)MallUtils.OperaCode.Equal, 1), "goodsid", 1);

            goodscategory = GoodsCategories.GetRootGoodsCategoriesJson();

            rootgoodscategoryarray = GoodsCategories.GetShopRootCategory();
        }
예제 #2
0
        /// <summary>
        /// 获取帖子广告信息
        /// </summary>
        public void GetPostAds(int forumid)
        {
            ///得到广告列表
            headerad = Advertisements.GetOneHeaderAd("", forumid);
            footerad = Advertisements.GetOneFooterAd("", forumid);

            pagewordad = Advertisements.GetPageWordAd("", forumid);
            pagead     = Advertisements.GetPageAd("", forumid);
            doublead   = Advertisements.GetDoubleAd("", forumid);
            floatad    = Advertisements.GetFloatAd("", forumid);
            mediaad    = Advertisements.GetMediaAd(templatepath, "", forumid);
            //快速发帖广告
            quickeditorad = Advertisements.GetQuickEditorAD("", forumid);

            //快速编辑器背景广告
            quickbgad = Advertisements.GetQuickEditorBgAd("", forumid);
            if (quickbgad.Length <= 1)
            {
                quickbgad = new string[2] {
                    "", ""
                }
            }
            ;
        }
예제 #3
0
        protected override void ShowPage()
        {
            pagetitle = "首页";
            if (userid > 0 && useradminid > 0)
            {
                AdminGroupInfo admingroupinfo = AdminGroups.GetAdminGroupInfo(usergroupid);
                if (admingroupinfo != null)
                {
                    disablepostctrl = admingroupinfo.Disablepostctrl;
                }
            }

            int toframe = DNTRequest.GetInt("f", 1);

            if (toframe == 0)
            {
                ForumUtils.WriteCookie("isframe", "1");
            }
            else
            {
                toframe = Utils.StrToInt(ForumUtils.GetCookie("isframe"), -1) == -1 ? config.Isframeshow : Utils.StrToInt(ForumUtils.GetCookie("isframe"), -1);
            }

            if (toframe == 2)
            {
                HttpContext.Current.Response.Redirect(BaseConfigs.GetForumPath + "frame.aspx");
                HttpContext.Current.Response.End();
                return;
            }

            if (config.Rssstatus == 1)
            {
                AddLinkRss("tools/rss.aspx", "最新主题");
            }

            OnlineUsers.UpdateAction(olid, UserAction.IndexShow.ActionID, 0, config.Onlinetimeout);

            //if (newpmcount > 0)
            //    pmlist = PrivateMessages.GetPrivateMessageListForIndex(userid,5,1,1);

            if (userid != -1)
            {
                userinfo = Users.GetShortUserInfo(userid);
                if (userinfo == null)
                {
                    userid = -1;
                    ForumUtils.ClearUserCookie("dnt");
                }
                else
                {
                    newpmcount = userinfo.Newpm == 0 ? 0 : newpmcount;
                    lastvisit  = userinfo.Lastvisit.ToString();
                    showpmhint = Convert.ToInt32(userinfo.Newsletter) > 4;
                }
            }

            navhomemenu = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname);

            forumlist      = Forums.GetForumIndexCollection(config.Hideprivate, usergroupid, config.Moddisplay, out totaltopic, out totalpost, out todayposts);
            forumlinkcount = forumlinklist.Rows.Count;

            //个人空间控制
            if (config.Enablespace == 1)
            {
                GetSpacePerm();
            }

            // 获得统计信息
            totalusers       = TypeConverter.StrToInt(Statistics.GetStatisticsRowItem("totalusers"));
            lastusername     = Statistics.GetStatisticsRowItem("lastusername").Trim();
            lastuserid       = TypeConverter.StrToInt(Statistics.GetStatisticsRowItem("lastuserid"));
            yesterdayposts   = TypeConverter.StrToInt(Statistics.GetStatisticsRowItem("yesterdayposts"));
            highestposts     = TypeConverter.StrToInt(Statistics.GetStatisticsRowItem("highestposts"));
            highestpostsdate = Statistics.GetStatisticsRowItem("highestpostsdate").ToString().Trim();
            if (todayposts > highestposts)
            {
                highestposts     = todayposts;
                highestpostsdate = DateTime.Now.ToString("yyyy-M-d");
            }
            totalonline     = onlineusercount;
            showforumonline = false;
            onlineiconlist  = Caches.GetOnlineGroupIconList();
            if (totalonline < config.Maxonlinelist || DNTRequest.GetString("showonline") == "yes")
            {
                showforumonline = true;
                //获得在线用户列表和图标
                onlineuserlist = OnlineUsers.GetOnlineUserCollection(out totalonline, out totalonlineguest, out totalonlineuser, out totalonlineinvisibleuser);
            }

            if (DNTRequest.GetString("showonline") == "no")
            {
                showforumonline = false;
            }

            highestonlineusercount = Statistics.GetStatisticsRowItem("highestonlineusercount");
            highestonlineusertime  = DateTime.Parse(Statistics.GetStatisticsRowItem("highestonlineusertime")).ToString("yyyy-MM-dd HH:mm");
            // 得到公告
            announcementlist  = Announcements.GetSimplifiedAnnouncementList(nowdatetime, "2999-01-01 00:00:00");
            announcementcount = announcementlist != null ? announcementlist.Rows.Count : 0;

            List <IndexPageForumInfo> topforum = new List <IndexPageForumInfo>();

            foreach (IndexPageForumInfo f in forumlist)
            {
                f.Description = UBB.ParseSimpleUBB(f.Description);
                if (f.Layer == 0)
                {
                    topforum.Add(f);
                }
            }

            taglist = config.Enabletag == 1 ? ForumTags.GetCachedHotForumTags(config.Hottagcount) : new TagInfo[0];

            ///得到广告列表
            headerad   = Advertisements.GetOneHeaderAd("indexad", 0);
            footerad   = Advertisements.GetOneFooterAd("indexad", 0);
            inforumad  = Advertisements.GetInForumAd("indexad", 0, topforum, templatepath);
            pagewordad = Advertisements.GetPageWordAd("indexad", 0);
            doublead   = Advertisements.GetDoubleAd("indexad", 0);
            floatad    = Advertisements.GetFloatAd("indexad", 0);
            mediaad    = Advertisements.GetMediaAd(templatepath, "indexad", 0);
            pagead     = Advertisements.GetPageAd("indexad", 0);

            if (userid > 0)
            {
                if (oluserinfo.Newpms < 0)
                {
                    Users.UpdateUserNewPMCount(userid, olid);
                }
            }
        }
예제 #4
0
        private string condition = ""; //查询条件


        protected override void ShowPage()
        {
            if (config.Enablemall == 0) //未启用交易模式
            {
                AddErrLine("系统未开启交易模式, 当前页面暂时无法访问!");
                return;
            }
            else
            {
                goodscategoryfid = Discuz.Mall.GoodsCategories.GetGoodsCategoryWithFid();
            }

            forumnav      = "";
            forumallowrss = 0;
            if (categoryid <= 0)
            {
                AddErrLine("无效的商品分类ID");
                return;
            }

            if (config.Enablemall == 2) //开启高级模式
            {
                AddLinkRss("mallgoodslist.aspx?categoryid=" + categoryid, "商品列表");
                AddErrLine("当前页面在开启商城(高级)模式下无法访问, 系统将会重定向到商品列表页面!");
                return;
            }

            goodscategoryinfo = GoodsCategories.GetGoodsCategoryInfoById(categoryid);
            if (goodscategoryinfo != null && goodscategoryinfo.Categoryid > 0)
            {
                forumid = GoodsCategories.GetCategoriesFid(goodscategoryinfo.Categoryid);
            }
            else
            {
                AddErrLine("无效的商品分类ID");
                return;
            }

            ///得到广告列表
            ///头部
            headerad   = Advertisements.GetOneHeaderAd("", forumid);
            footerad   = Advertisements.GetOneFooterAd("", forumid);
            pagewordad = Advertisements.GetPageWordAd("", forumid);
            doublead   = Advertisements.GetDoubleAd("", forumid);
            floatad    = Advertisements.GetFloatAd("", forumid);
            mediaad    = Advertisements.GetMediaAd(templatepath, "", forumid);

            disablepostctrl = 0;
            if (userid > 0 && useradminid > 0)
            {
                admingroupinfo = AdminGroups.GetAdminGroupInfo(usergroupid);
            }

            if (admingroupinfo != null)
            {
                this.disablepostctrl = admingroupinfo.Disablepostctrl;
            }

            if (forumid == -1)
            {
                AddLinkRss("tools/rss.aspx", "最新商品");
                AddErrLine("无效的商品分类ID");
                return;
            }
            else
            {
                forum = Forums.GetForumInfo(forumid);
                // 检查是否具有版主的身份
                if (useradminid > 0)
                {
                    ismoder = Moderators.IsModer(useradminid, userid, forumid);
                }

                #region 对搜索条件进行检索

                string orderStr = "goodsid";

                if (DNTRequest.GetString("search").Trim() != "") //进行指定查询
                {
                    //所在城市信息
                    cond = DNTRequest.GetInt("locus_2", -1);
                    if (cond < 1)
                    {
                        condition = "";
                    }
                    else
                    {
                        locus     = Locations.GetLocusByLID(cond);
                        condition = "AND [lid] = " + cond;
                    }

                    //排序的字段
                    order = DNTRequest.GetInt("order", -1);
                    switch (order)
                    {
                    case 2:
                        orderStr = "expiration";     //到期日
                        break;

                    case 1:
                        orderStr = "price";     //商品价格
                        break;

                    default:
                        orderStr = "goodsid";
                        break;
                    }

                    if (DNTRequest.GetInt("direct", -1) == 0)
                    {
                        direct = 0;
                    }
                }

                #endregion

                if (forum == null)
                {
                    if (config.Rssstatus == 1)
                    {
                        AddLinkRss("tools/rss.aspx", Utils.EncodeHtml(config.Forumtitle) + " 最新商品");
                    }

                    AddErrLine("不存在的商品分类ID");
                    return;
                }


                //当版块有外部链接时,则直接跳转
                if (forum.Redirect != null && forum.Redirect != string.Empty)
                {
                    System.Web.HttpContext.Current.Response.Redirect(forum.Redirect);
                    return;
                }

                if (forum.Istrade <= 0)
                {
                    AddErrLine("当前版块不允许商品交易");
                    forumnav = "";
                    return;
                }

                if (forum.Fid < 1)
                {
                    if (config.Rssstatus == 1 && forum.Allowrss == 1)
                    {
                        AddLinkRss("tools/" + base.RssAspxRewrite(forum.Fid), Utils.EncodeHtml(forum.Name) + " 最新商品");
                    }

                    AddErrLine("不存在的商品分类ID");
                    return;
                }
                if (config.Rssstatus == 1)
                {
                    AddLinkRss("tools/" + base.RssAspxRewrite(forum.Fid), Utils.EncodeHtml(forum.Name) + " 最新商品");
                }

                forumname     = forum.Name;
                pagetitle     = Utils.RemoveHtml(forum.Name);
                subforumcount = forum.Subforumcount;
                forumnav      = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);
                navhomemenu   = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname);

                //更新页面Meta中的Description项, 提高SEO友好性
                UpdateMetaInfo(config.Seokeywords, forum.Description, config.Seohead);

                // 是否显示版块密码提示 1为显示, 0不显示
                showforumlogin = 1;
                // 如果版块未设密码
                if (forum.Password == "")
                {
                    showforumlogin = 0;
                }
                else
                {
                    // 如果检测到相应的cookie正确
                    if (Utils.MD5(forum.Password) == ForumUtils.GetCookie("forum" + forumid.ToString() + "password"))
                    {
                        showforumlogin = 0;
                    }
                    else
                    {
                        // 如果用户提交的密码正确则保存cookie
                        if (forum.Password == DNTRequest.GetString("forumpassword"))
                        {
                            ForumUtils.WriteCookie("forum" + forumid.ToString() + "password", Utils.MD5(forum.Password));
                            showforumlogin = 0;
                        }
                    }
                }

                if (!Forums.AllowViewByUserId(forum.Permuserlist, userid))        //判断当前用户在当前版块浏览权限
                {
                    if (forum.Viewperm == null || forum.Viewperm == string.Empty) //当板块权限为空时,按照用户组权限
                    {
                        if (useradminid != 1 && (usergroupinfo.Allowvisit != 1 || usergroupinfo.Allowtrade != 1))
                        {
                            AddErrLine("您当前的身份 \"" + usergroupinfo.Grouptitle + "\" 没有浏览该商品分类的权限");
                            if (userid == -1)
                            {
                                needlogin = true;
                            }
                            return;
                        }
                    }
                    else //当板块权限不为空,按照板块权限
                    {
                        if (!Forums.AllowView(forum.Viewperm, usergroupid))
                        {
                            AddErrLine("您没有浏览该商品分类的权限");
                            if (userid == -1)
                            {
                                needlogin = true;
                            }
                            return;
                        }
                    }
                }


                ////判断是否有发主题的权限
                if (userid > -1 && Forums.AllowPostByUserID(forum.Permuserlist, userid))
                {
                    canposttopic = true;
                }

                if (forum.Postperm == null || forum.Postperm == string.Empty) //权限设置为空时,根据用户组权限判断
                {
                    // 验证用户是否有发表交易的权限
                    if (usergroupinfo.Allowtrade == 1)
                    {
                        canposttopic = true;
                    }
                }
                else if (Forums.AllowPost(forum.Postperm, usergroupid))
                {
                    canposttopic = true;
                }

                // 如果当前用户非管理员并且论坛设定了禁止发帖时间段,当前时间如果在其中的一个时间段内,不允许用户发帖
                if (useradminid != 1 && usergroupinfo.Disableperiodctrl != 1)
                {
                    string visittime = "";
                    if (Scoresets.BetweenTime(config.Postbanperiods, out visittime))
                    {
                        canposttopic = false;
                    }
                }

                if (newpmcount > 0)
                {
                    pmlist     = PrivateMessages.GetPrivateMessageListForIndex(userid, 5, 1, 1);
                    showpmhint = Convert.ToInt32(Users.GetShortUserInfo(userid).Newsletter) > 4;
                }

                //得到子分类JSON格式
                subcategoriesjson = GoodsCategories.GetSubCategoriesJson(categoryid);
                //得到当前用户请求的页数
                pageid = DNTRequest.GetInt("page", 1);
                //获取主题总数
                goodscount = Goods.GetGoodsCount(categoryid, condition);

                // 得到gpp设置
                if (gpp <= 0)
                {
                    gpp = config.Gpp;
                }

                if (gpp <= 0)
                {
                    gpp = 16;
                }

                //修正请求页数中可能的错误
                if (pageid < 1)
                {
                    pageid = 1;
                }

                if (forum.Layer > 0)
                {
                    //获取总页数
                    pagecount = goodscount % gpp == 0 ? goodscount / gpp : goodscount / gpp + 1;
                    if (pagecount == 0)
                    {
                        pagecount = 1;
                    }

                    if (pageid > pagecount)
                    {
                        pageid = pagecount;
                    }

                    goodslist = Goods.GetGoodsInfoList(categoryid, gpp, pageid, condition, orderStr, direct);

                    ForumUtils.WriteCookie("referer", string.Format("showgoodslist.aspx?categoryid={0}&page={1}&order={2}&direct={3}&locus2={4}&search={5}", categoryid.ToString(), pageid.ToString(), orderStr, direct, cond, DNTRequest.GetString("search")));

                    //得到页码链接
                    if (DNTRequest.GetString("search") == "")
                    {
                        if (categoryid == 0)
                        {
                            if (config.Aspxrewrite == 1)
                            {
                                pagenumbers = Utils.GetStaticPageNumbers(pageid, pagecount, "showgoodslist-" + categoryid.ToString(), config.Extname, 8);
                            }
                            else
                            {
                                pagenumbers = Utils.GetPageNumbers(pageid, pagecount, "showgoodslist.aspx?categoryid=" + categoryid.ToString(), 8);
                            }
                        }
                        else //当有类型条件时
                        {
                            pagenumbers = Utils.GetPageNumbers(pageid, pagecount, "showgoodslist.aspx?categoryid=" + categoryid, 8);
                        }
                    }
                    else
                    {
                        pagenumbers = Utils.GetPageNumbers(pageid, pagecount,
                                                           "showgoodslist.aspx?search=" + DNTRequest.GetString("search") + "&order=" + 2 + "&direct=" + direct + "&categoryid=" + categoryid + "&locus_2=" + cond, 8);
                    }
                }
            }


            forumlistboxoptions = Caches.GetForumListBoxOptionsCache();

            OnlineUsers.UpdateAction(olid, UserAction.ShowForum.ActionID, forumid, forumname, -1, "");


            showforumonline = false;
            onlineiconlist  = Caches.GetOnlineGroupIconList();
            if (forumtotalonline < config.Maxonlinelist || DNTRequest.GetString("showonline") == "yes")
            {
                showforumonline = true;
                onlineuserlist  = OnlineUsers.GetForumOnlineUserCollection(forumid, out forumtotalonline, out forumtotalonlineguest,
                                                                           out forumtotalonlineuser, out forumtotalonlineinvisibleuser);
            }

            if (DNTRequest.GetString("showonline") == "no")
            {
                showforumonline = false;
            }

            ForumUtils.UpdateVisitedForumsOptions(forumid);
            visitedforumsoptions = ForumUtils.GetVisitedForumsOptions(config.Visitedforums);
            //因为目前还未提供RSS功能,所以下面两项为0
            forumallowrss = 0;
        }
예제 #5
0
        private string condition = ""; //查询条件

        protected override void ShowPage()
        {
            // 得到公告
            announcementlist  = Announcements.GetSimplifiedAnnouncementList(nowdatetime, "2999-01-01 00:00:00");
            announcementcount = 0;
            if (announcementlist != null)
            {
                announcementcount = announcementlist.Rows.Count;
            }

            inforumad = "";

            floatad  = Advertisements.GetFloatAd("indexad", 0);
            doublead = Advertisements.GetDoubleAd("indexad", 0);
            mediaad  = Advertisements.GetMediaAd(templatepath, "indexad", 0);

            if (config.Enablemall <= 1) //开启普通模式
            {
                AddErrLine("当前页面只有在开启商城(高级)模式下才可访问");
                return;
            }

            categoryid = DNTRequest.GetInt("categoryid", 0);

            if (categoryid <= 0)
            {
                AddErrLine("无效的商品分类I1");
                return;
            }

            goodscategoryinfo = GoodsCategories.GetGoodsCategoryInfoById(categoryid);

            if (goodscategoryinfo == null || goodscategoryinfo.Categoryid <= 0)
            {
                AddErrLine("无效的商品分类ID");
                return;
            }


            string orderStr = "goodsid";

            condition = "";


            //得到当前用户请求的页数
            pageid = DNTRequest.GetInt("page", 1);

            //获取主题总数
            goodscount = Goods.GetGoodsCount(categoryid, condition);


            // 得到gpp设置
            gpp = 16;//Utils.StrToInt(ForumUtils.GetCookie("tpp"), config.Tpp);

            if (gpp <= 0)
            {
                gpp = config.Tpp;
            }

            //修正请求页数中可能的错误
            if (pageid < 1)
            {
                pageid = 1;
            }

            //获取总页数
            pagecount = goodscount % gpp == 0 ? goodscount / gpp : goodscount / gpp + 1;
            if (pagecount == 0)
            {
                pagecount = 1;
            }

            if (pageid > pagecount)
            {
                pageid = pagecount;
            }

            goodslist = Goods.GetGoodsInfoList(goodscategoryinfo.Categoryid, gpp, pageid, condition, orderStr, direct);

            if (config.Aspxrewrite == 1)
            {
                pagenumbers = Utils.GetStaticPageNumbers(pageid, pagecount, "mallgoodslist-" + categoryid.ToString(), config.Extname, 8);
            }
            else
            {
                pagenumbers = Utils.GetPageNumbers(pageid, pagecount, "mallgoodslist.aspx?categoryid=" + categoryid.ToString(), 8);
            }

            //得到子分类JSON格式
            subcategoriesjson = GoodsCategories.GetSubCategoriesJson(goodscategoryinfo.Categoryid);

            new_goodsinfocoll = Goods.GetGoodsInfoList(3, 1, "", "goodsid", 1);

            sec_hand_goodsinfocoll = Goods.GetGoodsInfoList(9, 1, DatabaseProvider.GetInstance().GetGoodsQualityCondition((int)MallUtils.OperaCode.Equal, 2), "goodsid", 1);

            one_yuan_goodsinfocoll = Goods.GetGoodsInfoList(9, 1, DatabaseProvider.GetInstance().GetGoodsPriceCondition((int)MallUtils.OperaCode.Equal, 1), "goodsid", 1);

            recommend_goodsinfocoll = Goods.GetGoodsInfoList(10, 1, DatabaseProvider.GetInstance().GetGoodsRecommendCondition((int)MallUtils.OperaCode.Equal, 1), "goodsid", 1);

            goodscategory = GoodsCategories.GetRootGoodsCategoriesJson();

            rootgoodscategoryarray = GoodsCategories.GetShopRootCategory();
        }