Files
2026-08-31 16:22:00 +08:00

154 lines
5.1 KiB
XML

<?xml version="1.0"?>
<root>
<LabelType>问答类</LabelType>
<LabelIntro>
</LabelIntro>
<OutType>txt</OutType>
<LabelDataType>static</LabelDataType>
<EnabelAjax>False</EnabelAjax>
<LabelTemplate>
<![CDATA[<script type="text/javascript" language="JavaScript">
function searchAnswer()
{
var keyword = document.getElementById("txtKeyword");
var url;
if(keyword.value == "请输入您所需要的关键字" || keyword.value == "")
{
url = "{PE.SiteConfig.ApplicationPath/}QA/QuestionList.aspx?ShowType=2";
}
else
{
url = "{PE.SiteConfig.ApplicationPath/}QA/QuestionList.aspx?ShowType=2&Keyword=" + escape(keyword.value);
}
window.open(url,'_self');
}
function askQuestion()
{
var keyword = document.getElementById("txtKeyword");
var url;
if(keyword.value == "请输入您所需要的关键字" || keyword.value == "")
{
url = "{PE.SiteConfig.ApplicationPath/}QA/Question.aspx";
}
else
{
url = "{PE.SiteConfig.ApplicationPath/}QA/Question.aspx?Keyword=" + escape(keyword.value);
}
window.open(url,'_self');
}
function answerQuestion()
{
var keyword = document.getElementById("txtKeyword");
var url;
if(keyword.value == "请输入您所需要的关键字" || keyword.value == "")
{
url = "{PE.SiteConfig.ApplicationPath/}QA/QuestionList.aspx?ShowType=1";
}
else
{
url = "{PE.SiteConfig.ApplicationPath/}QA/QuestionList.aspx?ShowType=1&Keyword=" + escape(keyword.value);
}
window.open(url,'_self'); }
function lostFocus()
{
var keyword = document.getElementById("txtKeyword");
if(keyword.value == "")
{
keyword.value = "请输入您所需要的关键字";
}
}
function setFocus()
{
var keyword = document.getElementById("txtKeyword");
keyword.value = "";
}
LoadCheck();
var userName = "";
function LoadCheck()
{
var x = new AjaxRequest('XML', 'status');
x.para = [];
x.async = false;
x.post('logincheck', '{PE.SiteConfig.ajaxsitepath/}ajax.aspx', function(s){
var xml = x.createXmlDom(s);
var status = xml.getElementsByTagName("status")[0].firstChild.data;
if (status == 'ok') {
userName = xml.getElementsByTagName("username")[0].firstChild.data;
ChangeState(true);
}
else {
ChangeState(false);
}
});
}
function ChangeState(flag)
{
var logindiv = document.getElementById("logindiv");
var logoutdiv = document.getElementById("logoutdiv");
if(flag == true)
{
logindiv.style.display = "none";
logoutdiv.style.display = "";
document.getElementById("spanUserName").innerHTML = userName + ",欢迎您!";
}
else
{
logindiv.style.display="";
logoutdiv.style.display="none";
}
}
function Logout()
{
var x = new AjaxRequest('XML','');
x.post('userlogout', '{PE.SiteConfig.ajaxsitepath/}ajax.aspx',
function(s)
{
var xml = x.createXmlDom(s);
var status = xml.getElementsByTagName("status")[0].firstChild.data;
if (status == "ok")
{
if (xml.getElementsByTagName("API_Enable")[0].firstChild.data == "1")
{
var LogOutString = xml.getElementsByTagName("LogOutString")[0].firstChild.data;
Loginin(LogOutString);
}
LoadCheck();
}
});
}
</script>
<div id="header">
<div id="logindiv" class="uplink" style="display: block;">
<a href="{PE.SiteConfig.ApplicationPath/}QA/Index.aspx"> 首页</a> |
<a href="{PE.SiteConfig.ApplicationPath/}User/Register.aspx">注册</a> |
<a href="javascript:CheckIsLogin();"> 登录</a>
</div>
<div id="logoutdiv" class="uplink" style="display: none;">
<span id="spanUserName">{PE.Label id="显示用户名" /}</span>
<a href="{PE.SiteConfig.ApplicationPath/}QA/Index.aspx"> 首页</a> |
<a href="{PE.SiteConfig.ApplicationPath/}QA/MyQuestion.aspx"> 我的问答</a> |
<a href="{PE.SiteConfig.ApplicationPath/}User/"> 用户中心</a> |
<a href="javascript:Logout();"> 退出</a>
</div>
<div class="searchbox">
<input class="inputtext" id="txtKeyword" name="txtKeyword" onfocus="setFocus()" onblur="lostFocus()" value="请输入您所需要的关键字" type="text" />
<a href="{PE.SiteConfig.ApplicationPath/}QA/Help.aspx" target="_blank">帮助</a>
<input class="inputbutton" type="button" onclick="searchAnswer()" value="搜索答案" />
<input class="inputbutton" type="button" onclick="askQuestion()" value="我要提问" />
<input class="inputbutton" type="button" onclick="answerQuestion()" value="我要回答" />
</div>
<a href="{PE.SiteConfig.ApplicationPath/}QA/Index.aspx"><div class="logo" title="动易问答"></div></a>
</div>
{PE.Label id="热点问答" titleLength="10" outputQty="10" splitChar="、" /}]]></LabelTemplate>
</root>