<!-- #include file="setup.asp" -->

<%
top
if Request.Cookies("username")=empty then error("<li>您还未<a href=login.asp>登录</a>社区")
%>


<table border=0 width=97% align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3>
<td height=25>&nbsp;<img src=images/Forum_nav.gif>&nbsp; <%ClubTree%> → <a href="zt.asp">转贴工具</a></td>
</tr>
</table><br>


<SCRIPT>valigntop()</SCRIPT>
<BODY>
<div align="center">
    <TEXTAREA class=textarea onbeforepaste="if(document.getElementById('x_paste').checked){window.clipboardData.setData('text',trans());this.focus();}" id=text style="WIDTH: 97%; HEIGHT: 200px"></TEXTAREA>
  <BR>
    <IFRAME 
id=rtf style="WIDTH: 0px; HEIGHT: 0px" marginWidth=0 marginHeight=0 
src="about:blank" scrolling=no></IFRAME>
	<SCRIPT>valignbottom()</SCRIPT>
  <INPUT onclick="document.getElementById('text').value += trans()" type=button value=转换剪切版超文本数据> 
  <INPUT id=x_paste type=checkbox> 
  <LABEL for=x_paste>启用超文本粘贴转换</LABEL>
  
    <table height="193" cellpadding="0" cellspacing="0">
      <tr>
        <td width="97%">本工具主要用途： </td>
      </tr>
      <tr>
        <td width="97%">你可以通过本工具将一篇图文并茂的教程或者文章、帖子直接转贴到本论坛，而不用在发贴时将图片一张张插入贴子或者上传,转贴非常方便!</td>
      </tr>
      <tr>
        <td width="97%"></td>
      </tr>
      <tr>
        <td width="97%">本工具使用方法： </td>
      </tr>
      <tr>
        <td width="97%">1、首先选择您要转贴的图片和文字,并点击右键复制(ctrl+c) </td>
      </tr>
      <tr>
        <td width="97%">2、然后到本转换页面，直接按下“转换剪贴板超文本数据” </td>
      </tr>
      <tr>
        <td width="97%">3、转换好的代码将出现在上面的对话框中 </td>
      </tr>
      <tr>
        <td width="97%">4、复制对话框中的代码，发表新话题时粘贴过来就可以了。 </td>
      </tr>
      <tr>
        <td width="97%"></td>
      </tr>
      <tr>
        <td width="97%">本工具不支持将本站内容转出，如有疑问，请到帮助区询问。 </td>
      </tr>
    </table>
  <p>&nbsp;</p>
    <p>
      <SCRIPT>

rtf.document.designMode="On";



function html_trans(str) {
	str = str.replace(/\r/g,"");
	str = str.replace(/on(load|click|dbclick|mouseover|mousedown|mouseup)="[^"]+"/ig,"");
	str = str.replace(/<script[^>]*?>([\w\W]*?)<\/script>/ig,"");
	
	str = str.replace(/<a[^>]+href="([^"]+)"[^>]*>(.*?)<\/a>/ig,"\n[url=$1]$2[/url]\n");
	
	str = str.replace(/<font[^>]+color=([^ >]+)[^>]*>(.*?)<\/font>/ig,"\n[color=$1]$2[/color]\n");
	
	str = str.replace(/<img[^>]+src="([^"]+)"[^>]*>/ig,"\n[img]$1[/img]\n");
	
	str = str.replace(/<([\/]?)b>/ig,"[$1b]");
	str = str.replace(/<([\/]?)strong>/ig,"[$1b]");
	str = str.replace(/<([\/]?)u>/ig,"[$1u]");
	str = str.replace(/<([\/]?)i>/ig,"[$1i]");
	
	str = str.replace(/&nbsp;/g," ");
	str = str.replace(/&amp;/g,"&");
	str = str.replace(/&quot;/g,"\"");
	str = str.replace(/&lt;/g,"<");
	str = str.replace(/&gt;/g,">");
	
	str = str.replace(/<br>/ig,"\n");
	str = str.replace(/<[^>]*?>/g,"");
	str = str.replace(/\[url=([^\]]+)\]\n(\[img\]\1\[\/img\])\n\[\/url\]/g,"$2");
	str = str.replace(/\n+/g,"\n");
	
	return str;
}

function trans(){
	var str = "";
	rtf.focus();
	rtf.document.body.innerHTML = "";
	rtf.document.execCommand("paste");
	str = rtf.document.body.innerHTML;
	if(str.length == 0) {
		alert("剪切版不存在超文本数据！");
		return "";
	}
	return html_trans(str);
}
    </SCRIPT>
    </p>
</div>
</BODY>

<%
htmlend
%>