 <%@ Page Language="C#" ValidateRequest="false" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="True" Inherits="Plus.Group.Admin_BBSClass" Title="论坛社群管理" Codebehind="KS.BBSCategory.aspx.cs" %>

<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.BLL" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" runat="Server">

    <asp:Panel ID="ClassList" runat="server" Width="100%">
        <div class="listedit">
            <ul>
                <asp:LinkButton ID="delbutton" runat="server" OnClientClick="if (GetIDS('del')){return true}else{return false}" OnClick="BtnDelete_Click" CssClass="button">删除社群</asp:LinkButton>
            </ul>
        </div>
        <div class="content-area mt20">
            <script type="text/javascript">
                function ExtSub(ID, event) {//阻止冒泡调用parent
                    var e = (event) ? event : window.event;
                    if (window.event) {//IE
                        e.cancelBubble = true;
                    } else { //FF
                        e.stopPropagation();
                    }
                    if (jQuery('#C' + ID).attr('class') == "tree_Close") {
                        jQuery('#C' + ID).attr('class', 'tree_Open');
                        if ($(".CTable").find("tr[attr*='," + ID + ",']").length > 0) {
                            $(".CTable").find("tr[attr*='," + ID + ",']").show();
                        } else {
                            jQuery('#ajaxmsg', window.parent.document).toggle();
                            jQuery.ajax({
                                type: "POST",
                                url: "KS.BBSCategory.aspx",
                                data: "parentid=" + ID + "&action=ExtSub",
                                success: function (data) {
                                    jQuery('#ajaxmsg', window.parent.document).toggle();
                                    jQuery("#sub" + ID).after(data);
                                    //jQuery("#sub"+ID).html(data);
                                }
                            });
                        }
                    }
                    else {
                        $(".CTable").find("tr[attr*='," + ID + ",']").hide();
                        jQuery('#C' + ID).attr('class', 'tree_Close');
                    }
                }
            </script>
            <script>
                function SetDate() {
                    var today = new Date();
                    if ($("#showdate").is(":hidden")) {
                        $("#showdate").show();
                        $('#<%=TxtBeginDate.ClientID%>').val(today.getFullYear() + '-' + (today.getMonth() + 1) + '-01');
                $('#<%=TxtEndDate.ClientID%>').val(today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate());
            }
            else {
                $("#showdate").hide();
                $('#<%=TxtBeginDate.ClientID%>').val('');
                $('#<%=TxtEndDate.ClientID%>').val('');
                    }
                }
                function keyWordFocus() {
                    if (jQuery("#<%=this.KeyWord.ClientID %>").val() == '请输入关键字！') {
                jQuery("#<%=this.KeyWord.ClientID %>").val('');
                    }
                }
                function keyWordBlur() {
                    if (jQuery("#<%=this.KeyWord.ClientID %>").val() == '') {
                jQuery("#<%=this.KeyWord.ClientID %>").val('请输入关键字！');
                    }
                }
                $(function () {
                    //全选反选
                    $("#selectAll").click(function () {
                        if ($(this).is(":checked")) {
                            $(".courseList").find("input[type=checkbox]").attr("checked", true);//从父标签开始找
                        }
                        else {
                            $(".courseList").find("input[type=checkbox]").attr("checked", false);
                        };
                    });
                    $("#selectinfo").click(function () {
                        if ($(this).is(":checked")) {
                            $(".infolist").find("input[type=checkbox]").attr("checked", true);//从父标签开始找
                        }
                        else {
                            $(".infolist").find("input[type=checkbox]").attr("checked", false);
                        };
                    });
                });

        //课程信息时间的开关
            </script>
            <div class="tabs_header clearfix">
                <div class="fr">
                    <asp:LinkButton ID="addbutton" runat="server" OnClick="lbtaddmodel_Click" CssClass="mr20 button button_on"><%=KSCMS.S("TypeInfo")=="1"?"添加社群分类":"添加社群"%></asp:LinkButton>
                    <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" CssClass="mr20 button">一级社群排序</asp:LinkButton>
                    <asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkButton2_Click" CssClass="mr20 button">N级社群排序</asp:LinkButton>
                    <asp:LinkButton ID="LinkButton3" runat="server" OnClick="LinkButton3_Click" CssClass="mr20 button">一键重计兴趣社群数</asp:LinkButton>
                </div>
                <ul class="tabs">
                    <li <%=KSCMS.S("TypeInfo")==""?" class='active'":string.Empty %>><a href="KS.BBSCategory.aspx"><span>社群</span></a></li>
                    <li <%=KSCMS.S("TypeInfo")=="1"?" class='active'":string.Empty %>><a href="KS.BBSCategory.aspx?TypeInfo=1"><span>分类</span></a></li>
                </ul>
            </div>
            <div class="quickSearch clearfix">
                <div class="quickSelect">
                    <%if (KSCMS.S("TypeInfo") != "1")
                        { %>
                    <select name="classid" style="width: 150px" onchange="location.href='/Plus/Plus.Group/KS.BBSCategory.Aspx?classid='+this.value;">
                        <option value="0">快速跳转到栏目...</option>
                        <%=getgrouptype() %>
                    </select>
                    <%} %>
                </div>
                <div class="SearchBox fl">
                    <asp:DropDownList ID="Condition" runat="server" Style="margin-right: 8px;">
                        <asp:ListItem Value="1">名称</asp:ListItem>
                        <asp:ListItem Value="2">ID</asp:ListItem>
                    </asp:DropDownList>
                    <asp:TextBox onfocus="keyWordFocus();" onblur="keyWordBlur();" Style="color: #ccc" Text="请输入关键字！" CssClass="textbox" ID="KeyWord" runat="server" Width="180px"></asp:TextBox>
                    <span onclick="SetDate()" class="link-color" style="cursor: pointer">日期范围？</span>
                    <span id="showdate" <%if (this.TxtBeginDate.Text == "")
                                      { %>
                        style="display: none" <%} %>>
                        <asp:TextBox ID="TxtBeginDate" placeholder="格式：YYYY-MM-DD" Width="150px" runat="server" onclick="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;});" CssClass="textbox Wdate"></asp:TextBox>至
                    <asp:TextBox ID="TxtEndDate" placeholder="格式：YYYY-MM-DD" Width="150px" runat="server" onclick="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;});" CssClass="textbox Wdate"></asp:TextBox>
                    </span>
                    <asp:Button ID="search" runat="server" CssClass="button" Text="开始搜索" OnClick="search_Click" />
                </div>
            </div>

            <asp:Repeater ID="list" runat="server">
                <HeaderTemplate>
                    <table width="99%" align="center" cellpadding="0" cellspacing="0" class="CTable">
                        <tr class="CTitle">
                            <th scope="col">
                                <input type="checkbox" name="chkall" onclick="CheckBox(this.checked);" for="chkall" /></th>
                            <th scope="col"><%=KSCMS.S("TypeInfo") == "1" ? "分类" : "社群" %>ID</th>
                            <th scope="col"><%=KSCMS.S("TypeInfo") == "1" ? "分类" : "社群" %>图标</th>
                            <th scope="col" style="text-align: left"><%=KSCMS.S("TypeInfo") == "1" ? "分类" : "社群" %>名称</th>
                            <%if(KSCMS.S("TypeInfo") != "1"){%>
                            <th scope="col">社群组长</th>
                            <%} %>
                            <th scope="col"><%=KSCMS.S("TypeInfo")=="1"?"分类":"社群" %>简介</th>
                             <%if(KSCMS.S("TypeInfo")!="1"){%>
                            <th scope="col">所属分类</th>
                            <%} %>
                            <th scope="col">管理操作</th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr id='sub<%#Eval("BoardID") %>' onmouseover="jQuery('#a<%# Eval("BoardID") %>').show();this.className='CtrMouseOver'" onmouseout="jQuery('#a<%# Eval("BoardID") %>').hide();this.className='CtrMouseOut'" onclick="chk(this)">
                        <td class="Ctd" style="text-align: center; width: 30px;">
                            <input type="checkbox" name="ids" value='<%#Eval("BoardID")%>' /></td>
                        <td class="Ctd" style="text-align: center; width: 50px;"><%# Eval("BoardID") %></td>
                        <td class="Ctd" align="center">
                            <img src="<%# Eval("ico") %>" width="80px" height="60px" onerror="this.src='/sysimg/nopic.gif'" /></td>
                        <td class="Ctd" style="height: 30px; width: 150px;"><%# Eval("BoardName") %> </td>
                        <%if(KSCMS.S("TypeInfo") != "1"){%> 
                        <td class="Ctd" align="center" style="width: 100px;"><%# Eval("BoardMaster")==""?"--":Eval("BoardMaster") %></td>
                        <%} %>
                        <td class="Ctd" align="left"><%#Eval("intro") %>  </td>
                        <%if (KSCMS.S("TypeInfo") != "1")
                            { %>
                        <td class="Ctd" align="center"><%#Kesion.BLL.DataFactory.GetOnlyValue("select top 1 BoardName from KS_BBSBoard where BoardID="+Eval("ParentID")) %></td>
                        <%} %>
                        <td class="Ctd link-operate" align="center" style="width: 200px;">

                            <a href="KS.BBSCategory.Aspx?TypeInfo=<%#KSCMS.S("TypeInfo") %>&action=edit&BoardID=<%# Eval("BoardID") %>">编辑</a>
                            <a href="KS.BBSCategory.Aspx?Action=del&Ids=<%# Eval("BoardID") %>" onclick="return(confirm('删除社群，同时删除该社群下的问答，此操作不可逆，确定删除社群吗?'));">删除</a>
                            <%if(KSCMS.S("TypeInfo")!="1"){ %><a href='<%# Kesion.BLL.BaseFun.GetRewriteUrl("clubforum",Convert.ToInt16(Eval("BoardID"))) %>' target="_blank">预览</a>
                            <a href='KS.BBSMemberTopic.aspx?BoardID=<%# Eval("BoardID") %>' >组员信息</a>
                            <%} %>
                             <%if (KSCMS.S("TypeInfo") != "1")
                                 { %><a href="KS.BBSSign.aspx?BoardID=<%# Eval("BoardID") %>">报名信息</a>
                            <%} %>
                        </td>
                    </tr>

                </ItemTemplate>
                <FooterTemplate>
                    <tr style="display: <%# bool.Parse((list.Items.Count==0).ToString())?"":"none"%>">
                        <td class="Ctd" style="text-align: center" colspan="5">
                            <asp:LinkButton ID="addbutton" runat="server" OnClick="lbtaddmodel_Click"> 还没有添加任何社群，点此添加社群&raquo;</asp:LinkButton>
                        </td>
                    </tr>
                    </table>
                </FooterTemplate>
            </asp:Repeater>

            <asp:Label ID="LabPage" runat="server"></asp:Label>
            <!--
          <br />
        <script type="text/javascript">
            showtips('<span class="state"><strong>操作说明：</strong><br /></span>可使用标签{$GetBBSCategory}在前台模板调用出论坛社群。');
		</script>
         -->
    </asp:Panel>

    <asp:Panel ID="ClassAdd" runat="server" Width="100%">
        <script>
            function setFileFileds(num) {
                for (var i = 1, str = ""; i <= 20; i++) {
                    jQuery("#define" + i).css("display", "none");
                }
                for (var i = 1, str = ""; i <= num; i++) {
                    jQuery("#define" + i).css("display", "");
                }
            }

            function CheckAddMode() {
                if (jQuery("#AddType")[0].checked == true) {
                    jQuery("#AddOne").hide();
                    jQuery("#AddMore").show();
                } else {
                    jQuery("#AddOne").show();
                    jQuery("#AddMore").hide();
                }
            }

            function CheckForm() {
                if (jQuery('#<%=this.BoardName.ClientID %>').val() == '' && jQuery("#AddType")[0].checked == false) {
                    KesionJS.Alert('请输入论坛社群/分类名称！', "jQuery('#<%=this.BoardName.ClientID %>').focus()");
                    return false;
                } else if (jQuery("#AddType")[0].checked == true && jQuery('#<%=this.TxtMoreBoardName.ClientID %>').val() == '') {
                    KesionJS.Alert('请按格式输入论坛社群名称,一行表示一个社群！', "jQuery('#<%=this.TxtMoreBoardName.ClientID %>').focus()");
                    return false;
                }
                var IsInViteStatus = jQuery("#<%=this.IsInViteRadioButtonList.ClientID%> :radio[checked]").val();//加入权限
                 var ISLoad = jQuery("#<%=this.ISLoad.ClientID %> :radio[checked]").val();
                if (IsInViteStatus == '2') {
                    if (parseFloat(jQuery('#<%=this.TxtPrice.ClientID %>').val()) <=0) {
                          KesionJS.Alert("社群价格不能小于等于0！", "jQuery('#<%=this.TxtPrice.ClientID %>').focus()");
                        return false;
                    }
                    if (ISLoad == '2') {//固定价格

                        if (parseFloat(jQuery('#<%=this.IsFixedPrice.ClientID %>').val()) <= 0) {
                            KesionJS.Alert("VIP用户的固定价格不能小于等于0！", "jQuery('#<%=this.IsFixedPrice.ClientID %>').focus()");
                            return false;
                        }
                    }
                    else if (ISLoad == '1') {//折扣

                        if (parseFloat(jQuery('#<%=this.Loadzhekou.ClientID %>').val()) <= 0) {
                            KesionJS.Alert("VIP用户的折扣不能小于等于0！", "jQuery('#<%=this.Loadzhekou.ClientID %>').focus()");
                            return false;
                        }
                       else  if (parseFloat(jQuery('#<%=this.Loadzhekou.ClientID %>').val()) >=10) {
                            KesionJS.Alert("VIP用户的折扣不能大于等于10！", "jQuery('#<%=this.Loadzhekou.ClientID %>').focus()");
                            return false;
                        }
                    }
                }
               //可设置浏览的条数
                var lookdStatus = jQuery("#<%=this.IsLook.ClientID%> :radio[checked]").val();
                if (lookdStatus == '1') {
                    var topicNum=jQuery('#<%=this.TxtTopicNum.ClientID %>').val()
                    if (parseInt(topicNum) <= 0) {
                         KesionJS.Alert("设置可浏览话题条数不能小于等于0！", "jQuery('#<%=this.TxtTopicNum.ClientID %>').focus()");
                            return false;
                    }
                } 


            }
            function showPurview() {
                var checkrad = jQuery("#<%=this.RdbVisitorView.ClientID%> :radio[checked]").val();
                if (checkrad == "1") {
                    jQuery("#showpurview").hide();
                } else {
                    jQuery("#showpurview").show();
                }
            }
            $(document).ready(function () {
                showPurview();
            });
        </script>

        <!--<KS:TopNav ID="TopNav1" runat="server" Text="添加社群/分类" />-->
        <div class="content-area mt20">
            <div class="tab-page" id="BBSClassPanel">
                <script type="text/javascript">
                    var tabPane1 = new WebFXTabPane(document.getElementById("BBSClassPanel"), 1)
                </script>
                <input type="hidden" name="TypeInfo" value="<%=KSCMS.S("TypeInfo") %>" />
                <div class="tab-page" id="tab0">
                    <h2 class="tab">基本信息</h2>
                    <script type="text/javascript">
                        tabPane1.addTabPage(document.getElementById("tab0"));
                    </script>

                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable">
                        <tr style="display: <%=KSCMS.S("TypeInfo")=="1"?"none":"" %>">
                            <td align="right" class="lefttd" style="height: 37px;"><strong>所属社群：</strong><br>
                            </td>
                            <td class="righttd" style="height: 37px">
                                <asp:DropDownList ID="ParentID" runat="server">
                                    <asp:ListItem Value="0">-请选择-</asp:ListItem>
                                </asp:DropDownList>&nbsp;
                             <span id="ParentIDMessage" runat="server"></span>
                            </td>
                        </tr> 
                        <tr>
                            <td class="lefttd" height="30" align="right" style="width: 145px">
                                <strong><%=KSCMS.S("TypeInfo")=="1"?"分类名称":"社群名称" %>：</strong></td>
                            <td class="righttd">
                                <span id="AddOne">
                                    <asp:TextBox CssClass="textbox" ID="BoardName" runat="server"></asp:TextBox>
                                    <span class="tips">*请输入<%=KSCMS.S("TypeInfo")=="1"?"分类名称":"社群名称" %>，如：情感交流、家居生活等</span>
                                </span>
                                <label style="<%=KSCMS.S("action")=="edit"?"display:none;": "" %>font-weight:bold; color: Green">
                                    <input onclick="CheckAddMode()" type="checkbox" name="AddType" id="AddType" value="1" />切换到批量添加模式</label>
                                <div id="AddMore" style="display: none">
                                    <font color="red">一行代表一个<%=KSCMS.S("TypeInfo")=="1"?"分类":"社群" %></font>
                                    <br />
                                    <asp:TextBox Text="名称1" ID="TxtMoreBoardName" runat="server" CssClass="textbox" TextMode="MultiLine" Width="250px" Height="150px"></asp:TextBox>
                                </div>
                            </td>
                        </tr>



                        <tr id="IntroArea">
                            <td align="right" class="lefttd" style="height: 50px;">
                                <strong><%=KSCMS.S("TypeInfo")=="1"?"分类":"社群" %>介绍：</strong><br />
                            </td>
                            <td class="righttd" style="height: 50px">
                                <asp:TextBox CssClass="textbox textarea" ID="TxtIntro" runat="server" Rows="6" TextMode="MultiLine" Width="383px" Height="80px" MaxLength="255"></asp:TextBox>
                                <a class="textarea_min" href="javascript:zoomtextarea(-5,'<%=this.TxtIntro.ClientID %>');"></a>
                                <a class="textarea_max" href="javascript:zoomtextarea(5,'<%=this.TxtIntro.ClientID %>');"></a>
                                <br />
                                <font class='tips'>简要介绍社群信息，不超过255个字符。</font>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" class="lefttd" align="right">
                                <strong><%=KSCMS.S("TypeInfo")=="1"?"分类":"社群" %>图标：</strong></td>
                            <td class="righttd">
                                <asp:TextBox CssClass="textbox" ID="TxtICO" runat="server" Width="380px"></asp:TextBox>&nbsp;<input type="button" class="button" onclick="SelectFiles('<%=this.TxtICO.ClientID %>',101);" value="选择图片">
                                <br />
                                <font class='tips'>用于在社群页显示指定的图片</font>
                            </td>
                        </tr>

                        <tr style="display: <%=KSCMS.S("TypeInfo")=="1"?"none":"" %>">
                            <td height="30" class="lefttd" align="right" style="width: 155px">
                                <strong>组长：</strong></td>
                            <td class="righttd">
                                <asp:TextBox CssClass="textbox" ID="TxtBoardMaster" runat="server" Width="380px"></asp:TextBox>&nbsp;
                        <font class='tips'>多个版主请用英文逗号隔开。</font>
                            </td>
                        </tr>

                        <tr style="display: <%=KSCMS.S("TypeInfo")=="1"?"none":"" %>">
                            <td height="30" class="lefttd" align="right" style="width: 155px">
                                <strong>本社群列表启用缓存：</strong></td>
                            <td class="righttd">列表页前<asp:TextBox Text="0" CssClass="textbox" ID="TxtCacheNum" runat="server" Style="text-align: center" Width="50px"></asp:TextBox>页启用缓存 
                        <span class="tips">tips:建议设置不超过100页，设置“0”不启用缓存。</span>
                            </td>
                        </tr>
                        <tr style="display: <%=KSCMS.S("TypeInfo")=="1"?"none":"" %>">
                            <td height="30" class="lefttd" align="right" style="width: 155px">
                                <strong>本社群分页方式：</strong></td>
                            <td class="righttd">
                                <asp:RadioButtonList ID="RdbPageType" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                                    <%--<asp:ListItem Value="0">普通分页</asp:ListItem>--%>
                                    <asp:ListItem Value="1" Selected="True">滚动条加载</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <tr style="display: <%=KSCMS.S("TypeInfo")=="1"?"none":"" %>">
                            <td height="30" class="lefttd" align="right" style="width: 155px">
                                <strong>分页设置：</strong></td>
                            <td class="righttd">每页加载<asp:TextBox Text="5" CssClass="textbox" ID="TxtRollTopicPageNum" runat="server" Style="text-align: center" Width="50px"></asp:TextBox>条话题
                        话题详细页每页加载<asp:TextBox Text="5" CssClass="textbox" ID="TxtRollReplyPageNum" runat="server" Style="text-align: center" Width="50px"></asp:TextBox>条回复
                            </td>
                        </tr>
                        <tr style="display:none">
                            <td height="30" class="lefttd" align="right" style="width: 155px">
                                <strong>热帖设置：</strong></td>
                            <td class="righttd">浏览数大于<asp:TextBox Text="100" CssClass="textbox" ID="TxtHotTopicHits" runat="server" Style="text-align: center" Width="50px"></asp:TextBox>次且回复数大于<asp:TextBox Text="10" CssClass="textbox" ID="TxtHotReplyHits" runat="server" Style="text-align: center" Width="50px"></asp:TextBox>楼时自动转为热帖
                            </td>
                        </tr>

                    </table>

                </div>
                <div style="display: <%=KSCMS.S("TypeInfo")=="1"?"none":"" %>">
                    <div class="tab-page" id="post">
                        <h2 class="tab">发帖权限</h2>
                        <script type="text/javascript">
                <% if(KSCMS.S("TypeInfo")=="1"){%><%}else{%>
                            tabPane1.addTabPage(document.getElementById("post"));
                <% }%>
