<!--<?php
include_once PrintEot('m_header');
print <<<EOT
-->
<div class="infobox pr cc">
	<div class="p10">
		<table border="0" class="vt" style="table-layout:fixed; width:100%;">
			<tr>
				<td width="60"><a href="{$basename}q=user&u=$u"><img src="$faceimg" class="portrait-m"/></a></td>
				<td><p class="pdtb3">
					<span class="b f14 pdr">{$username}</span>
					<a href="{$basename}q=user">返回首页</a></p>
					<div class="tabA" style="position:absolute;bottom:-1px;padding-left:0;width:600px;">
						<ul>
<!--
EOT;
if ($u == $winduid) {print <<<EOT
-->
							<li id="type_friend"><a href="{$basename}q=groups&a=friend">朋友的群</a></li>
							<li id="type_index"><a href="{$basename}q=groups">我的群组</a></li>
							<li id="type_all"><a href="{$basename}q=groups&a=all">所有群组</a></li>
							<li id="type_create"><a href="{$basename}q=groups&a=create">创建新群组</a></li>
<!--
EOT;
} else {print <<<EOT
-->
							<li><a href="{$basename}q=write&u=$u">记录</a></li>
							<li><a href="{$basename}q=photos&u=$u">相册</a></li>
							<li><a href="{$basename}q=share&u=$u">分享</a></li>
							<li><a href="{$basename}q=article&u=$u">帖子</a></li>
							<li><a href="{$basename}q=friend&u=$u">好友</a></li>
							<li class="current"><a href="{$basename}q=groups&u=$u">群组</a></li>
<!--
EOT;
}print <<<EOT
-->
						</ul>
					</div>
				</td>
            </tr>
        </table>
    </div>
</div>

<script language="JavaScript">
function ajaxurl(o) {
	read.obj = o;
	ajax.send(o.href,'',ajax.get);
	return false;
}
setCurrent('type_$a','type_index','current');
</script>

