Exemple #1
0
 private void UpdateAdvertisementAvailable(int available)
 {
     #region 设置公告为有效状态
     if (this.CheckCookie())
     {
         if (DNTRequest.GetString("advid") != "")
         {
             Advertisements.UpdateAdvertisementAvailable(DNTRequest.GetString("advid"), available);
             Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/Advertisements");
             base.RegisterStartupScript("PAGE", "window.location.href='global_advsgrid.aspx';");
         }
         else
         {
             base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='global_advsgrid.aspx';</script>");
         }
     }
     #endregion
 }
Exemple #2
0
        private void InitAdvertisementAvailable()
        {
            DataRow[] drs = Advertisements.GetAdvertisements(type).Select("endtime < '" + DateTime.Now.ToString() + "'");
            if (drs.Length == 0)
            {
                return;
            }
            string aidList = "";

            foreach (DataRow dr in drs)
            {
                aidList += dr["advid"] + ",";
            }
            if (aidList != "")
            {
                Advertisements.UpdateAdvertisementAvailable(aidList.TrimEnd(','), 0);
            }
        }
Exemple #3
0
 private void DelAds_Click(object sender, EventArgs e)
 {
     #region  除指定的广告
     if (this.CheckCookie())
     {
         if (DNTRequest.GetString("advid") != "")
         {
             Advertisements.DeleteAdvertisementList(DNTRequest.GetString("advid"));
             DNTCache.GetCacheService().RemoveObject("/Forum/Advertisements");
             base.RegisterStartupScript("PAGE", "window.location.href='global_advsgrid.aspx';");
         }
         else
         {
             base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='global_advsgrid.aspx';</script>");
         }
     }
     #endregion
 }
 //[ChildActionOnly]
 //[ValidateAntiForgeryToken]
 public void Create(CreateAdvertisementViewModel model)
 {
     if (ModelState.IsValid)
     {
         Advertisement advertisement = Advertisements.Create(Security.UserId, model.Text, model.Title, Convert.FromBase64String(model.Image));
         dynamic       rez           = new ExpandoObject();
         rez.Id          = advertisement.Id;
         rez.Title       = advertisement.Title;
         rez.Text        = advertisement.Text;
         rez.Author      = advertisement.Author.Profile.Name;
         rez.Image       = Convert.ToBase64String(advertisement.Image);
         rez.DateCreated = advertisement.DateCreated;
         var result = new List <dynamic> {
             rez
         };
         AdvertisementSearch.AddUpdateLuceneIndex(advertisement);
         ResponseData.WriteList(Response, "result", result);
     }
 }
