Threads list implemented; Thread, Post and User dataclasses implemented

main
Inga 🏳‍🌈 15 years ago
parent 478ed8ebce
commit 0037134c32
  1. 2
      Builder/IISMainHandler/build.txt
  2. 3
      Common/Common.csproj
  3. 10
      Common/UserContext.cs
  4. 42
      Common/dataobjects/Board.cs
  5. 3
      Common/dataobjects/Category.cs
  6. 131
      Common/dataobjects/Post.cs
  7. 170
      Common/dataobjects/Thread.cs
  8. 120
      Common/dataobjects/User.cs
  9. 13
      Core/Util.cs
  10. 4
      Core/extensions/Extensions.cs
  11. 1
      IISMainHandler/IISMainHandler.csproj
  12. 7
      IISMainHandler/WebContext.cs
  13. 5
      IISMainHandler/handlers/BoardHandler.cs
  14. 2
      IISMainHandler/handlers/DebugHandler.cs
  15. 30
      IISMainHandler/handlers/ThreadHandler.cs
  16. 9
      MySQLConnector/Connection.cs
  17. 58
      templates/Full/Board.xslt
  18. 6
      templates/Full/elems/BoardInfo.xslt
  19. 4
      templates/Full/elems/Main.xslt
  20. 64
      templates/Full/elems/ThreadInfo.xslt

@ -50,6 +50,9 @@
<Compile Include="dataobjects\Category.cs" />
<Compile Include="dataobjects\IUserSettings.cs" />
<Compile Include="dataobjects\AnonymousUserSettings.cs" />
<Compile Include="dataobjects\Post.cs" />
<Compile Include="dataobjects\Thread.cs" />
<Compile Include="dataobjects\User.cs" />
<Compile Include="IOutputParams.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SqlObject.cs" />

@ -20,6 +20,16 @@ namespace FLocal.Common {
get;
}
abstract public string formatDateTime(DateTime dateTime);
}
public static class UserContext_Extensions {
public static string ToString(this DateTime dateTime, UserContext context) {
return context.formatDateTime(dateTime);
}
}
}

@ -5,6 +5,7 @@ using System.Text;
using System.Xml.Linq;
using FLocal.Core;
using FLocal.Core.DB;
using FLocal.Core.DB.conditions;
namespace FLocal.Common.dataobjects {
public class Board : SqlObject<Board> {
@ -55,6 +56,11 @@ namespace FLocal.Common.dataobjects {
return this._lastPostId;
}
}
public Post lastPost {
get {
return Post.LoadById(this.lastPostId.Value);
}
}
private int _totalPosts;
public int totalPosts {
@ -138,16 +144,19 @@ namespace FLocal.Common.dataobjects {
select board;
}
}
internal void subBoards_Reset() {
Cache<IEnumerable<int>>.instance.delete(this.subBoards_Locker);
}
private bool hasNewPosts() {
return Core.Util.RandomInt(0, 1000) < 500;
}
private XElement exportLastPostInfo() {
private XElement exportLastPostInfo(UserContext context) {
if(!this.lastPostId.HasValue) {
return new XElement("none");
} else {
throw new NotImplementedException();
return this.lastPost.exportToXmlWithoutThread(context);
}
}
@ -169,8 +178,8 @@ namespace FLocal.Common.dataobjects {
new XElement("totalThreads", this.totalThreads),
new XElement("name", this.name),
new XElement("description", this.description),
new XElement("hasNewPosts", this.hasNewPosts() ? "true" : "false"),
new XElement("lastPostInfo", this.exportLastPostInfo())
new XElement("hasNewPosts", this.hasNewPosts().ToPlainString()),
new XElement("lastPostInfo", this.exportLastPostInfo(context))
);
if(includeSubBoards) {
@ -182,5 +191,30 @@ namespace FLocal.Common.dataobjects {
return result;
}
public IEnumerable<Thread> getThreads(Diapasone diapasone, UserContext context) {
return Thread.LoadByIds(
from stringId in Config.instance.mainConnection.LoadIdsByConditions(
Thread.TableSpec.instance,
new ComparisonCondition(
Thread.TableSpec.instance.getColumnSpec(Thread.TableSpec.FIELD_BOARDID),
ComparisonType.EQUAL,
this.id.ToString()
),
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
),
}
) select int.Parse(stringId)
);
}
}
}

