<%@ Page Language="C#" Inherits="Caicai.Jingpin.UI.Plugins.Bbs" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="css.css" rel="stylesheet" type="text/css" />
<title><%= Caicai.Framework.Utils.CAppSettings.ConfigGet("Page.SiteCopyright") %>在线论坛系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="../style.css" rel="stylesheet" rev="stylesheet" media="all" />
<meta name="author" content="guqiu.com" />
<meta name="keywords" content="谷秋精品课程系统,精品课程,谷秋精品课程,精品课程软件,谷秋精品工具" />
<meta name="description" content="谷秋精品课程系统网站由《谷秋精品课程软件》生成，谷秋精品课程软件官方网站http://www.guqiu.com。" />
<script type="text/javascript" src="../../files/common/jquery.js"></script>
<script type="text/javascript" src="../../files/xheditor/xheditor-zh-cn.min.js"></script>
<script type="text/javascript">
$(pageInit);

function media(url, width, height, autoPlay)
{
	var myJsVal = "";

	if(url == "http://" || url == "")
	{
		myJsVal = "";
	}
	else if(url.lastIndexOf(".flv") > 0)
	{
		myJsVal+="<div>";
		myJsVal+="<embed width=\""+ width +"\" height=\""+ height +"\" loop=\"true\" play=\"true\" quality=\"high\" flashvars=\"file="+ url +"&amp;autostart="+ autoPlay +"\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" src=\"files/Common/flvplayer.swf\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>";
		myJsVal+="</div>";
	}
	else if(url.lastIndexOf(".rm") > 0)
	{
		myJsVal+="<div>";
		myJsVal+="<object mediatype=\"0\" width=\""+ width +"\" height=\""+ height +"\" classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\">";
		myJsVal+="<param name=\"src\" value=\""+ url +"\" \/>";
		myJsVal+="<param name=\"autostart\" value=\""+ autoPlay +"\" \/>";
		myJsVal+="<param name=\"loop\" value=\"true\" \/>";
		myJsVal+="<param name=\"menu\" value=\"false\" \/>";
		myJsVal+="<\/object>";
		myJsVal+="</div>";
	}
	else
	{
		myJsVal+="<div>";
		myJsVal+="<object mediatype=\"0\" width=\""+ width +"\" height=\""+ height +"\" codebase=\"http:\/\/microsoft.com\/windows\/mediaplayer\/en\/download\/\" classid=\"clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6\">";
		myJsVal+="<param name=\"url\" value=\""+ url +"\" \/>";
		myJsVal+="<param name=\"autostart\" value=\""+ autoPlay +"\" \/>";
		myJsVal+="<param name=\"loop\" value=\"true\" \/>";
		myJsVal+="<param name=\"menu\" value=\"false\" \/>";
		myJsVal+="<\/object>";
		myJsVal+="</div>";
	}
	return myJsVal;
}

function iframe(url, width, height)
{
	var myJsVal = "";

	if(url == "http://" || url == "")
	{
		myJsVal = "";
	}
	else
	{
		myJsVal = "<iframe border=\"0\" frameborder=\"0\" framespacing=\"0\" style=\"width:"+ width +"px; height:"+ height +"px\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"auto\" src=\""+ url +"\" vspale=\"0\" name=\"iframe\" id=\"iframe\"><\/iframe>";
	}
	return myJsVal;
}