Exemple #5
0
        public async Task <int> EditAdvertisement(AdvertisementModel model)
        {
            var newAdvertisement = new Advertisements()
            {
                Adid            = model.Adid,
                Userid          = model.Userid,
                Ondisplay       = model.Ondisplay,
                Rental          = model.Rental,
                PostalCode      = model.PostalCode,
                ContactPhoneNum = model.ContactPhoneNum,
                ContactPerson   = model.ContactPerson,
                Title           = model.Title,
                Description     = model.Description,
                Country         = model.Country,
                Province        = model.Province,
                City            = model.City,
                Streetname      = model.Streetname,
                Streetnum       = model.Streetnum,
                Bedroomsnum     = model.Bedroomsnum,
                Bathroomsnum    = model.Bathroomsnum,
                Hydro           = model.Hydro,
                Heat            = model.Heat,
                Water           = model.Water,
                Internet        = model.Internet,
                Parkingnum      = model.Parkingnum,
                Agreementtype   = model.Agreementtype,
                Moveindate      = model.Moveindate,
                Petfriendly     = model.Petfriendly,
                Size            = model.Size,
                Furnished       = model.Furnished,
                Laundry         = model.Laundry,
                Dishwasher      = model.Dishwasher,
                Fridge          = model.Fridge,
                Airconditioning = model.Airconditioning,
                Smokingpermit   = model.Smokingpermit,
                Postdate        = DateTime.UtcNow
            };

            _context.Update(newAdvertisement);
            await _context.SaveChangesAsync();

            return(newAdvertisement.Adid);
        }
        private void CreateAdvertisement(VmapAdBreak adBreak)
        {
            Advertisement ad = null;

            switch (adBreak.TimeOffset)
            {
            case "start":
                ad = new PrerollAdvertisement();
                break;

            case "end":
                ad = new PostrollAdvertisement();
                break;

            default:
                var offset = FlexibleOffset.Parse(adBreak.TimeOffset);
                if (offset != null)
                {
                    var midroll = new MidrollAdvertisement();
                    if (!offset.IsAbsolute)
                    {
                        midroll.TimePercentage = offset.RelativeOffset;
                    }
                    else
                    {
                        midroll.Time = offset.AbsoluteOffset;
                    }
                    ad = midroll;
                }
                break;
            }

            if (ad != null)
            {
                ad.Source = GetAdSource(adBreak.AdSource);
                if (ad.Source != null)
                {
                    Advertisements.Add(ad);
                    adBreaks.Add(ad, adBreak);
                }
            }
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AdvertisementsAndCategories acvm = new AdvertisementsAndCategories();
            Advertisements advertisements    = db.Advertisements.Find(id);

            if (advertisements.user_id != User.Identity.GetUserId())
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            acvm.Advertisements = advertisements;
            acvm.Categories     = categoryContext.Categories.ToList();
            if (advertisements == null)
            {
                return(HttpNotFound());
            }
            return(View(acvm));
        }
        private void Advertisements_Click(object sender, int row, int col)
        {
            try
            {
                HudStaticText adToDelete = (HudStaticText)Advertisements[row][0];
                Advertisements.RemoveRow(row);

                for (int i = 0; i < Parent.Machine.Utility.BotSettings.Advertisements.Count; i++)
                {
                    if (Parent.Machine.Utility.BotSettings.Advertisements[i].Message.Equals(adToDelete.Text))
                    {
                        Parent.Machine.Utility.BotSettings.Advertisements.RemoveAt(i);
                        break;
                    }
                }

                Parent.Machine.Utility.SaveBotSettings();
                adToDelete.Dispose();
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
        private void AddAdInfo_Click(object sender, EventArgs e)
        {
            #region 添加广告
            if (this.CheckCookie())
            {
                string targetlist = DNTRequest.GetString("TargetFID");

                if ((targetlist == "" || targetlist == ",") && type.SelectedIndex < 10)//非聚合页面广告
                {
                    base.RegisterStartupScript("", "<script>alert('请您先选取相关的投放范围,再点击提交按钮');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                    return;
                }
                //获取生效与结束日期
                string starttimestr = starttime.SelectedDate.ToString();
                string endtimestr   = endtime.SelectedDate.ToString();

                //有发布时间限制的广告,则检查发布日期范围是否合法
                if (starttimestr.IndexOf("1900") < 0 && endtimestr.IndexOf("1900") < 0)
                {
                    if (Convert.ToDateTime(starttime.SelectedDate.ToString()) >= Convert.ToDateTime(endtime.SelectedDate.ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('生效时间应该早于结束时间');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                        return;
                    }
                }
                if (endtime.SelectedDate < DateTime.Now)
                {
                    base.RegisterStartupScript("", "<script>alert('您选择的结束日期已过期,请重新选择一个大于今天的日期');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                    return;
                }

                Advertisements.CreateAd(Utils.StrToInt(available.SelectedValue, 0), type.SelectedValue, Utils.StrToInt(displayorder.Text, 0),
                                        title.Text, targetlist, GetParameters(), GetCode(), starttimestr, endtimestr);

                Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/Advertisements");

                base.RegisterStartupScript("PAGE", "window.location.href='global_advsgrid.aspx';");
            }
            #endregion
        }
        async void timer_Tick(object sender, object e)
        {
            try
            {
#if SILVERLIGHT
                var vmap = await VmapFactory.LoadSource(Source, cts.Token);
#else
                var vmap = await VmapFactory.LoadSource(Source).AsTask(cts.Token);
#endif
                // remove all ads that were not found new info
                foreach (var adBreak in adBreaks.Where(existingBreak => !vmap.AdBreaks.Any(newBreak => newBreak.BreakId == existingBreak.Value.BreakId)))
                {
                    Advertisements.Remove(adBreak.Key);
                }
                // create new ads for those that do not already exist
                foreach (var adBreak in vmap.AdBreaks.Where(newBreak => !adBreaks.Values.Any(existingBreak => existingBreak.BreakId == newBreak.BreakId)))
                {
                    CreateAdvertisement(adBreak);
                }
            }
            catch { /* ignore */ }
        }
        public void SearchTest()
        {
            List <Advertisement> list           = new List <Advertisement>();
            Advertisements       adverse        = new Advertisements();
            List <Advertisement> expectedAdvert = new List <Advertisement>
            {
                new Advertisement("Education", "English", "Lessions", 1000, "+380635699990", "Julia", "Matveeva", "*****@*****.**")
            };
            List <Advertisement> expectedList = new List <Advertisement>();

            expectedList.Add(new Advertisement("Education", "English", "Lessions", 2000, "+380638699990", "Dmytro", "Maryshchuk", "*****@*****.**"));
            expectedList.Add(new Advertisement("Education", "English", "Lessions", 2000, "+380635799100", "Dmytro", "Maryshchuk", "*****@*****.**"));

            list.Add(new Advertisement("Education", "English", "Lessions", 2000, "+380638699990", "Dmytro", "Maryshchuk", "*****@*****.**"));
            list.Add(new Advertisement("Education", "English", "Lessions", 1000, "+380635699990", "Julia", "Matveeva", "*****@*****.**"));
            list.Add(new Advertisement("Education", "English", "Lessions", 2000, "+380635799100", "Dmytro", "Maryshchuk", "*****@*****.**"));

            CollectionAssert.Equals(expectedAdvert, adverse.Search(list, "+380635699990"));
            CollectionAssert.Equals(expectedList, adverse.Search(list, 2000));
            expectedList.Clear();
            CollectionAssert.Equals(expectedList, adverse.Search(list, "Jora"));
        }
        public void DeserializeXmlTest()
        {
            List <Advertisement> list = new List <Advertisement>();

            list.Add(new Advertisement("Education", "English", "Lessions", 1000, "+380635699990", "Dmytro"));
            list.Add(new Advertisement("Education", "English", "Lessions", 3000, "+380635699990", "Dmytro"));
            list.Add(new Advertisement("Education", "English", "Lessions", 500, "+380635699990", "Dmytro"));

            List <Advertisement> excpectedList = list;
            Advertisements       adverse       = new Advertisements();

            XmlSerializer formatter = new XmlSerializer(typeof(List <Advertisement>));

            try
            {
                using (FileStream fs = new FileStream("Test.xml", FileMode.Create))
                {
                    formatter.Serialize(fs, list);
                    fs.Close();
                }
                list = null;
                list = new List <Advertisement>();
                using (FileStream fs = new FileStream("Test.xml", FileMode.Open))
                {
                    list = (List <Advertisement>)formatter.Deserialize(fs);
                    fs.Close();
                }
            }

            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                CollectionAssert.Equals(excpectedList, list);
            }
        }
Exemple #13
0
        public SearchResults(string terms, bool includeUnavailable)
        {
            Terms = terms;
            IncludeUnavailable = includeUnavailable;

            foreach (var owner in Estatehub.Owners)
            {
                foreach (var estate in owner.Estates)
                {
                    if (includeUnavailable || estate.IsCurrentlyAvailable())
                    {
                        if (estate.IsBeingAdvertised())
                        {
                            Advertisements.Add(estate.Advertisement);
                        }
                        else if (estate.MatchesTerms(terms))
                        {
                            Estates.Add(estate);
                        }
                    }
                }
            }
        }
        public void DeserializeLsonTest()
        {
            List <Advertisement> list = new List <Advertisement>();

            list.Add(new Advertisement("Education", "English", "Lessions", 1000, "+380635699990", "Dmytro"));
            list.Add(new Advertisement("Education", "English", "Lessions", 3000, "+380635699990", "Dmytro"));
            list.Add(new Advertisement("Education", "English", "Lessions", 500, "+380635699990", "Dmytro"));

            List <Advertisement> excpectedList = list;
            Advertisements       adverse       = new Advertisements();

            XmlSerializer formatter = new XmlSerializer(typeof(List <Advertisement>));

            try
            {
                using (StreamWriter file = File.CreateText("Test.json"))
                {
                    string json = JsonConvert.SerializeObject(list);
                    file.WriteLine(json);
                    file.Close();
                }
                list = null;
                list = new List <Advertisement>();
                JsonSerializer se     = new JsonSerializer();
                StreamReader   re     = new StreamReader("Test.json");
                JsonTextReader reader = new JsonTextReader(re);
                list = se.Deserialize <List <Advertisement> >(reader);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                CollectionAssert.Equals(excpectedList, list);
            }
        }
        // GET: Advertisements/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Advertisements advertisements = db.Advertisements.Find(id);

            if (advertisements == null)
            {
                return(HttpNotFound());
            }

            ShowAdvertisementViewModel savm = new ShowAdvertisementViewModel();

            string user_id = advertisements.user_id;
            ApplicationDbContext context = new ApplicationDbContext();
            var    userManager           = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(context));
            string username = userManager.FindById(user_id).Email;

            savm = savm.getEditAdvertisementModelForUser(user_id, username, advertisements.Id);

            return(View(savm));
        }
        /// <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] {
                    "", ""
                }
            }
            ;
        }
