110 lines
4.3 KiB
XML
110 lines
4.3 KiB
XML
<?xml version="1.0"?>
|
|
<root>
|
|
<LabelType>问答类</LabelType>
|
|
<LabelIntro>精彩推荐问题列表</LabelIntro>
|
|
<OutType>sin</OutType>
|
|
<LabelDataType>sql_sysquery</LabelDataType>
|
|
<EnabelAjax>False</EnabelAjax>
|
|
<IsXsltSql>true</IsXsltSql>
|
|
<IsXsltCountSql>true</IsXsltCountSql>
|
|
<LabelSqlString>
|
|
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
|
|
<xsl:param name="CategoryID"/>
|
|
<xsl:param name="Keyword"/>
|
|
<xsl:output method="xml" />
|
|
<xsl:template match="/">
|
|
<root>
|
|
<sql>
|
|
SELECT TOP @pagesize * FROM PE_QA_Question, PE_QA_Category WHERE PE_QA_Question.CategoryID = PE_QA_Category.CategoryID AND Status = 1 AND IsElite = 1
|
|
<xsl:if test="$Keyword != ''"> AND PE_QA_Question.Title LIKE '%@Keyword%'</xsl:if>
|
|
<xsl:if test="$CategoryID != 0">
|
|
AND (PE_QA_Question.CategoryId=@CategoryID or PE_QA_Category.ParentID=@CategoryID)
|
|
</xsl:if>
|
|
AND PE_QA_Question.QuestionID NOT IN(SELECT TOP @startrow PE_QA_Question.QuestionID FROM PE_QA_Question, PE_QA_Category WHERE PE_QA_Question.CategoryID = PE_QA_Category.CategoryID AND Status = 1 AND IsElite = 1
|
|
<xsl:if test="$Keyword != ''"> AND PE_QA_Question.Title LIKE '%@Keyword%'</xsl:if>
|
|
<xsl:if test="$CategoryID != 0">
|
|
AND (PE_QA_Question.CategoryId=@CategoryID or PE_QA_Category.ParentID=@CategoryID)
|
|
</xsl:if>
|
|
ORDER BY UpdateTime DESC)
|
|
ORDER BY UpdateTime DESC
|
|
</sql>
|
|
<countsql>
|
|
select count(*) from PE_QA_Question, PE_QA_Category WHERE PE_QA_Question.CategoryID = PE_QA_Category.CategoryID AND Status = 1 AND IsElite = 1
|
|
<xsl:if test="$Keyword != ''"> AND PE_QA_Question.Title LIKE '%@Keyword%'</xsl:if>
|
|
<xsl:if test="$CategoryID != 0">
|
|
AND (PE_QA_Question.CategoryId=@CategoryID or PE_QA_Category.ParentID=@CategoryID)
|
|
</xsl:if>
|
|
</countsql>
|
|
</root>
|
|
</xsl:template>
|
|
</xsl:transform>]]></LabelSqlString>
|
|
<LabelTemplate>
|
|
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
|
|
<xsl:output method="html" />
|
|
<xsl:param name="TitleLen"/>
|
|
<xsl:param name="Keyword"/>
|
|
<xsl:template match="/">
|
|
<div class="qu_list">
|
|
<ul>
|
|
<xsl:for-each select="/NewDataSet/Table">
|
|
<li>
|
|
<span>
|
|
<xsl:value-of select="pe:FormatDate(UpdateTime,'yyyy-mm-dd')"/>
|
|
</span>
|
|
<span>
|
|
<a>
|
|
<xsl:choose>
|
|
<xsl:when test="IsAnonymity = 'false'">
|
|
<xsl:value-of select="UserName"/>
|
|
</xsl:when>
|
|
<xsl:otherwise>匿名</xsl:otherwise>
|
|
</xsl:choose>
|
|
</a>
|
|
</span>
|
|
<b class="unsolved">
|
|
<xsl:value-of select="Point"/>
|
|
</b>
|
|
<em>
|
|
<a>
|
|
<xsl:attribute name="href">{PE.SiteConfig.ApplicationPath/}QA/ShowQuestion.aspx?Id=<xsl:value-of select="QuestionID"/>
|
|
</xsl:attribute>
|
|
<xsl:attribute name="title"><xsl:value-of select="Title"/></xsl:attribute>
|
|
<xsl:value-of select="pe:CutText(Title,$TitleLen,'...')"/>
|
|
</a>
|
|
</em> |
|
|
<a>
|
|
<xsl:attribute name="href">{PE.SiteConfig.ApplicationPath/}QA/QuestionList.aspx?Id=<xsl:value-of select="CategoryID"/>
|
|
</xsl:attribute>
|
|
[<xsl:value-of select="CategoryName"/>]
|
|
</a>
|
|
</li>
|
|
</xsl:for-each>
|
|
</ul>
|
|
</div>
|
|
</xsl:template>
|
|
</xsl:transform>]]></LabelTemplate>
|
|
<UsePage>True</UsePage>
|
|
<LabelSqlCount><![CDATA[请在上面的<countsql></countsql>标记之间写分页SQL查询语句
|
|
select count(*) from PE_QA_Question, PE_QA_Category WHERE PE_QA_Question.CategoryID = PE_QA_Category.CategoryID AND Status = 2 AND Title LIKE '%@Keyword%']]></LabelSqlCount>
|
|
<attributes>
|
|
<name>TitleLen</name>
|
|
<datatype>int</datatype>
|
|
<default>30</default>
|
|
<intro>标题长度</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>CategoryID</name>
|
|
<datatype>supersql</datatype>
|
|
<default>0</default>
|
|
<intro>问题类型ID</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>Keyword</name>
|
|
<datatype>supersql</datatype>
|
|
<default>
|
|
</default>
|
|
<intro>关键字</intro>
|
|
</attributes>
|
|
</root> |