function pageInit()
{
	//编辑器
	var allPlugin={
		Video:{c:'xheBtnMedia',t:'视频',s:'ctrl+m',h:1,e:function(){
			var _this=this;
			var jTest=$('<div>视频文件： <input type="text" id="xheMediaSrc" value="http://" class="xheText" /></div><div>宽度高度： <input type="text" id="xheMediawidth" style="width:40px;" value="480" /> x <input type="text" id="xheMediaheight" style="width:40px;" value="400" /></div><div>自动播放： <input type="checkbox" id="xheMediaplay"></div><div style="text-align:right;"><input type="button" id="xheSave" value="确定" /></div>');
			if(_this.settings.upMediaUrl)
				_this.uploadInit($('#xheMediaSrc',jTest),_this.settings.upMediaUrl,_this.settings.upMediaExt);
			var jSave=$('#xheSave',jTest);
			jSave.click(function(){
				_this.loadBookmark();
				_this.pasteHTML(media($('#xheMediaSrc',jTest).val(),$('#xheMediawidth',jTest).val(),$('#xheMediaheight',jTest).val(),$('#xheMediaplay',jTest).attr("checked")));
				_this.hidePanel();
				return false;	
			});
			_this.showDialog(jTest);
		}},

		Iframe:{c:'xheBtnIframe',t:'网页',s:'ctrl+i',h:1,e:function(){
			var _this=this;
			var jTest=$('<div>网页文件： <input type="text" id="xheIframeSrc" value="http://" class="xheText" /></div><div>宽度高度： <input type="text" id="xheIframewidth" style="width:40px;" value="480" /> x <input type="text" id="xheIframeheight" style="width:40px;" value="400" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="确定" /></div>');
			var jSave=$('#xheSave',jTest);
			jSave.click(function(){
				_this.loadBookmark();
				_this.pasteHTML(iframe($('#xheIframeSrc',jTest).val(),$('#xheIframewidth',jTest).val(),$('#xheIframeheight',jTest).val()));
				_this.hidePanel();
				return false;	
			});
			_this.showDialog(jTest);
		}},

		Word:{c:'xheBtnWord',t:'导入word',s:'ctrl+w',e:function(){
			var _this=this;
			_this.saveBookmark();
			_this.showIframeModal('导入word',"{editorRoot}xheditor_plugins/word/word.aspx",function(v){
				_this.loadBookmark();
				_this.pasteHTML(v);
				},320,200);
		}},
		
		uploadAll:{c:'xheuploadAll',t:'图片：showIframeModal (Ctrl+7)',s:'ctrl+7',e:function(){
			var _this=this;
			_this.showIframeModal('上传文件', "{editorRoot}xheditor_plugins/multiupload/multiuploadadd.aspx?type=image&uploadurl={editorRoot}xheditor_plugins/multiupload/upload.aspx%3Ftype%3Dimage&ext=图片文件(*.jpg;*.jpeg;*.gif;*.png;*.bmp;)",function(v){
				_this.loadBookmark();
				var urlall = "";
				for(i=0; i<v.length; i++)
				{
					urlall += "|" + v[i].url;
				};
				$(".urlall").val(urlall.substring(1));
				},320,200);
		}}
	};

	if($(".Editor").length != 0)
		$('.Editor').xheditor({plugins:allPlugin,width:'80%', height:'240',internalScript:true,tools:'Source,Preview,Fullscreen,|,Cut,Copy,Paste,Pastetext,|,Blocktag,Fontface,FontSize,|,FontColor,BackColor,|,Bold,Italic,Underline,Strikethrough,/,SelectAll,Removeformat,|,Align,List,Outdent,Indent,|,Link,Unlink,Anchor,|,Img,Flash,Video,Word,Iframe,Table,|,About',upLinkUrl:"!{editorRoot}xheditor_plugins/multiupload/multiupload.aspx?type=file&uploadurl={editorRoot}xheditor_plugins/multiupload/upload.aspx%3Ftype%3Dfile&ext=附件文件(*.gif;*.jpg;*.bmp;*.png;*.zip;*.rar;*.txt;*.doc;*.pdf;*.xls;*.ppt;*.swf;*.htm;*.html)",upImgUrl:'!{editorRoot}xheditor_plugins/multiupload/multiupload.aspx?type=image&uploadurl={editorRoot}xheditor_plugins/multiupload/upload.aspx%3Ftype%3Dimage&ext=图片文件(*.jpg;*.jpeg;*.gif;*.png;*.bmp;)',upFlashUrl:'!{editorRoot}xheditor_plugins/multiupload/multiupload.aspx?type=flash&uploadurl={editorRoot}xheditor_plugins/multiupload/upload.aspx%3Ftype%3Dflash&ext=Flash动画(*.swf)',upMediaUrl:'!{editorRoot}xheditor_plugins/multiupload/multiupload.aspx?type=media&uploadurl={editorRoot}xheditor_plugins/multiupload/upload.aspx%3Ftype%3Dmedia&ext=多媒体文件(*.wmv;*.flv;*.rm;*.avi;*.wma;*.mp3;*.mid)'});
	if($(".EditorBasic").length != 0)
		$('.EditorBasic').xheditor({width:'80%', height:'120',tools:'Cut,Copy,Paste,Pastetext,|,Fontface,FontSize,|,FontColor,BackColor,|,Bold,Italic,Underline,Strikethrough,|,Align,List,Outdent,Indent,About'});

}
</script>
<script type="text/javascript">
$(function()
{
	$("#ButtonInsert").click(function()
	{
		//TB_TaskClass验证
		if ($("#TB_Title").val()=='')
		{
			alert("请填写标题！");
			$("#TB_Title").focus(); 
			return false;
		} 

		//TB_Content验证
		if($("#TB_Content").val()=='')
		{
			alert("请填写内容！");
			$("#TB_Content").focus(); 
			return false;
		}
	})

	$("#ButtonRe").click(function()
	{
		//TB_Content验证
		if($("#ReTB_Content").val()=='')
		{
			alert("请填写内容！");
			$("#ReTB_Content").focus(); 
			return false;
		}
	})

	//删除数据的提示
	$("a[title=delete]").click(function()
    {
        return confirm("你确定要删除这一项吗？");
    })

	$("#search").click(function()
    {
        location.href = 'default.aspx?action=search&keyword=' + $("#keyword").val();
    })
})
</script>
</head>
<body>
<form id="form1" runat="server">
<table class="table">
<tr>
	<td style="text-align:right"><input type="text" id="keyword" ><input id="search" class="search" type="button" value="搜索"></td>
