279 lines
13 KiB
XML
279 lines
13 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="2907" compatibleVersion="" />
|
|
<attributes>
|
|
<name>blogId</name>
|
|
<datatype>sql.int</datatype>
|
|
<default>0</default>
|
|
<intro>博客ID</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>outputQty</name>
|
|
<datatype>supersql</datatype>
|
|
<default>0</default>
|
|
<intro>输出数量,大于0时不支持分页</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>openType</name>
|
|
<datatype>int</datatype>
|
|
<default>0</default>
|
|
<intro>打开方式{新窗口:1,原窗口:0}</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>titleLength</name>
|
|
<datatype>int</datatype>
|
|
<default>0</default>
|
|
<intro>标题长度</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>contentLength</name>
|
|
<datatype>int</datatype>
|
|
<default>0</default>
|
|
<intro>项目内容长度</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>orderType</name>
|
|
<datatype>int</datatype>
|
|
<default>0</default>
|
|
<intro>排序方式</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>displayCategory</name>
|
|
<datatype>bool</datatype>
|
|
<default>true</default>
|
|
<intro>是否显示分类名称</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>displayTags</name>
|
|
<datatype>bool</datatype>
|
|
<default>true</default>
|
|
<intro>是否显示标签</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>displayHit</name>
|
|
<datatype>bool</datatype>
|
|
<default>true</default>
|
|
<intro>是否显示阅读数</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>displayComment</name>
|
|
<datatype>bool</datatype>
|
|
<default>true</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="orderType" />
|
|
<xsl:param name="outputQty"/>
|
|
<xsl:output method="xml" />
|
|
<xsl:template match="/">
|
|
<!--请按提示编辑,保持该模板结构的正确性-->
|
|
<root>
|
|
<sql>
|
|
<xsl:variable name="orderTypeValue">
|
|
<xsl:choose>
|
|
<xsl:when test="$orderType=0">L.LogID DESC</xsl:when>
|
|
<xsl:when test="$orderType=2">L.Hits DESC,L.LogID DESC</xsl:when>
|
|
<xsl:when test="$orderType=3">L.UpdateTime DESC,L.LogID DESC</xsl:when>
|
|
<xsl:otherwise>L.LogID DESC</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:variable>
|
|
<xsl:choose>
|
|
<xsl:when test="$outputQty>0">
|
|
SELECT TOP <xsl:value-of select="$outputQty"/> L.LogID,L.BlogID,L.UserCategoryID,L.Title,L.Content,L.Tags,L.Hits,L.UpdateTime,B.UserName FROM PE_BG_Log L INNER JOIN PE_BG_Blog B ON L.BlogID = B.BlogID WHERE L.BlogID=1 AND L.State>0
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
EXEC [dbo].[PR_Common_PagingLarge] 'PE_BG_Log L INNER JOIN PE_BG_Blog B ON L.BlogID = B.BlogID','L.LogID','L.LogID,L.BlogID,L.UserCategoryID,L.Title,L.Content,L.Tags,L.Hits,L.UpdateTime,B.UserName',@pagesize, @startrow,'L.BlogID=@blogId AND L.State>0','','<xsl:value-of select="$orderTypeValue"/>'
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</sql>
|
|
<sqlpage>
|
|
<!--请在这里编写你的SQL分页查询语句,只有下面启用了分页SQL的XSLT编程支持这里才有效-->
|
|
</sqlpage>
|
|
<countsql>
|
|
<!--请在这里编写你的分页SQL语句,只有下面启用了分页SQL的XSLT编程支持这里才有效-->
|
|
<xsl:if test="$outputQty=0">
|
|
SELECT COUNT(L.LogID) FROM PE_BG_Log L INNER JOIN PE_BG_Blog B ON L.BlogID = B.BlogID WHERE L.BlogID=@blogId AND L.State>0
|
|
</xsl:if>
|
|
</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="blogId" />
|
|
<xsl:param name="openType" />
|
|
<xsl:param name="titleLength" />
|
|
<xsl:param name="contentLength" />
|
|
<xsl:param name="OrderType" />
|
|
<xsl:param name="displayCategory" />
|
|
<xsl:param name="displayTags" />
|
|
<xsl:param name="displayHit" />
|
|
<xsl:param name="displayComment" />
|
|
<xsl:param name="displayContent" />
|
|
|
|
<xsl:output method="html" />
|
|
<xsl:template match="/">
|
|
<xsl:choose>
|
|
<xsl:when test="count(NewDataSet/Table)=0">
|
|
暂时没有信息!
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:variable name="LoginName" select="pe:LoginedUserName()"/>
|
|
<xsl:for-each select="NewDataSet/Table">
|
|
<div class="blogItem">
|
|
<div class="itemTitle">
|
|
<h4>
|
|
<a>
|
|
<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:choose>
|
|
<xsl:when test="$titleLength>0">
|
|
<xsl:value-of select="pe:CutText(Title,$titleLength,'...')"/>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of select="Title"/>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</a>
|
|
</h4>
|
|
<span>
|
|
<xsl:value-of select="pe:FormatDate(UpdateTime,'yyyy-mm-dd hh:ff')"/>
|
|
</span>
|
|
<xsl:if test="$LoginName=UserName">
|
|
<span class="artmanage">
|
|
[<a href="{pe:InstallDir()}Blog/Log.aspx?id={BlogID}&Action=modify&LogId={LogID}">编辑</a>]
|
|
[<a href="javascript:DeleteLog('{LogID}','{$blogId}');" onclick='return confirm("删除的博文将被放入回收站,确定要删除此博文吗?");'>删除</a>]
|
|
</span>
|
|
</xsl:if>
|
|
</div>
|
|
<div class="itemSort clearFloat">
|
|
<xsl:if test="$displayTags='true'">
|
|
<div class="tags">
|
|
<strong>标签:</strong>
|
|
{PE.Label id="处理博文Tags" tags="<xsl:value-of select="Tags"/>" /}
|
|
</div>
|
|
</xsl:if>
|
|
<xsl:if test="$displayCategory='true'">
|
|
<div class="sort">
|
|
<strong>分类:</strong>
|
|
<a>
|
|
<xsl:attribute name="href">
|
|
<xsl:value-of select="pe:InstallDir()"/>Blog/UserCategory.aspx?id=<xsl:value-of select="BlogID"/>&categoryId=<xsl:value-of select="UserCategoryID"/>
|
|
</xsl:attribute>{PE.Label id="获取用户博文分类名称" userCategoryId="<xsl:value-of select="UserCategoryID"/>" /}
|
|
</a>
|
|
</div>
|
|
</xsl:if>
|
|
</div>
|
|
<xsl:if test="$displayContent='true'">
|
|
<div class="itemContent">
|
|
<xsl:choose>
|
|
<xsl:when test="$contentLength>0">
|
|
<xsl:value-of disable-output-escaping="yes" select="pe:CutContent(Content,$contentLength)"/>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of disable-output-escaping="yes" select="Content"/>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</div>
|
|
</xsl:if>
|
|
<div class="itemInfo clearFloat">
|
|
<a>
|
|
<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:attribute>
|
|
<xsl:attribute name="class">details</xsl:attribute>阅读全文
|
|
</a>
|
|
<div class="itemStati">
|
|
<xsl:if test="$displayHit='true'">
|
|
<a>
|
|
<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="阅读"/>
|
|
</xsl:attribute>阅读
|
|
</a>
|
|
<span>
|
|
(<xsl:value-of select="Hits"/>)
|
|
</span>
|
|
</xsl:if>
|
|
<xsl:if test="$displayHit='true' and $displayComment='true'">
|
|
|
|
|
</xsl:if>
|
|
<xsl:if test="$displayComment='true'">
|
|
<a>
|
|
<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"/>#commentform
|
|
</xsl:attribute>
|
|
<xsl:attribute name="title">
|
|
<xsl:value-of select="评论"/>
|
|
</xsl:attribute>评论
|
|
</a>
|
|
<span>
|
|
({PE.Label id="博文评论数" logId="<xsl:value-of select="LogID"/>" /})
|
|
</span>
|
|
</xsl:if>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</xsl:for-each>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
<script language="javascript" type="text/javascript">
|
|
function DeleteLog(id,blogID){
|
|
var x = new AjaxRequest('XML', '');
|
|
x.para = ['logID='+id,'blogID='+blogID];
|
|
x.post('deletelog', '{PE.SiteConfig.AjaxSitepath/}Ajax.aspx?HandlerName=BlogAjaxHandler', function(s){
|
|
var xml = x.createXmlDom(s);
|
|
var status = xml.getElementsByTagName("status")[0].firstChild.data;
|
|
if (status == "ok") {
|
|
window.location.reload();
|
|
}
|
|
else {
|
|
ShowBlogMessage("error","删除失败!","");
|
|
}
|
|
});
|
|
}
|
|
|
|
jQuery(function($) {
|
|
$(".itemContent img").each(function(i,ele){
|
|
if($(ele).width()>600){
|
|
$(ele).width(600);
|
|
$(ele).height("auto");
|
|
$(ele).css("cursor","pointer");
|
|
$(ele).click(function(){
|
|
window.open($(ele).attr('src'), "_blank");
|
|
});
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</xsl:template>
|
|
</xsl:stylesheet>]]></LabelTemplate>
|
|
<attributes>
|
|
<name>displayContent</name>
|
|
<datatype>bool</datatype>
|
|
<default>true</default>
|
|
<intro>是否显示内容</intro>
|
|
</attributes>
|
|
<LabelSqlCount><![CDATA[请在上面的<countsql></countsql>标记之间写分页SQL查询语句
|
|
SELECT COUNT(L.LogID) FROM PE_BG_Log L INNER JOIN PE_BG_Blog B ON L.BlogID = B.BlogID WHERE L.BlogID=@blogId AND L.State>0]]></LabelSqlCount>
|
|
</root> |