<div class="wrapB cc mt8">
<!--
EOT;
if (empty($a)) {print <<<EOT
-->

<!--
EOT;
if ($u==$winduid) {print <<<EOT
-->
	<div class="contentB cc">
		<div>
<!--
EOT;
if($threaddb){print <<<EOT
-->
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr class="tr2 bdtA">
				<td>标题</td>
				<td>群组</td>
				<td>作者/最后发言时间</td>
			</tr>
<!--
EOT;
foreach ($threaddb as $key => $value) {print <<<EOT
-->
			<tr class="tr3">
				<td><a href="{$basename}q=group&a=read&cyid=$value[colonyid]&tid=$value[tid]" class="blue">$value[subject]</a></td>
				<td class="f10"><a href="{$basename}q=group&cyid=$value[colonyid]">$value[cname]</a></td>
				<td class="f10"><a href="{$basename}q=user&uid=$value[authorid]">$value[author]</a><br />$value[lastpost]</td>
			</tr>
<!--
EOT;
}print <<<EOT
-->
		</table>$pages
<!--
EOT;
} else {print <<<EOT
-->
		<p>暂无群组最新动态</p>
<!--
EOT;
}print <<<EOT
-->
		</div>
	</div>
	<div class="sidebarB cc">
<!--
EOT;
if (!empty($apply)) {print <<<EOT
-->
		<h4 class="h5A">
			<span class="b">我申请加入的群组</span>
		</h4>
		<div class="list-dlA list-dlA-C mb8">
			<dl>
<!--
EOT;
foreach ($apply as $key => $value) {print <<<EOT
-->
				<dd class="cc">
					<a href="{$basename}q=group&cyid=$value[id]"><img src="$value[cnimg]" class="fl pdr" width="40" /></a>
					<span class="b blue"><a href="{$basename}q=group&cyid=$value[id]">$value[cname]</a></span><br />
					申请时间：<span class="f10">$value[addtime]</span>
				</dd>
<!--
EOT;
}print <<<EOT
-->
			</dl>
		</div>
<!--
EOT;
}print <<<EOT
-->
		<h4 class="h5A">
			<span class="b">我加入的群组</span>
		</h4>
		<div class="list-dlA list-dlA-C">
			<dl>
<!--
EOT;
if (!empty($group)) {
foreach ($group as $key => $value) {print <<<EOT
-->
				<dd class="cc">
					<a href="{$basename}q=group&cyid=$value[id]"><img src="$value[cnimg]" class="fl pdr" width="40" /></a>
					<span class="b blue"><a href="{$basename}q=group&cyid=$value[id]">$value[cname]</a></span><br />
					群主：$value[admin]
				</dd>
<!--
EOT;
}} else {print <<<EOT
-->
				<dd>您还没有加入任何群组</dd>
<!--
EOT;
}print <<<EOT
-->
			</dl>
		</div>
	</div>
<!--
EOT;
} else {print <<<EOT
-->
	<div class="contentB fl cc">
<!--
EOT;
if ($group) {
foreach ($group as $value) {
print <<<EOT
-->
		<div class="boxB bgB pdD" style="margin:5px;">
			<div class="table-list table-list-B">
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td class="tac"><a href="{$basename}q=group&cyid=$value[id]"><img src="$value[cnimg]" width="100" /></a></td>
					<td width="70%" valign="top"><a href="{$basename}q=group&cyid=$value[id]" class="f14 b blue pdr">$value[cname]</a><p class="text">分类：{$o_classdb[$value[classid]]}<br />人数：<span class="blue">$value[members]</span><br />简介：$value[descrip]</p></td>
				</tr>
			</table>
			</div>
		</div>
<!--
EOT;
}} else {print <<<EOT
-->
		您的好友还未加入群组
<!--
EOT;
}print <<<EOT
-->
    </div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
} elseif ($a == 'friend') {print <<<EOT
-->
	 <div class="fl cc">
<!--
EOT;
if ($group) {
foreach ($group as $value) {
print <<<EOT
-->
		<div class="boxB bgB pdD fl" style="width:345px;height:120px;margin:5px;">
			<div class="table-list table-list-B">
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td class="tac"><a href="{$basename}q=group&cyid=$value[id]"><img src="$value[cnimg]" width="100" height="100" /></a></td>
					<td width="70%" valign="top"><a href="{$basename}q=group&cyid=$value[id]" class="f14 b blue pdr">$value[cname]</a><p class="text">分类：{$o_classdb[$value[classid]]}<br />人数：<span class="blue">$value[members]</span><br />简介：$value[descrip]</p></td>
				</tr>
			</table>
			</div>
		</div>
<!--
EOT;
}} else {print <<<EOT
-->
		您的好友还未加入群组
<!--
EOT;
}print <<<EOT
-->
	$pages
    </div>
<!--
EOT;
} elseif ($a == 'all') {print <<<EOT
-->
	<div class="contentC cc fl">
		<div class="boxB bgB pdD">
			<div class="table-list table-list-B">
<!--
EOT;
if (!empty($group)) {
foreach ($group as $key => $value) {print <<<EOT
-->
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td class="tac"><a href="{$basename}q=group&cyid=$value[id]"><img src="$value[cnimg]" width="100" /></a></td>
					<td width="70%" valign="top"><a href="{$basename}q=group&cyid=$value[id]" class="f14 b blue pdr">{$value[cname]}</a><p class="text">分类：{$o_classdb[$value[classid]]}<br />人数：<span class="blue">$value[members]</span><br />简介：$value[descrip]</p></td>
					<td width="25%" class="tar" style="vertical-align:middle;">
<!--
EOT;
if(isset($cMembers[$key])){print <<<EOT
-->
						您已是该群成员<br /><a href="{$basename}q=group&a=out&cyid=$value[id]" onclick="return ajaxurl(this);">退出该群</a>
<!--
EOT;
}else{print <<<EOT
-->
						<a href="{$basename}q=group&cyid=$value[id]">浏览此群组</a><br />
						<a href="{$basename}q=group&a=join&cyid=$value[id]" onclick="return ajaxurl(this);">加入该群</a>
<!--
EOT;
}print <<<EOT
-->
						<br />
					</td>
				</tr>
			</table>
<!--
EOT;
}}print <<<EOT
-->
			</div>
			$pages
		</div>
	</div>
	<div class="sidebarC cc" style="margin-left:10px;">
		<h4 class="h5A">
			<span class="b">群组分类</span>
		</h4>
		<div class="list-F list-fen">
			<ul>
<!--
EOT;
foreach ($o_classdb as $key => $value) {print <<<EOT
-->
				<li><a href="{$basename}q=$q&a=all&cid=$key"><span class="pdr">$value</span><span class="gray pdr"></span></a></li>
<!--
EOT;
}print <<<EOT
-->
			</ul>
		</div>
	</div>
<!--
EOT;
} elseif ($a == 'create') {print <<<EOT
-->
	<div class="contentC cc fl">
		<div class="boxB bgB pdD">
			<div class="table-list table-list-B">
				<form action="{$basename}q=$q&a=$a" method="post">
				<input type="hidden" name="step" value="3" />
				<table cellpadding="0" cellspacing="0" width="100%">
					<tr class="h6A"><td colspan="2">创建新群组</td></tr>
					<tr>
						<td width="30%" align="right" class="gray">名称</td>
						<td><input type="text" name="cname" /></td>
					</tr>
					<tr>
						<td align="right" class="gray">描述</td>
						<td><textarea name="descrip" style="width:350px;height:70px"></textarea></td>
					</tr>
					<tr>
						<td align="right" class="gray">分类</td>
						<td>
							<select name="cid">
<!--
EOT;
foreach ($o_classdb as $key => $value) {print <<<EOT
-->
								<option value="$key">$value</option>
<!--
EOT;
}print <<<EOT
-->
							</select>
						</td>
					</tr>
					<tr>
						<td></td>
						<td><input class="bt3" type="submit" value="注册新群组" /></td>
					</tr>
				</table>
				</form>
			</div>
		</div>
	</div>
	<div class="sidebarC cc" style="margin-left:10px;">
		<h4 class="h5A">
			<span class="b">群组分类</span>
		</h4>
		<div class="list-F list-fen">
			<ul>
<!--
EOT;
foreach ($o_classdb as $key => $value) {print <<<EOT
-->
				<li><a href="{$basename}q=$q&a=all&cid=$key"><span class="pdr">$value</span><span class="gray pdr"></span></a></li>
<!--
EOT;
}print <<<EOT
-->
			</ul>
		</div>
	</div>
<!--
EOT;
}print <<<EOT
-->
</div></div>
<!--
EOT;
?>-->