Exemple #17
0
        protected override void ShowPage()
        {
            if (config.Enablemall == 0) //未启用交易服务
            {
                AddErrLine("系统未开启交易服务, 当前页面暂时无法访问!");
                return;
            }

            if (userid == -1)
            {
                AddErrLine("你尚未登录");
                return;
            }

            headerad = "";
            footerad = "";

            // 如果商品交易日志不正确
            if (goodstradelogid <= 0)
            {
                AddErrLine("无效的交易日志信息.");
                return;
            }

            goodstradelog = TradeLogs.GetGoodsTradeLogInfo(goodstradelogid);
            int oldstatus = goodstradelog.Status;

            if (config.Enablemall == 1) //开启普通模式
            {
                forumid = GoodsCategories.GetCategoriesFid(goodstradelog.Categoryid);
            }
            else
            {
                forumid = 0;
            }

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

            if (goodstradelog.Sellerid != userid && goodstradelog.Buyerid != userid)
            {
                AddErrLine("您的身份不是买卖双方, 因为不能评价");
                return;
            }
            if (goodstradelog.Status != 7 && goodstradelog.Status != 17)
            {
                AddErrLine("交易尚未结束, 因为不能评价");
                return;
            }
            if (!GoodsRates.CanRate(goodstradelog.Id, userid)) //如果当前用户已评价过则不允许再评价
            {
                AddErrLine("不能重复评价");
                return;
            }


            //如果是提交...
            if (ispost)
            {
                Goodsrateinfo goodsrateinfo = new Goodsrateinfo();
                goodsrateinfo.Ip              = DNTRequest.GetIP();
                goodsrateinfo.Postdatetime    = DateTime.Now;
                goodsrateinfo.Price           = goodstradelog.Number * goodstradelog.Price + goodstradelog.Transportfee;
                goodsrateinfo.Ratetype        = DNTRequest.GetInt("ratetype", 0);
                goodsrateinfo.Uid             = userid;
                goodsrateinfo.Username        = username;
                goodsrateinfo.Message         = DNTRequest.GetString("message");
                goodsrateinfo.Goodstradelogid = goodstradelog.Id;
                goodsrateinfo.Goodstitle      = goodstradelog.Subject;
                goodsrateinfo.Goodsid         = goodstradelog.Goodsid;
                goodsrateinfo.Explain         = "";

                if (goodstradelog.Buyerid == userid)  //买家
                {
                    goodsrateinfo.Uidtype        = 2;
                    goodsrateinfo.Ratetouid      = goodstradelog.Sellerid;
                    goodsrateinfo.Ratetousername = goodstradelog.Seller;
                    goodstradelog.Ratestatus     = 2;
                }
                else //卖家
                {
                    goodsrateinfo.Uidtype        = 1;
                    goodsrateinfo.Ratetouid      = goodstradelog.Buyerid;
                    goodsrateinfo.Ratetousername = goodstradelog.Buyer;
                    goodstradelog.Ratestatus     = 1;
                }
                if (GoodsRates.CreateGoodsRate(goodsrateinfo) > 0) //如果评价成功
                {
                    if (GoodsRates.RateClosed(goodsrateinfo.Goodstradelogid, goodstradelog.Sellerid, goodstradelog.Buyerid))
                    {
                        goodstradelog.Ratestatus = 3;
                        TradeLogs.UpdateTradeLog(goodstradelog, oldstatus); //更新交易的评价状态
                    }

                    GoodsUserCredits.SetUserCredit(goodsrateinfo, goodsrateinfo.Uidtype == 1 ? goodstradelog.Buyerid : goodstradelog.Sellerid);

                    SetUrl(base.ShowGoodsAspxRewrite(goodsrateinfo.Goodsid));
                    SetMetaRefresh();
                    AddMsgLine("您的评价已经成功<br />(<a href=\"" + base.ShowGoodsAspxRewrite(goodsrateinfo.Goodsid) + "\">点击这里返回商品页面</a>)<br />");
                }
            }
        }
Exemple #18
0
 public void MapUpdate(ref Advertisements dbmodel, AdvertisementsExt model)
 {
     dbmodel.AdvertisementID = model.AdvertisementID;
     dbmodel.Advertisement   = model.Advertisement;
     dbmodel.SortBy          = model.SortBy;
 }
        /// <summary>
        /// 编辑广告绑定
        /// </summary>
        /// <param name="advid">广告ID</param>
        public void LoadAnnounceInf(int advid)
        {
            #region 加载相关广告信息
            GeneralConfigInfo configInfo = GeneralConfigs.GetConfig();
            for (int i = 1; i <= configInfo.Ppp; i++)
            {
                inpostfloor.Items.Add(new ListItem(" >#" + i, i.ToString()));
            }
            DataTable dt = Advertisements.GetAdvertisement(advid);
            if (dt.Rows.Count > 0)
            {
                displayorder.Text       = dt.Rows[0]["displayorder"].ToString();
                available.SelectedValue = dt.Rows[0]["available"].ToString();
                type.SelectedValue      = dt.Rows[0]["type"].ToString().Trim();
                title.Text = dt.Rows[0]["title"].ToString();

                //绑定广告有效的开始日期
                if (dt.Rows[0]["starttime"].ToString().IndexOf("1900") < 0)
                {
                    starttime.SelectedDate = Convert.ToDateTime(dt.Rows[0]["starttime"].ToString());
                }
                //绑定广告有效的结束日期
                if ((dt.Rows[0]["endtime"].ToString().IndexOf("1900") < 0) && (dt.Rows[0]["endtime"].ToString().IndexOf("2555") < 0))
                {
                    endtime.SelectedDate = Convert.ToDateTime(dt.Rows[0]["endtime"].ToString());
                }

                code.Text = dt.Rows[0]["code"].ToString().Trim();


                parameters.Items.Clear();
                parameters.Items.Add(new ListItem("代码", "htmlcode"));
                if ((type.SelectedValue != Convert.ToInt16(AdType.FloatAd).ToString()) && (type.SelectedValue != Convert.ToInt16(AdType.DoubleAd).ToString()))
                {
                    parameters.Items.Add(new ListItem("文字", "word"));
                }
                parameters.Items.Add(new ListItem("图片", "image"));
                parameters.Items.Add(new ListItem("flash", "flash"));


                //初始化参数
                string[] parameter = Utils.SplitString(dt.Rows[0]["parameters"].ToString().Trim(), "|", 9);
                parameters.SelectedValue = parameter[0].Trim();
                parameters.Attributes.Add("onChange", "showparameters();");
                wordlink.Text    = parameter[4].Trim();
                wordcontent.Text = parameter[5].Trim();
                wordfont.Text    = parameter[6].Trim();

                imgsrc.Text    = parameter[1].Trim();
                imgwidth.Text  = parameter[2].Trim();
                imgheight.Text = parameter[3].Trim();
                imglink.Text   = parameter[4].Trim();
                imgtitle.Text  = parameter[5].Trim();

                flashsrc.Text    = parameter[1].Trim();
                flashwidth.Text  = parameter[2].Trim();
                flashheight.Text = parameter[3].Trim();

                if (type.SelectedValue == Convert.ToInt16(AdType.InPostAd).ToString())
                {
                    inpostposition.SelectedValue = parameter[7].Trim();
                    string error = "";
                    foreach (string floor in parameter[8].Trim().Split(','))
                    {
                        if (Utils.StrToInt(floor, 0) > configInfo.Ppp)
                        {
                            error += floor + ",";
                        }
                        else
                        {
                            foreach (ListItem li in inpostfloor.Items)
                            {
                                if (Utils.InArray(li.Value, parameter[8].Trim()))
                                {
                                    li.Selected = true;
                                }
                            }
                        }
                    }
                    if (error != "")
                    {
                        base.RegisterStartupScript("", "<script>window.onload = function(){alert('每页帖数已经改变,原#" + error.TrimEnd(',') + "层大于现在" + configInfo.Ppp + "层');}</script>");
                    }
                }

                if (type.SelectedValue == Convert.ToInt16(AdType.MediaAd).ToString())
                {
                    slwmvsrc.Text  = parameter[1].Trim();
                    slimage.Text   = parameter[2].Trim();
                    buttomimg.Text = parameter[4].Trim();
                    words1.Text    = parameter[5].Trim();
                    words2.Text    = parameter[6].Trim();
                    words3.Text    = parameter[7].Trim();
                }
            }

            #endregion
        }
        protected override void ShowPage()
        {
            pagetitle = "首页";

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

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

            // 友情链接
            forumlinkcount = forumlinklist.Rows.Count;

            Forums.GetForumIndexCollection(config.Hideprivate, usergroupid, config.Moddisplay, out totaltopic, out totalpost, out todayposts);

            // 获得统计信息
            totalusers       = TypeConverter.StrToInt(Statistics.GetStatisticsRowItem("totalusers"));
            lastusername     = Statistics.GetStatisticsRowItem("lastusername");
            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;
            OnlineUsers.GetOnlineUserCollection(out totalonline, out totalonlineguest, out totalonlineuser, out totalonlineinvisibleuser);

            highestonlineusercount = Statistics.GetStatisticsRowItem("highestonlineusercount");
            highestonlineusertime  = Statistics.GetStatisticsRowItem("highestonlineusertime");

            if (userid != -1)
            {
                score = Scoresets.GetValidScoreName();
                ShortUserInfo user = Users.GetShortUserInfo(userid);
                score1 = ((decimal)user.Extcredits1).ToString();
                score2 = ((decimal)user.Extcredits2).ToString();
                score3 = ((decimal)user.Extcredits3).ToString();
                score4 = ((decimal)user.Extcredits4).ToString();
                score5 = ((decimal)user.Extcredits5).ToString();
                score6 = ((decimal)user.Extcredits6).ToString();
                score7 = ((decimal)user.Extcredits7).ToString();
                score8 = ((decimal)user.Extcredits8).ToString();
            }
            //相册

            if (config.Enablealbum == 1 && AlbumPluginProvider.GetInstance() != null)
            {
                albumcategorylist = AlbumPluginProvider.GetInstance().GetAlbumCategory();
            }

            if (config.Enablespace == 1 && AggregationFacade.SpaceAggregation.GetSpaceTopComments() != null)
            {
                topspacecomments = AggregationFacade.SpaceAggregation.GetSpaceTopComments();
            }

            taglist  = (config.Enabletag == 1 ? ForumTags.GetCachedHotForumTags(config.Hottagcount) : new TagInfo[0]);
            doublead = Advertisements.GetDoubleAd("indexad", 0);
            floatad  = Advertisements.GetFloatAd("indexad", 0);
        }
