first commit
This commit is contained in:
@@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<LabelType>评论类</LabelType>
|
||||
<LabelIntro>
|
||||
</LabelIntro>
|
||||
<OutType>sin</OutType>
|
||||
<LabelDataType>static</LabelDataType>
|
||||
<EnabelAjax>True</EnabelAjax>
|
||||
<Version officialVersion="" modifiedVersions="3004" compatibleVersion="" />
|
||||
<attributes>
|
||||
<name>itemId</name>
|
||||
<datatype>int</datatype>
|
||||
<default>1</default>
|
||||
<intro>项目ID</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>nodeId</name>
|
||||
<datatype>int</datatype>
|
||||
<default>1</default>
|
||||
<intro>项目所在的节点ID</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>targetId</name>
|
||||
<datatype>string</datatype>
|
||||
<default>commentForm</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:param name="itemId" />
|
||||
<xsl:param name="nodeId" />
|
||||
<xsl:param name="targetId" />
|
||||
<xsl:variable name="rootDir" select="pe:InstallDir()"/>
|
||||
<xsl:output method="html" />
|
||||
<xsl:template match="/">
|
||||
<xsl:variable name="commentStyle">
|
||||
<ul class="user_info">
|
||||
<li>
|
||||
<label>
|
||||
<span>标题:</span>
|
||||
<input type="text" class="input_tx" id="commentTitle"/>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label id="commentUsernameBlock">
|
||||
<span>用户名:</span>
|
||||
<input type="text" class="input_tx" value="游客" id="commentUsername"/>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<span id="commentRankingBlock">
|
||||
评分:
|
||||
<img onmouseout="rankingMouseOut()" onmouseover="rankingMouseOver(1)" onclick="rankingClick(1)" alt="星级1" src="{$rootDir}images/fstar.gif"/>
|
||||
<img onmouseout="rankingMouseOut()" onmouseover="rankingMouseOver(2)" onclick="rankingClick(2)" alt="星级2" src="{$rootDir}images/fstar.gif"/>
|
||||
<img onmouseout="rankingMouseOut()" onmouseover="rankingMouseOver(3)" onclick="rankingClick(3)" alt="星级3" src="{$rootDir}images/fstar.gif"/>
|
||||
<img onmouseout="rankingMouseOut()" onmouseover="rankingMouseOver(4)" onclick="rankingClick(4)" alt="星级4" src="{$rootDir}images/estar.gif"/>
|
||||
<img onmouseout="rankingMouseOut()" onmouseover="rankingMouseOver(5)" onclick="rankingClick(5)" alt="星级5" src="{$rootDir}images/estar.gif"/>
|
||||
</span>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label id="commentEmailBlock">
|
||||
<span>邮 箱:</span>
|
||||
<input type="text" class="input_tx" id="commentEmail"/>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
匿名发表<input type="checkbox" onclick="setAnonymous(this)" class="input_check"/>
|
||||
</label>
|
||||
<xsl:if test="pe:IsLogined() = 'true'">
|
||||
<label>
|
||||
隐藏内容<input type="checkbox" onclick="setPrivate(this)" class="input_check"/>
|
||||
</label>
|
||||
</xsl:if>
|
||||
</li>
|
||||
</ul>
|
||||
<textarea wrap="on" id="commentContnet"/>
|
||||
<div class="return">
|
||||
<button onmouseout="changeBtnStyle(this, 'bt')" onmouseover="changeBtnStyle(this, 'bt_click')" onclick="addComment()" class="bt" id="publish_msg">马上发表</button>
|
||||
<xsl:if test="pe:GetNodeInfo($nodeId,'EnableValidCode') = 'true'">
|
||||
<img align="absmiddle" style="border: medium none ; cursor: pointer;" src="{$rootDir}Controls/validateCodeImage.aspx" onclick="refreshValidCode(this);" id="commentValidCodeImg" title="看不清楚,换一个"/>
|
||||
<input type="text" onfocus="this.select();" size="12" id="commentValidCode" value="" maxlength="6"/>
|
||||
</xsl:if>
|
||||
</div>
|
||||
</xsl:variable>
|
||||
<a name="#commentTarget"/>
|
||||
<div class="msg_list_box">
|
||||
<div class="hd">
|
||||
<h3> 网友评论</h3>
|
||||
<p> (以下评论仅代表网友意见,与本站立场无关) </p>
|
||||
<div class="count">
|
||||
网友评论共 <strong id="commentCount">100</strong> 条
|
||||
</div>
|
||||
</div>
|
||||
<div class="bd">
|
||||
<ul class="msg_list" id="pe100_评论列表">
|
||||
</ul>
|
||||
<div class="page_box" id="pe100_page_评论列表">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="msg_box">
|
||||
<div class="hd">
|
||||
<ul class="standpoint">
|
||||
<li onclick="setViewpoint(1)" class="current" id="commentViewpointTab1" style="cursor: pointer;">我支持</li>
|
||||
<li onclick="setViewpoint(0)" id="commentViewpointTab0" style="cursor: pointer;">我中立</li>
|
||||
<li onclick="setViewpoint(-1)" id="commentViewpointTab-1" style="cursor: pointer;">我反对</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="bd">
|
||||
<xsl:choose>
|
||||
<xsl:when test="pe:EnableComment($nodeId) = 'true'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="pe:EnableTouristsComment($nodeId)='true'">
|
||||
<xsl:copy-of select="$commentStyle"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="pe:IsLogined() = 'true'">
|
||||
<xsl:copy-of select="$commentStyle"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<font style="color:red">该信息所属栏目不允许游客发表评论!</font>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="pe:UserPurview('commentcheck',$nodeId) = 'true'">
|
||||
<xsl:copy-of select="$commentStyle"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<font style="color:red">该信息所属栏目不允许发表评论!</font>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</div>
|
||||
</div>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>]]></LabelTemplate>
|
||||
</root>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0"?>
|
||||
<root>
|
||||
<LabelType>评论类</LabelType>
|
||||
<LabelIntro>
|
||||
</LabelIntro>
|
||||
<OutType>
|
||||
</OutType>
|
||||
<LabelDataType>sql_sysquery</LabelDataType>
|
||||
<attributes>
|
||||
<name>outputQty</name>
|
||||
<default>10</default>
|
||||
<intro>显示评论数</intro>
|
||||
</attributes>
|
||||
<LabelSqlString>SELECT TOP @outputQty * FROM PE_Comment ORDER BY UpdateTime DESC</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="titleLength" />
|
||||
<xsl:template match="/">
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(/NewDataSet/Table) = 0">
|
||||
<li style="color:red">没有评论!</li>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:for-each select="/NewDataSet/Table">
|
||||
<li>
|
||||
<a> <xsl:attribute name="href">
|
||||
<xsl:value-of select="pe:GetInfoPath(GeneralID)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="pe:CutText(CommentTitle,$titleLength,'…')"/>
|
||||
</a>
|
||||
[<xsl:value-of select="pe:FormatDate(UpdateTime,'mm-dd')"/>]
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
</xsl:transform>]]></LabelTemplate>
|
||||
<EnabelAjax>False</EnabelAjax>
|
||||
<IsXsltSql>false</IsXsltSql>
|
||||
<IsXsltCountSql>false</IsXsltCountSql>
|
||||
<attributes>
|
||||
<name>titleLength</name>
|
||||
<datatype>supersql</datatype>
|
||||
<default>30</default>
|
||||
<intro>评论标题长度</intro>
|
||||
</attributes>
|
||||
</root>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<LabelType>评论类</LabelType>
|
||||
<LabelIntro>
|
||||
</LabelIntro>
|
||||
<OutType>sin</OutType>
|
||||
<LabelDataType>sql_sysquery</LabelDataType>
|
||||
<EnabelAjax>True</EnabelAjax>
|
||||
<Version officialVersion="" modifiedVersions="3004" compatibleVersion="" />
|
||||
<attributes>
|
||||
<name>itemId</name>
|
||||
<datatype>sql.int</datatype>
|
||||
<default>13</default>
|
||||
<intro>项目Id</intro>
|
||||
</attributes>
|
||||
<UsePage>True</UsePage>
|
||||
<IsXsltSql>false</IsXsltSql>
|
||||
<IsXsltCountSql>false</IsXsltCountSql>
|
||||
<LabelSqlString>SELECT TOP @pagesize * FROM PE_Comment WHERE CommentID NOT IN (SELECT TOP @startrow CommentID FROM PE_Comment WHERE GeneralID = @itemId AND Status=1 ORDER BY UpdateTime DESC) AND (GeneralID = @itemId) AND Status=1 ORDER BY UpdateTime DESC</LabelSqlString>
|
||||
<LabelSqlCount>SELECT COUNT(*) FROM PE_Comment WHERE GeneralID = @itemId AND Status=1</LabelSqlCount>
|
||||
<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="itemId" />
|
||||
<xsl:variable name="rootDir" select="pe:InstallDir()"/>
|
||||
<xsl:variable name="stars"><img src="<xsl:value-of select="$rootDir"/>images/fstar.gif" alt="星级" /></xsl:variable>
|
||||
<xsl:variable name="_userName" select="pe:LoginedUserName()"/>
|
||||
<xsl:variable name="_isAdmin" select="pe:IsAdminLogined()"/>
|
||||
<xsl:output method="html" />
|
||||
<xsl:template name="_splitIp">
|
||||
<xsl:param name="_ipData"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($_ipData,'.')">
|
||||
<xsl:value-of select="substring-before($_ipData,'.')"/>.
|
||||
<xsl:variable name="_after" select="substring-after($_ipData,'.')" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($_after,'.')">
|
||||
<xsl:call-template name="_splitIp">
|
||||
<xsl:with-param name="_ipData" select="$_after"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>* </xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<xsl:template match="/NewDataSet/Table">
|
||||
<li>
|
||||
<div class="msg_info">
|
||||
<span class="reviewer">
|
||||
<xsl:value-of select="UserName"/>
|
||||
[<xsl:choose>
|
||||
<xsl:when test="CommentType='2'">手机用户
|
||||
</xsl:when>
|
||||
<xsl:otherwise>普通用户
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>]
|
||||
</span>
|
||||
<span class="reviewer_IP"> ( <xsl:call-template name="_splitIp">
|
||||
<xsl:with-param name="_ipData" select="IP"/>
|
||||
</xsl:call-template> ) </span> 于 <xsl:value-of select="pe:FormatDate(UpdateTime,'yy-mm-dd hh:ff:ss')"/> 发表
|
||||
<span class="star">
|
||||
<em>星级:</em>
|
||||
<xsl:value-of disable-output-escaping="yes" select="pe:ConvertToChar(Score,$stars)"/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="msg_content">
|
||||
<h4>
|
||||
<xsl:choose>
|
||||
<xsl:when test="Position = '1'">[我支持]</xsl:when>
|
||||
<xsl:when test="Position = '-1'">[我反对]</xsl:when>
|
||||
<xsl:otherwise>[我中立]</xsl:otherwise>
|
||||
</xsl:choose>:<xsl:value-of select="CommentTitle"/>
|
||||
</h4>
|
||||
<p>
|
||||
<xsl:choose>
|
||||
<xsl:when test="IsPrivate = 'true'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="(UserName = $_userName or $_isAdmin = 'true')">
|
||||
<xsl:value-of select="Content"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>该内容设置了隐藏!</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="Content"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</p>
|
||||
<xsl:if test="Reply != ''">
|
||||
<div class="reply">
|
||||
<span class="replyer">★管理员回复:</span>
|
||||
<xsl:choose>
|
||||
<xsl:when test="IsPrivate = 'true'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="(UserName = $_userName or $_isAdmin = 'true')">
|
||||
<xsl:value-of select="Reply"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>该内容设置了隐藏!</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="Reply"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</div>
|
||||
</xsl:if>
|
||||
</div>
|
||||
|
||||
<div class="msg_replyer_box">
|
||||
<div class="reviewer_info">
|
||||
|
||||
<xsl:if test="UserName != '游客'">
|
||||
<a href="{$rootDir}User/Message/Message.aspx?inceptUser={UserName}" title="短信" class="sms">短信</a>
|
||||
</xsl:if>
|
||||
<a href="mailto:{Email}" title="#" class="mail">邮件</a>[ 支持:<em>{PE.Label id="评论辩论人数统计" commentId="<xsl:value-of select="CommentID"/>" position="1" /}</em> 中立:<em>{PE.Label id="评论辩论人数统计" commentId="<xsl:value-of select="CommentID"/>" position="0" /}</em> 反对:<em>{PE.Label id="评论辩论人数统计" commentId="<xsl:value-of select="CommentID"/>" position="-1" /}</em> ]
|
||||
</div>
|
||||
<div class="return">
|
||||
<em>操作:</em>
|
||||
<a>
|
||||
<xsl:attribute name="href" >
|
||||
<xsl:value-of select="$rootDir"/>Comment/CommentPKZoneManage.aspx?Id=<xsl:value-of select="GeneralID" />&CommentID=<xsl:value-of select="CommentID" />&Title=<xsl:value-of select="CommentTitle" />
|
||||
</xsl:attribute> <xsl:attribute name="target">_blank</xsl:attribute>PK Zone
|
||||
</a>
|
||||
<a href="###" onclick="addPkZone({CommentID},1,'支持!')">支持</a>
|
||||
<a href="###" onclick="addPkZone({CommentID},-1,'反对!')">反对</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>]]></LabelTemplate>
|
||||
</root>
|
||||
@@ -0,0 +1,288 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<LabelType>评论类</LabelType>
|
||||
<LabelIntro>
|
||||
</LabelIntro>
|
||||
<OutType>txt</OutType>
|
||||
<LabelDataType>static</LabelDataType>
|
||||
<EnabelAjax>False</EnabelAjax>
|
||||
<Version officialVersion="" modifiedVersions="3000" compatibleVersion="" />
|
||||
<attributes>
|
||||
<name>nodeId</name>
|
||||
<datatype>int</datatype>
|
||||
<default>1</default>
|
||||
<intro>节点Id</intro>
|
||||
</attributes>
|
||||
<LabelTemplate>
|
||||
<![CDATA[
|
||||
<input type="hidden" id="commentViewpoint" value="1" />
|
||||
<input type="hidden" id="commentIsPrivate" value="0" />
|
||||
<input type="hidden" id="commentIsAnonymous" value="false" />
|
||||
<input type="hidden" id="commentRanking" value="3" />
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
function $getE(obj) {
|
||||
return document.getElementById(obj);
|
||||
}
|
||||
|
||||
//初始化评论
|
||||
function commentInit() {
|
||||
var x = new AjaxRequest('XML', 'commentForm');
|
||||
x.labelname = "内容评论标签";
|
||||
x.para = ['itemId=@RequestInt_Id','nodeId=<xsl:value-of select="$nodeId"/>'];
|
||||
x.currentpage = 1;
|
||||
x.post('updatelabel', '{PE.SiteConfig.ajaxSitePath/}ajax.aspx', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
$getE('commentform').innerHTML = xml.getElementsByTagName("body")[0].firstChild.data;
|
||||
changepage(1, '评论列表', 'JS_基本风格');
|
||||
setCurrentUserInfo();
|
||||
});
|
||||
}
|
||||
|
||||
//添加评论
|
||||
function addComment() {
|
||||
if ($getE('commentTitle').value == '') {
|
||||
alert("请输入标题!");
|
||||
$getE("commentTitle").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if ($getE('commentIsAnonymous').value == 'false') {
|
||||
if ($getE('commentUsername').value == '') {
|
||||
alert("请输入用户名!");
|
||||
$getE('commentUsername').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if ($getE('commentEmail').value == '') {
|
||||
alert('请输入Email地址!');
|
||||
$getE('commentEmail').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
var regEmail = /^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
|
||||
if ($getE('commentEmail').value.match(regEmail) == null) {
|
||||
alert('请输入正确的Email格式!');
|
||||
$getE('commentEmail').focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ($getE("commentContnet").value == '') {
|
||||
alert("请输入评论内容!");
|
||||
$getE("commentContnet").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
var commentValidCode = "";
|
||||
var checkValidCode = false;
|
||||
if ($getE("commentValidCode") != null) {
|
||||
if ($getE("commentValidCode").value == '') {
|
||||
alert("请输入验证码!");
|
||||
$getE("commentValidCode").focus();
|
||||
return;
|
||||
}
|
||||
commentValidCode = $getE("commentValidCode").value;
|
||||
checkValidCode = true;
|
||||
}
|
||||
|
||||
var x = new AjaxRequest('XML', 'status');
|
||||
x.para = ['username=' + $getE("commentUsername").value, 'commenttitle=' + $getE("commentTitle").value, 'content=' + $getE("commentContnet").value, 'email=' + $getE("commentEmail").value, 'gid=@RequestInt_Id', 'nid=' + <xsl:value-of select="$nodeId"/>, 'private=' + $getE("commentIsPrivate").value, 'position=' + $getE("commentViewpoint").value, 'score=' + $getE("commentRanking").value, 'TxtValidCode=' + commentValidCode, 'isguest=' + $getE("commentIsAnonymous").value];
|
||||
x.paratype = ['nohtml', 'nohtml', 'nohtml']
|
||||
x.post('addcomment', '{PE.SiteConfig.ajaxSitePath/}ajax.aspx', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
var status = xml.getElementsByTagName("status")[0].firstChild.data;
|
||||
switch (status) {
|
||||
case "ok":
|
||||
changepage(1, '评论列表', 'JS_基本风格');
|
||||
alert("发表评论成功!");
|
||||
window.location.href = '#commentTarget';
|
||||
$getE("commentContnet").value = '';
|
||||
break;
|
||||
case "check":
|
||||
alert("发表评论成功,请等待管理员审核。");
|
||||
break;
|
||||
case "err":
|
||||
alert("发表评论失败!");
|
||||
break;
|
||||
case "nopurview":
|
||||
alert("此栏目已禁止发表评论!");
|
||||
break;
|
||||
case "noTourists":
|
||||
alert("此栏目已禁止游客发表评论!");
|
||||
break;
|
||||
case "checkCodeError":
|
||||
$getE("commentValidCode").value = '';
|
||||
refreshValidCode($getE("commentValidCodeImg"));
|
||||
alert("您输入的验证码和系统产生的不一致,请重新输入!");
|
||||
break;
|
||||
default:
|
||||
alert("发表评论失败!");
|
||||
break;
|
||||
}
|
||||
if (checkValidCode) {
|
||||
refreshValidCode($getE("commentValidCodeImg"));
|
||||
$getE("commentValidCode").value = '';
|
||||
checkValidCode = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addPkZone(commentid, position, content) {
|
||||
var x = new AjaxRequest('XML', 'status');
|
||||
x.para = ['commentid=' + commentid, 'position=' + position, 'content=' + content];
|
||||
x.post('addpkzone', '{PE.SiteConfig.ajaxsitepath/}ajax.aspx', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
var status = xml.getElementsByTagName("status")[0].firstChild.data;
|
||||
switch (status) {
|
||||
case "ok":
|
||||
changepage(1, '评论列表', 'JS_基本风格');
|
||||
break;
|
||||
default:
|
||||
alert("辩论失败!");
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//更新列表
|
||||
function changepage(pagenum, sourcename, spanname) {
|
||||
var x = new AjaxRequest('XML', 'pe100_' + sourcename);
|
||||
x.labelname = sourcename;
|
||||
x.currentpage = pagenum;
|
||||
x.para = ['itemId=@RequestInt_Id', 'outputQty=10', 'page=true', 'pagesize=10', 'currentpage=' + pagenum];
|
||||
x.post('updatelabel', '{PE.SiteConfig.ajaxSitePath/}ajax.aspx', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
var plstr = "";
|
||||
for (var i = 0; i < xml.getElementsByTagName("body")[0].childNodes.length; i++) {
|
||||
plstr += xml.getElementsByTagName("body")[0].childNodes[i].nodeValue;
|
||||
}
|
||||
$getE('pe100_' + sourcename).innerHTML = plstr;
|
||||
$getE('commentCount').innerHTML = xml.getElementsByTagName("total")[0].firstChild.data;
|
||||
updatepage(spanname, sourcename, xml);
|
||||
});
|
||||
}
|
||||
|
||||
//更新分页
|
||||
function updatepage(spanname, sourcename, xml) {
|
||||
if (parseInt(xml.getElementsByTagName("total")[0].firstChild.data) > 0) {
|
||||
var x = new AjaxRequest('XML', 'pe100_page_' + sourcename);
|
||||
x.labelname = spanname;
|
||||
x.sourcename = sourcename;
|
||||
x.total = xml.getElementsByTagName("total")[0].firstChild.data;
|
||||
x.currentpage = xml.getElementsByTagName("currentpage")[0].firstChild.data;
|
||||
x.pagesize = xml.getElementsByTagName("pagesize")[0].firstChild.data;
|
||||
x.post('updatepage', '{PE.SiteConfig.ajaxSitePath/}ajax.aspx', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
if ($getE('pe100_page_' + sourcename) != null) {
|
||||
var plstr = "";
|
||||
for (var i = 0; i < xml.getElementsByTagName("body")[0].childNodes.length; i++) {
|
||||
plstr += xml.getElementsByTagName("body")[0].childNodes[i].nodeValue;
|
||||
}
|
||||
$getE('pe100_page_' + sourcename).innerHTML = plstr;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//设置默用户信息
|
||||
function setCurrentUserInfo() {
|
||||
try {
|
||||
var x = new AjaxRequest('XML', '');
|
||||
x.post('logincheck', '{PE.SiteConfig.ajaxSitePath/}ajax.aspx', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
if (xml.getElementsByTagName("status")[0].firstChild.data == "ok") {
|
||||
if ($getE('commentUsername') != null) {
|
||||
$getE('commentUsername').value = xml.getElementsByTagName("username")[0].firstChild.data;
|
||||
$getE('commentEmail').value = xml.getElementsByTagName("email")[0].firstChild.data;
|
||||
$getE('commentUsername').disabled = true;
|
||||
$getE('commentEmail').disabled = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
//刷新验证码
|
||||
function refreshValidCode(obj) {
|
||||
obj.src = obj.src + '?code=' + randomNumber(10);
|
||||
}
|
||||
|
||||
function randomNumber(n) {
|
||||
var rnd = '';
|
||||
for (var i = 0; i < n; i++)
|
||||
rnd += Math.floor(Math.random() * 10);
|
||||
return rnd;
|
||||
}
|
||||
|
||||
//设置匿名
|
||||
function setAnonymous(obj) {
|
||||
if (obj.checked) {
|
||||
$getE('commentUsernameBlock').style.display = 'none';
|
||||
$getE('commentEmailBlock').style.display = 'none';
|
||||
$getE('commentIsAnonymous').value = 'true';
|
||||
}
|
||||
else {
|
||||
$getE('commentUsernameBlock').style.display = '';
|
||||
$getE('commentEmailBlock').style.display = '';
|
||||
$getE('commentIsAnonymous').value = 'false';
|
||||
}
|
||||
}
|
||||
|
||||
//设置私有
|
||||
function setPrivate(obj) {
|
||||
if (obj.checked) {
|
||||
$getE('commentIsPrivate').value = 1;
|
||||
}
|
||||
else {
|
||||
$getE('commentIsPrivate').value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//设置观点
|
||||
function setViewpoint(value) {
|
||||
for (i = -1; i < 2; i++) {
|
||||
if (i == value) {
|
||||
$getE('commentViewpointTab' + i).className = "current";
|
||||
}
|
||||
else {
|
||||
$getE('commentViewpointTab' + i).className = "";
|
||||
}
|
||||
}
|
||||
$getE('commentViewpoint').value = value;
|
||||
}
|
||||
|
||||
//设置按钮
|
||||
function changeBtnStyle(obj, className) {
|
||||
obj.className = className;
|
||||
}
|
||||
|
||||
//设置评分
|
||||
function changeRanking(index, isfixed) {
|
||||
var colStars = $getE("commentRankingBlock").getElementsByTagName("img");
|
||||
var k = isfixed ? parseInt($getE("commentRanking").value) : index;
|
||||
for (var i = 0; i < colStars.length; i++) {
|
||||
colStars[i].src = (i < k ? "{PE.SiteConfig.applicationpath/}Images/fstar.gif" : "{PE.SiteConfig.applicationpath/}Images/estar.gif");
|
||||
}
|
||||
}
|
||||
|
||||
function rankingClick(index) {
|
||||
$getE("commentRanking").value = index;
|
||||
}
|
||||
|
||||
function rankingMouseOver(index) {
|
||||
changeRanking(index, false);
|
||||
}
|
||||
|
||||
function rankingMouseOut() {
|
||||
changeRanking(0, true);
|
||||
}
|
||||
|
||||
//初始化评论
|
||||
commentInit();
|
||||
|
||||
</script>]]></LabelTemplate>
|
||||
</root>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0"?>
|
||||
<root>
|
||||
<LabelType>评论类</LabelType>
|
||||
<LabelIntro>
|
||||
</LabelIntro>
|
||||
<OutType>sin</OutType>
|
||||
<LabelDataType>sql_sysquery</LabelDataType>
|
||||
<attributes>
|
||||
<name>commentId</name>
|
||||
<default>0</default>
|
||||
<intro>评论ID</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>position</name>
|
||||
<default>0</default>
|
||||
<intro>观点{中立:0,赞同:1,反对:-1}</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:ms="urn:schemas-microsoft-com:xslt" xmlns:lewi="http://www.powereasy.net" xmlns:pe="labelproc" exclude-result-prefixes="pe ms lewi">
|
||||
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
|
||||
<xsl:template match="/NewDataSet/Table">
|
||||
<xsl:value-of select="Column1"/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>]]></LabelTemplate>
|
||||
<LabelSqlString>SELECT COUNT(*) FROM PE_CommentPK WHERE CommentID = @commentId AND Position = @position</LabelSqlString>
|
||||
<EnabelAjax>False</EnabelAjax>
|
||||
<IsXsltSql>false</IsXsltSql>
|
||||
<IsXsltCountSql>false</IsXsltCountSql>
|
||||
</root>
|
||||
Reference in New Issue
Block a user