<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
	<xsl:output method="xml" omit-xml-declaration = "yes" indent="yes"/>
	<!--
	Copyright (C) 2004,2005 NiuTou.Net. All rights reserved.
	Written by niutou.net Lao Mi
	Web: http://www.niutou.net/,http://bbs.niutou.net/
	Email: root@niutou.net
	-->
<xsl:template  match="/">
<!--个性圈子排行整页面-->
<script language="JavaScript" src="hst_plus/IndivGroup/js/IndivGroup_Main.js"></script>
<script language="JavaScript" src="js/Pagination.js"></script>
<xsl:call-template name="IndivGroupClassList" />
<table width="97%" class="heightd tableborder" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td colspan="4" width="50%">
			<div style="float:left;padding-left:12px;">个性圈子总数： <xsl:value-of select="xml/Forum/@IndivGroupTotal" /> 个</div>
			<div style="float:left;padding-left:12px;height:21px;"><input type="button" name="appgroup" value="申请圈子" onclick="ShowAppForm({xml/Forum/@AppPowerFlag});" /></div>			
			<div id="appgroupform" style="display:none;clear:both;padding-left:12px;">			
			</div>
			<div id="groupclasslist" style="display:none;">
			<div style="float:left">所属分类:</div>
			<div style="padding-top:2px;">
			<select name="ClassId">
			<option value="0">不属于任何分类</option>
			<xsl:for-each select="xml/groupclass/list">
				<option value="{@id}">
					<xsl:if test="@id = xml/Info/@classid">
						<xsl:attribute name="selected">selected</xsl:attribute>
					</xsl:if>
					<xsl:value-of select="@classname"/></option>
			</xsl:for-each>
			</select>
			</div>
			</div>
			<iframe style="border:0px;width:0px;height:0px;" src="" name="hiddenframe" id="hiddenframe"></iframe>
		</td>
		<td colspan="5" align="right" valign="top">
			<form method="post" action="?action=grouplist" name="IndivQueryFrom">
			个性圈子搜索：<input name="keyword" type="text" value="{xml/Forum/@keyword}" size="15" /> <input name="Submit" type="submit" value="搜索" />
			<input type="hidden" name="ClassId" value="{xml/Forum/@classid}" />
			<select name="orders" onchange="javascript:submit()">
				<option value="1">按发帖总数排序</option>
				<option value="2">按成员总数排序</option>
				<option value="3">按最新建立排序</option>
			</select>
			<script language="JavaScript">ChkSelected(document.IndivQueryFrom.orders,'<xsl:value-of select="xml/Forum/@Orders" />');</script>
			</form>
		</td>
	</tr>
	</table>
<table width="97%" class="heightd tableborder" align="center" cellspacing="0" cellpadding="0" style="border-top-style:none;">
	<tr>
		<th style="text-align:center">圈子名称</th>
		<th style="text-align:center">管理员</th>
		<th style="text-align:center">状态</th>
		<th style="text-align:center">圈子成员数</th>
		<th style="text-align:center">圈子发帖数</th>
		<th style="text-align:center">圈子主题数</th>
		<th style="text-align:center">圈子今日帖数</th>
		<th style="text-align:center">圈子建立日期</th>
		<th></th>
	</tr>
	<xsl:choose>
		<xsl:when test="xml/IndivGroup/row">
			<xsl:for-each select="xml/IndivGroup/row">
				<xsl:call-template name="IndivGroupList" />
			</xsl:for-each>
		</xsl:when>
		<xsl:otherwise><tr><td colspan="9" class="tablebody1">　　搜索不到个性圈子数据。</td></tr></xsl:otherwise>
	</xsl:choose>
</table>
<table cellpadding="2" cellspacing="1" width="960" align="center">
	<tr>
		<td>
		<script language="javascript">
			PageList(<xsl:value-of select="xml/Forum/@Page"/>,10,<xsl:value-of select="xml/Forum/@pagesize"/>,<xsl:value-of select="xml/Forum/@IndivGroupTotal"/>,'?action=grouplist&amp;keyword=<xsl:value-of select="xml/Forum/@keyword"/>&amp;ClassId=<xsl:value-of select="xml/Forum/@classid"/>&amp;Orders=<xsl:value-of select="xml/Forum/@Orders"/>',4);
		</script>
		</td>
	</tr>