Exemple #21
0
        protected override void ShowPage()
        {
            if (config.Enablemall == 0) //未启用交易服务
            {
                AddErrLine("系统未开启交易服务, 当前页面暂时无法访问!");
                return;
            }

            headerad = "";
            footerad = "";

            // 如果主题ID非数字
            if (goodsid == -1)
            {
                AddErrLine("无效的商品ID");
                return;
            }

            if (userid <= 0)
            {
                HttpContext.Current.Response.Redirect(BaseConfigs.GetForumPath + "login.aspx?reurl=buygoods.aspx?goodsid=" + goodsid);
            }

            goodsinfo = Goods.GetGoodsInfo(goodsid);

            //验证不通过则返回
            if (!IsConditionsValid())
            {
                return;
            }

            goodscategoryinfo = GoodsCategories.GetGoodsCategoryInfoById(goodsinfo.Categoryid);

            if (config.Enablemall == 1) //开启普通模式
            {
                forumid = goodscategoryinfo.Fid;
                forum   = Forums.GetForumInfo(forumid);

                if (forum.Password != "" &&
                    Utils.MD5(forum.Password) != ForumUtils.GetCookie("forum" + forumid + "password"))
                {
                    AddErrLine("本版块被管理员设置了密码");
                    System.Web.HttpContext.Current.Response.Redirect(base.ShowGoodsListAspxRewrite(goodsinfo.Categoryid, 1), true);
                    return;
                }

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

                        if (useradminid != 1 && (usergroupinfo.Allowvisit != 1 || usergroupinfo.Allowtrade != 1))
                        {
                            AddErrLine("您当前的身份 \"" + usergroupinfo.Grouptitle + "\" 没有进行交易商品的权限");
                            return;
                        }
                    }
                    else//当板块权限不为空,按照板块权限
                    {
                        if (!Forums.AllowView(forum.Viewperm, usergroupid))
                        {
                            AddErrLine("您没有浏览该版块的权限");
                            if (userid == -1)
                            {
                                needlogin = true;
                            }
                            return;
                        }
                    }
                }

                if (!Forums.AllowPostByUserID(forum.Permuserlist, userid))        //判断当前用户在当前版块发布商品权限
                {
                    if (forum.Postperm == null || forum.Postperm == string.Empty) //权限设置为空时,根据用户组权限判断
                    {
                        // 验证用户是否有发布商品的权限
                        if (usergroupinfo.Allowtrade != 1)
                        {
                            AddErrLine("您当前的身份 \"" + usergroupinfo.Grouptitle + "\" 没有进行交易商品的权限");
                            return;
                        }
                    }
                    else//权限设置不为空时,根据板块权限判断
                    {
                        if (!Forums.AllowPost(forum.Postperm, usergroupid))
                        {
                            AddErrLine("您没有进行交易商品的权限");
                            return;
                        }
                    }
                }

                forumname = forum.Name;
                pagetitle = goodsinfo.Title;
                forumnav  = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);
            }
            else if (config.Enablemall == 2) //当为高级模式时
            {
                forumid = 0;
            }

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

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

            if (useradminid != 0)
            {
                if (config.Enablemall == 1) //开启普通模式
                {
                    ismoder = Moderators.IsModer(useradminid, userid, forumid) ? 1 : 0;
                }
                //得到管理组信息
                admininfo = AdminGroups.GetAdminGroupInfo(usergroupid);
            }


            //如果是提交...
            if (ispost)
            {
                //创建商品交易日志
                goodstradelog.Number = DNTRequest.GetInt("number", 0);
                // 商品数不正确
                if (goodstradelog.Number <= 0)
                {
                    AddErrLine("请输入正确的商品数, 请返回修改.");
                    return;
                }
                if (goodsinfo.Amount < goodstradelog.Number)
                {
                    AddErrLine("商品剩余数量不足 (剩余数量为 " + goodsinfo.Amount + ", 而购买数量为 " + goodstradelog.Number + ").");
                    return;
                }

                goodstradelog.Sellerid = goodsinfo.Selleruid;
                goodstradelog.Buyerid  = userid;
                if (goodstradelog.Buyerid == goodstradelog.Sellerid)
                {
                    AddErrLine("买卖双方不能是同一用户.");
                    return;
                }
                goodstradelog.Goodsid       = goodsinfo.Goodsid;
                goodstradelog.Offline       = DNTRequest.GetInt("offline", 0);
                goodstradelog.Orderid       = TradeLogs.GetOrderID();
                goodstradelog.Subject       = goodsinfo.Title;
                goodstradelog.Price         = goodsinfo.Price;
                goodstradelog.Quality       = goodsinfo.Quality;
                goodstradelog.Categoryid    = goodsinfo.Categoryid;
                goodstradelog.Tax           = 0;
                goodstradelog.Locus         = goodsinfo.Locus;
                goodstradelog.Seller        = goodsinfo.Seller;
                goodstradelog.Selleraccount = goodsinfo.Account;
                goodstradelog.Buyer         = username;
                goodstradelog.Buyercontact  = DNTRequest.GetString("buyercontact");
                goodstradelog.Buyercredit   = 0;
                goodstradelog.Buyermsg      = DNTRequest.GetString("buyermsg");
                goodstradelog.Status        = (int)TradeStatusEnum.UnStart;
                goodstradelog.Lastupdate    = DateTime.Now;
                goodstradelog.Buyername     = DNTRequest.GetString("buyername");
                goodstradelog.Buyerzip      = DNTRequest.GetString("buyerzip");
                goodstradelog.Buyerphone    = DNTRequest.GetString("buyerphone");
                goodstradelog.Buyermobile   = DNTRequest.GetString("buyermobile");
                goodstradelog.Transport     = DNTRequest.GetInt("transport", 0);
                goodstradelog.Transportpay  = goodsinfo.Transport;
                goodstradelog.Transportfee  = Convert.ToDecimal(DNTRequest.GetFormFloat("fee", 0).ToString());
                goodstradelog.Tradesum      = goodstradelog.Number * goodstradelog.Price + (goodstradelog.Transportpay == 2 ? goodstradelog.Transportfee : 0);
                goodstradelog.Baseprice     = goodsinfo.Costprice;
                goodstradelog.Discount      = goodsinfo.Discount;
                goodstradelog.Ratestatus    = 0;
                goodstradelog.Message       = "";

                int tradelogid = TradeLogs.CreateTradeLog(goodstradelog);

                if (tradelogid > 0)
                {
                    string jumpurl = "";
                    if (goodstradelog.Offline == 0)
                    {
                        jumpurl = "onlinetrade.aspx?goodstradelogid=" + tradelogid;
                    }
                    else
                    {
                        jumpurl = "offlinetrade.aspx?goodstradelogid=" + tradelogid;
                    }

                    SetUrl(jumpurl);
                    SetMetaRefresh();
                    AddMsgLine("交易单已创建, 现在将转入交易单页面<br />(<a href=\"" + jumpurl + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                }
                else
                {
                    SetUrl("buygoods.aspx?goodsid=" + goodsid);
                    SetMetaRefresh();
                    AddMsgLine("交易单创建错误, 请重新添写交易单<br />(<a href=\"" + "buygoods.aspx?goodsid=" + goodsid + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                }
            }
        }
        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;
        }