@ -95,6 +95,9 @@ namespace FLocal.Common.dataobjects {
select board;
}
}
internal void subBoards_Reset() {
Cache<IEnumerable<int>>.instance.delete(this.subBoards_Locker);
}
public XElement exportToXmlSimple(UserContext context) {
return new XElement("category",

@ -0,0 +1,131 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using FLocal.Core;
using FLocal.Core.DB;
namespace FLocal.Common.dataobjects {
public class Post : SqlObject<Post> {
public class TableSpec : FLocal.Core.DB.ITableSpec {
public const string TABLE = "Posts";
public const string FIELD_ID = "Id";
public const string FIELD_POSTERID = "PosterId";
public const string FIELD_POSTDATE = "PostDate";
public const string FIELD_LASTCHANGEDATE = "LastChangeDate";
public const string FIELD_REVISION = "Revision";
public const string FIELD_LAYER = "Layer";
public const string FIELD_TITLE = "Title";
public const string FIELD_BODY = "Body";
public const string FIELD_THREADID = "ThreadId";
public static readonly TableSpec instance = new TableSpec();
public string name { get { return TABLE; } }
public string idName { get { return FIELD_ID; } }
}
protected override FLocal.Core.DB.ITableSpec table { get { return TableSpec.instance; } }
private int _posterId;
public int posterId {
get {
this.LoadIfNotLoaded();
return this._posterId;
}
}
public User poster {
get {
this.LoadIfNotLoaded();
return User.LoadById(this.posterId);
}
}
private DateTime _postDate;
public DateTime postDate {
get {
this.LoadIfNotLoaded();
return this._postDate;
}
}
private DateTime? _lastChangeDate;
public DateTime? lastChangeDate {
get {
this.LoadIfNotLoaded();
return this._lastChangeDate;
}
}
private int _revision;
public int revision {
get {
this.LoadIfNotLoaded();
return this._revision;
}
}
private int _layer;
public int layer {
get {
this.LoadIfNotLoaded();
return this._layer;
}
}
private string _title;
public string title {
get {
this.LoadIfNotLoaded();
return this._title;
}
}
private string _body;
public string body {
get {
this.LoadIfNotLoaded();
return this._body;
}
}
private int _threadId;
public int threadId {
get {
this.LoadIfNotLoaded();
return this._threadId;
}
}
public Thread thread {
get {
return Thread.LoadById(this.threadId);
}
}
protected override void doFromHash(Dictionary<string, string> data) {
this._posterId = int.Parse(data[TableSpec.FIELD_POSTERID]);
this._postDate = new DateTime(long.Parse(data[TableSpec.FIELD_POSTDATE]));
this._lastChangeDate = Util.ParseDateTimeFromTimestamp(data[TableSpec.FIELD_LASTCHANGEDATE]);
this._revision = int.Parse(data[TableSpec.FIELD_REVISION]);
this._layer = int.Parse(data[TableSpec.FIELD_LAYER]);
this._title = data[TableSpec.FIELD_TITLE];
this._body = data[TableSpec.FIELD_BODY];
this._threadId = int.Parse(data[TableSpec.FIELD_THREADID]);
}
public XElement exportToXmlWithoutThread(UserContext context) {
return new XElement("post",
new XElement("id", this.id),
new XElement("poster", this.poster.exportToXmlForViewing(context)),
new XElement("postDate", this.postDate.ToString(context)),
new XElement("lastChangeDate", this.postDate.ToString(context)),
new XElement("revision", this.revision),
new XElement("layer", this.layer),
new XElement("title", this.title),
new XElement("body", this.body),
new XElement("threadId", this.threadId)
);
}
}
}

@ -0,0 +1,170 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using FLocal.Core;
using FLocal.Core.DB;
namespace FLocal.Common.dataobjects {
public class Thread : SqlObject<Thread> {
public class TableSpec : FLocal.Core.DB.ITableSpec {
public const string TABLE = "Threads";
public const string FIELD_ID = "Id";
public const string FIELD_BOARDID = "BoardId";
public const string FIELD_FIRSTPOSTID = "FirstPostId";
public const string FIELD_TOPICSTARTERID = "TopicstarterId";
public const string FIELD_TITLE = "Title";
public const string FIELD_LASTPOSTID = "LastPostId";
public const string FIELD_LASTPOSTDATE = "LastPostDate";
public const string FIELD_ISANNOUNCEMENT = "IsAnnouncement";
public const string FIELD_ISLOCKED = "IsLocked";
public const string FIELD_TOTALPOSTS = "TotalPosts";
public const string FIELD_TOTALVIEWS = "TotalViews";
public static readonly TableSpec instance = new TableSpec();
public string name { get { return TABLE; } }
public string idName { get { return FIELD_ID; } }
}
protected override FLocal.Core.DB.ITableSpec table { get { return TableSpec.instance; } }
private int _boardId;
public int boardId {
get {
this.LoadIfNotLoaded();
return this._boardId;
}
}
public Board board {
get {
return Board.LoadById(this.boardId);
}
}
private int _firstPostId;
public int firstPostId {
get {
this.LoadIfNotLoaded();
return this._firstPostId;
}
}
public Post firstPost {
get {
return Post.LoadById(this.firstPostId);
}
}
private int _topicstarterId;
public int topicstarterId {
get {
this.LoadIfNotLoaded();
return this._topicstarterId;
}
}
public User topicstarter {
get {
return User.LoadById(this.topicstarterId);
}
}
private string _title;
public string title {
get {
this.LoadIfNotLoaded();
return this._title;
}
}
private int _lastPostId;
public int lastPostId {
get {
this.LoadIfNotLoaded();
return this._lastPostId;
}
}
private DateTime _lastPostDate;
public DateTime lastPostDate {
get {
this.LoadIfNotLoaded();
return this._lastPostDate;
}
}
private bool _isAnnouncement;
public bool isAnnouncement {
get {
this.LoadIfNotLoaded();
return this._isAnnouncement;
}
}
private bool _isLocked;
public bool isLocked {
get {
this.LoadIfNotLoaded();
return this._isAnnouncement;
}
}
private int _totalPosts;
public int totalPosts {
get {
this.LoadIfNotLoaded();
return this._totalPosts;
}
}
private int _totalViews;
public int totalViews {
get {
this.LoadIfNotLoaded();
return this._totalViews;
}
}
protected override void doFromHash(Dictionary<string, string> data) {
this._boardId = int.Parse(data[TableSpec.FIELD_BOARDID]);
this._firstPostId = int.Parse(data[TableSpec.FIELD_FIRSTPOSTID]);
this._topicstarterId = int.Parse(data[TableSpec.FIELD_TOPICSTARTERID]);
this._title = data[TableSpec.FIELD_TITLE];
this._lastPostId = int.Parse(data[TableSpec.FIELD_LASTPOSTID]);
this._lastPostDate = new DateTime(long.Parse(data[TableSpec.FIELD_LASTPOSTDATE]));
this._isAnnouncement = FLocal.Core.Util.string2bool(data[TableSpec.FIELD_ISANNOUNCEMENT]);
this._isLocked = FLocal.Core.Util.string2bool(data[TableSpec.FIELD_ISLOCKED]);
this._totalPosts = int.Parse(data[TableSpec.FIELD_TOTALPOSTS]);
this._totalViews = int.Parse(data[TableSpec.FIELD_TOTALVIEWS]);
}
private bool hasNewPosts() {
return Core.Util.RandomInt(0, 1000) < 500;
}
public XElement exportToXmlSimpleWithParent(UserContext context) {
return new XElement("thread",
new XElement("id", this.id),
new XElement("name", this.title),
new XElement("parent", this.board.exportToXmlSimpleWithParent(context))
);
}
public XElement exportToXml(UserContext context) {
return new XElement("thread",
new XElement("id", this.id),
new XElement("firstPostId", this.firstPost.exportToXmlWithoutThread(context)),
new XElement("topicstarter", this.topicstarter.exportToXmlForViewing(context)),
new XElement("title", this.title),
new XElement("lastPostId", this.lastPostId),
new XElement("lastPostDate", this.lastPostDate.ToString(context)),
new XElement("isAnnouncement", this.isAnnouncement),
new XElement("isLocked", this.isLocked),
new XElement("totalPosts", this.totalPosts),
new XElement("totalViews", this.totalViews),
new XElement("hasNewPosts", this.hasNewPosts()),
new XElement("body", this.firstPost.body)
);
}
}
}

@ -0,0 +1,120 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using FLocal.Core;
using FLocal.Core.DB;
namespace FLocal.Common.dataobjects {
public class User : SqlObject<User> {
public class TableSpec : FLocal.Core.DB.ITableSpec {
public const string TABLE = "Users";
public const string FIELD_ID = "Id";
public const string FIELD_REGDATE = "RegDate";
public const string FIELD_TOTALPOSTS = "TotalPosts";
public const string FIELD_SIGNATURE = "Signature";
public const string FIELD_TITLE = "Title";
public const string FIELD_LOCATION = "Location";
public const string FIELD_NAME = "Name";
public const string FIELD_USERGROUPID = "UserGroupId";
public const string FIELD_SHOWPOSTSTOUSERS = "ShowPostsToUsers";
public static readonly TableSpec instance = new TableSpec();
public string name { get { return TABLE; } }
public string idName { get { return FIELD_ID; } }
}
protected override FLocal.Core.DB.ITableSpec table { get { return TableSpec.instance; } }
private DateTime _regDate;
public DateTime regDate {
get {
this.LoadIfNotLoaded();
return this._regDate;
}
}
private int _totalPosts;
public int totalPosts {
get {
this.LoadIfNotLoaded();
return this._totalPosts;
}
}
private string _signature;
public string signature {
get {
this.LoadIfNotLoaded();
return this._signature;
}
}
private string _title;
public string title {
get {
this.LoadIfNotLoaded();
return this._title;
}
}
private string _location;
public string location {
get {
this.LoadIfNotLoaded();
return this._location;
}
}
private string _name;
public string name {
get {
this.LoadIfNotLoaded();
return this._name;
}
}
private int _userGroupId;
public int userGroupId {
get {
this.LoadIfNotLoaded();
return this._userGroupId;
}
}
private string _showPostsToUsers;
public string showPostsToUsers {
get {
this.LoadIfNotLoaded();
return this._showPostsToUsers;
}
}
protected override void doFromHash(Dictionary<string, string> data) {
this._regDate = new DateTime(long.Parse(data[TableSpec.FIELD_REGDATE]));
this._totalPosts = int.Parse(data[TableSpec.FIELD_TOTALPOSTS]);
this._signature = data[TableSpec.FIELD_SIGNATURE];
this._title = data[TableSpec.FIELD_TITLE];
this._location = data[TableSpec.FIELD_LOCATION];
this._name = data[TableSpec.FIELD_NAME];
this._userGroupId = int.Parse(data[TableSpec.FIELD_USERGROUPID]);
this._showPostsToUsers = data[TableSpec.FIELD_SHOWPOSTSTOUSERS];
}
public XElement exportToXmlForViewing(UserContext context) {
return new XElement("user",
new XElement("id", this.id),
new XElement("regDate", this.regDate.ToString(context)),
new XElement("totalPosts", this.totalPosts),
new XElement("signature", this.signature),
new XElement("title", this.title),
new XElement("location", this.location),
new XElement("name", this.name),
new XElement("userGroupId", this.userGroupId),
new XElement("showPostsToUsers", this.showPostsToUsers)
);
}
}
}

@ -120,6 +120,19 @@ namespace FLocal.Core {
}
}
public static DateTime? ParseDateTimeFromTimestamp(string raw) {
if(raw == "") {
return null;
} else {
long timestamp = long.Parse(raw);
if(timestamp < 1) {
return null;
} else {
return new DateTime(timestamp);
}
}
}
}
}