</tr>
</table>
<table class="table menu">
  <tr>
    <td width="105">
	<a href="default.aspx">查看论坛列表</a>
	</td>
	<td align="right">
	<asp:placeholder runat="server" Visible='<%# IsLogin %>'><a href="../user.aspx?action=show&id=<%= LoginKey("UserID") %>"><%= LoginKey("Name") %>的用户中心</a><asp:LinkButton ID="LinkButton1" runat="server" onclick="Loginout_Click"  Text="退出系统" /></asp:placeholder>
	<asp:placeholder runat="server" Visible='<%# !IsLogin %>'><a href="../login.aspx?url=<%=Server.UrlEncode("bbs/default.aspx")%>&table=C_Bbs&islog=yes">用户登陆</a></asp:placeholder>
	</td>	
  </tr>
</table>
<asp:Panel ID="PanelDefault" runat="server">
<asp:Repeater ID="RepeaterDefault" runat="server">
<ItemTemplate>
<table class="table">
<tr>
    <td style="width:100px; text-align:center;" rowspan="2"><img src="../../<%# Eval("Pic") %>" style="margin:5px;" /></td>
    <td style="background:#f1f1f1; font-weight:bold;"><a href="default.aspx?action=class&id=<%# Eval("ID") %>"><%# Eval("Name") %></a></td>
</tr>
<tr>
    <td style="table-layout:fixed;word-break:break-all; line-height:20px;"><%# Eval("Content") %></td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</asp:Panel>

<asp:Panel ID="PanelClass" runat="server">
<table class="table">
<thead>
<tr>
    <td style="width:25px; text-align:center;"></td>
    <td style="width:100px;">姓名</td>
    <td>主题</td>
    <td style="width:120px;">提交时间</td>
</tr>
</thead>
<asp:Repeater ID="RepeaterList" runat="server">
<ItemTemplate>
<tr>
    <td><img src="images/ico_file.gif" /></td>
    <td><a href="../user.aspx?action=show&id=<%# Eval("UserID")%>"><%# UserName(Eval("UserID").ToString())%></a></td>
    <td><a href="?action=show&class=<%# Eval("Classid") %>&id=<%# Eval("ID") %>"><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Title").ToString()) %></a><asp:Panel ID="Panel2" runat="server" CssClass="inline" Visible="<%# IsAdmin %>"><a href="?action=delete&id=<%# Eval("ID") %>"  title="delete" class="button">删除</a>
    </asp:Panel></td>
    <td class="time"><%# Eval("InputDate") %></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<table class="table">
<tr>
    <td><Caicai:CPageSql ID="PageShow" runat="server" PageSize="10" /></td>
</tr>
</table>
<table class="table">
<tr>
    <td align="right"><a href="javascript:history.back()" class="button">返回上一页</a></td>
</tr>
</table>
<asp:placeholder runat="server" ID="PlaceHolderInsert" Visible='<%# IsLogin %>'>
<table class="table">
<thead>
<tr>
    <td colspan="2">发表主题</td>
</tr>
</thead>
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">标题</td>
    <td><Cai:CTextBox runat="server" ID="TB_Title" Style="width:50%;" /></td>
</tr>
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">内容</td>
    <td><Cai:CTextBox runat="server" ID="TB_Content" TextMode="MultiLine" Style="height:80px;width:90%;" Class="EditorBasic" /></td>