Exemple #23
0
 public void BindData(int type)
 {
     DataGrid1.AllowCustomPaging = false;
     DataGrid1.BindData(Advertisements.GetAdvertisements(type));
 }
Exemple #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        LeftBannersCount  = 0;
        RightBannersCount = 0;
        String leftAdstoHtml  = String.Empty;
        String rightAdstoHtml = String.Empty;
        List <REIQ.Access.Advertisement.AdvertisementExtended> randAds = new List <REIQ.Access.Advertisement.AdvertisementExtended>();

        //get scroll speed from the page property Scroll Speed
        var currentNode = umbraco.NodeFactory.Node.GetCurrent();

        if (currentNode != null)
        {
            if (currentNode.GetProperty("scrollSpeed") != null && !String.IsNullOrEmpty(currentNode.GetProperty("scrollSpeed").Value))
            {
                ScrollSpeed = Convert.ToInt32(currentNode.GetProperty("scrollSpeed").Value) * 1000;
            }
            if (currentNode.GetProperty("amountHomeBanners") != null && !String.IsNullOrEmpty(currentNode.GetProperty("amountHomeBanners").Value))
            {
                MaxCountAds = Convert.ToInt32(currentNode.GetProperty("amountHomeBanners").Value);
            }
        }

        if (Request.QueryString["nomatches"] == "1")
        {
            Response.Write("<script>alert('Please type in correct suburb, postcode, region or property ID to begin your search');</script>");
        }

        //Get banners adverts if present
        Advertisements = REIQ.Access.Advertisement.GetBannerAdsHomePage();

        if (Advertisements.Count > 0)
        {
            if (Advertisements.Count < MaxCountAds)
            {
                MaxCountAds = Advertisements.Count;
            }

            Random RandomClass = new Random();
            for (var i = 0; i <= (MaxCountAds - 1); i++)
            {
                int rndNo = RandomClass.Next(0, Advertisements.Count);
                randAds.Add(Advertisements[rndNo]);
                Advertisements.Remove(Advertisements[rndNo]);
            }

            //leftAdstoHtml = "<ul>";
            //rightAdstoHtml = "<ul>";

            foreach (var randAd in randAds)
            {
                if (randAds.IndexOf(randAd) % 2 == 0)
                {
                    leftAdstoHtml += BannerImageToString(randAd);
                    LeftBannersCount++;
                }
                else
                {
                    rightAdstoHtml += BannerImageToString(randAd);
                    RightBannersCount++;
                }
            }

            //leftAdstoHtml += "</ul>";
            //rightAdstoHtml += "</ul>";

            leftAds.Text  = HttpUtility.HtmlDecode(leftAdstoHtml);
            rightAds.Text = HttpUtility.HtmlDecode(rightAdstoHtml);
        }
    }