</table>
</xsl:template>


<xsl:template  name="IndivGroupClassList">
	<style>
	.classUl{margin:5px;}
	.classUl li{width:16%;float:left;padding:3px;}
	</style>
	<!--个性圈子分类循环部分-->
	<table cellpadding="0" cellspacing="1" align="center" class="tableborder1">
	<tr><th>圈子分类：</th></tr>
	<tr><td class="tablebody1">
	<ul class="classUl">
		<li><a href="IndivGroup_List.asp">全部圈子</a></li>
		<xsl:for-each select="xml/groupclass/list">		
		<li>
		<xsl:if test="/xml/Forum/@classid = @id">
			<xsl:attribute name="style">font-weight:bold;color:red;</xsl:attribute>
		</xsl:if>
		<a href="IndivGroup_List.asp?ClassId={@id}" title="该分类下属有个{@groupcount}圈子"><xsl:value-of select="@classname" disable-output-escaping="yes"/></a> (<xsl:value-of select="@groupcount"/>)</li>
		<xsl:if test="position() mod 6 =0"></xsl:if>
		</xsl:for-each>
	</ul>
	</td></tr>
	</table><br />
</xsl:template>


<xsl:template  name="IndivGroupList">
<!--个性圈子排行循环部分-->
<tr>
	<td class="tablebody1"><a href="IndivGroup_index.asp?groupid={@id}"><xsl:value-of select="@groupname"/></a></td>
	<td align="center" class="tablebody2"><a href="dispuser.asp?id={@appuserid}" target="_blank"><xsl:value-of select="@appusername"/></a></td>
	<td align="center" class="tablebody1">
		<xsl:call-template name="IndivGroupStatsStr">
			<xsl:with-param name="Sid"><xsl:value-of select="@stats"/></xsl:with-param>
		</xsl:call-template>
	</td>
	<td align="center" class="tablebody2"><xsl:value-of select="@usernum"/></td>
	<td align="center" class="tablebody1"><xsl:value-of select="@postnum"/></td>
	<td align="center" class="tablebody2"><xsl:value-of select="@topicnum"/></td>
	<td align="center" class="tablebody1"><xsl:value-of select="@todaynum"/></td>
	<td align="center" class="tablebody2"><xsl:value-of select="@passdate"/></td>
	<td align="center" class="tablebody1">
	<xsl:choose>
		<xsl:when test="@islock='1'"><font color="red">待审核中...</font></xsl:when>
		<xsl:when test="@islock='2'">已加入</xsl:when>
		<xsl:otherwise>
			<xsl:choose>
				<xsl:when test="@usernum=@limituser or @limituser='' or @stats=2 or @stats=3">
					<input type="button" id="appJionGroup_{@id}" name="appJionGroup_{@id}" value="申请加入" onclick="submitappjion({/xml/Forum/@AppJionFlag},{@id});" disabled="true" />
				</xsl:when>
				<xsl:otherwise>
					<input type="button" id="appJionGroup_{@id}" name="appJionGroup_{@id}" value="申请加入" onclick="submitappjion({/xml/Forum/@AppJionFlag},{@id});" />
				</xsl:otherwise>
			</xsl:choose>
		</xsl:otherwise>
	</xsl:choose>
	</td>
</tr>
</xsl:template>
<xsl:template name="IndivGroupStatsStr">
<xsl:param name="Sid"/>
<xsl:choose>
	<xsl:when test="$Sid=1">正常</xsl:when>
	<xsl:when test="$Sid=2">锁定</xsl:when>
	<xsl:when test="$Sid=3">关闭</xsl:when>
	<xsl:when test="$Sid=0">审核</xsl:when>
	<xsl:otherwise>未知</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>