first commit
This commit is contained in:
@@ -0,0 +1,217 @@
|
||||
<?xml version="1.0"?>
|
||||
<root>
|
||||
<LabelType>问答类</LabelType>
|
||||
<LabelIntro>
|
||||
</LabelIntro>
|
||||
<OutType>sin</OutType>
|
||||
<LabelDataType>sql_sysquery</LabelDataType>
|
||||
<EnabelAjax>False</EnabelAjax>
|
||||
<attributes>
|
||||
<name>questionID</name>
|
||||
<datatype>supersql</datatype>
|
||||
<default>1</default>
|
||||
<intro>问题ID</intro>
|
||||
</attributes>
|
||||
<IsXsltSql>false</IsXsltSql>
|
||||
<IsXsltCountSql>false</IsXsltCountSql>
|
||||
<LabelSqlString>SELECT Q.*,U.UserExp,U.HonorType FROM PE_QA_Reply Q INNER JOIN PE_USERS U ON Q.USERNAME=U.USERNAME WHERE QuestionID = @questionID AND IsBest = 0 AND Q.Status = 2</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="questionID"/>
|
||||
<xsl:param name="qUserName"/>
|
||||
<xsl:param name="qStatus"/>
|
||||
<xsl:param name="qPoint"/>
|
||||
<xsl:template match="/">
|
||||
<div class="ask_title">
|
||||
<div class="rr-1">
|
||||
</div>
|
||||
<div class="rr-2-1">
|
||||
</div>
|
||||
<div class="rr-3-1">
|
||||
</div>
|
||||
<div class="best_answerTit" >
|
||||
<h4>
|
||||
<span> (共 <xsl:value-of select="count(/NewDataSet/Table)"/> 个回答) </span>网友回答 </h4>
|
||||
</div>
|
||||
<div class="answer_box">
|
||||
<div class="quiz">
|
||||
<xsl:for-each select="/NewDataSet/Table">
|
||||
<div class="quiz_detail">
|
||||
<xsl:if test="pe:IsEditReply() = 'True' and $qStatus =2 and UserName = pe:LoginedUserName()">
|
||||
<p id="pEditReply{position()}"><a href="#" onClick="Show('3','{position()}');return false;">修改答案内容</a></p>
|
||||
<div id="divEditReply{position()}" style="display:none;">
|
||||
<textarea name="EditReply{position()}" rows="2" class="inputtext2" tabindex="2" id="EditReply{position()}"><xsl:value-of select="Content"/></textarea><br/>
|
||||
<input name="" class="inputbutton2" type="button" value="确定" onClick="EditReply('{ReplyID}','{position()}')" />
|
||||
<input name="" class="inputbutton2" type="button" value="取消" onClick="Show('4','{position()}');" />
|
||||
</div>
|
||||
</xsl:if>
|
||||
<p id="pContent{position()}">
|
||||
<xsl:value-of disable-output-escaping="yes" select="pe:HtmlEncode(Content)"/>
|
||||
</p>
|
||||
<div class="Name">回答者:
|
||||
<xsl:choose>
|
||||
<xsl:when test="IsAnonymity = 'true' or UserName = ''">
|
||||
匿名<xsl:text disable-output-escaping="yes">&nbsp;&nbsp;</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="UserName"/> -
|
||||
{PE.Label id="显示用户级别" qAPoint="<xsl:value-of select="UserExp"/>" honorType="<xsl:value-of select="HonorType"/>" /}
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:value-of select="pe:FormatDate(ReplyTime,'mm-dd hh:ff')"/> </div>
|
||||
<xsl:if test="($qStatus = 2) and ($qUserName = pe:LoginedUserName())">
|
||||
<p id="pIsBest{position()}">
|
||||
<input name="" class="inputbutton3" type="button" value="设为最佳答案" onClick="Show('2','{position()}');"/>
|
||||
</p>
|
||||
<div id="comDiv{position()}" style="display:none;">
|
||||
感谢语或评论:
|
||||
<textarea name="comContent{position()}" rows="2" onkeyup="CheckLength(this,255)" onchange="CheckLength(this,255)" class="inputtext3" onfocus='ifComValue(this)' tabindex="2" id="comContent{position()}">说声谢谢,感谢回答者无私帮助</textarea>
|
||||
<p>
|
||||
<input name="" class="inputbutton2" type="button" value="确定" onClick="SetIsBest('{ReplyID}','{position()}')" />
|
||||
<input name="" class="inputbutton2" type="button" value="取消" onClick="Show('1','{position()}');" />
|
||||
</p>
|
||||
</div>
|
||||
</xsl:if>
|
||||
</div>
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rr-3">
|
||||
</div>
|
||||
<div class="rr-2">
|
||||
</div>
|
||||
<div class="rr-1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function Show(num,position)
|
||||
{
|
||||
if(num == 1)
|
||||
{
|
||||
document.getElementById("pIsBest" + position).style.display = '';
|
||||
document.getElementById("comDiv" + position).style.display = 'none';
|
||||
}
|
||||
else if(num == 2)
|
||||
{
|
||||
document.getElementById("pIsBest" + position).style.display = 'none';
|
||||
document.getElementById("comDiv" + position).style.display = '';
|
||||
}
|
||||
else if(num == 3)
|
||||
{
|
||||
document.getElementById("divEditReply" + position).style.display = '';
|
||||
document.getElementById("pEditReply" + position).style.display = 'none';
|
||||
document.getElementById("pContent" + position).style.display = 'none';
|
||||
<xsl:if test="($qStatus = 2) and ($qUserName = pe:LoginedUserName())">
|
||||
document.getElementById("pIsBest" + position).style.display = 'none';
|
||||
document.getElementById("comDiv" + position).style.display = 'none';
|
||||
</xsl:if>
|
||||
}
|
||||
else if(num == 4)
|
||||
{
|
||||
document.getElementById("divEditReply" + position).style.display = 'none';
|
||||
document.getElementById("pContent" + position).style.display = '';
|
||||
document.getElementById("pEditReply" + position).style.display = '';
|
||||
<xsl:if test="($qStatus = 2) and ($qUserName = pe:LoginedUserName())">
|
||||
Show('1',position);
|
||||
</xsl:if>
|
||||
}
|
||||
}
|
||||
<xsl:if test="pe:IsEditReply() = 'True'">
|
||||
function EditReply(m_replyID,position)
|
||||
{
|
||||
replyComment = document.getElementById("EditReply" + position);
|
||||
if(replyComment.value == '')
|
||||
{
|
||||
alert("请填写答案内容!");
|
||||
replyComment.focus();
|
||||
return false;
|
||||
}
|
||||
var rComment = escape(replyComment.value);
|
||||
var x = new AjaxRequest('XML','status');
|
||||
x.para = ['replyID=' + m_replyID, 'comContent=' + rComment];
|
||||
x.post('editReply','{PE.SiteConfig.applicationpath/}ajax.aspx', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
var status = xml.getElementsByTagName("status")[0].firstChild.data;
|
||||
switch (status) {
|
||||
case "ok":
|
||||
window.open('ShowMessage.aspx?MessageType=4&type=1&Id=@RequestInt_id','_self');
|
||||
break;
|
||||
case "err":
|
||||
window.open('ShowMessage.aspx?MessageType=4&type=0&Id=@RequestInt_id','_self');
|
||||
break;
|
||||
default:
|
||||
window.open('ShowMessage.aspx?MessageType=4&type=0&Id=@RequestInt_id','_self');
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
</xsl:if>
|
||||
<xsl:if test="($qStatus = 2) and ($qUserName = pe:LoginedUserName())">
|
||||
function ifComValue(obj)
|
||||
{
|
||||
if(document.activeElement.id == obj.id && obj.value == '说声谢谢,感谢回答者无私帮助')
|
||||
{
|
||||
obj.value = "";
|
||||
}
|
||||
}
|
||||
function CheckLength(obj,maxLength)
|
||||
{
|
||||
if(obj.value.length > maxLength)
|
||||
{
|
||||
obj.value=obj.value.substring(0,maxLength-1);
|
||||
alert("字符长度不能超过"+maxLength+"个字符");
|
||||
}
|
||||
}
|
||||
function SetIsBest(m_replyID,position)
|
||||
{
|
||||
var replyComment = document.getElementById("comContent" + position);
|
||||
if(replyComment.value == '说声谢谢,感谢回答者无私帮助')
|
||||
{
|
||||
replyComment.value = '';
|
||||
}
|
||||
var x = new AjaxRequest('XML', 'status');
|
||||
x.para = ['replyID=' + m_replyID, 'comContent=' + replyComment.value];
|
||||
x.post('setIsBest', '{PE.SiteConfig.applicationpath/}ajax.aspx', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
var status = xml.getElementsByTagName("status")[0].firstChild.data;
|
||||
switch (status) {
|
||||
case "ok":
|
||||
window.open('ShowMessage.aspx?MessageType=3&type=1&Id=@RequestInt_id','_self');
|
||||
break;
|
||||
case "err":
|
||||
window.open('ShowMessage.aspx?MessageType=3&type=0&Id=@RequestInt_id','_self');
|
||||
break;
|
||||
default:
|
||||
window.open('ShowMessage.aspx?MessageType=3&type=0&Id=@RequestInt_id','_self');
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
</xsl:if>
|
||||
</script>
|
||||
|
||||
</xsl:template>
|
||||
</xsl:transform>]]>
|
||||
</LabelTemplate>
|
||||
<attributes>
|
||||
<name>qUserName</name>
|
||||
<datatype>supersql</datatype>
|
||||
<default>admin</default>
|
||||
<intro>提问者用户名</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>qStatus</name>
|
||||
<datatype>supersql</datatype>
|
||||
<default>1</default>
|
||||
<intro>问题状态</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>qPoint</name>
|
||||
<datatype>supersql</datatype>
|
||||
<default>0</default>
|
||||
<intro>问题悬赏分</intro>
|
||||
</attributes>
|
||||
</root>
|
||||
Reference in New Issue
Block a user