📄 showmusic.xsl
字号:
<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="title" select="/body/Site/SiteTitle"/>
<xsl:template match="/">
<xsl:element name="html">
<head>
<title><xsl:value-of select="body/MyBlog/BlogName"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="OceanSkin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<![CDATA[
/* 拖动面板CSS定义 */
div#diarycontent {
width: 100%;
float: left;
margin: 0px;
}
div#diarybody {
width: 564px;
float: left;
margin: 2px;
border: 1px solid #d2d3d9;
}
div#diarytitle {
color: ffffff;background:url(../skin/Ocean/main_bs1.gif);border-top: 1px solid #d2d3d9;border-right: 1px solid #d2d3d9;border-left: 1px solid #d2d3d9;text-align: left;padding-left:30;height: 29;
}
div#diarytext {
font-family:宋体;text-align: left;padding-left:5;font-size: 9pt;line-height: 15pt;text-indent: 20px
}
div#diaryfoot {
color: 0000FF;background:#d2d3d9;text-align: right;padding-right:20;height: 20;
}
div#commentbody {
margin: 10px;
border: 1px solid #ffffff;
}
div#commenttitle {
text-align: left;padding-left:10;height: 10;
}
div#commentcontent {
border: 1px solid #d2d3d9;text-align: left;padding-left:10;height: 20;text-indent: 20px
}
div#showpage {
width: 564px;
float: left;
margin: 2px;
border: 1px solid #d2d3d9;
text-align: right;
padding-right:5;
}
]]>
</style>
<script src="../JS/prototype.js"></script>
<script src="../JS/scriptaculous.js"></script>
<script src="../JS/checklogin.js"></script>
<script language="JavaScript">
<![CDATA[
var tempdivcontent;
var isroot;
var s1;
var s2;
var s3;
var s4;
var s5;
function initPage(totalpage,current,totalitem,iBid,iUid,iroot)
{
s1 = totalpage;
s2 = current;
s3 = totalitem;
s4 = iBid;
s5 = iUid;
isroot = iroot;
if(isroot==1){
ShowPage(s1,s2,s3,s4,isroot);
}else{
ShowPage(s1,s2,s3,s5,isroot);
}
}
function ShowPage(totalpage,current,totalitem,iBid,iroot)
{
if(totalpage>1){
var temppage = "<b style=\"cursor:hand;\" onclick=\"ChangePage(" + totalpage + ",1," + totalitem + "," + iBid + ",1);\">首页</b>";
if(current>1){
temppage += " <b style=\"cursor:hand;\" onclick=\"ChangePage(" + totalpage + "," + (current-1) + "," + totalitem + "," + iBid + ",1);\"><</b> ";
}
for (var i = 1; i <= totalpage; i++) {
if(i==current){
temppage += " [<font color=\"red\"><b style=\"cursor:hand;\" onclick=\"ChangePage(" + totalpage + "," + i + "," + totalitem + "," + iBid + ",1);\">" + i + "</b></font>] ";
}else{
temppage += " <b style=\"cursor:hand;\" onclick=\"ChangePage(" + totalpage + "," + i + "," + totalitem + "," + iBid + ",1);\">" + i + "</b> ";
}
}
if(current<totalpage){
temppage += " <b style=\"cursor:hand;\" onclick=\"ChangePage(" + totalpage + "," + (current+1) + "," + totalitem + "," + iBid + ",1);\">></b> ";
}
if(totalpage>1){
temppage += " <b style=\"cursor:hand;\" onclick=\"ChangePage(" + totalpage + "," + totalpage + "," + totalitem + "," + iBid + ",1);\">尾页</b> 共[" + totalpage + "]页 ";
}else{
temppage += " 尾页</b> 共[" + totalpage + "]页 ";
}
$('showpage').innerHTML = temppage;
}else{
Element.hide('showpage');
}
}
function ChangePage(iTotalPage,iPage,iTotal,Bid2,iType)
{
s2 = iPage;
$('diarycontent').innerHTML = "数据更新中...";
var url = "Showmusic.asp";
if(iType==1){
var pars = "BlogID=" + Bid2 + "&page=" + iPage;
}else{
var pars = "ID=" + Bid2;
}
var myAjax = new Ajax.Request(url, {method: 'get', parameters: pars, onComplete: PageResponse});
ShowPage(iTotalPage,iPage,iTotal,Bid2,isroot);
}
function PageResponse(originalRequest)
{
var tempstr;
tempstr = "";
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = false;
xml.load(originalRequest.responseXml);
var root = xml.getElementsByTagName("Diary");
for(i = 0; i < root.length; i++){
tempstr += "<div id=\"diarybody\">";
tempstr += "<div id=\"diarytitle\"><table width=\"100%\"><tr valign=\"middle\"><td><font color=\"#ffffff\">" + root.item(i).getElementsByTagName("Title").item(0).text + "</font></td><td align=\"right\">浏览<font color=\"red\">" + root.item(i).getElementsByTagName("Hits").item(0).text + "</font>次</td></tr></table></div>";
tempstr += "<div id=\"diarytext\"><li style=\"cursor:hand;\" onclick=\"player.url='" + root.item(i).getElementsByTagName("Content").item(0).text + "';player.controls.play();\">" + root.item(i).getElementsByTagName("Title").item(0).text + "</li></div>";
tempstr += "<div id=\"diaryfoot\">[<b style=\"cursor:hand;\" onclick=\"new Element.toggle('comment_" + root.item(i).getElementsByTagName("Title").item(0).text + "')\">查看评论</b>(<font color=\"red\">" + root.item(i).getElementsByTagName("Comment").item(0).text + "</font>)][<b style=\"cursor:hand;\" onclick=\"showComment(" + root.item(i).getElementsByTagName("ID").item(0).text
tempstr += "," + xml.getElementsByTagName("MyBlog/BlogID").item(0).text
tempstr += ");\">发表评论</b>] [发布时间" + root.item(i).getElementsByTagName("Datetime").item(0).text + "]</div>";
tempstr += "<div id=\"comment_" + root.item(i).getElementsByTagName("Title").item(0).text + "\" style=\"display:none\">";
var commentstr = root.item(i).getElementsByTagName("CommentList");
for(j = 0; j < commentstr.length; j++){
tempstr += "<div id=\"commentbody\">";
tempstr += "<div id=\"commenttitle\">" + commentstr.item(j).getElementsByTagName("name").item(0).text + "在" + commentstr.item(j).getElementsByTagName("datetime").item(0).text + "评论说:<b>" + commentstr.item(j).getElementsByTagName("title").item(0).text + "</b></div>";
tempstr += "<div id=\"commentcontent\">" + commentstr.item(j).getElementsByTagName("content").item(0).text + "</div>";
tempstr += "</div>";
}
tempstr += "</div>";
tempstr += "</div>";
}
$('diarycontent').innerHTML = tempstr;
}
function showComment(itemID,blogid)
{
tempdivcontent = $('diarycontent').innerHTML;
var templ = "<div id=\"diarybody\">";
templ = templ + "<div id=\"diarytitle\">发表评论</div>";
templ = templ + "<div id=\"pltext\">";
templ = templ + "<input name=\"plname\" type=\"hidden\" value=\"" + username + "\">"
templ = templ + "<input name=\"plpass\" type=\"hidden\" value=\"" + userpass + "\">";
if(userstat=='login'){
templ = templ + "匿名评论 <input type=\"checkbox\" name=\"noname\" value='1'><br />";
}else{
templ = templ + "匿名评论 <input type=\"checkbox\" name=\"noname\" value='1' Checked Disabled><br />";
}
templ = templ + "评论标题 <input name=\"pltitle\" id=\"pltitle\" type=\"text\"><br />";
templ = templ + "评论内容 <textarea name=\"plcontent\" cols=\"50\" rows=\"4\"></textarea><br />";
templ = templ + "<input name=\"plid\" id=\"plid\" type=\"hidden\" value=" + itemID + ">";
templ = templ + "<input name=\"blogid\" id=\"blogid\" type=\"hidden\" value=" + blogid + ">";
templ = templ + "<center><a href=\"#\" onclick=\"SaveComment();\">保存</a> <a href=\"#\" onclick=\"CancelComment();\">取消</a></center></div>";
templ = templ + "</div>";
$('diarycontent').innerHTML = templ;
Field.focus('pltitle');
}
function CancelComment()
{
$('diarycontent').innerHTML = tempdivcontent;
Sortable.create('diarycontent',{tag:'div'});
}
function SaveComment()
{
var saveurl = "Showmusic.asp?Action=savepl";
var name = $F('plname');
var noname = $F('noname');
var plpass = $F('plpass');
var title = $F('pltitle');
var content = $F('plcontent').stripTags();
var pid = $F('plid');
var blogid = $F('blogid');
//$('pltext').innerHTML = "<center>保存数据中...</center>";
if((noname!='1')&&(name=='')&&(userstat=='login')){
alert("您尚未登录,请选择匿名发表!");
}else{
if((noname!='1')&(plpass=='')&&(userstat=='login')){
alert("您尚未登录,请选择匿名发表!");
}else{
if(title==''){
alert("标题不能为空!");
Field.focus('pltitle');
}else{
if(content==''){
alert("内容不能为空!");
Field.focus('plcontent');
}else{
// 创建返回信息XML文档
var checkurl = "Showmusic.asp?Action=savepl";
var pl_dom = new ActiveXObject("Microsoft.XMLDOM");
pl_dom.async=false;
var p = pl_dom.createProcessingInstruction("xml","version=\"1.0\" encoding=\"gb2312\"");
//添加文件头
pl_dom.appendChild(p);
//创建根节点
var objRoot = pl_dom.createElement("root");
//创建子节点
var objField = pl_dom.createNode(1,"username","");
objField.text = name;
objRoot.appendChild(objField);
objField = pl_dom.createNode(1,"password","");
objField.text = plpass;
objRoot.appendChild(objField);
objField = pl_dom.createNode(1,"noname","");
if(noname!='1'){
objField.text = 0;
}else{
objField.text = 1;
}
objRoot.appendChild(objField);
objField = pl_dom.createNode(1,"title","");
objField.text = title;
objRoot.appendChild(objField);
objField = pl_dom.createNode(1,"content","");
objField.text = content;
objRoot.appendChild(objField);
objField = pl_dom.createNode(1,"type","");
objField.text = 4;
objRoot.appendChild(objField);
objField = pl_dom.createNode(1,"id","");
objField.text = pid;
objRoot.appendChild(objField);
objField = pl_dom.createNode(1,"blogid","");
objField.text = blogid;
objRoot.appendChild(objField);
//添加根节点
pl_dom.appendChild(objRoot);
// 把XML文档发送到Web服务器
var plhttp = getHTTPObject();
plhttp.open("POST",checkurl,false);
plhttp.send(pl_dom);
// 显示服务器返回的信息
if(plhttp.readyState == 4 && plhttp.status==200){
CommentReponse(plhttp);
}else{
CancelComment();
}
}
}
}
}
}
function CommentReponse(backRequest)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -