Exemple #1
0
        public static string Getnovellist(string m_where, int Top, int CutTitle, string Model)
        {
            StringBuilder sb = new StringBuilder();

            var NovelList = BookView.GetModelList(m_where, Top.ToInt32());

            foreach (var b in NovelList)
            {
                string str = Model;
                str = str.Replace("{id}", b.ID.ToS());
                str = str.Replace("{title}", b.Title.CutString(CutTitle));
                str = str.Replace("{author}", b.Author);
                str = str.Replace("{classid}", b.ClassID.ToS());
                str = str.Replace("{classname}", b.ClassName);
                str = str.Replace("{clickcount}", b.ClickCount.ToS());
                str = str.Replace("{lastchapterid}", b.LastChapterID.ToS());
                str = str.Replace("{lastchaptertitle}", b.LastChapterTitle);
                str = str.Replace("{tjcount}", b.TjCount.ToS());
                str = str.Replace("{url}", BasePage.GetBookUrl(b, BookView.GetClass(b)));

                sb.Append(str);
            }

            return(sb.ToS());
        }
Exemple #2
0
        /// <summary>
        /// 获取最新更新的书籍
        /// </summary>
        /// <param name="top"></param>
        /// <returns></returns>
        public string getnoveltopupdate(string top)
        {
            int           i_top = top.ToInt32();
            List <Book>   bs    = BookView.GetModelList("Enable=1 order by UpdateTime desc", i_top);
            StringBuilder sb    = new StringBuilder();

            //foreach (Book b in bs)
            for (int i = 0; i < bs.Count; i++)
            {
                Book   b         = bs[i];
                Class  c         = BookView.GetClass(b);
                string str_style = "";
                if (i % 2 == 0)
                {
                    str_style = " style=\"background-color: #f5f5f5\"";
                }

                sb.AppendLine(string.Format("<tr" + str_style + "><td>[<a target=\"_blank\" href=\"{0}\" class=\"sort\">{1}</a>]</td><td><a class=\"name\" target=\"_blank\" href=\"{2}\">{3}</a> <a target=\"_blank\" href=\"{4}\" class=\"chapter\">{5}</a></td><td><a target=\"_blank\" href=\"/Search.aspx?m=4&key={6}\" class=\"author\">{6}</a></td><td style=\"color: #666666\">{7}</td></tr>",
                                            BasePage.GetClassUrl(c),
                                            b.ClassName,
                                            BasePage.GetBookUrl(b, c),
                                            b.Title,
                                            BasePage.GetBookChapterUrl(BookChapterView.GetModelByID(b.LastChapterID.ToS()), c),
                                            b.LastChapterTitle,
                                            b.Author,
                                            b.UpdateTime.ToString("MM-dd HH:mm")
                                            ));
            }
            return(sb.ToS());
        }
Exemple #3
0
        /// <summary>
        /// 获取最新更新的书籍 Metro风格
        /// </summary>
        /// <param name="top"></param>
        /// <returns></returns>
        public string getnoveltopmetroupdate(string top)
        {
            int           i_top = top.ToInt32();
            List <Book>   bs    = BookView.GetModelList("Enable=1 order by UpdateTime desc", i_top);
            StringBuilder sb    = new StringBuilder();
            int           i     = 1;

            foreach (Book b in bs)
            {
                Class c = BookView.GetClass(b);
                sb.AppendLine(string.Format("<li style=\" background-color:{0};\"><div class=\"item\"><h1><a href=\"{1}\">" + i + ".{2}</a></h1><div><div class=\"lastchapter\"><a href=\"{5}\">{6}</a></div></div></div><div class=\"item\"><h1><a href=\"{1}\">阅读书籍</a></h1><div><div class=\"lastchapter\"><a href=\"{5}\" title=\"{6}\">阅读最新章节</a></div><div class=\"class\">分类:<a href=\"{3}\">{4}</a></div><div class=\"author\">作者:{8}</div><div class=\"time\">更新时间:{9}</div></div></div></li>",
                                            BasePage.RandomBGColor(),
                                            BasePage.GetBookUrl(b, c),
                                            b.Title,
                                            BasePage.GetClassUrl(c),
                                            b.ClassName,
                                            BasePage.GetBookChapterUrl(BookChapterView.GetModelByID(b.LastChapterID.ToS()), c),
                                            b.LastChapterTitle,
                                            b.LastChapterTitle.CutString(12),
                                            b.Author,
                                            b.UpdateTime.ToString("MM-dd HH:mm")
                                            ));
                i++;
            }
            return(sb.ToS());
        }
