<!--<?php
require_once uTemplate::PrintEot('header');
require_once uTemplate::PrintEot('profile_left');
print <<<EOT
-->
<div class="contUser">
	<div class="p15">
		<h4 class="site"><span>隱私</span></h4>
		<div class="navC">
			<ul>
				<li{$privacyCurrent}><a href="profile.php?action=privacy" hidefocus="true">隱私設置</a></li>
				<li{$weiboCurrent}><a href="profile.php?action=privacy&t=weibo" hidefocus="true">新鮮事設置</a></li>
			</ul>
		</div>
<!--
EOT;
if (empty($t)) {print <<<EOT
-->
		<form action="profile.php?action=$action" method="post">
		<input type="hidden" name="verify" value="$verifyhash" />
		<input type="hidden" name="step" value="2" />
		<div class="p15">
			<div class="b f14 s7 mb10"><a name="space"></a>個人空間隱私</div>
			<table width="100%" class="setTable">
				<tr>
					<th class="th" style="width:180px;">個人空間</th>
					<td class="td">
						<select class="select_wa" name="privacy[index]" onchange="optionSelect(this.value)">
							<option value="0" $index_0 >任何人可見</option>
							<option value="1" $index_1 >僅好友可見</option>
							<option value="2" $index_2 >僅自己可見</option>
						</select>
					</td>
				</tr>
                <tr>
					<th class="th" style="width:180px;">個人資料</th>
					<td class="td">
						<select class="select_wa" name="privacy[info]" id="privacy1"> 
							<option value="0" $info_0 >任何人可見</option>                           
							<option value="1" $info_1 >僅好友可見</option>
							<option value="2" $info_2 >僅自己可見</option>                  
						</select>
					</td>
				</tr>
				<tr>
					<th class="th">空間留言</th>
					<td class="td"><select class="select_wa" name="privacy[msgboard]" id="privacy2">
						<option value="0" $msgboard_0 >任何人可見</option>
						<option value="1" $msgboard_1 >僅好友可見</option>  
						<option value="2" $msgboard_2 >僅自己可見</option>
					</select></td>
				</tr>
			</table>
			<div class="b f14 s7 mb10"><a name="friend"></a>加好友隱私</div>
			<table width="100%" class="setTable">
				<tr>
					<th class="th" style="width:180px;">加我為好友時身份驗證</th>
					<td class="td">
						<ul>
							<li class="lh_24"><label for="friendcheck0"><input type="radio" name="friendcheck" id="friendcheck0" value="0" $friend_0 /> 允許任何人加我為好友</label></li>
							<li class="lh_24"><label for="friendcheck1"><input type="radio" name="friendcheck" id="friendcheck1" value="1" $friend_1 /> 需要身份驗證才能加我為好友</label></li>
							<li class="lh_24"><label for="friendcheck2"><input type="radio" name="friendcheck" id="friendcheck2" value="2" $friend_2 /> 不允許任何人加我為好友</label></li>
						</ul>
					</td>
				</tr>
			</table>
			<div class="b f14 s7 mb10"><a name="friend"></a>加關注隱私</div>
			<table width="100%" class="setTable">
				<tr>
					<th class="th" style="width:180px;">黑名單設置</th>
					<td class="td">
						<div class="mb5"><textarea name="attentionblacklist" class="textareaA">$names</textarea></div>
						<div class="mb5">你可以添加對象到黑名單，被列為黑名單的用戶，將不能關注你，不能給你發評論，也不能提到你。</div>
						<div class="mb20">多個用戶用英文狀態下的逗號隔開，如︰張三,李四 </div>
					</td>
				</tr>
			</table>
			<div class="tac" style="padding:1em">
				<span class="btn"><span><button type="submit">提 交</button></span></span>
			</div>
		</div>
		</form>
<script>
var index_privacy = '$userdb[index_privacy]';
var info_privacy = '$userdb[info_privacy]';
var msgboard_privacy = '$userdb[msgboard_privacy]';
function setOptions(obj,id,type) {
	var opt0 = new Option('任何人可見',0);
	var opt1 = new Option('僅好友可見',1);
	var opt2 = new Option('僅自己可見',2);
	var defaultPrivacy = (type == 1) ? info_privacy : msgboard_privacy;
	obj.options.length=0;
	var defaultId;
    switch(id) {
    	case '0' :
            obj.options.add(opt0);
            obj.options.add(opt1);
            obj.options.add(opt2);
    		defaultId = defaultPrivacy;
    		break;
    	case '1' :
            obj.options.add(opt1);
            obj.options.add(opt2);
            defaultId = defaultPrivacy > 0 ? defaultPrivacy-1 : '';
            break;
    	case '2' :
        	obj.options.add(opt2);
        	defaultId = defaultPrivacy > 1 ? defaultPrivacy-2 : '';
        	break;
		default:
            obj.options.add(opt0);
            obj.options.add(opt1);
            obj.options.add(opt2);
    		break;
    }
	if (defaultId) {
		obj.options.selectedIndex = defaultId;
	}
}
function optionSelect(id) {
	   var optionobj1 = getObj('privacy1');
	   var optionobj2 = getObj('privacy2');
	   setOptions(optionobj1,id,1);
	   setOptions(optionobj2,id,2); 
}

window.onReady(function(){
	optionSelect(index_privacy);
});
</script>
<!--
EOT;
} else {print <<<EOT
-->
		<form action="profile.php?action=$action&t=$t" method="post">
		<input type="hidden" name="verify" value="$verifyhash" />
		<input type="hidden" name="step" value="2" />
		<div class="p15">
			<div class="b f14 s7 mb15"><a name="space"></a>我產生的新鮮事</div>
			<div class="mb5">通過設置，下面這些信息的更新將產生新鮮事</div>
				<div class="p10 bgA mb20">
					<label class="mr20"><input type="checkbox" name="article_isfeed" value="1"{$article_isfeed} />帖子</label>
					<label class="mr20"><input type="checkbox" name="diary_isfeed" value="1"{$diary_isfeed} />日志</label>
					<label class="mr20"><input type="checkbox" name="photos_isfeed" value="1"{$photos_isfeed} />相冊</label>
					<label class="mr20"><input type="checkbox" name="group_isfeed" value="1"{$group_isfeed} />群組</label>
			</div>
			<div class="b f14 s7 mb15"><a name="friend"></a>@提到我的</div>
			<div class="mb5">通過設置，以下人將可以@提到你</div>
				<div class="p15 bgA mb20">
					<div class="mb10">
						<select name="at_isfeed">
<!--
EOT;
$atFeed = array(
	2=>'拒絕所有人@我',
	1=>'僅我關注的可@我',
	0=>'允許所有人@我',
);
foreach($atFeed as $k=>$v){
$selected = $k == $at_isfeed ? ' selected' : '';
print <<<EOT
-->
	<option value="$k"$selected>$v</option>
<!--
EOT;
}print <<<EOT
-->
						</select>
					</div>
				</div>
			<div class="b f14 s7 mb15"><a name="friend"></a>我關注的新鮮事</div>
			<div class="mb5">通過設置，系統會幫你在眾多新鮮事中篩選出你最關注的類型。</div>
				<div class="p15 bgA mb20">
					<div class="mb10">
						關系︰
						<label class="mr20"><input type="checkbox" name="self_isfollow" value="1"{$self_isfollow} />自己</label>
						<label class="mr20"><input type="checkbox" name="friend_isfollow" value="1"{$friend_isfollow} />好友</label>
						<label class="mr20"><input type="checkbox" name="cnlesp_isfollow" value="1"{$cnlesp_isfollow} />關注的人</label>
					</div>
					<div>
<!--
EOT;
	/* platform weibo app */
	if ($isSiteBindWeibo) {
print <<<EOT
-->
						來源︰
<!--
EOT;
		foreach ($bindTypes as $key => $title) {
print <<<EOT
-->
						<label class="mr20"><input type="checkbox" name="$key" value="1" checked="checked" />$title</label>
<!--
EOT;
		}
	}
print <<<EOT
-->
					</div>
				</div>
			<div class="tac mb20">
				<span class="btn"><span><button type="submit">提 交</button></span></span>
			</div>
			
		</div>
		</form>

<!--
EOT;
}print <<<EOT
-->
	</div>
</div>
<!--
EOT;
require_once uTemplate::printEot('footer');
?>-->