Exemple #25
0
        protected override void ShowPage()
        {
            if (config.Enablemall == 0) //未启用交易服务
            {
                AddErrLine("系统未开启交易服务, 当前页面暂时无法访问!");
                return;
            }
            else
            {
                goodscategoryfid = Discuz.Mall.GoodsCategories.GetGoodsCategoryWithFid();
            }

            headerad = "";
            footerad = "";
            floatad  = "";

            disablepostctrl = 0;

            // 如果商品ID无效
            if (goodsid == -1)
            {
                AddErrLine("无效的商品ID");
                return;
            }

            goodsinfo = Goods.GetGoodsInfo(goodsid);
            if (goodsinfo == null || goodsinfo.Closed > 1)
            {
                AddErrLine("不存在的商品ID");
                headerad = Advertisements.GetOneHeaderAd("", 0);
                footerad = Advertisements.GetOneFooterAd("", 0);
                floatad  = Advertisements.GetFloatAd("", 0);
                return;
            }

            UserInfo userinfo = Users.GetUserInfo(goodsinfo.Selleruid);

            if (userinfo != null)
            {
                joindate = Convert.ToDateTime(userinfo.Joindate).ToString("yyyy-MM-dd");
            }

            sb_usercredit       = GoodsUserCredits.GetUserCreditJsonData(goodsinfo.Selleruid);
            creditrulesjsondata = GoodsUserCredits.GetCreditRulesJsonData().ToString();

            if (config.Enablemall == 1) //开启普通模式
            {
                forumid = GoodsCategories.GetCategoriesFid(goodsinfo.Categoryid);
                forum   = Forums.GetForumInfo(forumid);
                if (forum == null)
                {
                    AddErrLine("当前商品所属分类未绑定相应版块");
                    return;
                }

                forumname = forum.Name;
                forumnav  = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);

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

                // 检查是否具有版主的身份
                if (useradminid != 0)
                {
                    ismoder = Moderators.IsModer(useradminid, userid, forumid) ? 1 : 0;
                    //得到管理组信息
                    admininfo = AdminGroups.GetAdminGroupInfo(usergroupid);
                    if (admininfo != null)
                    {
                        disablepostctrl = admininfo.Disablepostctrl;
                    }
                }
            }
            goodscategoryinfo = GoodsCategories.GetGoodsCategoryInfoById(goodsinfo.Categoryid);
            pagetitle         = goodsinfo.Title;
            navhomemenu       = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname);

            //验证不通过则返回
            if (!IsConditionsValid())
            {
                return;
            }

            //编辑器状态
            StringBuilder sb = new StringBuilder("var Allowhtml=1;\r\n");

            parseurloff = 0;
            bbcodeoff   = 1;
            if (config.Enablemall == 1) //开启普通模式
            {
                smileyoff = 1 - forum.Allowsmilies;

                if (forum.Allowbbcode == 1 && usergroupinfo.Allowcusbbcode == 1)
                {
                    bbcodeoff = 0;
                }

                allowimg = forum.Allowimgcode;
            }
            else if (config.Enablemall == 2) //当为高级模式时
            {
                if (usergroupinfo.Allowcusbbcode == 1)
                {
                    bbcodeoff = 0;
                }

                allowimg = 1;
            }

            sb.Append("var Allowsmilies=" + (1 - smileyoff) + ";\r\n");
            sb.Append("var Allowbbcode=" + (1 - bbcodeoff) + ";\r\n");
            usesig = ForumUtils.GetCookie("sigstatus") == "0" ? 0 : 1;
            sb.Append("var Allowimgcode=" + allowimg + ";\r\n");

            AddScript(sb.ToString());

            if (config.Enablemall == 2)
            {
                recommendgoodslist = Goods.GetGoodsRecommendList(goodsinfo.Selleruid, 6, 1,
                                                                 DbProvider.GetInstance().GetGoodsIdCondition((int)MallUtils.OperaCode.NoEuqal, goodsinfo.Goodsid));
            }

            smilietypes = Caches.GetSmilieTypesCache();

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


            // 得到pptradelog设置
            pptradelog = Utils.StrToInt(ForumUtils.GetCookie("ppp"), config.Ppp);
            if (pptradelog <= 0)
            {
                pptradelog = config.Ppp;
            }

            //快速发帖广告
            if (config.Enablemall == 1) //开启普通模式
            {
                quickeditorad = Advertisements.GetQuickEditorAD("", forumid);
            }

            //更新页面Meta中的Description项, 提高SEO友好性
            string metadescritpion = Utils.RemoveHtml(goodsinfo.Message);

            metadescritpion = metadescritpion.Length > 100 ? metadescritpion.Substring(0, 100) : metadescritpion;
            UpdateMetaInfo(config.Seokeywords, metadescritpion, config.Seohead);

            GoodspramsInfo goodspramsInfo = new GoodspramsInfo();

            goodspramsInfo.Goodsid = goodsinfo.Goodsid;

            if (config.Enablemall == 1) //开启普通模式
            {
                goodspramsInfo.Fid           = forum.Fid;
                goodspramsInfo.Jammer        = forum.Jammer;
                goodspramsInfo.Getattachperm = forum.Getattachperm;
                goodspramsInfo.Showimages    = forum.Allowimgcode;
            }
            else if (config.Enablemall == 2) //当为高级模式时
            {
                goodspramsInfo.Jammer        = 0;
                goodspramsInfo.Getattachperm = "";
                goodspramsInfo.Showimages    = 1;
            }
            goodspramsInfo.Pageindex          = pageid;
            goodspramsInfo.Usergroupid        = usergroupid;
            goodspramsInfo.Attachimgpost      = config.Attachimgpost;
            goodspramsInfo.Showattachmentpath = config.Showattachmentpath;
            goodspramsInfo.Hide  = 0;
            goodspramsInfo.Price = 0;
            goodspramsInfo.Usergroupreadaccess = usergroupinfo.Readaccess;

            if (ismoder == 1)
            {
                goodspramsInfo.Usergroupreadaccess = int.MaxValue;
            }

            goodspramsInfo.CurrentUserid          = userid;
            goodspramsInfo.Smiliesinfo            = Smilies.GetSmiliesListWithInfo();
            goodspramsInfo.Customeditorbuttoninfo = Editors.GetCustomEditButtonListWithInfo();
            goodspramsInfo.Smiliesmax             = config.Smiliesmax;
            goodspramsInfo.Bbcodemode             = config.Bbcodemode;
            goodspramsInfo.CurrentUserGroup       = usergroupinfo;
            goodspramsInfo.Sdetail     = goodsinfo.Message;
            goodspramsInfo.Smileyoff   = goodsinfo.Smileyoff;
            goodspramsInfo.Bbcodeoff   = goodsinfo.Bbcodeoff;
            goodspramsInfo.Parseurloff = goodsinfo.Parseurloff;
            goodspramsInfo.Allowhtml   = 1;
            goodspramsInfo.Sdetail     = goodsinfo.Message;

            message = Goods.MessgeTranfer(goodspramsInfo, GoodsAttachments.GetGoodsAttachmentsByGoodsid(goodsinfo.Goodsid));

            forumlistboxoptions = Caches.GetForumListBoxOptionsCache();
            tradecount          = TradeLogs.GetGoodsTradeLogCount(goodsid);
            leavewordcount      = GoodsLeaveWords.GetGoodsLeaveWordCount(goodsid);
            pptradelog          = 16;

            ForumUtils.WriteCookie("referer", string.Format(base.ShowGoodsAspxRewrite(goodsinfo.Goodsid)));

            if (config.Enablemall == 1) //开启普通模式
            {
                ForumUtils.UpdateVisitedForumsOptions(forumid);
            }

            visitedforumsoptions = ForumUtils.GetVisitedForumsOptions(config.Visitedforums);

            //删除留言
            if (DNTRequest.GetInt("deleteleaveword", 0) == 1)
            {
                isdeleteop = true;
                int leavewordid = DNTRequest.GetInt("leavewordid", 0);

                if (leavewordid <= 0)
                {
                    AddErrLine("您要删除的留言已被删除, 现在转入商品页面");
                    return;
                }
                if (GoodsLeaveWords.DeleteLeaveWordById(leavewordid, userid, goodsinfo.Selleruid, useradminid))
                {
                    SetUrl(base.ShowGoodsAspxRewrite(goodsinfo.Goodsid));
                    SetMetaRefresh();
                    AddMsgLine("该留言已被删除, 现在转入商品页面<br />(<a href=\"" + base.ShowGoodsAspxRewrite(goodsinfo.Goodsid) + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                    return;
                }
                else
                {
                    AddErrLine("您的用户身份无效删除该留言, 现在转入商品页面");
                    return;
                }
            }

            //删除商品
            if (DNTRequest.GetInt("deletegoods", 0) == 1)
            {
                isdeleteop = true;
                //是否为卖家或版主
                if (Goods.IsSeller(goodsinfo.Goodsid.ToString(), userid) || ismoder == 1)
                {
                    Goods.DeleteGoods(goodsinfo.Goodsid.ToString(), false);

                    SetUrl(this.ShowGoodsListAspxRewrite(goodsinfo.Categoryid, 1));
                    SetMetaRefresh();
                    AddMsgLine("操作成功. <br />(<a href=\"" + this.ShowGoodsListAspxRewrite(goodsinfo.Categoryid, 1) + "\">点击这里返回</a>)<br />");
                    return;
                }
                else
                {
                    AddErrLine("你不是当前商品的卖家或版主,因此无法删除该商品");
                    return;
                }
            }


            //如果是提交
            if (ispost)
            {
                //如果不是提交...
                if (ForumUtils.IsCrossSitePost())
                {
                    AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }

                if (DNTRequest.GetString("postleaveword") == "add")
                {
                    //当验证密码正确后,则发送相应留言
                    Goodsleavewordinfo goodsleavewordinfo = new Goodsleavewordinfo();
                    goodsleavewordinfo.Ip         = DNTRequest.GetIP();
                    goodsleavewordinfo.Goodsid    = goodsinfo.Goodsid;
                    goodsleavewordinfo.Tradelogid = 0;
                    goodsleavewordinfo.Uid        = userid;
                    goodsleavewordinfo.Username   = username;
                    goodsleavewordinfo.Message    = DNTRequest.GetString("message");
                    goodsleavewordinfo.Isbuyer    = goodsinfo.Selleruid != userid ? 1 : 0;
                    if (GoodsLeaveWords.CreateLeaveWord(goodsleavewordinfo, goodsinfo.Selleruid, DNTRequest.GetString("sendnotice") == "on" ? true : false) > 0)
                    {
                        SetUrl(base.ShowGoodsAspxRewrite(goodsinfo.Goodsid));
                        SetMetaRefresh();
                        AddMsgLine("您的留言已发布, 现在转入商品页面<br />(<a href=\"" + base.ShowGoodsAspxRewrite(goodsinfo.Goodsid) + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                    }
                }
                else
                {
                    //当验证密码正确后,则发送相应留言
                    Goodsleavewordinfo goodsleavewordinfo = GoodsLeaveWords.GetGoodsLeaveWordById(DNTRequest.GetInt("leavewordid", 0));
                    if (goodsleavewordinfo != null && goodsleavewordinfo.Id > 0)
                    {
                        goodsleavewordinfo.Ip           = DNTRequest.GetIP();
                        goodsleavewordinfo.Uid          = userid;
                        goodsleavewordinfo.Username     = username;
                        goodsleavewordinfo.Message      = DNTRequest.GetString("message");
                        goodsleavewordinfo.Postdatetime = DateTime.Now;
                        if (GoodsLeaveWords.UpdateLeaveWord(goodsleavewordinfo))
                        {
                            SetUrl(base.ShowGoodsAspxRewrite(goodsinfo.Goodsid));
                            SetMetaRefresh();
                            AddMsgLine("留言更新成功, 现在转入商品页面<br />(<a href=\"" + base.ShowGoodsAspxRewrite(goodsinfo.Goodsid) + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                        }
                    }
                    else
                    {
                        AddErrLine("当前留言不存在或已被删除");
                        return;
                    }
                }
            }
            else
            {
                goodsinfo.Viewcount += 1; //浏览量加1
                Goods.UpdateGoods(goodsinfo);
            }
        }
Exemple #26
0
        protected override void ShowPage()
        {
            if (config.Enablemall == 0) //未启用交易服务
            {
                AddErrLine("系统未开启交易服务, 当前页面暂时无法访问!");
                return;
            }

            headerad = "";
            footerad = "";
            floatad  = "";

            // 如果商品交易日志不正确
            if (goodstradelogid <= 0)
            {
                AddErrLine("无效的交易日志信息.");
                return;
            }

            goodstradelog = TradeLogs.GetGoodsTradeLogInfo(goodstradelogid);
            int oldstatus = goodstradelog.Status;

            if (config.Enablemall == 1) //开启普通模式
            {
                forumid   = GoodsCategories.GetCategoriesFid(goodstradelog.Categoryid);
                forum     = Forums.GetForumInfo(forumid);
                forumname = forum.Name;
                forumnav  = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);
            }
            else if (config.Enablemall == 2) //当为高级模式时
            {
                forumid = 0;
            }

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

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

            if (useradminid != 0)
            {
                if (config.Enablemall == 1) //开启普通模式
                {
                    ismoder = Moderators.IsModer(useradminid, userid, forumid) ? 1 : 0;
                }

                //得到管理组信息
                admininfo = AdminGroups.GetAdminGroupInfo(usergroupid);
            }
            //验证不通过则返回
            if (!IsConditionsValid())
            {
                return;
            }

            if (goodstradelog.Status == 7 || goodstradelog.Status == 17)
            {
                israted = GoodsRates.CanRate(goodstradelog.Id, userid) ? false : true; //如果当前用户已评价过则不允许再评价
            }
            if (DNTRequest.GetString("pay") == "yes")
            {
                ispay = true;
                string alipayurl = GetAliPayUrl();
                SetUrl(alipayurl);
                SetMetaRefresh();
                AddMsgLine("正在提交编号为 " + goodstradelog.Tradeno + " 的订单<br />(<a href=\"" + alipayurl + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                return;
            }


            //如果是提交则更新商品交易日志
            if (ispost)
            {
                if (ForumUtils.IsCrossSitePost())
                {
                    AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }

                //当为买家时
                if (isbuyer)
                {
                    goodstradelog.Quality       = goodsinfo.Quality;
                    goodstradelog.Categoryid    = goodsinfo.Categoryid;
                    goodstradelog.Tax           = 0;
                    goodstradelog.Locus         = goodsinfo.Locus;
                    goodstradelog.Seller        = goodsinfo.Seller;
                    goodstradelog.Sellerid      = goodsinfo.Selleruid;
                    goodstradelog.Selleraccount = goodsinfo.Account;
                    goodstradelog.Buyerid       = userid;
                    goodstradelog.Buyer         = username;
                    goodstradelog.Buyercontact  = DNTRequest.GetString("buyercontact");
                    goodstradelog.Buyercredit   = 0;
                    goodstradelog.Buyermsg      = DNTRequest.GetString("buyermsg");
                    goodstradelog.Status        = 0;
                    goodstradelog.Lastupdate    = DateTime.Now;
                    goodstradelog.Buyername     = DNTRequest.GetString("buyername");
                    goodstradelog.Buyerzip      = DNTRequest.GetString("buyerzip");
                    goodstradelog.Buyerphone    = DNTRequest.GetString("buyerphone");
                    goodstradelog.Buyermobile   = DNTRequest.GetString("buyermobile");
                    goodstradelog.Transport     = goodsinfo.Transport;
                    goodstradelog.Baseprice     = goodsinfo.Costprice;
                    goodstradelog.Discount      = goodsinfo.Discount;
                    goodstradelog.Ratestatus    = 0;
                    goodstradelog.Message       = "";
                }
                else //当为卖家时
                {
                    goodstradelog.Transportfee = DNTRequest.GetInt("fee", 0);
                }

                if (TradeLogs.UpdateTradeLog(goodstradelog, oldstatus))
                {
                    SetUrl("onlinetrade.aspx?goodstradelogid=" + goodstradelogid);
                    SetMetaRefresh();
                    AddMsgLine("交易单已更新, 现在转入交易单页面<br />(<a href=\"" + "onlinetrade.aspx?goodstradelogid=" + goodstradelogid + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                }
            }
        }
Exemple #27
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);
                }
            }
        }
        protected override void ShowPage()
        {
            if (config.Enablemall == 0) //未启用交易服务
            {
                AddErrLine("系统未开启交易服务, 当前页面暂时无法访问!");
                return;
            }

            headerad = "";
            footerad = "";

            // 如果商品交易日志不正确
            if (goodstradelogid <= 0)
            {
                AddErrLine("无效的交易日志信息.");
                return;
            }

            goodstradelog = TradeLogs.GetGoodsTradeLogInfo(goodstradelogid);
            int oldstatus = goodstradelog.Status;

            if (config.Enablemall == 1) //开启普通模式
            {
                forumid   = GoodsCategories.GetCategoriesFid(goodstradelog.Categoryid);
                forum     = Forums.GetForumInfo(forumid);
                forumname = forum.Name;
                forumnav  = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);
            }
            else if (config.Enablemall == 2) //当为高级模式时
            {
                forumid = 0;
            }

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

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

            if (useradminid != 0)
            {
                if (config.Enablemall == 1) //开启普通模式
                {
                    ismoder = Moderators.IsModer(useradminid, userid, forumid) ? 1 : 0;
                }

                //得到管理组信息
                admininfo = AdminGroups.GetAdminGroupInfo(usergroupid);
            }
            //验证不通过则返回
            if (!IsConditionsValid())
            {
                return;
            }

            goodsleavewordlist = GoodsLeaveWords.GetLeaveWordList(goodstradelog.Id);

            if (goodstradelog.Status == 7 || goodstradelog.Status == 17)
            {
                israted = GoodsRates.CanRate(goodstradelog.Id, userid) ? false : true; //如果当前用户已评价过则不允许再评价
            }
            //如果是提交则更新商品交易日志
            if (ispost && goodstradelog.Status >= 0)
            {
                if (ForumUtils.IsCrossSitePost())
                {
                    AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }

                //当要验证密码时
                if (DNTRequest.GetInt("status", -1) > 0 && IsVerifyPassWord(goodstradelog.Status))
                {
                    if (Utils.StrIsNullOrEmpty(DNTRequest.GetString("password")))
                    {
                        AddErrLine("密码不能为空, 请返回填写.");
                        return;
                    }

                    int uid = -1;
                    if (config.Passwordmode == 1)
                    {
                        uid = Users.CheckDvBbsPassword(base.username, DNTRequest.GetString("password"));
                    }
                    else
                    {
                        uid = Users.CheckPassword(username, DNTRequest.GetString("password"), true);
                    }

                    if (uid < 0)
                    {
                        AddErrLine("您输入的密码不正确, 不能修改订单状态, 请返回修改.");
                        return;
                    }

                    //当验证密码正确后,则发送相应留言
                    Goodsleavewordinfo goodsleavewordinfo = new Goodsleavewordinfo();
                    goodsleavewordinfo.Ip         = DNTRequest.GetIP();
                    goodsleavewordinfo.Goodsid    = goodstradelog.Goodsid;
                    goodsleavewordinfo.Tradelogid = goodstradelog.Id;
                    goodsleavewordinfo.Uid        = userid;
                    goodsleavewordinfo.Username   = username;
                    goodsleavewordinfo.Message    = DNTRequest.GetString("message");
                    goodsleavewordinfo.Isbuyer    = buyerleaveword;
                    GoodsLeaveWords.CreateLeaveWord(goodsleavewordinfo, goodsinfo.Selleruid);
                }

                goodstradelog.Status = DNTRequest.GetInt("status", -1);

                if (goodstradelog.Status == 0)
                {
                    //当为买家时
                    if (isbuyer)
                    {
                        goodstradelog.Quality       = goodsinfo.Quality;
                        goodstradelog.Categoryid    = goodsinfo.Categoryid;
                        goodstradelog.Tax           = 0;
                        goodstradelog.Locus         = goodsinfo.Locus;
                        goodstradelog.Seller        = goodsinfo.Seller;
                        goodstradelog.Sellerid      = goodsinfo.Selleruid;
                        goodstradelog.Selleraccount = goodsinfo.Account;
                        goodstradelog.Buyerid       = userid;
                        goodstradelog.Buyer         = username;
                        goodstradelog.Buyercontact  = DNTRequest.GetString("buyercontact");
                        goodstradelog.Buyercredit   = 0;
                        goodstradelog.Buyermsg      = DNTRequest.GetString("buyermsg");
                        goodstradelog.Lastupdate    = DateTime.Now;
                        goodstradelog.Buyername     = DNTRequest.GetString("buyername");
                        goodstradelog.Buyerzip      = DNTRequest.GetString("buyerzip");
                        goodstradelog.Buyerphone    = DNTRequest.GetString("buyerphone");
                        goodstradelog.Buyermobile   = DNTRequest.GetString("buyermobile");
                        goodstradelog.Transport     = goodsinfo.Transport;
                        goodstradelog.Baseprice     = goodsinfo.Costprice;
                        goodstradelog.Discount      = goodsinfo.Discount;
                        goodstradelog.Ratestatus    = 0;
                        goodstradelog.Message       = "";
                    }

                    if (isseller) //当为卖家时
                    {
                        goodstradelog.Transportfee = DNTRequest.GetInt("fee", 0);
                    }
                }

                if (TradeLogs.UpdateTradeLog(goodstradelog, oldstatus, true))
                {
                    SetUrl("offlinetrade.aspx?goodstradelogid=" + goodstradelogid);
                    SetMetaRefresh();
                    AddMsgLine("交易单已更新, 现在转入交易单页面<br />(<a href=\"" + "offlinetrade.aspx?goodstradelogid=" + goodstradelogid + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                }
            }
        }
