Slight fixes in BoardAsThread

main
Inga 🏳‍🌈 15 years ago
parent 33af0e6fc4
commit dc774dcb7f
  1. 30
      Common/dataobjects/Board.cs
  2. 10
      IISMainHandler/handlers/response/BoardAsThread.cs

@ -191,7 +191,7 @@ namespace FLocal.Common.dataobjects {
return result;
}
public IEnumerable<Thread> getThreads(Diapasone diapasone, UserContext context) {
public IEnumerable<Thread> getThreads(Diapasone diapasone, UserContext context, SortSpec[] sortBy) {
return Thread.LoadByIds(
from stringId in Config.instance.mainConnection.LoadIdsByConditions(
Thread.TableSpec.instance,
@ -202,19 +202,27 @@ namespace FLocal.Common.dataobjects {
),
diapasone,
new JoinSpec[0],
new SortSpec[] {
new SortSpec(
Thread.TableSpec.instance.getColumnSpec(Thread.TableSpec.FIELD_ISANNOUNCEMENT),
false
),
new SortSpec(
Thread.TableSpec.instance.getColumnSpec(Thread.TableSpec.FIELD_LASTPOSTDATE),
true
),
}
sortBy
) select int.Parse(stringId)
);
}
public IEnumerable<Thread> getThreads(Diapasone diapasone, UserContext context) {
return this.getThreads(
diapasone,
context,
new SortSpec[] {
new SortSpec(
Thread.TableSpec.instance.getColumnSpec(Thread.TableSpec.FIELD_ISANNOUNCEMENT),
false
),
new SortSpec(
Thread.TableSpec.instance.getColumnSpec(Thread.TableSpec.FIELD_LASTPOSTID),
true
),
}
);
}
}
}

@ -21,7 +21,15 @@ namespace FLocal.IISHandler.handlers {
override protected XElement[] getSpecificData(WebContext context) {
Board board = Board.LoadById(int.Parse(context.requestParts[1]));
PageOuter pageOuter = PageOuter.createFromGet(context.requestParts, context.userSettings.postsPerPage);
IEnumerable<Thread> threads = board.getThreads(pageOuter, context);
IEnumerable<Thread> threads = board.getThreads(
pageOuter,
context, new SortSpec[] {
new SortSpec(
Thread.TableSpec.instance.getColumnSpec(Thread.TableSpec.FIELD_ID),
false
),
}
);
return new XElement[] {
new XElement("currentLocation", board.exportToXmlSimpleWithParent(context)),
new XElement("boards", from subBoard in board.subBoards select subBoard.exportToXml(context, true)),

Loading…
Cancel
Save