</script>

                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable">
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>新用户注册</strong>：<br />
                                </td>
                                <td class="righttd">
                                    <asp:TextBox ID="Txt1" Style="text-align: center" Text="20" CssClass="textbox" runat="server" Width="50px"></asp:TextBox>分钟后才可以在本社群发帖
                                </td>
                            </tr>
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>是否允许游客浏览</strong>：<br />
                                </td>
                                <td class="righttd">
                                    <asp:RadioButtonList ID="RdbVisitorView" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                        <asp:ListItem Value="1" Selected="True">允许</asp:ListItem>
                                        <asp:ListItem Value="0">不允许</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tbody id="showpurview">
                                <tr>
                                    <td height="30" align="right" class="lefttd" style="width: 145px">
                                        <strong>浏览权限授权</strong>：<br />
                                    </td>
                                    <td class="righttd">
                                        <strong>1、限制会员组:(不限制请不要勾选) </strong>
                                        <br />
                                        <asp:Label ID="LabGroupID" runat="server" Text=""></asp:Label>
                                        <strong>2、认证会员</strong><br />
                                        <asp:TextBox ID="TxtUserNames" runat="server" CssClass="textbox" Width="600" Height="100" TextMode="MultiLine"></asp:TextBox>
                                        <br />
                                        <span class="tips">多个会员允许查看，请用英文逗号隔开。</span>
                                        <!--<br />
                        <strong>3、有效期限制</strong><br />
                        <asp:RadioButtonList ID="RdbLimitValidDays" runat="Server">
                            <asp:ListItem Value="0" Selected="True">不启用有效期限制</asp:ListItem>
                            <asp:ListItem Value="1">有效期用户都可以浏览</asp:ListItem>
                            <asp:ListItem Value="2">有效期用户还需要最高满足以上任一条件才能浏览</asp:ListItem>
                        </asp:RadioButtonList>    -->
                                    </td>
                                </tr>
                            </tbody>
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>是否允许上传附件</strong>：<br />
                                </td>
                                <td class="righttd">
                                    <asp:RadioButtonList ID="RdbUpload" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                        <asp:ListItem Value="1" Selected="True">允许</asp:ListItem>
                                        <asp:ListItem Value="0">不允许</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>

                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>发表话题限制</strong>：<br />
                                </td>
                                <td class="righttd">一天内每个会员最多只能发表
                        <asp:TextBox ID="Txt2" Text="0" Style="text-align: center" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>
                                    个话题 发帖字数不少于
                        <asp:TextBox ID="Txt3" Text="0" Style="text-align: center" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>
                                    个字 发帖间隔时间
                        <asp:TextBox ID="Txt4" Text="0" Style="text-align: center" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>
                                    秒 
                        <span class="tips">不限制请输入“0”。</span>
                                    <br />
                                    <br />
                                    发帖时间从
                        <asp:TextBox ID="Txt5" Text="0" Style="text-align: center" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>
                                    -
                       <asp:TextBox ID="Txt6" Text="0" Style="text-align: center" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>
                                    点不能发帖 <span class="tips">不限制请输入“0”。</span>
                                </td>

                            </tr>

                        </table>
                    </div>

                    <div class="tab-page" id="score">
                        <h2 class="tab">积分规则</h2>
                        <script type="text/javascript">
                <% if(KSCMS.S("TypeInfo")=="1"){%><%}else{%>
                            tabPane1.addTabPage(document.getElementById("score"));
                <%}%>
