first commit
This commit is contained in:
@@ -0,0 +1,395 @@
|
||||
<root>
|
||||
<LabelType>Flash类</LabelType>
|
||||
<LabelIntro>Flash带图片的信息列表复杂算法主标签,此标签仅用来调用,无需修改!</LabelIntro>
|
||||
<OutType>sin</OutType>
|
||||
<LabelDataType>sql_sysquery</LabelDataType>
|
||||
<EnabelAjax>False</EnabelAjax>
|
||||
<IsXsltSql>false</IsXsltSql>
|
||||
<IsXsltCountSql>false</IsXsltCountSql>
|
||||
<LabelSqlString>SELECT NodeID,arrChildID,ItemListOrderType,ItemPageSize FROM PE_Nodes WHERE NodeID IN (@parentId)</LabelSqlString>
|
||||
<attributes>
|
||||
<name>bindStyle</name>
|
||||
<datatype>string</datatype>
|
||||
<default>图片式</default>
|
||||
<intro>项目呈现样式</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>usePage</name>
|
||||
<datatype>bool</datatype>
|
||||
<default>false</default>
|
||||
<intro>是否分页显示</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>outputQty</name>
|
||||
<datatype>int</datatype>
|
||||
<default>10</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>0</default>
|
||||
<intro>项目内容长度</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>parentId</name>
|
||||
<datatype>supersql</datatype>
|
||||
<default>0</default>
|
||||
<intro>父栏目ID</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>nodeArray</name>
|
||||
<datatype>string</datatype>
|
||||
<default>0</default>
|
||||
<intro>栏目数组</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>modelId</name>
|
||||
<datatype>string</datatype>
|
||||
<default>0</default>
|
||||
<intro>模型ID</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>joinModelId</name>
|
||||
<datatype>int</datatype>
|
||||
<default>1</default>
|
||||
<intro>通过模型ID与指定的模型表联合</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>specialId</name>
|
||||
<datatype>int</datatype>
|
||||
<default>0</default>
|
||||
<intro>专题ID</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>itemId</name>
|
||||
<datatype>string</datatype>
|
||||
<default>0</default>
|
||||
<intro>项目ID</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>itemListOrderType</name>
|
||||
<datatype>int</datatype>
|
||||
<default>1</default>
|
||||
<intro>项目列表排序方式</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>inDays</name>
|
||||
<datatype>int</datatype>
|
||||
<default />
|
||||
<intro>近多少天的项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>betDate</name>
|
||||
<datatype>string</datatype>
|
||||
<default />
|
||||
<intro>介于时间段之间的项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>editor</name>
|
||||
<datatype>string</datatype>
|
||||
<default />
|
||||
<intro>为指定编辑者的项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>inputer</name>
|
||||
<datatype>string</datatype>
|
||||
<default />
|
||||
<intro>为指定录入者的项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>hits</name>
|
||||
<datatype>int</datatype>
|
||||
<default />
|
||||
<intro>点击数大于等于指定值的项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>dayHits</name>
|
||||
<datatype>int</datatype>
|
||||
<default />
|
||||
<intro>日点击数大于等于指定值的项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>weekHits</name>
|
||||
<datatype>int</datatype>
|
||||
<default />
|
||||
<intro>周点击数大于等于指定值的项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>monthHits</name>
|
||||
<datatype>int</datatype>
|
||||
<default />
|
||||
<intro>月点击数大于等于指定值的项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>eliteLevel</name>
|
||||
<datatype>int</datatype>
|
||||
<default />
|
||||
<intro>推荐级大于等于指定值的项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>priorityLevel</name>
|
||||
<datatype>int</datatype>
|
||||
<default />
|
||||
<intro>优先级大于等于指定值的项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>disableVirtualLink</name>
|
||||
<datatype>bool</datatype>
|
||||
<default>false</default>
|
||||
<intro>是否禁止输出虚连接项目</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>imageClass</name>
|
||||
<datatype>string</datatype>
|
||||
<default>pe_u_thumb</default>
|
||||
<intro>图片区块选择器名</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>contentClass</name>
|
||||
<datatype>string</datatype>
|
||||
<default>pe_u_thumb_title</default>
|
||||
<intro>标题简介区择器名</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>imageWidth</name>
|
||||
<datatype>int</datatype>
|
||||
<default>160</default>
|
||||
<intro>图片宽度</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>imageHeight</name>
|
||||
<datatype>int</datatype>
|
||||
<default>120</default>
|
||||
<intro>图片高度</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>forceItemListOrder</name>
|
||||
<datatype>bool</datatype>
|
||||
<default>true</default>
|
||||
<intro>强行由"项目列表排序方式参数"控制,否则由节点配置取代</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>forceOutputQty</name>
|
||||
<datatype>bool</datatype>
|
||||
<default>true</default>
|
||||
<intro>强行由参数"输出的项目数量"否则由节点配置取代</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>optionalCond</name>
|
||||
<datatype>string</datatype>
|
||||
<default>
|
||||
</default>
|
||||
<intro>可选扩展查询约束条件</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>optionalExtend</name>
|
||||
<datatype>string</datatype>
|
||||
<default />
|
||||
<intro>可选扩展参数</intro>
|
||||
</attributes>
|
||||
<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:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
|
||||
<xsl:param name="bindStyle" />
|
||||
<xsl:param name="usePage" />
|
||||
<xsl:param name="outputQty" />
|
||||
<xsl:param name="titleLength" />
|
||||
<xsl:param name="contentLength" />
|
||||
<xsl:param name="parentId" />
|
||||
<xsl:param name="nodeArray"/>
|
||||
<xsl:param name="modelId" />
|
||||
<xsl:param name="joinModelId"/>
|
||||
<xsl:param name="specialId" />
|
||||
<xsl:param name="itemId" />
|
||||
<xsl:param name="itemListOrderType" />
|
||||
<xsl:param name="inDays" />
|
||||
<xsl:param name="betDate" />
|
||||
<xsl:param name="editor" />
|
||||
<xsl:param name="inputer" />
|
||||
<xsl:param name="hits" />
|
||||
<xsl:param name="dayHits" />
|
||||
<xsl:param name="weekHits" />
|
||||
<xsl:param name="monthHits" />
|
||||
<xsl:param name="eliteLevel" />
|
||||
<xsl:param name="priorityLevel" />
|
||||
<xsl:param name="disableVirtualLink" />
|
||||
<xsl:param name="imageClass" />
|
||||
<xsl:param name="contentClass" />
|
||||
<xsl:param name="imageWidth" />
|
||||
<xsl:param name="imageHeight" />
|
||||
<xsl:param name="forceItemListOrder" />
|
||||
<xsl:param name="forceOutputQty" />
|
||||
<xsl:param name="optionalCond" />
|
||||
<xsl:param name="optionalExtend" />
|
||||
<xsl:template match="/">
|
||||
<xsl:variable name="params">
|
||||
<!--如需增加标签传递参数请添加在此位置-->
|
||||
titleLength="<xsl:value-of select="$titleLength"/>" contentLength="<xsl:value-of select="$contentLength"/>" contentClass="<xsl:value-of select="$contentClass"/>" imageClass="<xsl:value-of select="$imageClass"/>" imageHeight="<xsl:value-of select="$imageHeight"/>" imageWidth="<xsl:value-of select="$imageWidth"/>" optionalExtend="<xsl:value-of select="$optionalExtend"/>"
|
||||
</xsl:variable>
|
||||
<xsl:variable name="importStyle">
|
||||
<!--样式依赖项,被传递标签样式名称规则-->
|
||||
Flash信息列表_<xsl:value-of select="$bindStyle"/>
|
||||
</xsl:variable>
|
||||
<!--核心计算方式开始,以下内容请勿修改-->
|
||||
<xsl:variable name="itemPageSize">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$forceOutputQty = 'true'">
|
||||
<xsl:value-of select="$outputQty"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="/NewDataSet/Table/ItemPageSize > 0">
|
||||
<xsl:value-of select="/NewDataSet/Table/ItemPageSize"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$outputQty"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="itemListOrderType">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$forceItemListOrder = 'true'">
|
||||
<xsl:value-of select="$itemListOrderType"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="/NewDataSet/Table/ItemListOrderType"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="itemListOrderValue">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$itemListOrderType = 1">CM.GeneralID DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 2">CM.GeneralID</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 3">CM.UpdateTime DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 4">CM.UpdateTime</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 5">CM.Hits DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 6">CM.Hits</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 7">CM.CommentAudited DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 8">CM.CommentAudited</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 9">CM.DayHits DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 10">CM.DayHits</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 11">CM.WeekHits DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 12">CM.WeekHits</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 13">CM.MonthHits DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 14">CM.MonthHits</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 15">CM.EliteLevel DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 16">CM.EliteLevel</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 17">CM.Priority DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 18">CM.Priority</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 19">CM.Hits DESC,CM.UpdateTime DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 20">CM.EliteLevel DESC,CM.UpdateTime DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 21">CM.Priority DESC,CM.UpdateTime DESC</xsl:when>
|
||||
<xsl:when test="$itemListOrderType = 22">CM.CommentAudited DESC,CM.UpdateTime DESC</xsl:when>
|
||||
<xsl:otherwise>CM.UpdateTime DESC</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="node">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$nodeArray = 0">
|
||||
<xsl:for-each select="/NewDataSet/Table">
|
||||
<xsl:value-of select="arrChildID"/>,
|
||||
</xsl:for-each>0
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$nodeArray"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="queryCondition">
|
||||
<xsl:if test="$specialId != 0">
|
||||
AND SI.SpecialID IN (<xsl:value-of select="$specialId"/>)
|
||||
</xsl:if>
|
||||
<xsl:if test="$modelId != 0">
|
||||
AND CM.ModelID IN (<xsl:value-of select="$modelId"/>)
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemId != 0">
|
||||
AND CM.GeneralID IN (<xsl:value-of select="$itemId"/>)
|
||||
</xsl:if>
|
||||
<xsl:if test="$disableVirtualLink = 'true'">
|
||||
AND CM.LinkType = 0
|
||||
</xsl:if>
|
||||
<xsl:if test="$inputer != ''">
|
||||
AND CM.Inputer = '<xsl:value-of select="$inputer"/>'
|
||||
</xsl:if>
|
||||
<xsl:if test="$editor != ''">
|
||||
AND CM.Editor = <xsl:value-of select="$editor"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$eliteLevel != ''">
|
||||
AND CM.EliteLevel >= <xsl:value-of select="$eliteLevel"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$priorityLevel != ''">
|
||||
AND CM.Priority >= <xsl:value-of select="$priorityLevel"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$hits != ''">
|
||||
AND CM.Hits >= <xsl:value-of select="$hits"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$dayHits != ''">
|
||||
AND CM.DayHits >= <xsl:value-of select="$dayHits"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$weekHits != ''">
|
||||
AND CM.WeekHits >= <xsl:value-of select="$weekHits"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$monthHits != ''">
|
||||
AND CM.MonthHits >= <xsl:value-of select="$monthHits"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$inDays != ''">
|
||||
AND DATEDIFF(d,CM.UpdateTime,GETDATE()) <= <xsl:value-of select="$inDays"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$betDate != ''">
|
||||
AND (CM.UpdateTime >= '<xsl:value-of select="substring-before($betDate,'|')" />' AND CM.UpdateTime <= '<xsl:value-of select="substring-after($betDate,'|')" />')
|
||||
</xsl:if>
|
||||
<xsl:if test="$optionalCond != ''">
|
||||
<xsl:value-of select="$optionalCond"/>
|
||||
</xsl:if>
|
||||
AND SUBSTRING(UT.FlashPic,0,10) != ''
|
||||
</xsl:variable>
|
||||
<xsl:variable name="joinQuerySnippet">
|
||||
<xsl:if test="$specialId != 0">
|
||||
INNER JOIN PE_SpecialInfos SI ON (CM.ItemID = SI.GeneralID)
|
||||
</xsl:if>
|
||||
INNER JOIN PE_U_Flash UT ON (CM.ItemID = UT.ID)
|
||||
</xsl:variable>
|
||||
<!--核心计算方式结束,以上内容请勿修改-->
|
||||
<!--**********************************-->
|
||||
<!--分页、扩展样式、查询语句、参数传递-->
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(/NewDataSet/Table) = 0">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$parentId = 0">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$usePage = 'false'">
|
||||
{PE.Label id="<xsl:value-of select="$importStyle"/>" <xsl:value-of select="$params"/> queryCond="SELECT TOP <xsl:value-of select="$itemPageSize"/> * FROM PE_CommonModel CM <xsl:value-of select="$joinQuerySnippet"/> WHERE CM.Status = 99 <xsl:value-of select="$queryCondition"/> ORDER BY <xsl:value-of select="$itemListOrderValue"/>" page="false" /}
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
{PE.Label id="<xsl:value-of select="$importStyle"/>" <xsl:value-of select="$params"/>" queryCond="SELECT TOP @pagesize * FROM PE_CommonModel CM <xsl:value-of select="$joinQuerySnippet"/> WHERE CM.Status = 99 <xsl:value-of select="$queryCondition"/> AND CM.ItemID NOT IN(SELECT TOP @startrow CM.ItemID FROM PE_CommonModel CM <xsl:value-of select="$itemListOrderValue"/> WHERE <xsl:value-of select="$queryCondition"/> ORDER BY <xsl:value-of select="$itemListOrderValue"/>) ORDER BY <xsl:value-of select="$itemListOrderType"/>" queryCount="SELECT COUNT (CM.ItemID) FROM PE_CommonModel CM <xsl:value-of select="$joinQuerySnippet"/> WHERE CM.Status = 99 <xsl:value-of select="$queryCondition"/>" page="true" pagesize="<xsl:value-of select="$itemPageSize"/>" urlpage="true" /}
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<font style="color:red">出错啦!指定了不可能的栏目ID(数组)!</font>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$usePage = 'false'">
|
||||
{PE.Label id="<xsl:value-of select="$importStyle"/>" <xsl:value-of select="$params"/> queryCond="SELECT TOP <xsl:value-of select="$itemPageSize"/> * FROM PE_CommonModel CM <xsl:value-of select="$joinQuerySnippet"/> WHERE CM.Status = 99 AND CM.NodeID IN (<xsl:value-of select="$node"/>) <xsl:value-of select="$queryCondition"/> ORDER BY <xsl:value-of select="$itemListOrderValue"/>" page="false" /}
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
{PE.Label id="<xsl:value-of select="$importStyle"/>" <xsl:value-of select="$params"/> queryCond="SELECT TOP @pagesize * FROM PE_CommonModel CM <xsl:value-of select="$joinQuerySnippet"/> WHERE CM.Status = 99 AND CM.NodeID IN (<xsl:value-of select="$node"/>) <xsl:value-of select="$queryCondition"/> AND CM.ItemID NOT IN(SELECT TOP @startrow CM.ItemID FROM PE_CommonModel CM <xsl:value-of select="$joinQuerySnippet"/> WHERE CM.Status = 99 AND CM.NodeID IN (<xsl:value-of select="$node"/>) <xsl:value-of select="$queryCondition"/> ORDER BY <xsl:value-of select="$itemListOrderValue"/>) ORDER BY <xsl:value-of select="$itemListOrderValue"/>" queryCount="SELECT COUNT (CM.ItemID) FROM PE_CommonModel CM <xsl:value-of select="$joinQuerySnippet"/> WHERE CM.Status = 99 AND CM.NodeID IN (<xsl:value-of select="$node"/>) <xsl:value-of select="$queryCondition"/>" page="true" pagesize="<xsl:value-of select="$itemPageSize"/>" urlpage="true" /}
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>]]></LabelTemplate>
|
||||
</root>
|
||||
Reference in New Issue
Block a user