website.aspx.cs.rename
上传用户:wenllgg125
上传日期:2020-04-09
资源大小:7277k
文件大小:8k
源码类别:

SCSI/ASPI

开发平台:

Others

  1. using System;
  2. using System.Data;
  3. using Discuz.Common;
  4. using Discuz.Common.Generic;
  5. using Discuz.Forum;
  6. using Discuz.Entity;
  7. using Discuz.Aggregation;
  8. using Discuz.Plugin.Album;
  9. namespace Discuz.Web
  10. {
  11.     /// <summary>
  12.     /// 聚合首页
  13.     /// </summary>
  14.     public class website : PageBase
  15.     {
  16.         /// <summary>
  17.         /// 论坛推荐主题
  18.         /// </summary>
  19.         public PostInfo[] postlist = AggregationFacade.ForumAggregation.GetPostListFromFile("Website");
  20.         /// <summary>
  21.         /// 论坛聚合主题
  22.         /// </summary>
  23.         public DataTable topiclist = AggregationFacade.ForumAggregation.GetForumTopicList();
  24.         /// <summary>
  25.         /// 用户聚合数据
  26.         /// </summary>
  27.         public DataTable userlist;
  28.         /// <summary>
  29.         /// 聚合空间数据
  30.         /// </summary>
  31.         public SpaceConfigInfoExt[] spaceconfigs = AggregationFacade.SpaceAggregation.GetSpaceListFromFile("Website");
  32.         /// <summary>
  33.         /// 聚合相册数据
  34.         /// </summary>
  35.         public AlbumInfo[] albuminfos;
  36.         /// <summary>
  37.         /// 聚合日志数据
  38.         /// </summary>
  39.         public SpaceShortPostInfo[] spacepostlist = AggregationFacade.SpaceAggregation.GetSpacePostList("Website");
  40.         /// <summary>
  41.         /// 最近更新的空间
  42.         /// </summary>
  43.         public DataTable recentupdatespaceList;
  44.         /// <summary>
  45.         /// 友情链接列表
  46.         /// </summary>
  47.         public DataTable forumlinklist = Caches.GetForumLinkList();
  48.         /// <summary>
  49.         /// 友情链接数量
  50.         /// </summary>
  51.         public int forumlinkcount;
  52.         /// <summary>
  53.         /// 公告数量
  54.         /// </summary>
  55.         public int announcementcount = 0;
  56.         /// <summary>
  57.         /// 公告列表
  58.         /// </summary>
  59.         public DataTable announcementlist;
  60.         /// <summary>
  61.         /// 图片轮显数据
  62.         /// </summary>
  63.         public string rotatepicdata = AggregationFacade.BaseAggregation.GetRotatePicData();
  64.         /// <summary>
  65.         /// 聚合图片信息
  66.         /// </summary>
  67.         public PhotoAggregationInfo photoconfig = AggregationFacade.PhotoAggregation.GetPhotoAggregationInfo();
  68.         /// <summary>
  69.         /// 推荐相册列表
  70.         /// </summary>
  71.         public List<AlbumInfo> recommendalbumlist = AggregationFacade.AlbumAggregation.GetRecommandAlbumList("Website");
  72.         /// <summary>
  73.         /// 相册分类列表
  74.         /// </summary>
  75.         public Discuz.Common.Generic.List<AlbumCategoryInfo> albumcategorylist;
  76.         /// <summary>
  77.         /// 图片列表
  78.         /// </summary>
  79.         public Discuz.Common.Generic.List<PhotoInfo> photolist;
  80.         /// <summary>
  81.         /// 焦点相册列表
  82.         /// </summary>
  83.         public Discuz.Common.Generic.List<AlbumInfo> albumlist;
  84.         public ForumAggregationData forumagg = Discuz.Aggregation.AggregationFacade.ForumAggregation;
  85.         public AlbumAggregationData albumagg = Discuz.Aggregation.AggregationFacade.AlbumAggregation;
  86.         public SpaceAggregationData spaceagg = Discuz.Aggregation.AggregationFacade.SpaceAggregation;
  87.         public GoodsAggregationData goodsagg = Discuz.Aggregation.AggregationFacade.GoodsAggregation;
  88.         /// <summary>
  89.         /// 总主题数
  90.         /// </summary>
  91.         public int totaltopic;
  92.         /// <summary>
  93.         /// 总帖子数
  94.         /// </summary>
  95.         public int totalpost;
  96.         /// <summary>
  97.         /// 总用户数
  98.         /// </summary>
  99.         public int totalusers;
  100.         /// <summary>
  101.         /// 今日帖数
  102.         /// </summary>
  103.         public int todayposts;
  104.         /// <summary>
  105.         /// 昨日帖数
  106.         /// </summary>
  107.         public int yesterdayposts;
  108.         /// <summary>
  109.         /// 最高日帖数
  110.         /// </summary>
  111.         public int highestposts;
  112.         /// <summary>
  113.         /// 最高发帖日
  114.         /// </summary>
  115.         public string highestpostsdate;
  116.         /// <summary>
  117.         /// 最新注册的用户名
  118.         /// </summary>
  119.         public string lastusername;
  120.         /// <summary>
  121.         /// 最新注册的用户Id
  122.         /// </summary>
  123.         public int lastuserid;
  124.         /// <summary>
  125.         /// 总在线用户数
  126.         /// </summary>
  127.         public int totalonline;
  128.         /// <summary>
  129.         /// 总在线注册用户数
  130.         /// </summary>
  131.         public int totalonlineuser;
  132.         /// <summary>
  133.         /// 总在线游客数
  134.         /// </summary>
  135.         public int totalonlineguest;
  136.         /// <summary>
  137.         /// 总在线隐身用户数
  138.         /// </summary>
  139.         public int totalonlineinvisibleuser;
  140.         /// <summary>
  141.         /// 最高在线用户数
  142.         /// </summary>
  143.         public string highestonlineusercount;
  144.         /// <summary>
  145.         /// 最高在线用户数发生时间
  146.         /// </summary>
  147.         public string highestonlineusertime;
  148.         /// <summary>
  149.         /// 最新空间评论列表
  150.         /// </summary>
  151.         public DataTable topspacecomments;
  152.         /// <summary>
  153.         /// 标签列表
  154.         /// </summary>
  155.         public TagInfo[] taglist;
  156.         public GoodsinfoCollection goodscoll = new GoodsinfoCollection();
  157.         /// <summary>
  158.         /// 对联广告
  159.         /// </summary>
  160.         public string doublead;
  161.         /// <summary>
  162.         /// 浮动广告
  163.         /// </summary>
  164.         public string floatad;
  165.         /// <summary>
  166.         /// 用户发帖排行
  167.         /// </summary>
  168.         public List<UserPostCountInfo> userPostCountInfoList = new List<UserPostCountInfo>();
  169.         protected override void ShowPage()
  170.         {
  171.             pagetitle = "首页";
  172.             // 得到公告
  173.             announcementlist = Announcements.GetSimplifiedAnnouncementList(nowdatetime, "2999-01-01 00:00:00");
  174.             if (announcementlist != null)
  175.                 announcementcount = announcementlist.Rows.Count;
  176.             // 友情链接
  177.             forumlinkcount = forumlinklist.Rows.Count;
  178.             Forums.GetForumIndexCollection(config.Hideprivate, usergroupid, config.Moddisplay, out totaltopic, out totalpost, out todayposts);
  179.             // 获得统计信息
  180.             totalusers = TypeConverter.StrToInt(Statistics.GetStatisticsRowItem("totalusers"));
  181.             lastusername = Statistics.GetStatisticsRowItem("lastusername");
  182.             lastuserid = TypeConverter.StrToInt(Statistics.GetStatisticsRowItem("lastuserid"));
  183.             yesterdayposts = TypeConverter.StrToInt(Statistics.GetStatisticsRowItem("yesterdayposts"));
  184.             highestposts = TypeConverter.StrToInt(Statistics.GetStatisticsRowItem("highestposts"));
  185.             highestpostsdate = Statistics.GetStatisticsRowItem("highestpostsdate").ToString().Trim();
  186.             if (todayposts > highestposts)
  187.             {
  188.                 highestposts = todayposts;
  189.                 highestpostsdate = DateTime.Now.ToString("yyyy-M-d");
  190.             }
  191.             totalonline = onlineusercount;
  192.             OnlineUsers.GetOnlineUserCollection(out totalonline, out totalonlineguest, out totalonlineuser, out totalonlineinvisibleuser);
  193.             highestonlineusercount = Statistics.GetStatisticsRowItem("highestonlineusercount");
  194.             highestonlineusertime = Statistics.GetStatisticsRowItem("highestonlineusertime");
  195.             //相册
  196.             if (config.Enablealbum == 1 && AlbumPluginProvider.GetInstance() != null)
  197.                 albumcategorylist = AlbumPluginProvider.GetInstance().GetAlbumCategory();
  198.             if (config.Enablespace == 1 && AggregationFacade.SpaceAggregation.GetSpaceTopComments() != null)
  199.                 topspacecomments = AggregationFacade.SpaceAggregation.GetSpaceTopComments();
  200.             taglist = (config.Enabletag == 1 ? ForumTags.GetCachedHotForumTags(config.Hottagcount) : new TagInfo[0]);
  201.             doublead = Advertisements.GetDoubleAd("indexad", 0);
  202.             floatad = Advertisements.GetFloatAd("indexad", 0);
  203.         }
  204.     }
  205. }