Exemple #29
0
        protected override void ShowPage()
        {
            pagetitle = "首页";

            score = Scoresets.GetValidScoreName();

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

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

            if (newpmcount > 0)
            {
                pmlist = PrivateMessages.GetPrivateMessageCollectionForIndex(userid, 5, 1, 1);
            }

            userinfo = new ShortUserInfo();
            if (userid != -1)
            {
                userinfo = Discuz.Forum.Users.GetShortUserInfo(userid);
                if (userinfo.Newpm == 0)
                {
                    base.newpmcount = 0;
                }
                lastvisit  = userinfo.Lastvisit.ToString();
                showpmhint = Convert.ToInt32(userinfo.Newsletter) > 4;
            }

            Statistics.GetPostCountFromForum(0, out totaltopic, out totalpost, out todayposts);
            digesttopiclist = Focuses.GetDigestTopicList(16);
            hottopiclist    = Focuses.GetHotTopicList(16, 30);
            forumlinklist   = Caches.GetForumLinkList();
            forumlinkcount  = forumlinklist.Rows.Count;

            // 获得统计信息
            totalusers   = Utils.StrToInt(Statistics.GetStatisticsRowItem("totalusers"), 0);
            lastusername = Statistics.GetStatisticsRowItem("lastusername");
            lastuserid   = Utils.StrToInt(Statistics.GetStatisticsRowItem("lastuserid"), 0);

            totalonline = onlineusercount;

            showforumonline = false;
            if (totalonline < config.Maxonlinelist || DNTRequest.GetString("showonline") == "yes")
            {
                showforumonline = true;
                onlineuserlist  = OnlineUsers.GetOnlineUserList(onlineusercount, out totalonlineguest, out totalonlineuser, out totalonlineinvisibleuser);
                onlineiconlist  = Caches.GetOnlineGroupIconList();
            }

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

            highestonlineusercount = Statistics.GetStatisticsRowItem("highestonlineusercount");
            highestonlineusertime  = Statistics.GetStatisticsRowItem("highestonlineusertime");

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

            ///得到广告列表
            headerad   = Advertisements.GetOneHeaderAd("indexad", 0);
            footerad   = Advertisements.GetOneFooterAd("indexad", 0);
            pagewordad = Advertisements.GetPageWordAd("indexad", 0);
            doublead   = Advertisements.GetDoubleAd("indexad", 0);
            floatad    = Advertisements.GetFloatAd("indexad", 0);
        }