@ -49,6 +49,10 @@ namespace FLocal.Core {
return val ? "Enabled" : "Disabled";
}
public static string ToPlainString(this bool val) {
return val ? "true" : "false";
}
public static string ToPrintableString<T>(this IEnumerable<T> list) {
return string.Join(",", (from elem in list select elem.ToString()).ToArray());
}

@ -58,6 +58,7 @@
<Compile Include="handlers\DebugHandler.cs" />
<Compile Include="handlers\RootHandler.cs" />
<Compile Include="handlers\StaticHandler.cs" />
<Compile Include="handlers\ThreadHandler.cs" />
<Compile Include="handlers\WrongUrlHandler.cs" />
<Compile Include="ISpecificHandler.cs" />
<Compile Include="MainHandler.cs" />

@ -47,8 +47,15 @@ namespace FLocal.IISHandler {
}
}
public override string formatDateTime(DateTime dateTime) {
return dateTime.ToString();
}
public DateTime requestTime;
public WebContext(HttpContext httpcontext) {
this.httpcontext = httpcontext;
this.requestTime = DateTime.Now;
}
public string Transform(string templateName, System.Xml.Linq.XDocument data) {

@ -20,8 +20,9 @@ namespace FLocal.IISHandler.handlers {
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))
new XElement("currentLocation", board.exportToXmlSimpleWithParent(context)),
new XElement("boards", from subBoard in board.subBoards select subBoard.exportToXml(context, true)),
new XElement("threads", from thread in board.getThreads(FLocal.Core.DB.Diapasone.unlimited, context) select thread.exportToXml(context))
};
}