Exemple #4
0
        /// <summary>
        /// 生成内容页--图片
        /// </summary>
        /// <param name="album"></param>
        /// <param name="cls"></param>
        public static void CreateContentPage(Book b, Class cls)
        {
            TemplateHelper h        = new TemplateHelper();
            string         FileName = BasePage.GetBookUrl(b, cls);

            Voodoo.IO.File.Write(System.Web.HttpContext.Current.Server.MapPath("~" + FileName), h.CreateContentPage(b, cls));

            ping(BasePage.SystemSetting.SiteUrl.TrimEnd('/') + FileName);

            CreatePagesByCrateWith(3);
        }
Exemple #5
0
        /// <summary>
        /// 获取小说分类新闻
        /// </summary>
        /// <param name="ClassID">分类ID</param>
        /// <param name="Top">所取条数</param>
        /// <returns></returns>
        public static string getclassnews(string ClassID, string Top)
        {
            List <Book>   qs = BookView.GetModelList(string.Format("ClassID in(select id from Class where ID={0} union select id from Class where ParentID={0}) order by clickcount desc", ClassID), Top.ToInt32(12));
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < qs.Count; i++)
            {
                if (i == 0)
                {
                    sb.AppendLine(string.Format("<ul class=\"picList\"><li><a href=\"{0}\" title=\"{1}\" class=\"ablum\"><img src=\"{3}\" alt=\"{1}\" width=\"120\" height=\"160\" /></a><div class=\"text\"><h2 class=\"h22\"><a href=\"{0}\" title=\"{1}\" target=\"_blank\">《{1}》</a></h2><p>{2}</p></div></li>",
                                                BasePage.GetBookUrl(qs[i], BookView.GetClass(qs[i])),
                                                qs[i].Title,
                                                qs[i].Intro.CutString(150),
                                                qs[i].FaceImage.IsNull("/Book/Bookface/0.jpg")
                                                ));
                }
                else if (i == 1)
                {
                    sb.AppendLine(string.Format("<li><a href=\"{0}\" title=\"{1}\" class=\"ablum\"><img src=\"{3}\" alt=\"{1}\" width=\"120\" height=\"160\" /></a><div class=\"text\"><h2 class=\"h22\"><a href=\"{0}\" title=\"{1}\" target=\"_blank\">《{1}》</a></h2><p>{2}</p></div></li></ul>",
                                                BasePage.GetBookUrl(qs[i], BookView.GetClass(qs[i])),
                                                qs[i].Title,
                                                qs[i].Intro.CutString(150),
                                                qs[i].FaceImage.IsNull("/Book/Bookface/0.jpg")
                                                ));
                }
                else if (i == 2)
                {
                    sb.AppendLine(string.Format("<ul class=\"newsList\"><li><a target=\"_blank\" title=\"{1}\" href=\"{0}\">{1}:{2}</a></li>",
                                                BasePage.GetBookUrl(qs[i], BookView.GetClass(qs[i])),
                                                qs[i].Title,
                                                qs[i].Intro.CutString(25)
                                                ));
                }
                else
                {
                    sb.AppendLine(string.Format("<li><a target=\"_blank\" title=\"{1}\" href=\"{0}\">{1}:{2}</a></li>",
                                                BasePage.GetBookUrl(qs[i], BookView.GetClass(qs[i])),
                                                qs[i].Title,
                                                qs[i].Intro.CutString(25)
                                                ));
                }
            }//end for
            sb.AppendLine("</ul>");
            return(sb.ToS());
        }
Exemple #6
0
        /// <summary>
        /// 获取小说列表
        /// </summary>
        /// <param name="m_where"></param>
        /// <returns></returns>
        public static string getnovellist(string m_where, string Top, string CutTitle, string firstClass, string ShowClickCount)
        {
            StringBuilder sb = new StringBuilder();

            var NovelList = BookView.GetModelList(m_where, Top.ToInt32());

            foreach (var b in NovelList)
            {
                string str_cls = "";
                if (firstClass.Length > 0 && b == NovelList.First())
                {
                    str_cls = " class=\"" + firstClass + "\"";
                }

                string str_clickcount = "";
                if (ShowClickCount.ToBoolean())
                {
                    str_clickcount = string.Format("<span>{0}</span>", b.ClickCount);
                }

                sb.Append(string.Format("<li" + str_cls + "><a title=\"{0}\" href=\"{1}\">{2}</a>{3}</li>", b.Title, BasePage.GetBookUrl(b, BookView.GetClass(b)), b.Title.CutString(CutTitle.ToInt32(10)), str_clickcount));
            }

            return(sb.ToS());
        }