Exemple #30
0
    //Treba riješiti sranje s firstloseom da se ne zove stalno, vjv u lateupdateu
    private void LateUpdate()
    {
        if (!GameTimer.Pause)
        {
            if (Input.touches.Length > 0)
            {
                Touch touch  = Input.touches[0];
                float deltaX = 0F;
                float deltaY = 0F;

                if (touch.phase == TouchPhase.Began)
                {
                    Vector3 position = Camera.main.ScreenToWorldPoint(touch.position);
                    hitPoint      = Physics2D.OverlapPoint(position);
                    startPosition = touch.position;
                    if (hitPoint != null)
                    {
                        swipeableObject = hitPoint.transform.GetComponent <ISwipeableObject>();
                    }
                }
                if (touch.phase == TouchPhase.Moved)
                {
                    endPosition = touch.position;
                    deltaX      = endPosition.x - startPosition.x;
                    deltaY      = endPosition.y - startPosition.y;
                    swipeableObject.Swipe(deltaX, deltaY);
                }
            }
        }

        //---------------------------------------------------

        if (!PlayerInfluence.lostGame)
        {
            if (lifePoints == 3)
            {
                backgroundControl.SetHP3();
            }
            else if (lifePoints == 2)
            {
                backgroundControl.SetHP2();
            }
            else if (lifePoints == 1)
            {
                backgroundControl.SetHP1();
            }
            else if (lifePoints == 0)
            {
                backgroundControl.SetHP0();
                continuePanelCounter.text = GameTimer.continueTime.ToString();
                if (!firstlose)
                {
                    Time.timeScale = 0;
                    GameTimer.Stop();
                    pauseButton.SetActive(false);
                    if (Application.internetReachability != NetworkReachability.NotReachable &&
                        Advertisements.IsReady())
                    {
                        OneMoreChance();
                    }
                    else
                    {
                        LoseGame();
                    }
                }
                else if (GameTimer.continueTime < 1 && firstlose || AdHandler.ContinuePressed)
                {
                    oneMoreChancePanel.SetActive(false);
                    LoseGame();
                }
            }
        }
    }