</script>

                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable">
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>发表话题</strong>：<br />
                                </td>
                                <td class="righttd">增加
                                    <asp:TextBox ID="TxtScore1" Style="text-align: center" Text="0" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>分 
                        <span class="tips">不送积分请设置“0”</span>
                                </td>
                            </tr>
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>发表回复</strong>：<br />
                                </td>
                                <td class="righttd">增加
                          <asp:TextBox ID="TxtScore2" Style="text-align: center" Text="0" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>分 
                         <span class="tips">不送积分请设置“0”，自问自答的话题回复不加积分。</span>
                                </td>
                            </tr>
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>设置精华</strong>：<br />
                                </td>
                                <td class="righttd">增加
                          <asp:TextBox ID="TxtScore3" Style="text-align: center" Text="0" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>分 
                         <span class="tips">不送积分请设置“0”</span>
                                </td>
                            </tr>
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>设置社群置顶</strong>：<br />
                                </td>
                                <td class="righttd">增加
                          <asp:TextBox ID="TxtScore4" Style="text-align: center" Text="0" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>分 
                         <span class="tips">不送积分请设置“0”</span>
                                </td>
                            </tr>
                            <tr style="display:none">
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>设置总置顶</strong>：<br />
                                </td>
                                <td class="righttd">增加
                          <asp:TextBox ID="TxtScore5" Style="text-align: center" Text="0" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>分 
                         <span class="tips">不送积分请设置“0”</span>
                                </td>
                            </tr>
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>话题被删除</strong>：<br />
                                </td>
                                <td class="righttd">扣除
                          <asp:TextBox ID="TxtScore6" Style="text-align: center" Text="0" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>分 
                         <span class="tips">不扣除积分请设置“0”</span>
                                </td>
                            </tr>
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>回复被删除</strong>：<br />
                                </td>
                                <td class="righttd">扣除
                          <asp:TextBox ID="TxtScore7" Style="text-align: center" Text="0" runat="server" CssClass="textbox" Width="50px"></asp:TextBox>分 
                         <span class="tips">不扣除积分请设置“0”</span>
                                </td>
                            </tr>

                        </table>
                    </div>


















                    <div class="tab-page" id="rules">
                        <h2 class="tab">本版版规</h2>
                        <script type="text/javascript">
                <% if(KSCMS.S("TypeInfo")=="1"){%><%}else{%>
                            tabPane1.addTabPage(document.getElementById("rules"));<%}%>
