User's posts list implemented

main
Inga 🏳‍🌈 15 years ago
parent 845dff341d
commit 63c7153dda
  1. 2
      Builder/IISMainHandler/build.txt
  2. 2
      Builder/IISUploadHandler/build.txt
  3. 21
      Common/dataobjects/User.cs
  4. 13
      IISMainHandler/HandlersFactory.cs
  5. 1
      IISMainHandler/IISMainHandler.csproj
  6. 1
      templates/Full/UserInfo.xslt
  7. 77
      templates/Full/UserPosts.xslt

@ -201,5 +201,26 @@ namespace FLocal.Common.dataobjects {
return desiredLayer;
}
public IEnumerable<Post> getPosts(Diapasone diapasone) {
return Post.LoadByIds(
from stringId in Config.instance.mainConnection.LoadIdsByConditions(
Post.TableSpec.instance,
new ComparisonCondition(
Post.TableSpec.instance.getColumnSpec(Post.TableSpec.FIELD_POSTERID),
ComparisonType.EQUAL,
this.id.ToString()
),
diapasone,
new JoinSpec[0],
new SortSpec[] {
new SortSpec(
Post.TableSpec.instance.getIdSpec(),
false
),
}
) select int.Parse(stringId)
);
}
}
}

@ -63,7 +63,18 @@ namespace FLocal.IISHandler {
case "users":
return new handlers.response.UserListHandler();
case "user":
return new handlers.response.UserInfoHandler();
if(context.requestParts.Length < 2) {
return new handlers.WrongUrlHandler();
}
if(context.requestParts.Length == 2) {
return new handlers.response.UserInfoHandler();
}
switch(context.requestParts[2].ToLower()) {
case "posts":
return new handlers.response.UserPostsHandler();
default:
return new handlers.WrongUrlHandler();
}
case "settings":
return new handlers.response.SettingsHandler();
case "conversations":

@ -86,6 +86,7 @@
<Compile Include="handlers\response\UploadListHandler.cs" />
<Compile Include="handlers\response\UploadNewHandler.cs" />
<Compile Include="handlers\response\UserInfoHandler.cs" />
<Compile Include="handlers\response\UserPostsHandler.cs" />
<Compile Include="handlers\RootHandler.cs" />
<Compile Include="handlers\StaticHandler.cs" />
<Compile Include="handlers\ThreadHandler.cs" />

@ -196,6 +196,7 @@
</a>
<xsl:text> | </xsl:text>
<a>
<xsl:attribute name="href">/User/<xsl:value-of select="user/id"/>/Posts/</xsl:attribute>
<img src="/static/images/viewposts.gif" align="top" style="vertical-align: text-bottom" />
<xsl:text>Ïîêàçàòü âñå ñîîáùåíèÿ ïîëüçîâàòåëÿ</xsl:text>
</a>

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="Windows-1251"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:import href="elems\Main.xslt"/>
<xsl:import href="elems\PostInfo.xslt"/>
<xsl:template name="specific">
<table width="95%" align="center" cellpadding="1" cellspacing="1" class="tablesurround">
<tr>
<td>
<table cellpadding="3" cellspacing="1" width="100%" class="tableborders">
<tr class="darktable">
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr class="darktable">
<td align="left" width="33%">
<font class="catandforum">
<a>
<xsl:attribute name="href">/Users/</xsl:attribute>
<xsl:text>Ïîëüçîâàòåëè</xsl:text>
</a>
<xsl:text> &gt;&gt; </xsl:text>
<a>
<xsl:attribute name="href">/User/<xsl:value-of select="user/id"/></xsl:attribute>
<xsl:value-of select="user/name"/>
</a>
<xsl:text> &gt;&gt; </xsl:text>
<xsl:text>Ïîñòû</xsl:text>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<table width="95%" align="center" cellpadding="1" cellspacing="1" class="tablesurround">
<tr>
<td>
<table cellpadding="0" cellspacing="1" width="100%" class="tableborders">
<tr class="tdheader">
<td>
<table width="100%" cellspacing="1" cellpadding="3" border="0">
<tr>
<td>
<xsl:text>ñòðàíèöû:</xsl:text>
<xsl:apply-templates select="posts/pageOuter" mode="withCurrent">
<xsl:with-param name="baseLink">/User/<xsl:value-of select="user/id"/>/Posts/</xsl:with-param>
</xsl:apply-templates>
</td>
</tr>
</table>
</td>
</tr>
<xsl:apply-templates select="posts/post"/>
<tr class="tdheader">
<td>
<table width="100%" cellspacing="1" cellpadding="3" border="0">
<tr>
<td>
<xsl:text>ñòðàíèöû:</xsl:text>
<xsl:apply-templates select="posts/pageOuter" mode="withCurrent">
<xsl:with-param name="baseLink">/User/<xsl:value-of select="user/id"/>/Posts/</xsl:with-param>
</xsl:apply-templates>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
Loading…
Cancel
Save