344 lines
11 KiB
XML
344 lines
11 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<root>
|
|
<LabelType>博客类</LabelType>
|
|
<LabelIntro>
|
|
</LabelIntro>
|
|
<OutType>sin</OutType>
|
|
<LabelDataType>sql_sysquery</LabelDataType>
|
|
<EnabelAjax>False</EnabelAjax>
|
|
<Version officialVersion="" modifiedVersions="2914" compatibleVersion="" />
|
|
<attributes>
|
|
<name>ouputQty</name>
|
|
<datatype>sql.int</datatype>
|
|
<default>10</default>
|
|
<intro>输出数量</intro>
|
|
</attributes>
|
|
<IsXsltSql>true</IsXsltSql>
|
|
<IsXsltCountSql>false</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">
|
|
<!--要使用上一步定义的自定义参数,要作为XSLT参数使用,务必要在这里声明。如:<xsl:param name="myPara" />.引用该参数:$myPara -->
|
|
<xsl:output method="xml" />
|
|
|
|
<xsl:param name="isElite"/>
|
|
<xsl:param name="categoryId"/>
|
|
<xsl:param name="listOrderType"/>
|
|
<xsl:param name="isIndex"/>
|
|
<xsl:param name="isCategory"/>
|
|
<xsl:template match="/">
|
|
<!--请按提示编辑,保持该模板结构的正确性-->
|
|
<root>
|
|
<sql>
|
|
SELECT TOP @ouputQty L.*,B.Nickname FROM PE_BG_log L INNER JOIN PE_BG_Blog B ON L.BlogID= B.BlogID WHERE L.State=1
|
|
<xsl:if test="$isIndex='true'">
|
|
AND L.IndexState=2
|
|
</xsl:if>
|
|
<xsl:if test="$isCategory='true'">
|
|
AND L.ClassState=2
|
|
</xsl:if>
|
|
|
|
<xsl:choose>
|
|
<xsl:when test="$isElite='true'">
|
|
AND L.EliteLevel>0
|
|
</xsl:when>
|
|
<xsl:otherwise></xsl:otherwise>
|
|
</xsl:choose>
|
|
<xsl:choose>
|
|
<xsl:when test="$categoryId!=''">
|
|
AND L.CategoryID=<xsl:value-of select="$categoryId"/>
|
|
</xsl:when>
|
|
<xsl:otherwise></xsl:otherwise>
|
|
</xsl:choose>
|
|
<xsl:choose>
|
|
<xsl:when test="$listOrderType!=''">
|
|
<!--推荐等级降序-->
|
|
<xsl:if test="$listOrderType=1">
|
|
ORDER BY L.EliteLevel DESC
|
|
</xsl:if>
|
|
<!--推荐等级升序-->
|
|
<xsl:if test="$listOrderType=2">
|
|
ORDER BY L.EliteLevel ASC
|
|
</xsl:if>
|
|
<!--博文ID降序-->
|
|
<xsl:if test="$listOrderType=3">
|
|
ORDER BY L.LogID DESC
|
|
</xsl:if>
|
|
<!--博文ID升序-->
|
|
<xsl:if test="$listOrderType=4">
|
|
ORDER BY L.LogID ASC
|
|
</xsl:if>
|
|
<!--更新时间降序-->
|
|
<xsl:if test="$listOrderType=5">
|
|
ORDER BY L.UpdateTime DESC
|
|
</xsl:if>
|
|
<!--更新时间升序-->
|
|
<xsl:if test="$listOrderType=6">
|
|
ORDER BY L.UpdateTime ASC
|
|
</xsl:if>
|
|
<!--点击数降序-->
|
|
<xsl:if test="$listOrderType=7">
|
|
ORDER BY L.Hits DESC
|
|
</xsl:if>
|
|
<!--点击数升序-->
|
|
<xsl:if test="$listOrderType=8">
|
|
ORDER BY L.Hits ASC
|
|
</xsl:if>
|
|
<!--月点击数降序-->
|
|
<xsl:if test="$listOrderType=9">
|
|
ORDER BY L.MonthHits DESC
|
|
</xsl:if>
|
|
<!--月点击数升序-->
|
|
<xsl:if test="$listOrderType=10">
|
|
ORDER BY L.MonthHits ASC
|
|
</xsl:if>
|
|
<!--周点击数降序-->
|
|
<xsl:if test="$listOrderType=11">
|
|
ORDER BY L.WeekHits DESC
|
|
</xsl:if>
|
|
<!--周点击数升序-->
|
|
<xsl:if test="$listOrderType=12">
|
|
ORDER BY L.WeekHits ASC
|
|
</xsl:if>
|
|
<!--日点击数降序-->
|
|
<xsl:if test="$listOrderType=13">
|
|
ORDER BY L.DayHits DESC
|
|
</xsl:if>
|
|
<!--日点击数升序-->
|
|
<xsl:if test="$listOrderType=14">
|
|
ORDER BY L.DayHits ASC
|
|
</xsl:if>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
|
|
</sql>
|
|
<sqlpage>
|
|
<!--请在这里编写你的SQL分页查询语句,只有下面启用了分页SQL的XSLT编程支持这里才有效-->
|
|
</sqlpage>
|
|
<countsql>
|
|
<!--请在这里编写你的分页SQL语句,只有下面启用了分页SQL的XSLT编程支持这里才有效-->
|
|
</countsql>
|
|
</root>
|
|
</xsl:template>
|
|
</xsl:transform>]]></LabelSqlString>
|
|
<LabelTemplate>
|
|
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
|
|
<xsl:param name="ouputQty" />
|
|
<xsl:param name="titleLength" />
|
|
<xsl:param name="linkOpenType" />
|
|
<xsl:param name="isShowNum" />
|
|
<xsl:param name="titleStyle"/>
|
|
<xsl:param name="displayInputer"/>
|
|
<xsl:param name="inputerStyle"/>
|
|
<xsl:param name="partitionNums"/>
|
|
<xsl:param name="categoryId"/>
|
|
<xsl:param name="numStyle"/>
|
|
<xsl:param name="displayHits"/>
|
|
<xsl:param name="hitsSytle"/>
|
|
<xsl:param name="hitsType"/>
|
|
<xsl:output method="html" />
|
|
<xsl:template match="/">
|
|
<xsl:choose>
|
|
<xsl:when test="count(NewDataSet/Table)=0">
|
|
暂时没有信息!
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:for-each select="NewDataSet/Table">
|
|
|
|
<li>
|
|
<xsl:if test="position() mod $partitionNums = 0">
|
|
<xsl:attribute name="class">separator</xsl:attribute>
|
|
</xsl:if>
|
|
<xsl:if test="$isShowNum='true'">
|
|
<em>
|
|
<xsl:if test="$numStyle!=''">
|
|
<xsl:attribute name="class">
|
|
<xsl:value-of select="$numStyle"/>
|
|
</xsl:attribute>
|
|
</xsl:if>
|
|
<xsl:value-of select="position()"/>
|
|
</em>
|
|
</xsl:if>
|
|
<a>
|
|
<xsl:if test="$titleStyle!=''">
|
|
<xsl:attribute name="class">
|
|
<xsl:value-of select="$titleStyle" />
|
|
</xsl:attribute>
|
|
</xsl:if>
|
|
<xsl:attribute name="target">
|
|
<xsl:value-of select="$linkOpenType" />
|
|
</xsl:attribute>
|
|
<xsl:attribute name="href">
|
|
<xsl:value-of select="pe:InstallDir()"/>blog/Item.aspx?Id=<xsl:value-of select="BlogID"/>&LogId=<xsl:value-of select="LogID"/>
|
|
</xsl:attribute>
|
|
<xsl:attribute name="title">
|
|
<xsl:value-of select="Title"/>
|
|
</xsl:attribute>
|
|
<xsl:value-of select="pe:CutText(pe:RemoveHtml(Title),$titleLength,'...')"/>
|
|
</a>
|
|
<xsl:if test="$displayInputer='true'">
|
|
<span>
|
|
<xsl:if test="$inputerStyle!=''">
|
|
<xsl:attribute name="class">
|
|
<xsl:value-of select="$inputerStyle" />
|
|
</xsl:attribute>
|
|
</xsl:if>
|
|
<a>
|
|
<xsl:attribute name="target">
|
|
<xsl:value-of select="$linkOpenType" />
|
|
</xsl:attribute>
|
|
<xsl:attribute name="href">
|
|
<xsl:value-of select="pe:InstallDir()"/>blog/UserIndex.aspx?Id=<xsl:value-of select="BlogID"/>
|
|
</xsl:attribute>
|
|
<xsl:attribute name="title">
|
|
<xsl:value-of select="Title"/>
|
|
</xsl:attribute>
|
|
|
|
</a>
|
|
<span title='{Nickname}'><xsl:value-of select="pe:CutText(Nickname,12,'…')"/></span>
|
|
</span>
|
|
</xsl:if>
|
|
<xsl:if test="$displayHits='true'">
|
|
<span>
|
|
<xsl:if test="$hitsSytle!=''">
|
|
<xsl:attribute name="class">
|
|
<xsl:value-of select="$hitsSytle"/>
|
|
</xsl:attribute>
|
|
</xsl:if>
|
|
<!--总点击数-->
|
|
<xsl:choose>
|
|
<xsl:when test="$hitsType!=0">
|
|
<xsl:if test="$hitsType=7">
|
|
<xsl:value-of select="Hits"/>
|
|
</xsl:if>
|
|
<!--月点击数-->
|
|
<xsl:if test="$hitsType=9">
|
|
<xsl:value-of select="MonthHits"/>
|
|
</xsl:if>
|
|
<!--周点击数-->
|
|
<xsl:if test="$hitsType=11">
|
|
<xsl:value-of select="WeekHits"/>
|
|
</xsl:if>
|
|
<!--日点击数-->
|
|
<xsl:if test="$hitsType=13">
|
|
<xsl:value-of select="DayHits"/>
|
|
</xsl:if>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of select="Hits"/>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
|
|
</span>
|
|
</xsl:if>
|
|
</li>
|
|
</xsl:for-each>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
</xsl:stylesheet>]]></LabelTemplate>
|
|
<attributes>
|
|
<name>titleLength</name>
|
|
<datatype>int</datatype>
|
|
<default>30</default>
|
|
<intro>标题截取长度</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>linkOpenType</name>
|
|
<datatype>string</datatype>
|
|
<default>_blank</default>
|
|
<intro>链接打开方式</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>listOrderType</name>
|
|
<datatype>int</datatype>
|
|
<default>1</default>
|
|
<intro>排序类型</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>displayInputer</name>
|
|
<datatype>bool</datatype>
|
|
<default>false</default>
|
|
<intro>是否显示作者</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>displayHits</name>
|
|
<datatype>bool</datatype>
|
|
<default>false</default>
|
|
<intro>是否点击数</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>titleStyle</name>
|
|
<datatype>string</datatype>
|
|
<default>
|
|
</default>
|
|
<intro>标题样式</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>inputerStyle</name>
|
|
<datatype>string</datatype>
|
|
<default>
|
|
</default>
|
|
<intro>作者样式</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>isShowNum</name>
|
|
<datatype>bool</datatype>
|
|
<default>false</default>
|
|
<intro>是否显示数字</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>categoryId</name>
|
|
<datatype>sql.int</datatype>
|
|
<default>
|
|
</default>
|
|
<intro>分类ID</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>isElite</name>
|
|
<datatype>bool</datatype>
|
|
<default>false</default>
|
|
<intro>是否推荐</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>partitionNums</name>
|
|
<datatype>int</datatype>
|
|
<default>0</default>
|
|
<intro>每多少行分隔</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>numStyle</name>
|
|
<datatype>string</datatype>
|
|
<default>
|
|
</default>
|
|
<intro>数字样式</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>hitsSytle</name>
|
|
<datatype>string</datatype>
|
|
<default>
|
|
</default>
|
|
<intro>点击数样式</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>hitsType</name>
|
|
<datatype>int</datatype>
|
|
<default>
|
|
</default>
|
|
<intro>点击数类型</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>isIndex</name>
|
|
<datatype>bool</datatype>
|
|
<default>true</default>
|
|
<intro>是否只显示推荐首页博文</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>isCategory</name>
|
|
<datatype>bool</datatype>
|
|
<default>true</default>
|
|
<intro>是否只显示推荐分类博文</intro>
|
|
</attributes>
|
|
</root> |