Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var chapters = BookChapterView.GetModelList("enable=1 order by UpdateTime desc", 500);
            var items    = new List <Voodoo.other.SEO.RssItem>();

            foreach (var chapter in chapters)
            {
                items.Add(new Voodoo.other.SEO.RssItem()
                {
                    Title       = chapter.BookTitle + "-" + chapter.Title,
                    PutTime     = chapter.UpdateTime,
                    Link        = SystemSetting.SiteUrl + GetBookChapterUrl(chapter, BookView.GetClass(chapter)),
                    Description = chapter.BookTitle + "Update to chapter:" + chapter.Title + ", from chanel" + chapter.ClassName
                });
            }

            var movies = MovieInfoView.GetModelList();

            foreach (var m in movies)
            {
                items.Add(new Voodoo.other.SEO.RssItem()
                {
                    Title       = m.Title,
                    PutTime     = m.UpdateTime,
                    Link        = SystemSetting.SiteUrl + GetMovieUrl(m, MovieInfoView.GetClass(m)),// GetBookChapterUrl(chapter, BookView.GetClass(chapter)),
                    Description = m.Title + "Update to :" + m.LastDramaTitle + ", from chanel" + m.ClassName + ", Intro:" + m.Intro
                });
            }

            Response.Clear();
            Voodoo.other.SEO.Rss.GetRss(items, SystemSetting.SiteName, SystemSetting.SiteUrl, SystemSetting.Description, SystemSetting.Copyright);
        }
Beispiel #2
0
        /// <summary>
        /// 获取演员列表
        /// </summary>
        /// <param name="top"></param>
        /// <param name="m_where"></param>
        /// <param name="templatestring"></param>
        /// <returns></returns>
        public static string getactorlist(string cutstring, string m_where, string top, string templatestring)
        {
            StringBuilder sb      = new StringBuilder();
            var           movies  = MovieInfoView.GetModelList(m_where);
            List <string> results = new List <string>();

            var actors = movies.GroupBy(p => p.Actors).OrderByDescending(p => p.Count()).Take(top.ToInt32(10));

            foreach (var actor in actors)
            {
                string[] acts = actor.Key.Split('/', ':', ',');
                foreach (string str in acts)
                {
                    results.Add(str);
                }
            }

            //分组处理最终结果
            var al_result = results.GroupBy(p => p.ToString()).OrderByDescending(p => p.Count());

            foreach (var str in al_result)
            {
                string tmp = templatestring;
                tmp = tmp.Replace("{name}", str.Key.ToS());
                tmp = tmp.Replace("{fname}", str.Key.ToS().CutString(cutstring.ToInt32(100)));
                sb.AppendLine(tmp);
            }
            return(sb.ToS());
        }
Beispiel #3
0
        /// <summary>
        /// 获取年代列表
        /// </summary>
        /// <param name="m_where"></param>
        /// <param name="top"></param>
        /// <param name="templatestring"></param>
        /// <returns></returns>
        public static string getyearlist(string cutstring, string m_where, string top, string templatestring)
        {
            StringBuilder sb = new StringBuilder();

            var movies = MovieInfoView.GetModelList(m_where);

            var years = movies.GroupBy(p => p.PublicYear).OrderByDescending(p => p.Count()).Take(top.ToInt32(10));

            foreach (var year in years)
            {
                string tmp = templatestring;
                tmp = tmp.Replace("{name}", year.Key.Replace(":", ""));
                tmp = tmp.Replace("{fname}", year.Key.Replace(":", "").CutString(cutstring.ToInt32(100)));
                sb.AppendLine(tmp);
            }

            return(sb.ToS());
        }
Beispiel #4
0
        /// <summary>
        /// 获取电影列表
        /// </summary>
        /// <param name="top">条数</param>
        /// <param name="custitle">标题截取</param>
        /// <param name="m_where">条件语句</param>
        /// <param name="htmlTemp">模板</param>
        /// <returns></returns>
        public static string getmovielist(string top, string custitle, string m_where, string htmlTemp)
        {
            StringBuilder sb = new StringBuilder();

            List <MovieInfo> movies = MovieInfoView.GetModelList(m_where, top.ToInt32());
            var i = 0;

            foreach (MovieInfo m in movies)
            {
                i++;
                string item = htmlTemp;
                item = item.Replace("{url}", BasePage.GetMovieUrl(m, MovieInfoView.GetClass(m)));
                item = item.Replace("{id}", m.Id.ToS());
                item = item.Replace("{authors}", m.Actors);
                item = item.Replace("{classid}", m.ClassID.ToS());
                item = item.Replace("{classname}", m.ClassName);
                item = item.Replace("{director}", m.Director);
                item = item.Replace("{faceimage}", m.FaceImage);
                item = item.Replace("{inserttime}", m.InsertTime.ToString("yyyy-MM-dd"));
                item = item.Replace("{intro}", m.Intro);
                item = item.Replace("{ismovie}", m.IsMove ? "电影" : "电视剧");
                item = item.Replace("{lastdramatitle}", m.LastDramaTitle);
                item = item.Replace("{location}", m.Location);
                item = item.Replace("{publicyear}", m.PublicYear);
                item = item.Replace("{status}", m.Status == 0 ? "更新中" : "完结");
                item = item.Replace("{tags}", m.Tags);
                item = item.Replace("{title}", m.Title);
                item = item.Replace("{ftitle}", m.Title.CutString(custitle.ToInt32()));
                item = item.Replace("{updatetime}", m.UpdateTime.ToString("yyyy-MM-dd"));
                item = item.Replace("{clickcount}", m.ClickCount.ToS());
                //item = item.Replace("{clickcount}", m.ClickCount.ToS());
                item = item.Replace("{replycount}", m.ReplyCount.ToS());
                item = item.Replace("{scoreavg}", m.ScoreAvg.ToS());
                item = item.Replace("{rownum}", i.ToS());
                item = item.Replace("{index}", (i - 1).ToS());
                sb.Append(item);
            }
            return(sb.ToS());
        }