'ActualPosts' counter implemented on ActiveAccountList page

main
Inga 🏳‍🌈 15 years ago
parent 4f8980384a
commit 90aa816ff4
  1. 2
      Builder/IISMainHandler/build.txt
  2. 2
      Builder/IISUploadHandler/build.txt
  3. 2
      Common/dataobjects/Thread.cs
  4. 5
      Common/dataobjects/User.cs
  5. 25
      IISMainHandler/handlers/response/ActiveAccountListHandler.cs

@ -11,7 +11,7 @@ using FLocal.Common.actions;
namespace FLocal.Common.dataobjects {
public class Thread : SqlObject<Thread> {
private const int FORMALREADMIN = 10000001;
public const int FORMALREADMIN = 10000001;
public class TableSpec : ISqlObjectTableSpec {
public const string TABLE = "Threads";

@ -162,7 +162,7 @@ namespace FLocal.Common.dataobjects {
this._avatarId = Util.ParseInt(data[TableSpec.FIELD_AVATARID]);
}
public XElement exportToXmlForViewing(UserContext context) {
public XElement exportToXmlForViewing(UserContext context, params XElement[] additional) {
XElement result = new XElement("user",
new XElement("id", this.id),
new XElement("regDate", this.regDate.ToXml()),
@ -177,6 +177,9 @@ namespace FLocal.Common.dataobjects {
if(this.avatarId.HasValue) {
result.Add(new XElement("avatar", this.avatarId));
}
foreach(XElement elem in additional) {
result.Add(elem);
}
return result;
}

@ -7,6 +7,7 @@ using System.Xml.Linq;
using FLocal.Common;
using FLocal.Common.dataobjects;
using FLocal.Core.DB;
using FLocal.Core.DB.conditions;
namespace FLocal.IISHandler.handlers.response {
@ -34,7 +35,29 @@ namespace FLocal.IISHandler.handlers.response {
);
return new XElement[] {
new XElement("users",
from account in accounts select account.user.exportToXmlForViewing(context),
from account in accounts
select account.user.exportToXmlForViewing(
context,
new XElement(
"actualPosts",
Config.instance.mainConnection.GetCountByConditions(
Post.TableSpec.instance,
new ComplexCondition(
ConditionsJoinType.AND,
new ComparisonCondition(
Post.TableSpec.instance.getColumnSpec(Post.TableSpec.FIELD_POSTERID),
ComparisonType.EQUAL,
account.user.id.ToString()
),
new ComparisonCondition(
Post.TableSpec.instance.getIdSpec(),
ComparisonType.GREATEROREQUAL,
Thread.FORMALREADMIN.ToString()
)
)
)
)
),
pageOuter.exportToXml(2, 5, 2)
)
};

Loading…
Cancel
Save