first commit
This commit is contained in:
@@ -0,0 +1,353 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<LabelType>博客类</LabelType>
|
||||
<LabelIntro>
|
||||
</LabelIntro>
|
||||
<OutType>
|
||||
</OutType>
|
||||
<LabelDataType>sql_sysquery</LabelDataType>
|
||||
<EnabelAjax>False</EnabelAjax>
|
||||
<Version officialVersion="" modifiedVersions="2907" compatibleVersion="" />
|
||||
<attributes>
|
||||
<name>searchType</name>
|
||||
<datatype>sql.int</datatype>
|
||||
<default>1</default>
|
||||
<intro>搜索类型 1.标题 2.作者 3.标签 4.内容</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>keyword</name>
|
||||
<datatype>supersql</datatype>
|
||||
<default>
|
||||
</default>
|
||||
<intro>关键字</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>titleLength</name>
|
||||
<datatype>int</datatype>
|
||||
<default>50</default>
|
||||
<intro>标题长度</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>contentLength</name>
|
||||
<datatype>int</datatype>
|
||||
<default>200</default>
|
||||
<intro>内容长度</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>displayUpdateTime</name>
|
||||
<datatype>bool</datatype>
|
||||
<default>true</default>
|
||||
<intro>是否显示时间</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>displayBlogName</name>
|
||||
<datatype>bool</datatype>
|
||||
<default>true</default>
|
||||
<intro>是否显示来源</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>displayTag</name>
|
||||
<datatype>bool</datatype>
|
||||
<default>true</default>
|
||||
<intro>是否显示标签</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>ouputQty</name>
|
||||
<datatype>sql.int</datatype>
|
||||
<default>10</default>
|
||||
<intro>输出数量</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>linkOpenType</name>
|
||||
<datatype>string</datatype>
|
||||
<default>
|
||||
</default>
|
||||
<intro>链接打开方式</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>listOrderType</name>
|
||||
<datatype>sql.int</datatype>
|
||||
<default>5</default>
|
||||
<intro>排序方式</intro>
|
||||
</attributes>
|
||||
<UsePage>True</UsePage>
|
||||
<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">
|
||||
<!--要使用上一步定义的自定义参数,要作为XSLT参数使用,务必要在这里声明。如:<xsl:param name="myPara" />.引用该参数:$myPara -->
|
||||
<xsl:param name="listOrderType" />
|
||||
<xsl:param name="searchType" />
|
||||
<xsl:param name="keyword" />
|
||||
<xsl:output method="xml" />
|
||||
<xsl:template match="/">
|
||||
<!--请按提示编辑,保持该模板结构的正确性-->
|
||||
<root>
|
||||
<sql>
|
||||
<!--请在这里编写你的SQL语句-->
|
||||
SELECT TOP @pagesize PE_BG_log.*,PE_BG_Blog.BlogName FROM PE_BG_log INNER JOIN PE_BG_Blog ON PE_BG_log.BlogID = PE_BG_Blog.BlogID WHERE PE_BG_log.LogID Not In (SELECT TOP @startrow PE_BG_log.LogID FROM PE_BG_log INNER JOIN PE_BG_Blog ON PE_BG_log.BlogID = PE_BG_Blog.BlogID Where PE_BG_log.State=1 <xsl:if test="$keyword!=''">
|
||||
<xsl:choose>
|
||||
<!--标题关键字搜索-->
|
||||
<xsl:when test="$searchType=1">
|
||||
AND PE_BG_log.Title like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<!--作者关键字搜索-->
|
||||
<xsl:when test="$searchType=2">
|
||||
AND PE_BG_Blog.Nickname like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<!--标签关键字搜索-->
|
||||
<xsl:when test="$searchType=3">
|
||||
AND PE_BG_log.Tags like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<!--内容关键字搜索-->
|
||||
<xsl:when test="$searchType=4">
|
||||
AND PE_BG_log.Content like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<xsl:otherwise></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$listOrderType!=''">
|
||||
<!--推荐等级降序-->
|
||||
<xsl:if test="$listOrderType=1">
|
||||
ORDER BY PE_BG_log.EliteLevel DESC
|
||||
</xsl:if>
|
||||
<!--推荐等级升序-->
|
||||
<xsl:if test="$listOrderType=2">
|
||||
ORDER BY PE_BG_log.EliteLevel ASC
|
||||
</xsl:if>
|
||||
<!--博文ID降序-->
|
||||
<xsl:if test="$listOrderType=3">
|
||||
ORDER BY PE_BG_log.LogID DESC
|
||||
</xsl:if>
|
||||
<!--博文ID升序-->
|
||||
<xsl:if test="$listOrderType=4">
|
||||
ORDER BY PE_BG_log.LogID ASC
|
||||
</xsl:if>
|
||||
<!--更新时间降序-->
|
||||
<xsl:if test="$listOrderType=5">
|
||||
ORDER BY PE_BG_log.UpdateTime DESC
|
||||
</xsl:if>
|
||||
<!--更新时间升序-->
|
||||
<xsl:if test="$listOrderType=6">
|
||||
ORDER BY PE_BG_log.UpdateTime ASC
|
||||
</xsl:if>
|
||||
<!--点击数降序-->
|
||||
<xsl:if test="$listOrderType=7">
|
||||
ORDER BY PE_BG_log.Hits DESC
|
||||
</xsl:if>
|
||||
<!--点击数升序-->
|
||||
<xsl:if test="$listOrderType=8">
|
||||
ORDER BY PE_BG_log.Hits ASC
|
||||
</xsl:if>
|
||||
<!--月点击数降序-->
|
||||
<xsl:if test="$listOrderType=9">
|
||||
ORDER BY PE_BG_log.MonthHits DESC
|
||||
</xsl:if>
|
||||
<!--月点击数升序-->
|
||||
<xsl:if test="$listOrderType=10">
|
||||
ORDER BY PE_BG_log.MonthHits ASC
|
||||
</xsl:if>
|
||||
<!--周点击数降序-->
|
||||
<xsl:if test="$listOrderType=11">
|
||||
ORDER BY PE_BG_log.WeekHits DESC
|
||||
</xsl:if>
|
||||
<!--周点击数升序-->
|
||||
<xsl:if test="$listOrderType=12">
|
||||
ORDER BY PE_BG_log.WeekHits ASC
|
||||
</xsl:if>
|
||||
<!--日点击数降序-->
|
||||
<xsl:if test="$listOrderType=13">
|
||||
ORDER BY PE_BG_log.DayHits DESC
|
||||
</xsl:if>
|
||||
<!--日点击数升序-->
|
||||
<xsl:if test="$listOrderType=14">
|
||||
ORDER BY PE_BG_log.DayHits ASC
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose> ) And PE_BG_log.State=1
|
||||
<xsl:if test="$keyword!=''">
|
||||
<xsl:choose>
|
||||
<!--标题关键字搜索-->
|
||||
<xsl:when test="$searchType=1">
|
||||
AND PE_BG_log.Title like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<!--作者关键字搜索-->
|
||||
<xsl:when test="$searchType=2">
|
||||
AND PE_BG_Blog.Nickname like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<!--标签关键字搜索-->
|
||||
<xsl:when test="$searchType=3">
|
||||
AND PE_BG_log.Tags like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<!--内容关键字搜索-->
|
||||
<xsl:when test="$searchType=4">
|
||||
AND PE_BG_log.Content like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<xsl:otherwise></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$listOrderType!=''">
|
||||
<!--推荐等级降序-->
|
||||
<xsl:if test="$listOrderType=1">
|
||||
ORDER BY PE_BG_log.EliteLevel DESC
|
||||
</xsl:if>
|
||||
<!--推荐等级升序-->
|
||||
<xsl:if test="$listOrderType=2">
|
||||
ORDER BY PE_BG_log.EliteLevel ASC
|
||||
</xsl:if>
|
||||
<!--博文ID降序-->
|
||||
<xsl:if test="$listOrderType=3">
|
||||
ORDER BY PE_BG_log.LogID DESC
|
||||
</xsl:if>
|
||||
<!--博文ID升序-->
|
||||
<xsl:if test="$listOrderType=4">
|
||||
ORDER BY PE_BG_log.LogID ASC
|
||||
</xsl:if>
|
||||
<!--更新时间降序-->
|
||||
<xsl:if test="$listOrderType=5">
|
||||
ORDER BY PE_BG_log.UpdateTime DESC
|
||||
</xsl:if>
|
||||
<!--更新时间升序-->
|
||||
<xsl:if test="$listOrderType=6">
|
||||
ORDER BY PE_BG_log.UpdateTime ASC
|
||||
</xsl:if>
|
||||
<!--点击数降序-->
|
||||
<xsl:if test="$listOrderType=7">
|
||||
ORDER BY PE_BG_log.Hits DESC
|
||||
</xsl:if>
|
||||
<!--点击数升序-->
|
||||
<xsl:if test="$listOrderType=8">
|
||||
ORDER BY PE_BG_log.Hits ASC
|
||||
</xsl:if>
|
||||
<!--月点击数降序-->
|
||||
<xsl:if test="$listOrderType=9">
|
||||
ORDER BY PE_BG_log.MonthHits DESC
|
||||
</xsl:if>
|
||||
<!--月点击数升序-->
|
||||
<xsl:if test="$listOrderType=10">
|
||||
ORDER BY PE_BG_log.MonthHits ASC
|
||||
</xsl:if>
|
||||
<!--周点击数降序-->
|
||||
<xsl:if test="$listOrderType=11">
|
||||
ORDER BY PE_BG_log.WeekHits DESC
|
||||
</xsl:if>
|
||||
<!--周点击数升序-->
|
||||
<xsl:if test="$listOrderType=12">
|
||||
ORDER BY PE_BG_log.WeekHits ASC
|
||||
</xsl:if>
|
||||
<!--日点击数降序-->
|
||||
<xsl:if test="$listOrderType=13">
|
||||
ORDER BY PE_BG_log.DayHits DESC
|
||||
</xsl:if>
|
||||
<!--日点击数升序-->
|
||||
<xsl:if test="$listOrderType=14">
|
||||
ORDER BY PE_BG_log.DayHits ASC
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</sql>
|
||||
<sqlpage>
|
||||
<!--请在这里编写你的SQL分页查询语句,只有下面启用了分页SQL的XSLT编程支持这里才有效-->
|
||||
</sqlpage>
|
||||
<countsql>
|
||||
<!--请在这里编写你的分页SQL语句,只有下面启用了分页SQL的XSLT编程支持这里才有效-->
|
||||
SELECT Count(PE_BG_log.LogID) FROM PE_BG_log INNER JOIN PE_BG_Blog ON PE_BG_log.BlogID = PE_BG_Blog.BlogID WHERE PE_BG_log.State=1
|
||||
<xsl:if test="$keyword!=''">
|
||||
<xsl:choose>
|
||||
<!--标题关键字搜索-->
|
||||
<xsl:when test="$searchType=1">
|
||||
AND PE_BG_log.Title like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<!--作者关键字搜索-->
|
||||
<xsl:when test="$searchType=2">
|
||||
AND PE_BG_Blog.Nickname like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<!--标签关键字搜索-->
|
||||
<xsl:when test="$searchType=3">
|
||||
AND PE_BG_log.Tags like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<!--内容关键字搜索-->
|
||||
<xsl:when test="$searchType=4">
|
||||
AND PE_BG_log.Content like '%<xsl:value-of select="$keyword" />%'
|
||||
</xsl:when>
|
||||
<xsl:otherwise></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
</countsql>
|
||||
</root>
|
||||
</xsl:template>
|
||||
</xsl:transform>]]></LabelSqlString>
|
||||
<LabelSqlCount><![CDATA[请在上面的<countsql></countsql>标记之间写分页SQL查询语句
|
||||
select count(id) from database]]></LabelSqlCount>
|
||||
<LabelSqlPage>
|
||||
</LabelSqlPage>
|
||||
<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="contentLength" />
|
||||
<xsl:param name="linkOpenType" />
|
||||
<xsl:param name="displayUpdateTime" />
|
||||
<xsl:param name="displayBlogName" />
|
||||
<xsl:param name="displayTag" />
|
||||
<xsl:output method="html" />
|
||||
<xsl:template match="/">
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(NewDataSet/Table)=0">
|
||||
<li>暂时没有信息!
|
||||
</li>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:for-each select="NewDataSet/Table">
|
||||
<li>
|
||||
<h3>
|
||||
<a>
|
||||
<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>
|
||||
</h3>
|
||||
<span class="date">
|
||||
<xsl:if test="$displayUpdateTime='true'">
|
||||
<xsl:value-of select="pe:FormatDate(UpdateTime,'yyyy-mm-dd')"/>
|
||||
</xsl:if>
|
||||
</span>
|
||||
<p> <xsl:value-of select="pe:CutText(pe:RemoveHtml(Content),$contentLength,'...')"/>
|
||||
</p>
|
||||
<div class="info">
|
||||
<xsl:if test="$displayBlogName='true'">
|
||||
来源:<a>
|
||||
<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="BlogName"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="BlogName"/>
|
||||
</a>
|
||||
</xsl:if>
|
||||
<xsl:if test="$displayTag='true'">
|
||||
标签 {PE.Label id="自定义Tag显示" filed="<xsl:value-of select="Tags"/>" linkOpenType="1" /}
|
||||
</xsl:if>
|
||||
</div>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>]]></LabelTemplate>
|
||||
</root>
|
||||
Reference in New Issue
Block a user