@ -32,6 +32,8 @@ namespace FLocal.IISHandler.handlers {
context.httpresponse.WriteLine("description: " + board.description);
context.httpresponse.WriteLine("categoryname: " + board.category.name);
}
Thread.LoadById(1).ReLoad();
}
}

@ -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 ThreadHandler : AbstractGetHandler {
override protected string templateName {
get {
return "Thread.xslt";
}
}
override protected XElement[] getSpecificData(WebContext context) {
Board board = Board.LoadById(int.Parse(context.requestParts[1]));
return new XElement[] {
new XElement("currentLocation", board.exportToXmlSimpleWithParent(context)),
new XElement("boards", from subBoard in board.subBoards select subBoard.exportToXml(context, true))
};
}
}
}

@ -54,7 +54,14 @@ namespace FLocal.MySQLConnector {
Dictionary<string, string> row = new Dictionary<string,string>();
for(int i=0; i<reader.FieldCount; i++) {
// throw new CriticalException("Name: " + reader.GetName(i));
row.Add(reader.GetName(i), reader.GetValue(i).ToString());
object value = reader.GetValue(i);
string sValue;
if(value is DateTime) {
sValue = ((DateTime)value).Ticks.ToString();
} else {
sValue = value.ToString();
}
row.Add(reader.GetName(i), sValue);
}
rawResult.Add(row[table.idName], row);
}

