<!--<?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{
$friendHeaderGuide = creatFriendsHeader($u);
print <<<EOT
-->
	$friendHeaderGuide
<!--
EOT;
}print <<<EOT
-->
						</ul>
					</div>
				</td>
            </tr>
        </table>
    </div>
</div>
<script language="JavaScript">
function imgResize(o, size) {
	if (o.width > o.height) {
		if (o.width > size) o.width = size;
	} else {
		if (o.height > size) o.height = size;
	}
}
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">
<!--
EOT;
if($threaddb){print <<<EOT
-->
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr class="tr2 bdtA">
				<td>标题</td>
				<td style="width:10em;">群组</td>
				<td style="width:10em;">作者/最后发言时间</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><a href="{$basename}q=group&cyid=$value[colonyid]">$value[cname]</a></td>
				<td><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 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" height="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="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]" onload="imgResize(this,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]<br />创建时间：$value[createtime]</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="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]" onload="imgResize(this,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><div style="height:20px;overflow:hidden;">简介：$value[descrip]</div>创建时间：$value[createtime]</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="pdD">
			<div class="table-list table-list-B">
<!--
EOT;
if (!empty($group)) {
foreach ($group as $key => $value) {
$title = $value['title'];
$descrip = $value['descrip'];
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]" onload="imgResize(this,100)" /></a></td>
					<td width="60%" valign="top" style="line-height:2">
					<a href="{$basename}q=group&cyid=$value[id]" class="f14 b blue pdr">{$value[cname]}</a><br />
<!--
EOT;
if(isset($cMembers[$key])){print <<<EOT
-->
					<div class="fr"><span class="fl boxA pdD">您已是该群成员&nbsp;<a href="{$basename}q=group&a=out&cyid=$value[id]" onclick="return ajaxurl(this);" class="gray">退出该群</a></span></div>
<!--
EOT;
}print <<<EOT
-->
					<p class="text">分类：{$o_classdb[$value[classid]]}<br />人数：<span class="blue">$value[members]</span><br />简介：$value[descrip]<br />创建时间：$value[createtime]</p></td>
					<td width="35%" class="tar">
						<span class="fr"><a class="a-reply" href="#" onclick="shareOtherType('share_group_{$value[id]}');return false;">分享<span>+</span></a></span>
<!--
EOT;
if(isset($cMembers[$key])){print <<<EOT
-->
<!--
EOT;
}else{print <<<EOT
-->
					<a href="{$basename}q=group&a=join&cyid=$value[id]" onclick="return ajaxurl(this);">加入该群</a>&nbsp;
<!--
EOT;
}print <<<EOT
-->
					</td>
				</tr>
			</table>
<div id="share_group_{$value[id]}" style="display:none;">
					<div style="width:450px;">
						<div class="h" style="cursor:move" onmousedown="read.move(event);">
							<div class="pr cc" style="height:30px;">
							<div class="fl threadlist" style="padding-left:10px;">
							<a href="javascript:;" class="current b">分享</a>
							<a href="javascript:;" onclick="shareOtherType('recommend_group_{$value[id]}');return false;">推荐</a>
							</div>
							</div>
						</div>
		<ul class="nemu-list cc">
			<li>
				<div>摘要：</div>
				<div class="exp bgB">
					分享了一个群组 <b>$value[cname]</b>
				</div>
			</li>
		</ul>
		<div class="c"></div>
		<ul class="nemu-list cc">
			<li>
				<div>描述：</div>
				<textarea  style="width:98%;height:100px;"></textarea>
			</li>
		</ul>
		<div class="menu-bt tac">
			<input class="bt3" type="button" value=" 确 定 " style="width:80px;" onclick="postShareOtherType('group','$value[id]');">&nbsp;<input class="bt" type="button" value="取消" onclick="closep();"/>
		</div>
	</div>
</div>

<div id="recommend_group_{$value[id]}" style="display:none">
					<div style="width:450px;">
	<form method="post" action="mode.php?m=o&q=share&see=recommend&ajax=1" onsubmit="return false;">
	<input type="hidden" name="step" value="2" />
		<div class="h" style="cursor:move" onmousedown="read.move(event);">
							<div class="pr cc" style="height:30px;">
							<div class="fl threadlist" style="padding-left:10px;">
							<a href="javascript:;" onclick="shareOtherType('share_group_{$value[id]}');return false;">分享</a>
							<a href="javascript:;" class="current b">推荐</a>
							</div>
							</div>
						</div>
<div style="padding:5px 20px 0;">
	<table width="100%" cellspacing="0" cellpadding="5">
		<tr>
			<td width="24%" align="center">推荐方式：</td>
			<td>短消息推荐</td>
		</tr>
		<tr>
			<td align="center">对方姓名：</td>
			<td><input type="text" class="input" name="sendtoname" size="25" value="" /></td>
		</tr>
		<tr>
			<td align="center">标题：</td>
			<td><input type="text" class="input" name="subject" size="44" value="{$windid} 给您$atc_name" /></td>
		</tr>
		<tr><td align="center">内容：</td>
			<td><textarea rows="6" style="width:300px" name="atc_content" onkeydown="ajax.quickpost(event,this.form)">您好！我在$db_bbsname($db_bbsurl/?u=$winduid)\n这个信息，认为很有价值，特推荐给您。\n\n主要信息：\n$title\n\n描述：\n$descrip\n\n希望您能喜欢。</textarea></td>
		</tr>
	</table><div style="text-align:center;padding:10px 0;"><input type="button" class="bt3" name="ajaxsubmit" style="width:80px;" onclick="ajax.submit(this.form);" value="提 交" />&nbsp;<input class="bt" type="button" value="取消" onclick="closep();"/></div></form>
	</div></div>
</div>
<!--
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">名称</td>
						<td><input type="text" name="cname" id="cname" />&nbsp;<span id="cname_warn" class="gray">限 20 字节</span></td>
					</tr>
					<tr>
						<td align="right">描述</td>
						<td><textarea name="descrip" id="descrip" style="width:350px;height:70px"></textarea><div id="descrip_warn" class="fr gray" style="margin-right:100px;">限 255 字节</div></td>
					</tr>
					<tr>
						<td align="right">分类</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>
<script language="JavaScript">
var charset = '$db_charset';
initCheckTextNum('cname','cname_warn',20);
initCheckTextNum('descrip','descrip_warn',255);
</script>
<!--
EOT;
}print <<<EOT
-->
</div></div>
<!--
EOT;
?>-->