</script>

                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable">
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>版规</strong>：<br />
                                </td>
                                <td class="righttd">
                                    <asp:TextBox ID="TxtBoardRules" runat="server" Rows="3" TextMode="MultiLine" Height="350" Width="800px"></asp:TextBox>
                                    <%Kesion.APPCode.EditorAPI.EchoEditor("editor", this.TxtBoardRules.ClientID, "Basic", 0, false, true); %>
                                </td>
                            </tr>

                        </table>
                    </div>

                    <div class="tab-page" id="seooption">
                        <h2 class="tab">SEO选项</h2>
                        <script type="text/javascript">
                <% if(KSCMS.S("TypeInfo")=="1"){%><%}else{%>
                            tabPane1.addTabPage(document.getElementById("seooption"));<%}%>
</script>

                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable">
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>社群META关键词</strong>：<br />
                                    <span style="color: #0000ff">针对搜索引擎设置的关键词</span>
                                </td>
                                <td class="righttd">
                                    <asp:TextBox CssClass="textbox textarea" ID="MetaKeyWord" runat="server" Rows="3" TextMode="MultiLine" Width="378px" Height="100px"></asp:TextBox>
                                    <a class="textarea_min" href="javascript:zoomtextarea(-5,'<%=this.MetaKeyWord.ClientID %>');"></a>
                                    <a class="textarea_max" href="javascript:zoomtextarea(5,'<%=this.MetaKeyWord.ClientID %>');"></a>
                                    <br />
                                    <span class="tips">社群页调用标签：{$GetClassMetaKeyWords}</span>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" class="lefttd" style="height: 76px; width: 145px;">
                                    <strong>社群META网页描述：<br />
                                    </strong><span style="color: #0000ff">针对搜索引擎设置的网页描述</span> </td>
                                <td class="righttd" style="height: 76px">
                                    <asp:TextBox CssClass="textbox textarea" ID="MetaDescript" runat="server" Rows="3" TextMode="MultiLine" Width="376px" Height="100px"></asp:TextBox>
                                    <a class="textarea_min" href="javascript:zoomtextarea(-5,'<%=this.MetaDescript.ClientID %>');"></a>
                                    <a class="textarea_max" href="javascript:zoomtextarea(5,'<%=this.MetaDescript.ClientID %>');"></a>
                                    <br />
                                    <span class="tips">社群页调用标签：{$GetClassMetaDescript}</span>
                                </td>
                            </tr>
                        </table>
                    </div>

                    <div class="tab-page" id="add">
                        <h2 class="tab">加入权限</h2>
                        <script type="text/javascript">
                       <% if(KSCMS.S("TypeInfo")=="1"){%><%}else{%>
                            tabPane1.addTabPage(document.getElementById("add"));<%}%>
                            jQuery(document).ready(function () {
                                showIsInVite();
                                showRelatedBuy();
                                showBrowseRow();
                            });
                            function showIsInVite() {
                                 var IsInViteStatus = jQuery("#<%=this.IsInViteRadioButtonList.ClientID%> :radio[checked]").val();//关联售卖

                                if (IsInViteStatus == '2') {
                                    $("#shoufei").show();
                                    $("#relatedbuy").show();
                                    GetRelateList();
                                    iszhekou();
                                } else {
                                    $("#shoufei").hide();
                                      $("#relatedbuy").hide();

                                }
                            }
                            //关联售卖
                            function showRelatedBuy() {
                                var relatedStatus = jQuery("#<%=this.isrelated_Buy.ClientID%> :radio[checked]").val();//关联售卖
                                if (relatedStatus == '1') {
                                    $("#relatedlist").show();
                                    GetRelateList();
                                } else {
                                    $("#relatedlist").hide();

                                }
                            }
                            function showBrowseRow() {
                                //可设置浏览的条数
                                var lookdStatus = jQuery("#<%=this.IsLook.ClientID%> :radio[checked]").val();
                                if (lookdStatus == '1') {
                                    $("#looktopicrow").show();
                                   
                                } else {
                                    $("#looktopicrow").hide();

                                }
                            }
                            function GetRelateList() {
                                //关联列表
                                var bindids = $("#bindids").val();
                                var roomids = $("#roomids").val();
                                var cosids = $("#cosids").val();
                                var cosliveids = $("#cosliveids").val();
                                 var cosfaceids = $("#cosfaceids").val();
                                LoadRelate(bindids, roomids,cosids,cosliveids,cosfaceids);
                            }

                            function CancelRelate(id, type) {
                                //取消关联
                               
                                var bindids = $("#bindids").val();
                                var roomids = $("#roomids").val();
                                var cosids = $("#cosids").val();
                                var cosliveids = $("#cosliveids").val();
                                var cosfaceids = $("#cosfaceids").val();
                                var temp1 = (cosids + ",").split(",");
                                var temp5 = (cosliveids + ",").split(",");
                                var temp0 = (cosfaceids + ",").split(",");
                                var temp3 = (bindids + ",").split(",");
                                var temp6 = (roomids + ",").split(",");
                                var tempids3 = '';
                                var tempids6 = '';
                                var tempids1 = '';
                                var tempids5 = '';
                                 var tempids0 = '';
                                if (type == '3') {//专栏

                                    for (var i = 0; i <= temp3.length; i++) {

                                        if (parseInt(temp3[i]) != parseInt(id)) {

                                            if (tempids3 == '') {
                                                tempids3 = temp3[i];
                                            } else {
                                                tempids3 += ',' + temp3[i];
                                            }
                                        }

                                    }
                                    $("#bindids").val(tempids3);
                                    LoadRelate(tempids3, roomids,cosids,cosliveids,cosfaceids);
                                } else if (type == '6') {//班级
                                    for (var i = 0; i <= temp6.length; i++) {

                                        if (parseInt(temp6[i]) != parseInt(id) && parseInt(temp6[i]) > 0) {

                                            if (tempids6 == '') {
                                                tempids6 = temp6[i];
                                            } else {
                                                tempids6 += ',' + temp6[i];
                                           }
                                        }
                                    }
                                    $("#roomids").val(tempids6);
                                    LoadRelate(bindids, tempids6,cosids,cosliveids,cosfaceids);
                                }
                                else if (type == '1') {//点播
                                    for (var i = 0; i <= temp1.length; i++) {

                                        if (parseInt(temp1[i]) != parseInt(id) && parseInt(temp1[i]) > 0) {

                                            if (tempids1 == '') {
                                                tempids1 = temp1[i];
                                            } else {
                                                tempids1 += ',' + temp1[i];
                                           }
                                        }
                                    }
                                    $("#cosids").val(tempids1);
                                    LoadRelate(bindids, roomids,tempids1,cosliveids,cosfaceids);
                                }
                                else if (type == '5') {//直播
                                    for (var i = 0; i <= temp5.length; i++) {

                                        if (parseInt(temp5[i]) != parseInt(id) && parseInt(temp5[i]) > 0) {

                                            if (tempids5 == '') {
                                                tempids5 = temp5[i];
                                            } else {
                                                tempids5 += ',' + temp5[i];
                                           }
                                        }
                                    }
                                    $("#cosliveids").val(tempids5);
                                    LoadRelate(bindids, roomids,cosids,tempids5,cosfaceids);
                                }
                                else if (type == '0') {//面授
                                    for (var i = 0; i <= temp0.length; i++) {

                                        if (parseInt(temp0[i]) != parseInt(id) && parseInt(temp0[i]) > 0) {

                                            if (tempids0 == '') {
                                                tempids0 = temp0[i];
                                            } else {
                                                tempids0 += ',' + temp0[i];
                                           }
                                        }
                                    }
                                    $("#cosfaceids").val(tempids0);
                                    LoadRelate(bindids, roomids,cosids,cosliveids,tempids0);
                                }
                            }
                            function LoadRelate(bindids, roomids,cosids,cosliveids,cosfaceids) {
                                //加载关联数据；
                                $.ajax({
                                    url: "KS.BBSCategory.aspx?action=getrelatelist&bindids=" + bindids + "&roomids=" + roomids+"&cosids="+cosids+"&cosliveids="+cosliveids+"&cosfaceids="+cosfaceids,
                                    context: document.body,
                                    type: "GET",
                                    success: function (data) {

                                        $("#itemlist").html(data);


                                    }
                                });
                            }
                            //选择关联
                            function SelectRelate() {
                                var bindids = $("#bindids").val();
                                var roomids = $("#roomids").val();
                                 var cosids = $("#cosids").val();
                                var cosliveids = $("#cosliveids").val();
                                var cosfaceids = $("#cosfaceids").val();
                                parent.openWin('添加专栏/班级', '/Plus/Course/SelectRelateList.aspx?action=group&flag=3&bindids=' + bindids + '&roomids=' + roomids+"&cosids="+cosids+"&cosliveids="+cosliveids+"&cosfaceids="+cosfaceids, false, 1100, 700);
                            }
                            function iszhekou() {
                                var ISLoad = jQuery("#<%=this.ISLoad.ClientID %> :radio[checked]").val();
                              if (ISLoad == "1") {
                              //折扣价
                            jQuery("#<%=this.Iszhekou.ClientID %>").css("display", "");
                               jQuery("#<%=this.IsFixedPrice.ClientID %>").css("display", "none");
                           } else if (ISLoad == "0") {
                               //免费
                               jQuery("#<%=this.Iszhekou.ClientID %>").css("display", "none");
                               jQuery("#<%=this.IsFixedPrice.ClientID %>").css("display", "none");
                           } else {
                               //固定价格
                               jQuery("#<%=this.Iszhekou.ClientID %>").css("display", "none");
                               jQuery("#<%=this.IsFixedPrice.ClientID %>").css("display", "");
                                }
                            }
                        </script>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable">
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>加入权限：</strong><br />
                                </td>
                                <td class="tag_left">
                                    <asp:RadioButtonList ID="IsInViteRadioButtonList" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal" onclick="showIsInVite()">
                                        <asp:ListItem Value="1" Selected="True">免费</asp:ListItem>
                                        <asp:ListItem Value="2">收费</asp:ListItem>
                                        <asp:ListItem Value="0">申请加入</asp:ListItem>
                                    </asp:RadioButtonList>

                                </td>
                            </tr>
                            <tbody id="shoufei" style="display:none">
                            <tr>
                                <td align="right" class="lefttd" height="30" style="width: 155px;">
                                    <strong>社群价格：</strong></td>
                                <td class="righttd">
                                    <asp:TextBox ID="TxtPrice" CssClass="textbox" runat="server" Width="75px" Style="text-align: center" Text="60"></asp:TextBox>元
                                </td>
                            </tr>
                            <tr>
                                <td align="right" class="lefttd" height="30" style="width: 155px;">
                                    <strong>VIP用户：</strong></td>
                                <td class="righttd">
                                    <asp:RadioButtonList ID="ISLoad" runat="server" RepeatDirection="Horizontal" onclick="iszhekou()">
                                        <asp:ListItem Value="0" Selected="True">免费</asp:ListItem>
                                        <asp:ListItem Value="1">收费</asp:ListItem>
                                        <asp:ListItem Value="2">固定价格</asp:ListItem>
                                    </asp:RadioButtonList>

                                    <span id="Iszhekou" runat="server" style="display: none">折扣：<asp:TextBox ID="Loadzhekou" Style="text-align: center; width: 75px" CssClass="textbox" runat="server" Text="5"></asp:TextBox>折（请输入1-10范围之内，例如 8.5 或者 6 ）</span>
                                    <span id="IsFixedPrice" runat="server" style="display: none">固定价格：<asp:TextBox ID="FixedPrice" Style="text-align: center; width: 75px" CssClass="textbox" runat="server" Text="30"></asp:TextBox>元</span>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" class="lefttd" height="30" style="width: 155px;">
                                    <strong>指定用户组免费：</strong></td>
                                <td class="righttd">
                                     <asp:Label ID="Label1" runat="server"></asp:Label>
                             </td>
                            </tr>
                            <tr style="display: none">
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>发帖权限：</strong>：<br />
                                </td>
                                <td class="tag_left">
                                    <asp:RadioButtonList ID="AllowAddRadioButtonList" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                                        <asp:ListItem Value="0" Selected="True">不允许</asp:ListItem>
                                        <asp:ListItem Value="1">允许</asp:ListItem>
                                    </asp:RadioButtonList>
                            </tr>
                         </tbody>
                            <%if(BaseFun.CheckTableExists("KS_CosBundleSale")){ %>
                           <tbody id="relatedbuy" style="display:none">
                         <tr>
                            <td align="right" class="lefttd" height="30" style="width:258px;"><strong>是否支持关联售卖：</strong></td>
                            <td class="righttd">
                                <asp:RadioButtonList ID="isrelated_Buy" onclick="showRelatedBuy()" runat="server" RepeatDirection="Horizontal" Height="24px">
                                    <asp:ListItem Value="1" >支持关联售卖</asp:ListItem>
                                    <asp:ListItem Value="0" Selected="True">不支持</asp:ListItem>
                                </asp:RadioButtonList>
                               
                            </td>
                        </tr>
                     
                    <tr id="relatedlist" style="display:none">
                        <td align="right" class="lefttd" height="30" style="width: 258px">
                              <input name="bindids" id="bindids"     type="hidden"  />
                             <input name="roomids" id="roomids"    type="hidden"/>
                            <input name="cosids" id="cosids"    type="hidden"/>
                            <input name="cosliveids" id="cosliveids"    type="hidden"/>
                            <input name="cosfaceids" id="cosfaceids"    type="hidden"/>
                            <input type="button" name="addCourse" id="addcourse" class="button button_on" value="添加专栏/班级" onclick="SelectRelate();" style=" margin-right:15px;"/></td>
                        <td class="righttd">
                            <table border="0" class="CTable nTable" cellpadding="0" cellspacing="0" style="margin-left: 5px;" width="96%">
                                <tr bgcolor='#f2f4f7'>
                                    <td width='9%' height='30' align='center'>名称</td>
                                    <td align='center'>价格</td>
                                    <td align='center'>类型</td>
                                    <td align='center'>操作</td>

                                </tr>
                                <tbody id="itemlist">
                                </tbody>
                
                         </table>

                        </td>
                    </tr>
                    </tbody>
                     <%} %>
                     
                            <tr>
                                <td height="30" align="right" class="lefttd" style="width: 145px">
                                    <strong>未加入社群是否允许浏览</strong>：<br />
                                </td>
                                <td class="righttd">
                                    <asp:RadioButtonList ID="IsLook" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" onclick="showBrowseRow()">
                                        <asp:ListItem Value="0" Selected="True">不允许</asp:ListItem>
                                        <asp:ListItem Value="1">允许浏览部分</asp:ListItem>
                                         <asp:ListItem Value="2">允许浏览全部</asp:ListItem>
                                    </asp:RadioButtonList>
                                    <br />
                                    <span id="looktopicrow"  style="display: none">
                                       设置可浏览话题条数： <asp:TextBox ID="TxtTopicNum" Style="text-align: center; width: 75px" CssClass="textbox" runat="server"></asp:TextBox>
                                        </span>
                                </td>
                            </tr>
                        </table>

                    </div>

                </div>
                <div style="display: none;">
                    <KS:Foot ID="Foot1" runat="server" OnSubmit="SaveButton_Click" />
                </div>

                <div class="main-button" style="text-align: center;">
                    <asp:Button ID="Button1" runat="server" Text="确定保存(O)" OnClick="SaveButton_Click" CssClass="button" />
                   <%-- <a href="/plus/Plus.Group/KS.BBSCategory.aspx?TypeInfo=<%=KSCMS.S("TypeInfo")%>" class="button" >取消返回(C)</a>--%>
                    <a href="KS.BBSCategory.aspx" class="button" >取消返回(C)</a>
                </div>
            </div>
        </div>
    </asp:Panel>
</asp:Content>