@ -2,6 +2,7 @@
<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\BoardInfo.xslt"/>
<xsl:import href="elems\ThreadInfo.xslt"/>
<xsl:template name="specific">
<table width="95%" align="center" cellpadding="1" cellspacing="1" class="tablesurround">
<tr>
@ -12,7 +13,7 @@
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="catandforum">
<xsl:apply-templates select="currentBoard" mode="breadcrumbs"/>
<xsl:apply-templates select="currentLocation" mode="breadcrumbs"/>
</td>
<td align="right" valign="bottom">
<table border="0" class="tablesurround">
@ -97,47 +98,7 @@
<td nowrap="nowrap" width="20%" class="tdheader" align="center">Ïîñëåäíåå</td>
</tr>
<!-- BEGIN POST LOOP DO NOT DELETE -->
<tr>
<td align="left" class="lighttable">
<xsl:attribute name="title">Äàâàéòå âûêëàäûâàòü ñþäà ñâîè ôîòîãðàôèè ñ ïðåòåíçèåé íà õóäîæåñòâåííîñòü èëè ïðîñòî êðàñèâûå.
À ïîòîì ïðîâåäåì êîíêóðñ è äàäèì êàêîé-íòü ïðèç
&#160;Åñëè Âû íàøëè ýòîò òðåä â ìóñîðêå, âåðíèòå åãî ïîæàëóéñòà â Common. Atilla
Ñïåöèàëèçèðîâàííûé ñàéò ôîòî-âûñòàâêè: http://hg.b.gz.ru/peg/ by heGoat.</xsl:attribute>
<img alt="*" src="/static/images/book-notread.gif" hspace="5" style="vertical-align: text-bottom" />
<a href="/showflat.php?Cat=&amp;Board=Common&amp;Number=9546068&amp;Main=479355&amp;fullview=&amp;src=&amp;o=&amp;showlite=&amp;tistart=#Post9546068">
<img src="/static/images/sticky.gif" width="16" height="16" alt="" border="0" style="vertical-align: text-bottom" />
<span>Ôîòî-âûñòàâêà.</span>
</a>
<span class="small" style="margin-left:1.5em">
<a class="separate" href="/Thread/NOTIMPLEMENTED/p0/">0</a>
<a class="separate" href="/Thread/NOTIMPLEMENTED/p20/">20</a>
<a class="separate" href="/Thread/NOTIMPLEMENTED/p4620/">4620</a>
<a class="separate" href="/Thread/NOTIMPLEMENTED/p4640/">4640</a>
<a class="separate" href="/Thread/NOTIMPLEMENTED/all/">Âñå</a>
</span>
</td>
<td align="left" nowrap="nowrap" class="lighttable">
<a href="/showprofile.php?Cat=&amp;User=heGoat&amp;Board=Common&amp;what=ubbthreads&amp;page=0&amp;src=&amp;sb=5&amp;o="><font color="#0000FF">heGoat</font></a>
</td>
<td align="center" class="lighttable">
<span>811077</span>
</td>
<td align="center" nowrap="nowrap" class="lighttable">
<span class="separate">26633</span>
<a class="cup separate" href="/postlist.php?Cat=&amp;Board=Common&amp;page=0&amp;fullview=&amp;src=&amp;sb=5&amp;o=&amp;cupthread=479355&amp;cupmaxnumber=9559703&amp;showlite=" >
<font class="new"><i>(10)</i></font>
</a>
<a class="cup separate" href="/postlist.php?Cat=&amp;Board=Common&amp;page=0&amp;fullview=&amp;src=&amp;sb=5&amp;o=&amp;cupthread=479355&amp;cupdisc=1&amp;showlite=" >
<font class="new2"><i>(41)</i></font>
</a>
</td>
<td nowrap="nowrap" align="center" class="lighttable">
<span>13.09.2003 15:08</span>
</td>
</tr>
<xsl:apply-templates select="threads/thread"/>
<!-- END OF LOOP -->
<tr class="tdheader">
<td colspan="5">
@ -251,17 +212,4 @@
</table>
</xsl:template>
<xsl:template match="category">
<table width="100%" align="center" class="tableborders" cellpadding="3" cellspacing="1">
<tr>
<td class="tdheader" colspan="2" width="61%"><xsl:value-of select="name"/></td>
<td class="tdheader" align="center" width="7%">Òåìû</td>
<td class="tdheader" align="center" width="7%">Ñîîáùåíèé</td>
<td class="tdheader" align="center" width="15%">Ïîñëåäíåå</td>
<td class="tdheader" align="center" width="10%">Ìîäåðàòîð</td>
</tr>
<xsl:apply-templates select="boards/board"/>
</table>
</xsl:template>
</xsl:stylesheet>

