diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index afbe847..4701cc7 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -126 \ No newline at end of file +150 \ No newline at end of file diff --git a/Common/dataobjects/Board.cs b/Common/dataobjects/Board.cs index 5f699c2..39757a2 100644 --- a/Common/dataobjects/Board.cs +++ b/Common/dataobjects/Board.cs @@ -95,6 +95,11 @@ namespace FLocal.Common.dataobjects { return this._parentBoardId; } } + public Board parentBoard { + get { + return Board.LoadById(this.parentBoardId.Value); + } + } protected override void doFromHash(Dictionary data) { this._sortOrder = int.Parse(data[TableSpec.FIELD_SORTORDER]); @@ -146,7 +151,16 @@ namespace FLocal.Common.dataobjects { } } - public XElement exportToXmlForMainPage(UserContext context) { + public XElement exportToXmlSimpleWithParent(UserContext context) { + return new XElement("board", + new XElement("id", this.id), + new XElement("name", this.name), + new XElement("description", this.description), + new XElement("parent", this.parentBoardId.HasValue ? this.parentBoard.exportToXmlSimpleWithParent(context) : this.category.exportToXmlSimple(context)) + ); + } + + public XElement exportToXml(UserContext context, bool includeSubBoards) { XElement result = new XElement("board", new XElement("id", this.id), new XElement("sortOrder", this.sortOrder), @@ -159,9 +173,9 @@ namespace FLocal.Common.dataobjects { new XElement("lastPostInfo", this.exportLastPostInfo()) ); - if(!this.parentBoardId.HasValue) { + if(includeSubBoards) { result.Add(new XElement("subBoards", - from board in this.subBoards select board.exportToXmlForMainPage(context) + from board in this.subBoards select board.exportToXml(context, false) )); } diff --git a/Common/dataobjects/Category.cs b/Common/dataobjects/Category.cs index c9ec45d..3c9c413 100644 --- a/Common/dataobjects/Category.cs +++ b/Common/dataobjects/Category.cs @@ -96,11 +96,19 @@ namespace FLocal.Common.dataobjects { } } + public XElement exportToXmlSimple(UserContext context) { + return new XElement("category", + new XElement("id", this.id), + new XElement("name", this.name) + ); + } + public XElement exportToXmlForMainPage(UserContext context) { return new XElement("category", + new XElement("id", this.id), new XElement("name", this.name), new XElement("sortOrder", this.sortOrder), - new XElement("boards", from board in this.subBoards select board.exportToXmlForMainPage(context)) + new XElement("boards", from board in this.subBoards select board.exportToXml(context, true)) ); } diff --git a/IISMainHandler/HandlersFactory.cs b/IISMainHandler/HandlersFactory.cs index 3fd33f3..340175f 100644 --- a/IISMainHandler/HandlersFactory.cs +++ b/IISMainHandler/HandlersFactory.cs @@ -13,15 +13,16 @@ namespace FLocal.IISHandler { // return new handlers.WrongUrlHandler(); // throw new FLocalException("Malformed url"); // } - string[] requestParts = context.httprequest.Path.Split("/", StringSplitOptions.RemoveEmptyEntries); - if(requestParts.Length < 1) return new handlers.RootHandler(); - switch(requestParts[0]) { + if(context.requestParts.Length < 1) return new handlers.RootHandler(); + switch(context.requestParts[0].ToLower()) { case "boards": return new handlers.BoardsHandler(); + case "board": + return new handlers.BoardHandler(); case "static": - return new handlers.StaticHandler(requestParts); + return new handlers.StaticHandler(context.requestParts); default: - return new handlers.DebugHandler(requestParts[0]); + return new handlers.DebugHandler(context.requestParts[0]); } } diff --git a/IISMainHandler/IISMainHandler.csproj b/IISMainHandler/IISMainHandler.csproj index e6467b4..7009b25 100644 --- a/IISMainHandler/IISMainHandler.csproj +++ b/IISMainHandler/IISMainHandler.csproj @@ -53,6 +53,7 @@ + diff --git a/IISMainHandler/WebContext.cs b/IISMainHandler/WebContext.cs index 37d5da6..48a5f1c 100644 --- a/IISMainHandler/WebContext.cs +++ b/IISMainHandler/WebContext.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; +using FLocal.Core; namespace FLocal.IISHandler { class WebContext : Common.UserContext { @@ -15,6 +16,13 @@ namespace FLocal.IISHandler { } } + private object requestParts_Locker = new object(); + public string[] requestParts { + get { + return Cache.instance.get(requestParts_Locker, () => this.httprequest.Path.Split("/", StringSplitOptions.RemoveEmptyEntries)); + } + } + public HttpResponse httpresponse { get { return this.httpcontext.Response; diff --git a/IISMainHandler/handlers/BoardHandler.cs b/IISMainHandler/handlers/BoardHandler.cs new file mode 100644 index 0000000..bde4754 --- /dev/null +++ b/IISMainHandler/handlers/BoardHandler.cs @@ -0,0 +1,30 @@ +п»ї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; + +namespace FLocal.IISHandler.handlers { + + class BoardHandler : AbstractGetHandler { + + override protected string templateName { + get { + return "Board.xslt"; + } + } + + override protected XElement[] getSpecificData(WebContext context) { + Board board = Board.LoadById(int.Parse(context.requestParts[1])); + return new XElement[] { + new XElement("currentBoard", board.exportToXmlSimpleWithParent(context)), + new XElement("boards", from subBoard in board.subBoards select subBoard.exportToXml(context, true)) + }; + } + + } + +} \ No newline at end of file diff --git a/IISMainHandler/handlers/RootHandler.cs b/IISMainHandler/handlers/RootHandler.cs index a1773a4..de18056 100644 --- a/IISMainHandler/handlers/RootHandler.cs +++ b/IISMainHandler/handlers/RootHandler.cs @@ -11,12 +11,12 @@ namespace FLocal.IISHandler.handlers { override protected string templateName { get { - throw new NotImplementedException(); + return "Root.xslt"; } } override protected XElement[] getSpecificData(WebContext context) { - throw new NotImplementedException(); + return new XElement[0]; } } diff --git a/IISMainHandler/handlers/StaticHandler.cs b/IISMainHandler/handlers/StaticHandler.cs index 0146ddc..41a197f 100644 --- a/IISMainHandler/handlers/StaticHandler.cs +++ b/IISMainHandler/handlers/StaticHandler.cs @@ -21,7 +21,7 @@ namespace FLocal.IISHandler.handlers { throw new HttpException(403, "listing not allowed"); } - Regex checker = new Regex("^[a-z][0-9a-z]*(\\.[a-zA-Z]+)?$", RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.Singleline); + Regex checker = new Regex("^[a-z][0-9a-z\\-]*(\\.[a-zA-Z]+)?$", RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.Singleline); string path = ""; for(int i=1; i tr > td, .tableborders > tr > td { + border:solid 1px black; +} \ No newline at end of file diff --git a/static/images/all.gif b/static/images/all.gif new file mode 100644 index 0000000..5982706 Binary files /dev/null and b/static/images/all.gif differ diff --git a/static/images/book-notread.gif b/static/images/book-notread.gif new file mode 100644 index 0000000..c327ebb Binary files /dev/null and b/static/images/book-notread.gif differ diff --git a/static/images/book-read.gif b/static/images/book-read.gif new file mode 100644 index 0000000..1ee9f27 Binary files /dev/null and b/static/images/book-read.gif differ diff --git a/static/images/chat-notread.gif b/static/images/chat-notread.gif new file mode 100644 index 0000000..c88dfd4 Binary files /dev/null and b/static/images/chat-notread.gif differ diff --git a/static/images/chat-read.gif b/static/images/chat-read.gif new file mode 100644 index 0000000..3516562 Binary files /dev/null and b/static/images/chat-read.gif differ diff --git a/static/images/greyprevious.gif b/static/images/greyprevious.gif new file mode 100644 index 0000000..01db83c Binary files /dev/null and b/static/images/greyprevious.gif differ diff --git a/static/images/lb.gif b/static/images/lb.gif new file mode 100644 index 0000000..c50f6cd Binary files /dev/null and b/static/images/lb.gif differ diff --git a/static/images/newpost.gif b/static/images/newpost.gif new file mode 100644 index 0000000..3d8728e Binary files /dev/null and b/static/images/newpost.gif differ diff --git a/static/images/next.gif b/static/images/next.gif new file mode 100644 index 0000000..6fb38ca Binary files /dev/null and b/static/images/next.gif differ diff --git a/static/images/sticky.gif b/static/images/sticky.gif new file mode 100644 index 0000000..9c3092a Binary files /dev/null and b/static/images/sticky.gif differ diff --git a/templates/Full/Board.xslt b/templates/Full/Board.xslt new file mode 100644 index 0000000..6afcc51 --- /dev/null +++ b/templates/Full/Board.xslt @@ -0,0 +1,267 @@ + + + + + + + + + +
+ + + + +
+ + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + +
ПодразделыТемыСообщенийПоследнееМодератор
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + +
ТемаАвторПросмотрыОтветыПоследнее
+ Давайте выкладывать сюда свои фотографии с претензией на художественность или просто красивые. +А потом проведем конкурс и дадим какой-нть приз + + Если Вы нашли этот тред в мусорке, верните его пожалуйста в Common. Atilla + + + Специализированный сайт фото-выставки: http://hg.b.gz.ru/peg/ by heGoat. + * + + + Фото-выставка. + + + 0 + 20 + 4620 + 4640 + Все + + + heGoat + + 811077 + + 26633 + + (10) + + + (41) + + + 13.09.2003 15:08 +
+ + страницы: + 0 + + /Board/1/p20/ + 20 + + + /Board/1/p40/ + 40 + + + /Board/1/p60/ + 60 + + +
+
+
+ + + + +
+ + + + + + + + + + + + + + +
Дополнительная информация
+ 11 зарегистрированных и 1 анонимных пользователей просматривают этот форум. +
+
+ Модераторы: + Sash + DeadmoroZ  +
+
+
+ Права + + + + + +
Вы можете создавать новые темы
Вы можете отвечать на сообщения
HTML отключен
UBBCode включен
+
+ Легенда: + + + + + + + + + + + + + + + + + +
Новые сообщения
Нет новых сообщений
Новые сообщения
Нет новых сообщений
+
+
+ Поиск в форуме + + +
+
+
+ +
+
+ +
+
+ +
+
+
+ Переход в + + +
+
+
+
+ + + + + + + + + + + +
ТемыСообщенийПоследнееМодератор
+
+ +
\ No newline at end of file diff --git a/templates/Full/Boards.xslt b/templates/Full/Boards.xslt index 626eb07..47ecf73 100644 --- a/templates/Full/Boards.xslt +++ b/templates/Full/Boards.xslt @@ -1,6 +1,7 @@ + @@ -21,17 +22,17 @@
- Вы вошли в форум как summersun + Вы вошли в форум как summersun
- 18983 Зарегистрированных пользователей. + 18983 Зарегистрированных пользователей.
- Приветствуем нового пользователя, + Приветствуем нового пользователя, _PC
- Сейчас 222 зарегистрированных и 54 анонимных пользователей в онлайне. + Сейчас 222 зарегистрированных и 54 анонимных пользователей в онлайне.
Текущее время: - 08.06.2010 14:17, Вторник + 08.06.2010 14:17, Вторник
Просмотр новых сообщений @@ -48,10 +49,10 @@ Легенда:
* - Новые сообщения + Новые сообщения
* - Нет новых сообщений + Нет новых сообщений
@@ -73,82 +74,4 @@
- - - - - if(!confirm('Пометить все сообщения как прочитанные?')) {event.returnValue=false; return false;} else { alert("Not implemented yet"); } - - - - - - - - - - - - - - /Threads// - - - -
- - - - - - - - - - - -
- - /Threads// - A - -
  - -
- - - - - - - - Sash, - DeadmoroZ - - -
- - - - -
- - /Thread/NOTIMPLEMENTED/p/ - от - -
- - N/A - -
-
- - - - - /Threads// - - - -
\ No newline at end of file diff --git a/templates/Full/Root.xslt b/templates/Full/Root.xslt new file mode 100644 index 0000000..09bc028 --- /dev/null +++ b/templates/Full/Root.xslt @@ -0,0 +1,141 @@ + + + + + + + + <xsl:value-of select="title"/> + + + +
+ Всегда полезно: +
+ Yandex + Google + Mail.ru + Rambler +
+
+ +
+
+ + + + +
+ + + + + + +
+
+ + + + +
+ Hello, summersun (External IP). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ Найти файл в сети: +
+ + +
+
+
+ Может пригодиться: +
+ Энциклопедия "Кирилла и Мефодия" + Lingvo - электронный словарь + Карты городов и стран мира + Погода от Фобос + Afisha - Все развлечения Москвы + Online переводчик + Metal Library +
+
+ Без рекламы никуда: +
+ Rabot +
+ FXMoney +
+ ZheleZona +
+
+
+
+ + +
+ +
+ diff --git a/templates/Full/elems/BoardInfo.xslt b/templates/Full/elems/BoardInfo.xslt new file mode 100644 index 0000000..e807778 --- /dev/null +++ b/templates/Full/elems/BoardInfo.xslt @@ -0,0 +1,84 @@ + + + + + + + + if(!confirm('Пометить все сообщения как прочитанные?')) {event.returnValue=false; return false;} else { alert("Not implemented yet"); } + + + + + + + + + + + + + + /Board// + + + +
+ + + + + + + + + + + +
+ + /Board// + A + +
  + +
+ + + + + + + + Sash + , + DeadmoroZ + + +
+ + + + +
+ + /Thread/NOTIMPLEMENTED/p/ + от + + +
+ + N/A + +
+
+ + + + + /Board// + + + + +
\ No newline at end of file diff --git a/templates/Full/elems/Header.xslt b/templates/Full/elems/Header.xslt index a488eae..01dfd8d 100644 --- a/templates/Full/elems/Header.xslt +++ b/templates/Full/elems/Header.xslt @@ -8,17 +8,20 @@ Root - | Google - | Yandex - | Mail.ru - | Vedomosti - | Afisha - | Weather - | LAN Support - - - - + | + Google + | + Yandex + | + Mail.ru + | + Vedomosti + | + Afisha + | + Weather + | + LAN Support @@ -31,18 +34,19 @@
diff --git a/templates/Full/elems/Main.xslt b/templates/Full/elems/Main.xslt index 143e3c0..b0bbe56 100644 --- a/templates/Full/elems/Main.xslt +++ b/templates/Full/elems/Main.xslt @@ -14,30 +14,34 @@
-Data used for authoring this XHTML document: +Data used for authoring this XHTML document: <xsl:copy-of select="/"/> + + + + + /Boards/ + + + >> + + + + /Board// + + + >> + + + + + + + + - \ No newline at end of file