Thread activity display

main
Inga 🏳‍🌈 14 years ago
parent e32cf4ace7
commit 71959b2b75
  1. 2
      Builder/IISMainHandler/build.txt
  2. 29
      templates/Modern/elems/Main.xslt
  3. 66
      templates/Modern/elems/ThreadInfo.xslt

@ -330,5 +330,34 @@
</a> </a>
</xsl:template> </xsl:template>
<xsl:template name="log2">
<xsl:param name="number"/>
<xsl:choose>
<xsl:when test="not($number) or $number=''"/>
<xsl:when test="$number &lt; 1">-1</xsl:when>
<xsl:when test="$number &lt; 2">0</xsl:when>
<xsl:when test="$number &lt; 4">1</xsl:when>
<xsl:when test="$number &lt; 8">2</xsl:when>
<xsl:when test="$number &lt; 16">3</xsl:when>
<xsl:when test="$number &lt; 32">4</xsl:when>
<xsl:when test="$number &lt; 64">5</xsl:when>
<xsl:when test="$number &lt; 128">6</xsl:when>
<xsl:when test="$number &lt; 256">7</xsl:when>
<xsl:when test="$number &lt; 512">8</xsl:when>
<xsl:when test="$number &lt; 1024">9</xsl:when>
<xsl:when test="$number &lt; 2048">10</xsl:when>
<xsl:when test="$number &lt; 4096">11</xsl:when>
<xsl:when test="$number &lt; 8192">12</xsl:when>
<xsl:when test="$number &lt; 16384">13</xsl:when>
<xsl:when test="$number &lt; 32768">14</xsl:when>
<xsl:when test="$number &lt; 65536">15</xsl:when>
<xsl:when test="$number &lt; 131072">16</xsl:when>
<xsl:when test="$number &lt; 262144">17</xsl:when>
<xsl:when test="$number &lt; 524288">18</xsl:when>
<xsl:when test="$number &lt; 1048576">19</xsl:when>
<xsl:otherwise>9000</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

@ -58,7 +58,29 @@
<xsl:value-of select="title"/> <xsl:value-of select="title"/>
</a> </a>
</h4> </h4>
<div style="position:absolute;text-align:right;right:0px;bottom:0px;background-color:inherit;padding:3pt 0pt 0pt 3pt;"> <div>
<xsl:attribute name="style">
<xsl:variable name="rawHotness">
<xsl:call-template name="log2">
<xsl:with-param name="number">
<xsl:value-of select="totalPosts"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="hotness">
<xsl:choose>
<xsl:when test="$rawHotness &lt; 0">0</xsl:when>
<xsl:when test="$rawHotness &gt; 12">12</xsl:when>
<xsl:otherwise><xsl:value-of select="$rawHotness"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:text>position:absolute;text-align:right;right:0px;bottom:0px;padding:3pt 0pt 0pt 3pt;</xsl:text>
<xsl:text>background-color:rgb(</xsl:text>
<xsl:value-of select="round($hotness*12)"/>
<xsl:text>,0,</xsl:text>
<xsl:value-of select="144-round($hotness*12)"/>
<xsl:text>)</xsl:text>
</xsl:attribute>
<xsl:attribute name="onmouseover">showChildren(this);</xsl:attribute> <xsl:attribute name="onmouseover">showChildren(this);</xsl:attribute>
<xsl:attribute name="onmouseout">hideChildren(this);</xsl:attribute> <xsl:attribute name="onmouseout">hideChildren(this);</xsl:attribute>
<div default="default" style="z-index:1;"> <div default="default" style="z-index:1;">
@ -98,48 +120,6 @@
</div> </div>
</div> </div>
</div> </div>
<!--
<img alt="*" hspace="5" style="vertical-align: text-bottom">
<xsl:choose>
<xsl:when test="totalNewPosts and totalNewPosts!='0'">
<xsl:attribute name="src">/static/images/message-<xsl:value-of select="firstPost/post/layerName"/>-notread.gif</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="src">/static/images/message-<xsl:value-of select="firstPost/post/layerName"/>-read.gif</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</img>
<xsl:text> </xsl:text>
<xsl:if test="pageOuter/isEmpty='false'">
<span class="small" style="margin-left:1.5em">
<xsl:apply-templates select="pageOuter" mode="withoutCurrent">
<xsl:with-param name="baseLink">/Thread/<xsl:value-of select="id"/>/</xsl:with-param>
</xsl:apply-templates>
</span>
</xsl:if>
</td>
<td align="left" nowrap="nowrap">
<xsl:apply-templates select="firstPost/post/poster/user" mode="userLink"/>
</td>
<td align="center">
<xsl:value-of select="totalViews"/>
</td>
<td align="center" nowrap="nowrap">
<span class="separate"><xsl:value-of select="totalPosts"/></span>
<xsl:if test="totalNewPosts and totalNewPosts!='0'">
<a class="cup separate">
<xsl:if test="/root/session/sessionKey">
<xsl:attribute name="href">/do/MarkThreadAsRead/<xsl:value-of select="id"/>/p<xsl:value-of select="lastPostId"/>/</xsl:attribute>
</xsl:if>
<font class="new"><i>(<xsl:value-of select="totalNewPosts"/>)</i></font>
</a>
</xsl:if>
</td>
<td nowrap="nowrap" align="center">
<xsl:apply-templates select="lastPostDate/date" mode="dateTime"/>
</td>
</tr>
-->
</xsl:template> </xsl:template>

Loading…
Cancel
Save