@ -60,11 +60,11 @@
<xsl:template match="lastPostInfo">
<xsl:choose>
<xsl:when test="post">
<xsl:value-of select="post/date"/><br />
<xsl:value-of select="post/postDate"/><br />
<a>
<xsl:attribute name="href">/Thread/NOTIMPLEMENTED/p<xsl:value-of select="post/id"/>/</xsl:attribute>
<xsl:attribute name="href">/Thread/<xsl:value-of select="post/threadId"/>/e<xsl:value-of select="post/id"/>/</xsl:attribute>
<span>îò </span>
<xsl:value-of select="post/user/name"/>
<xsl:value-of select="post/poster/user/name"/>
</a>
</xsl:when>
<xsl:otherwise>

@ -38,9 +38,9 @@
</xsl:if>
</xsl:template>
<xsl:template match="currentBoard" mode="breadcrumbs">
<xsl:template match="currentLocation" mode="breadcrumbs">
<xsl:apply-templates select="*/parent" mode="breadcrumbsPart"/>
<xsl:value-of select="board/name"/>
<xsl:value-of select="*/name"/>
</xsl:template>
</xsl:stylesheet>

@ -0,0 +1,64 @@
<?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:template match="thread">
<tr>
<td align="left" class="lighttable">
<xsl:attribute name="title"><xsl:value-of select="body"/></xsl:attribute>
<img alt="*" hspace="5" style="vertical-align: text-bottom">
<xsl:choose>
<xsl:when test="hasNewPosts='true'">
<xsl:attribute name="src">/static/images/book-notread.gif</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="src">/static/images/book-read.gif</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</img>
<a>
<xsl:attribute name="href">/Thread/<xsl:value-of select="id"/>/</xsl:attribute>
<xsl:if test="isAnnouncement='true'">
<img src="/static/images/sticky.gif" class="separate" width="16" height="16" alt="" border="0" style="vertical-align: text-bottom;" />
</xsl:if>
<xsl:value-of select="title"/>
</a>
<span class="small" style="margin-left:1.5em">
<a class="separate">
<xsl:attribute name="href">/Thread/<xsl:value-of select="id"/>/0/</xsl:attribute>
<span>0</span>
</a>
<a class="separate">
<xsl:attribute name="href">/Thread/<xsl:value-of select="id"/>/20/</xsl:attribute>
<span>20</span>
</a>
</span>
</td>
<td align="left" nowrap="nowrap" class="lighttable">
<a>
<xsl:attribute name="href">/User/<xsl:value-of select="topicstarter/user/id"/>/</xsl:attribute>
<font>
<xsl:attribute name="color">#0000ff</xsl:attribute>
<xsl:value-of select="topicstarter/user/name"/>
</font>
</a>
</td>
<td align="center" class="lighttable">
<xsl:value-of select="totalViews"/>
</td>
<td align="center" nowrap="nowrap" class="lighttable">
<span class="separate"><xsl:value-of select="totalPosts"/></span>
<a class="cup separate" href="/postlist.php?Cat=&amp;Board=Common&amp;page=0&amp;fullview=&amp;src=&amp;sb=5&amp;o=&amp;cupthread=479355&amp;cupmaxnumber=9559703&amp;showlite=" >
<font class="new"><i>(10)</i></font>
</a>
<a class="cup separate" href="/postlist.php?Cat=&amp;Board=Common&amp;page=0&amp;fullview=&amp;src=&amp;sb=5&amp;o=&amp;cupthread=479355&amp;cupdisc=1&amp;showlite=" >
<font class="new2"><i>(41)</i></font>
</a>
</td>
<td nowrap="nowrap" align="center" class="lighttable">
<xsl:value-of select="lastPostDate"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
Loading…
Cancel
Save