<!--<?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');
?>-->