diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 7703a12..e59f063 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -656 \ No newline at end of file +658 \ No newline at end of file diff --git a/Builder/IISUploadHandler/build.txt b/Builder/IISUploadHandler/build.txt index bbb3d18..116f2e3 100644 --- a/Builder/IISUploadHandler/build.txt +++ b/Builder/IISUploadHandler/build.txt @@ -1 +1 @@ -389 \ No newline at end of file +391 \ No newline at end of file diff --git a/IISMainHandler/HandlersFactory.cs b/IISMainHandler/HandlersFactory.cs index 1332c23..c0c2d4b 100644 --- a/IISMainHandler/HandlersFactory.cs +++ b/IISMainHandler/HandlersFactory.cs @@ -30,6 +30,8 @@ namespace FLocal.IISHandler { switch(context.requestParts[0].ToLower()) { case "q": return new handlers.response.QuickLinkHandler(); + case "allposts": + return new handlers.response.AllPostsHandler(); case "boards": return new handlers.BoardsHandler(); case "board": diff --git a/IISMainHandler/IISMainHandler.csproj b/IISMainHandler/IISMainHandler.csproj index 94ba77f..e0e6c1d 100644 --- a/IISMainHandler/IISMainHandler.csproj +++ b/IISMainHandler/IISMainHandler.csproj @@ -72,6 +72,7 @@ + diff --git a/IISMainHandler/handlers/response/AllPostsHandler.cs b/IISMainHandler/handlers/response/AllPostsHandler.cs new file mode 100644 index 0000000..993f9b6 --- /dev/null +++ b/IISMainHandler/handlers/response/AllPostsHandler.cs @@ -0,0 +1,43 @@ +п»їusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Xml.Linq; +using FLocal.Common; +using FLocal.Common.dataobjects; +using FLocal.Core; +using FLocal.Core.DB; +using FLocal.Core.DB.conditions; + +namespace FLocal.IISHandler.handlers.response { + + class AllPostsHandler : AbstractGetHandler { + + override protected string templateName { + get { + return "AllPosts.xslt"; + } + } + + override protected XElement[] getSpecificData(WebContext context) { + PageOuter pageOuter = PageOuter.createFromGet( + context.requestParts, + context.userSettings.postsPerPage, + 3 + ); + IEnumerable posts = from stringId in Config.instance.mainConnection.LoadIdsByConditions(Post.TableSpec.instance, new EmptyCondition(), pageOuter, new JoinSpec[0], new SortSpec[] { new SortSpec(Post.TableSpec.instance.getIdSpec(), false) }) select Post.LoadById(int.Parse(stringId)); + + XElement[] result = new XElement[] { + new XElement("posts", + from post in posts select post.exportToXmlWithoutThread(context, true), + pageOuter.exportToXml(2, 5, 2) + ) + }; + + return result; + } + + } + +} \ No newline at end of file diff --git a/templates/Full/AllPosts.xslt b/templates/Full/AllPosts.xslt new file mode 100644 index 0000000..7d47db5 --- /dev/null +++ b/templates/Full/AllPosts.xslt @@ -0,0 +1,70 @@ + + + + + + Все сообщения + + + + + + +
+ + + + +
+ + + + +
+ + Все сообщения + +
+
+
+
+ + + + +
+ + + + + + + + +
+ + + + +
+ страницы: + + /AllPosts/ + +
+
+ + + + +
+ страницы: + + /AllPosts/ + +
+
+
+
+ +
\ No newline at end of file diff --git a/templates/Full/Boards.xslt b/templates/Full/Boards.xslt index 0530643..0cc0635 100644 --- a/templates/Full/Boards.xslt +++ b/templates/Full/Boards.xslt @@ -54,7 +54,10 @@ Просмотр новых сообщений
- Последние 7 дней + + /AllPosts/ + Последние 7 дней +
/User//Replies/