</tr>
<tr>
    <td colspan="2" align="center"><asp:Button ID="ButtonInsert" runat="server" onclick="Insert_Click"  Text=" 提 交 " />&nbsp;&nbsp;<input type="reset" value=" 重 置 " /></td>
</tr>
</table>
</asp:placeholder>
</asp:Panel>

<asp:Panel ID="PanelShow" runat="server">
<asp:Repeater ID="RepeaterShow" runat="server">
<ItemTemplate>
<table class="table">
<tr>
    <td style="width:100px; text-align:center;font-weight:bold;background:#f1f1f1;"><a href="../user.aspx?action=show&id=<%# Eval("UserID")%>"><%# UserName(Eval("UserID").ToString())%></a></td>
    <td style="table-layout:fixed;word-break:break-all; line-height:20px;">主题：<%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Title").ToString()) %><hr /><%# Eval("Content") %><hr /><span class="time">Time:<%# Eval("InputDate") %></span></td>
</tr>
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="RepeaterReShow" runat="server">
<ItemTemplate>
<tr>
    <td style="width:100px; text-align:center;font-weight:bold;"><a href="../user.aspx?action=show&id=<%# Eval("UserID")%>"><%# UserName(Eval("UserID").ToString())%></a></td>
    <td style="table-layout:fixed;word-break:break-all; line-height:20px;"><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Content").ToString()) %><hr /><span class="time">Time:<%# Eval("InputDate") %>&nbsp;&nbsp;IP:<%# Eval("InputIP") %></span><asp:Panel ID="Panel2" runat="server" CssClass="inline" Visible="<%# IsAdmin %>"><hr /><a href="?action=delete&id=<%# Eval("ID") %>"  title="delete" class="button">删除</a>
    </asp:Panel></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<table class="table">
<tr>
    <td><Caicai:CPageSql ID="PageReShow" runat="server" PageSize="10" /></td>
</tr>
</table>
<table class="table">
<tr>
    <td align="right"><a href="default.aspx?action=class&id=<%=Caicai.Framework.Utils.CFetch.Get("class", Caicai.Framework.Utils.CheckGetEnum.Int)%>" class="button">返回列表</a><a href="javascript:history.back()" class="button">返回上一页</a></td>
</tr>
</table>
<asp:placeholder runat="server" ID="PlaceHolderRe" Visible='<%# IsLogin %>'>
<table class="table">
<thead>
<tr>
    <td colspan="2">回复主题页</td>
</tr>
</thead>
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">内容</td>
    <td><Cai:CTextBox runat="server" ID="ReTB_Content" TextMode="MultiLine" Style="height:80px;width:90%;" Class="EditorBasic" /></td>
</tr>
<tr>
    <td colspan="2" align="center"><asp:Button ID="ButtonRe" runat="server" onclick="Re_Click"  Text=" 提 交 " />&nbsp;&nbsp;<input type="reset" value=" 重 置 " /></td>
</tr>
</table>
</asp:placeholder>
</asp:Panel>

<asp:Panel ID="PanelSearch" runat="server">
<table class="table">
<thead>
<tr>
    <td style="width:25px; text-align:center;"></td>
    <td style="width:100px;">姓名</td>
    <td>主题</td>
    <td style="width:120px;">提交时间</td>
</tr>
</thead>
<asp:Repeater ID="RepeaterSearch" runat="server">
<ItemTemplate>
<tr>
    <td><img src="images/ico_file.gif" /></td>
    <td><a href="../user.aspx?action=show&id=<%# Eval("UserID")%>"><%# UserName(Eval("UserID").ToString())%></a></td>
    <td><a href="?action=show&class=<%# Eval("Classid") %>&id=<%# Eval("ID") %>"><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Title").ToString()) %></a><asp:Panel ID="Panel2" runat="server" CssClass="inline" Visible="<%# IsAdmin %>"><a href="?action=delete&id=<%# Eval("ID") %>"  title="delete" class="button">删除</a>
    </asp:Panel></td>
    <td class="time"><%# Eval("InputDate") %></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<table class="table">
<tr>
    <td><Caicai:CPageSql ID="PageSearch" runat="server" PageSize="10" /></td>
</tr>
</table>
<table class="table">
<tr>
    <td align="right"><a href="javascript:history.back()" class="button">返回上一页</a></td>
</tr>
</table>
</asp:Panel>
</form>
</body>
</html>
