<!--<?php
if($rg_allowregister == 1){print <<<EOT
-->
<div class="p10">
	<h5 class="h5 mb10"><strong class="mr20">通過鏈接邀請</strong></h5>
	<div class="mb10">
		<div class="mb5">通過這個鏈接注冊後，你們可以直接成為好友</div>
		<div class="mb20"><input type="text" class="input mr5" size="90" value="$spaceurl" id="copy_invite"><span class="btn2"><span><button type="button" onclick="copyUrl(getObj('copy_invite').value)">復制鏈接</button></span></span></div>
<!--
EOT;
	if ($inv_linkopen) {print <<<EOT
-->
		<div>
<!--
EOT;
		if ($inv_linktype) {print <<<EOT
-->
			<div class="mb5">通過這個鏈接注冊後，你可以獲得<span class="s2">{$inv_linkscore}個{$credit->cType[$inv_linkcredit]}</span>獎勵</div>
<!--
EOT;
		} else {print <<<EOT
-->
			<div class="mb5">通過這個鏈接訪問後，你可以獲得<span class="s2">{$inv_linkscore}個{$credit->cType[$inv_linkcredit]}</span>獎勵</div>
<!--
EOT;
		}
$inviteUsername = rawurlencode($windid);
print <<<EOT
-->
			<div class="mb10"><input type="text" value="$db_bbsurl/index.php?a=$inviteUsername" class="input mr5" size="90" id="copy_username"><span class="btn2"><span><button type="button" onclick="copyUrl(getObj('copy_username').value)">復制鏈接</button></span></span></div>
			<div><input type="text" value="$db_bbsurl/index.php?u=$winduid" class="input mr5" size="90" id="copy_uid"><span class="btn2"><span><button type="button" onclick="copyUrl(getObj('copy_uid').value)">復制鏈接</button></span></span></div>
		</div>
<!--
EOT;
	}print <<<EOT
-->
	</div>
</div>
<script type="text/javascript">
function copyUrl(url) {
	if (is_ie) {
		if(window.clipboardData.setData("Text",url)){
			showDialog('success','已成功復制',1);
		}
	} else {
		prompt('按下 Ctrl+C 復制到剪貼板', url)
	}
}
</script>
<!--
EOT;
if($ml_mailifopen){print <<<EOT
-->
<div class="p10">
<h5 class="h5"><strong class="mr20">通過電子郵箱邀請</strong>（網站不會記錄您的任何賬號、密碼信息）</h5>
<div class="mb20">
<ul class="half mailadd cc">
<!--
EOT;
if(function_exists('curl_init')){print <<<EOT
-->
   	<li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=friendinvite&step=email');"><p>導入電子郵箱通訊錄至邀請名單</p>支持<b class="s4">126、163、Gmail</b>等3種郵箱</a></li>
    <li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=friendinvite&step=msn');"><p>導入MSN聯系人至邀請名單</p>導入<b class="s4">MSN</b>賬戶中的聯系人名單</a></li>
<!--
EOT;
}print <<<EOT
-->
    <li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=friendinvite&step=simple');"><p>直接發送邀請郵件</p>直接向對方的電子郵箱發送邀請郵件</a></li>
    <li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=friendinvite&step=csv');"><p>導入電子郵箱客戶端聯系人備份文件</p>支持<b class="s4">csv</b>備份文件導入</a></li>
</ul>
</div>
</div>
<!--
EOT;
}if(!$ml_mailifopen && !$inv_linkopen){
print <<<EOT
-->
<div class="p15 tac f14">您還沒有開啟宣傳鏈接或者電子郵箱功能</div>
<!--
EOT;
}}elseif ($rg_allowregister == 2) {print <<<EOT
-->
<script type="text/javascript">
function inviteCode(form,type){
	var content = '';
	var str = type == 'copy' ? "\\n" : ',';
    var url = type == 'copy' ? '$db_bbsurl/$db_registerfile?invcode=' : '';
	for (var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		if (e.type == 'checkbox' && e.checked == true && e.value != 'all') {
			content += url + e.value + str;
		}
	}
	if(content == ''){
		showDialog('error','請選擇要發送的邀請碼',0);
		return false;
	}
	if(type == 'copy'){
		if (is_ie) {
			if(window.clipboardData.setData("Text",content)){
				showDialog('success','已成功復制',1);
			}
		} else {
			prompt('按下 Ctrl+C 復制到剪貼板', content)
		}
	}else{
	     sendmsg('pw_ajax.php?action=friendinvite&step=simple&invcode='+content);
	}
}
</script>
<div class="c mb10">&nbsp;</div>
<!--
EOT;
if(empty($invdb)){
print <<<EOT
-->
<div class="p15 tac f14">沒有可用的邀請碼，請到<a href="u.php?a=friend&type=inviteCode">邀請碼管理</a>中購買</div>
<!--
EOT;
}else{
print <<<EOT
-->
<div class="p10">
<h5 class="h5 mb10"><strong class="mr20">邀請碼</strong></h5>
<form method="post" action="" name="INVLINKS">
<table width="100%" class="tA mb10">
    <tr class="tr">
     	<td>
     		<label><input name="" type="checkbox" value="all" onclick="CheckAll(this.form)"> 全選</label>
		</td>
        <td>可用邀請鏈接</td>
        <td>有效期</td>
    </tr>
<!--
EOT;
foreach($invdb as $key => $value){
$invlink = $db_bbsurl.'/'.$db_registerfile.'?invcode=' . $value['invcode'];
print <<<EOT
-->
    <tr>
    	<td><input name="invlink" type="checkbox" value="{$value[invcode]}"></td>
        <td><input type="text" value="{$invlink}" class="input" size="80" readonly="readonly"/></td>
        <td><p>{$value[overtime]}</p></td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
    <tr class="tr">
    	<td><label><input name="" type="checkbox" value="all" onclick="CheckAll(this.form)"> 全選</label></td>
      <td><span class="bt2"><span><button type="button" onclick="inviteCode(document.INVLINKS,'copy')">復制邀請鏈接到剪切板</button></span></span><span class="btn2"><span><button type="button" onclick="inviteCode(document.INVLINKS)">通過電子郵箱發送邀請鏈接</button></span></span></td>
      <td>&nbsp;</td>
    </tr>
</table>	
<div class="cc">{$pages}</div>
</form>
</div>
<!--
EOT;
}}?>-->