<%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
<%@ Page language="c#" Inherits="Discuz.ForumPage.Admin.updateforumstatic" Codebehind="forum_updateforumstatic.aspx.cs" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML >
	<HEAD>
		<title>updateforumstatic</title>
		<link href="../styles/dntmanager.css" type="text/css" rel="stylesheet"> 
		<script language="javascript" src="../js/common.js"></script>
		<script language="javascript1.2" type="text/javascript">		
     
    var lastnumber=0;
    var currentnum=0;
     
    function runstatic(opname,pertask)
    {  
      if(lastnumber>-1)
      { 
         currentnum=lastnumber/1+pertask/1;    // alert(currentnum);

         var result;
         switch (opname)      
         {
            case "ReSetFourmTopicAPost":     result="\r\n重建论坛帖数:"+lastnumber+" 至 "+currentnum;break
            case "ReSetUserDigestPosts":     result="\r\n重建用户精华帖数"+lastnumber+" 至 "+currentnum;break
            case "ReSetUserPosts":           result="\r\n重建用户发帖数"+lastnumber+" 至 "+currentnum;break
            case "ReSetTopicPosts":          result="\r\n重建主题帖数"+lastnumber+" 至 "+currentnum;break
         }
         
		 document.getElementById('Layer5').innerHTML ="<br /><table><tr><td valign=top><img border=\"0\" src=\"../images/ajax_loading.gif\"  /></td><td valign=middle style=\"font-size: 14px;\" >"+result+"<BR /></td></tr></table><BR />";
         document.getElementById('success').style.display ="block"; 
        
         lastnumber=getReturn('forum_runforumstatic.aspx?opname='+opname+'&lastnumber='+lastnumber+'&pertask='+pertask);
         //alert(lastnumber);
         if(lastnumber==null)
         {
            document.getElementById('Layer5').innerHTML="<br />操作成功执行";
            document.getElementById('success').style.display = "block";
		    count(); 
		    document.getElementById('Form1').submit();
         }
        }
      else
      {
         document.getElementById('Layer5').innerHTML="<br />操作成功执行";
         document.getElementById('success').style.display = "block";
		 count(); 
		 document.getElementById('Form1').submit();
      }
   }
   
   function clearflag()
   {
         bar=0;
         document.getElementById('Layer5').innerHTML="<br />操作成功执行";
         document.getElementById('success').style.display = "block";
		 count(); 
   }
    
    
   var bar=0;
   function count()
   { 
			bar=bar+4;
		    if (bar<99) {setTimeout("count()",100);} 
			else { document.getElementById('success').style.display ="none"; } 
   }
    
   function run(opname,pertask)
   {
      if(pertask=="")
      {   
          alert('每个循环更新数量不能为空!');return;
      }
      lastnumber=0;
      currentnum=0;
      bar=0;
      
      document.getElementById('Layer5').innerHTML="<br /><table><tr><td valign=top><img border=\"0\" src=\"../images/ajax_loading.gif\"  /></td><td valign=middle style=\"font-size: 14px;\" >正在处理数据, 请稍等...<BR /></td></tr></table><BR />";
      document.getElementById('success').style.display = "block";
      //runstatic(opname,pertask);
      setInterval('runstatic("'+opname+'",'+pertask+')',1000); //每次提交时间为1秒
   }
   
   
   var result=0;
   function run2(opname,startvalue,endvalue)
   {
    
      document.getElementById('Layer5').innerHTML="<br /><table><tr><td valign=top><img border=\"0\" src=\"../images/ajax_loading.gif\"  /></td><td valign=middle style=\"font-size: 14px;\" >正在处理数据, 请稍等...<BR /></td></tr></table><BR />";
      document.getElementById('success').style.display = "block";
      //alert(opname); 
      pageurl='forum_runforumstatic.aspx?opname='+opname+'&startvalue='+startvalue+'&endvalue='+endvalue;
      setTimeout('getforumdata("'+pageurl+'")',1000); //每次提交时间为5秒
   }


    function getforumdata(pageurl)
    {
      //alert(pageurl);
      result=getReturn(pageurl);
      //alert(result);
      if((result>0)||(result==null))
      {
			bar=0;
            document.getElementById('Layer5').innerHTML="<br />操作成功执行";
            document.getElementById('success').style.display = "block";
            count();
		    document.getElementById('Form1').submit();
      }
      result=0;
    }
	</script>
	</HEAD>
	<body>
		<form id="Form1" runat="server">
		<div style="width:98%;margin:0 auto;">
		  <table cellspacing="1" cellpadding="4" width="100%" class="tableborder">
				<tr>
					<TD class="td1" width="25%"><b>重建论坛全部帖数:</b></TD>
					<TD class="td1" width="40%">
						每个循环更新数量:&nbsp;&nbsp;&nbsp;&nbsp;
						<cc1:TextBox id="pertask1" runat="server" Text="15" RequiredFieldType="暂无校验" size="5"></cc1:TextBox></TD>
					<td class="td1">
					    <span id="ReSetFourmTopicAPost_id"  onmouseover="showhintinfo(this,0,0,'','重建论坛全部帖数','50','up');" onmouseout="hidehintinfo();"><span>
						<button type="button" id="ReSetFourmTopicAPost_id" class="ManagerButton" onclick="javascript:run('ReSetFourmTopicAPost',pertask1.value);"><img src="../images/submit.gif" />提 交</button>
				        </span></span>
				    </td>
				</tr>
				<tr >
					<TD class="td2"><b>重建全部用户精华帖数:</b></TD>
					<TD class="td2">每个循环更新数量:&nbsp;&nbsp;&nbsp;&nbsp;
						<cc1:TextBox id="pertask2" runat="server" Text="1000" RequiredFieldType="暂无校验" size="5"></cc1:TextBox></TD>
					<td class="td2">
			            <span id="ReSetUserDigestPosts_id"  onmouseover="showhintinfo(this,0,0,'','重建全部用户精华帖数','50','up');" onmouseout="hidehintinfo();"><span>
						<button id="ReSetUserDigestPosts_id" type="button" class="ManagerButton" onclick="javascript:run('ReSetUserDigestPosts',pertask2.value);"><img src="../images/submit.gif" />提 交</button>
						</span></span>
					</td>
				</tr>
				<TR>
					<TD class="td1"><b>重建全部用户发帖数:</b></TD>
					<TD class="td1">每个循环更新数量:&nbsp;&nbsp;&nbsp;&nbsp;
						<cc1:TextBox id="pertask3" runat="server" Text="1000" RequiredFieldType="暂无校验" size="5"></cc1:TextBox></TD>
					<TD class="td1">
					    <span id="ReSetUserPosts_id"  onmouseover="showhintinfo(this,0,0,'','重建全部用户发帖数','50','up');" onmouseout="hidehintinfo();"><span>
						<button id="ReSetUserPosts_id" type="button" class="ManagerButton" onclick="javascript:run('ReSetUserPosts',pertask3.value);"><img src="../images/submit.gif" />提 交</button>
						</span></span>
				</TD>
				</TR>
				<TR>
					<TD class="td2"><b>重建全部主题帖数:</b></TD>
					<TD class="td2">每个循环更新数量:&nbsp;&nbsp;
							<cc1:TextBox id="pertask4" runat="server" Text="500" RequiredFieldType="暂无校验" size="5"></cc1:TextBox></TD>
					<TD class="td2">
					    <span id="ReSetTopicPosts_id"  onmouseover="showhintinfo(this,0,0,'','重建全部主题帖数','50','up');" onmouseout="hidehintinfo();"><span>
						<button id="ReSetTopicPosts_id" type="button" class="ManagerButton" onclick="javascript:run('ReSetTopicPosts',pertask4.value);" ><img src="../images/submit.gif" />提 交</button>
						</span></span>		
					</TD>
				</TR>
		  </table>	
		<hr style="border-top:0; border-bottom:1px solid #ccc;" size="1" />
		   <table cellspacing="1" cellpadding="4" width="100%" class="tableborder">
				<tr>
					<TD class="td1" width="25%"><b>重建指定论坛区间帖数:</b></TD>
					<TD class="td1" width="40%">
						开始版块FID:
						<cc1:TextBox id="startfid" runat="server" Text="1" RequiredFieldType="数据校验" size="10"></cc1:TextBox><br />
						结束版块FID:
						<cc1:TextBox id="endfid" runat="server" Text="20" RequiredFieldType="数据校验" size="10"></cc1:TextBox>
					</TD>
					<td class="td1" >
					    <span id="ReSetFourmTopicAPost_StartEnd_id"  onmouseover="showhintinfo(this,0,0,'','重建指定论坛区间帖数','50','up');" onmouseout="hidehintinfo();"><span>
						<button id="ReSetFourmTopicAPost_StartEnd_id" type="button" class="ManagerButton" onclick="javascript:run2('ReSetFourmTopicAPost_StartEnd',startfid.value,endfid.value);"><img src="../images/submit.gif" />提 交</button>
						</span></span>
					</td>
				</tr>				
				<tr>
					<TD class="td2"><b>重建指定用户区间精华帖数:</b></TD>
					<TD class="td2">
						开始用户UID:
						<cc1:TextBox id="startuid_digest" runat="server" Text="1" RequiredFieldType="暂无校验" size="10"></cc1:TextBox><br />
						结束用户UID:
						<cc1:TextBox id="enduid_digest" runat="server" Text="20" RequiredFieldType="暂无校验" size="10"></cc1:TextBox>
					</TD>
					<td class="td2">
					    <span id="ReSetUserDigestPosts_StartEnd_id"  onmouseover="showhintinfo(this,0,0,'','重建指定用户区间精华帖数','50','up');" onmouseout="hidehintinfo();"><span>
						<button id="ReSetUserDigestPosts_StartEnd_id" type="button" class="ManagerButton" onclick="javascript:run2('ReSetUserDigestPosts_StartEnd',startuid_digest.value,enduid_digest.value);"><img src="../images/submit.gif" />提 交</button>
						</span></span>
					</td>
				</tr>
				
					<tr>
					<TD class="td1"><b>重建指定用户区间发帖数:</b></TD>
					<TD class="td1">
						开始用户UID:
						<cc1:TextBox id="startuid_post" runat="server" Text="1" RequiredFieldType="暂无校验" size="10"></cc1:TextBox><br />
						结束用户UID:
						<cc1:TextBox id="enduid_post" runat="server" Text="20" RequiredFieldType="暂无校验" size="10"></cc1:TextBox>
					</TD>
					<td class="td1">
					    <span id="ReSetUserPosts_StartEnd_id"  onmouseover="showhintinfo(this,0,0,'','重建指定用户区间发帖数','50','up');" onmouseout="hidehintinfo();"><span>
						<button id="ReSetUserPosts_StartEnd_id" type="button" class="ManagerButton" onclick="javascript:run2('ReSetUserPosts_StartEnd',startuid_post.value,enduid_post.value);"><img src="../images/submit.gif" />提 交</button>
						</span></span>
					</td>
				</tr>
				
				<tr>
					<TD class="td2"><b>重建指定主题区间帖数:</b></TD>
					<TD class="td2">
						开始主题TID:
						<cc1:TextBox id="starttid" runat="server" Text="1" RequiredFieldType="暂无校验" size="10"></cc1:TextBox><br />
						结束主题TID:
						<cc1:TextBox id="endtid" runat="server" Text="20" RequiredFieldType="暂无校验" size="10"></cc1:TextBox>
					</TD>
					<td class="td2">
					    <span id="ReSetTopicPosts_StartEnd_id"  onmouseover="showhintinfo(this,0,0,'','重建指定主题区间帖数','50','up');" onmouseout="hidehintinfo();"><span>
						<button id="ReSetTopicPosts_StartEnd_id" type="button" class="ManagerButton" onclick="javascript:run2('ReSetTopicPosts_StartEnd',starttid.value,endtid.value);"><img src="../images/submit.gif" />提 交</button>
						</span></span>
				    </td>
				</tr>
				
		  </table>		
		<hr style="border-top:0; border-bottom:1px solid #ccc;" size="1" />
		  <table cellspacing="1" cellpadding="4" width="100%" class="tableborder">
			<TR> 
			  <TD class="td1" width="25%"><b>清理移动标记:</b></TD>
			  <TD class="td1" width="40%"></TD>
			  <TD class="td1"> <cc1:Button ID="SubmitClearFlag" runat="server" HintInfo="清理移动标记" Text="提 交" /></TD>
			</TR>
			<TR> 
			  <TD class="td2"><b>重建论坛统计(表)数据:</b></TD>
			  <TD class="td2"></TD>
			  <TD class="td2"> <cc1:Button ID="ReSetStatistic" runat="server" HintInfo="重建论坛统计(表)数据" Text="提 交" /></TD>
			</TR>
			<TR> 
			  <TD colspan="2" class="td1"><b>系统调整论坛版块:</b></TD>
			  <TD class="td1"> <cc1:Button ID="SysteAutoSet" runat="server" HintInfo="系统调整论坛版块,对论坛版块表中的链接, 子版数等相关内容进行调整. " Text="提 交" /></TD>
			</TR>
			<asp:Panel ID="UpdateStoreProcPanel" Visible="true" runat="server">
			<TR> 
			  <TD class="td2"><b>更新分表存储过程:</b></TD>
			  <TD class="td2"></TD>
			  <TD class="td2"> <cc1:Button ID="UpdatePostSP" runat="server" HintInfo="更新分表存储过程" Text="提 交" /></TD>
			</TR>
			</asp:Panel>
			<TR> 
			  <TD class="td1"><b>更新分表最大和最小主题ID:</b></TD>
			  <TD class="td1"></TD>
			  <TD class="td1"><cc1:Button ID="UpdatePostMaxMinTid" runat="server" HintInfo="更新分表最大和最小主题ID" Text="提 交" /></TD>
			</TR>
			<TR> 
			  <TD colspan="2" class="td2"><b>为未建立全文索引的帖子表建立全文索引:</b></TD>
			  <TD class="td2"><cc1:Button id="CreateFullTextIndex" runat="server" Text="提 交" HintInfo="为未建立全文索引的帖子表建立全文索引,同时为已建全文索引的帖子表进行完全填充,操作时间与帖子数据量多少有关. 操作的结果要参见SqlServer相应数据库的“全文目录”的填充进度."></cc1:Button></TD>
			</TR>
			<TR> 
			  <TD colspan="2" class="td1"><b>更新所有版块的当前帖数:</b></TD>
			  <TD class="td1"><cc1:Button id="UpdateCurTopics" runat="server" Text="提 交" HintInfo="如果版块内主题数缺少或分页不准, 可执行此操作"></cc1:Button></TD>
			</TR>
		  </table>
		  <hr style="border-top:0; border-bottom:1px solid #ccc;" size="1" />
		  <table cellspacing="1" cellpadding="4" width="100%" class="tableborder">
		    <tr>
		        <td class="td1" width="25%"><b>更新我的主题:</b></td>
			    <td class="td1" width="40%"></td>
			    <td class="td1"><cc1:Button ID="UpdateMyTopic" runat="server" HintInfo="更新我的主题" Text="提 交" /></td>
		    </tr>
		    <tr>
		        <td class="td1"><b>更新我的帖子:</b></td>
			    <td class="td1"></td>
			    <td class="td1"><cc1:Button ID="UpdateMyPost" runat="server" HintInfo="更新我的帖子" Text="提 交" /></td>
		    </tr>
		  </table>
		  <cc1:Hint id="Hint1" runat="server" HintImageUrl="../images"></cc1:Hint>
		  </div>
		</form>
		<%=footer%>	
	</body>
</HTML>
