<?php include pTemplate("header");?>
     <div id="loadingbar"></div>
     
     <div id="main" class="mainPanel wd txt_left">
      <div class="f_size"><div class="notice_newstyle">
     <?php if($groupid||$cateid) { ?>
     	<div class="path b_size"><ul>
        <li class="home" style="z-index:100;"><a href="<?php echo SITEURL;?>?mod=group&do=group">讨论组</a></li>
        <?php if(is_array($str_groupcate)) { ?>
        <li style="z-index:2;"><a href="<?php echo SITEURL;?>?mod=group&do=group&cateid=<?php echo $str_groupcate['cateid'];?>"><?php echo $str_groupcate['catename'];?></a></li>
        <?php } ?>
        <?php if(is_array($str_group)) { ?>
        <li style="z-index:1;"><a href="<?php echo SITEURL;?>?mod=group&do=group&groupid=<?php echo $str_group['groupid'];?>"><?php echo $str_group['groupname'];?></a></li>
        <?php } ?>
        </ul>
        <div class=" right">
        <a class="btn btnComfirm " style=" padding:4px 5px 4px 6px; margin-top:3px; margin-right:10px; font-weight:bold" href="<?php echo SITEURL;?>?mod=group&do=group&c=addtopic&groupid=<?php echo $str_group['groupid'];?>">发布帖子</a>
         <a class="btn btnComfirm " style=" padding:4px 5px 4px 6px; margin-top:3px; margin-right:10px; font-weight:bold" href="<?php echo SITEURL;?>?mod=group&do=group&c=addtopic&groupid=<?php echo $str_group['groupid'];?>">关注</a>
        </div>
        </div>	
	<?php } else { ?>
       
        <div class="new_title_box"><h1 class="new_title left">讨论组</h1>
        <div class=" right">
         <?php if($_CO['groupid']==1||$_CO['groupid']==2||$_CO['groupid']==3) { ?>
        <a class="btn btnNormal bt_upload " href="<?php echo SITEURL;?>?mod=group&do=group&c=addgroupcate"><span class="btnAdd"></span>&nbsp;&nbsp;&nbsp;增加讨论区</a>
         <?php } ?>
        </div>
        <div class="info left">&nbsp;&nbsp;文明上网，理性发言！</div><div class="caption" style="text-align:right;display:none;">
	<?php } ?>
</div></div>

<div class="content">
<?php if(is_array($arrgroupcate)) { ?>
<div class="main clearfix">

		<!--分区开始-->
        <?php foreach((array)$arrgroupcate as $key=>$item) {?>
        <div class="sort-news mb10" style="min-height:100px;">
        <div class="hd clearfix">
                <h2><a href="<?php echo SITEURL;?>?mod=group&do=group&cateid=<?php echo $item['cateid'];?>" title="<?php echo $item['catename'];?>"><?php echo $item['catename'];?></a></h2>
    <div class="right mr10">
        <a style="line-height:25px;" href="<?php echo SITEURL;?>?mod=group&do=group&c=addgroup">编辑</a>
        &nbsp;<span class="graytext">|</span>&nbsp;
        <a style="line-height:25px;" href="<?php echo SITEURL;?>?mod=group&do=group&c=delcate&cateid=<?php echo $item['cateid'];?>" onclick="return confirm('您确定要删除吗，如不确定请点取消')">删除</a>
          &nbsp;<span class="graytext">|</span>&nbsp;
        <a style="line-height:25px;" href="<?php echo SITEURL;?>?mod=group&do=group&c=addgroup&cateid=<?php echo $item['cateid'];?>">创建讨论组</a>
    </div>
            </div>
            <?php foreach((array)$item['group'] as $kkey=>$iitem) {?>
          <div class="sprt-piece">
		
        <a href="<?php echo SITEURL;?>?mod=group&do=group&groupid=<?php echo $iitem['groupid'];?>" title="<?php echo $iitem['groupname'];?>" target="_blank">
                <div class="sprt-img">
                        <img src="<?php echo PUBURL;?>images/group<?php if($iitem['count_topic_today']) { ?>_new<?php } ?>.gif" alt="<?php echo $iitem['groupname'];?>">
                </div>
		</a>
                <div class="sprt-text">

                    <h3>

                        <a href="<?php echo SITEURL;?>?mod=group&do=group&groupid=<?php echo $iitem['groupid'];?>" title="<?php echo $iitem['groupname'];?>"<?php if($iitem['isrecommend']) { ?>style="color:#F30"<?php } ?>><?php echo $iitem['groupname'];?></a>

                    </h3>

                    <ul>
                    
                    <div>帖数: <?php echo $iitem['count_topic'];?>, 今日: <?php echo $iitem['count_topic_today'];?>
                    &nbsp;&nbsp;&nbsp;
                    <a style="line-height:25px;" href="<?php echo SITEURL;?>?mod=group&do=group&c=addgroup">编辑</a>
        &nbsp;<span class="graytext">|</span>&nbsp;
        <a style="line-height:25px;" href="<?php echo SITEURL;?>?mod=group&do=group&c=delgroup&groupid=<?php echo $iitem['groupid'];?>" onclick="return confirm('您确定要删除吗，如不确定请点取消')">删除</a>
          &nbsp;<span class="graytext">|</span>&nbsp;
        <a style="line-height:25px;" href="<?php echo SITEURL;?>?mod=group&do=group&c=addtopic&groupid=<?php echo $iitem['groupid'];?>">发布话题</a>
                    </div>
<?php if($iitem['newtopicid']) { ?>
					<a href="<?php echo SITEURL;?>?mod=group&do=group&c=topic&topicid=<?php echo $iitem['newtopicid'];?>" title="<?php echo $iitem['newtopictitle'];?>" class="xi2"><?php echo utf_substr($iitem['newtopictitle'],40)?></a> <cite>
                    <span title="<?php echo date('Y-m-d H:i:s',$iitem['newtopicuptime'])?>" class="clear_b"> <?php echo Ue_time($iitem['newtopicuptime'],'H:i')?></span>
                    </cite>
                    <?php } else { ?>
                    <span title="从未发布过话题" class="graytext">从未发布过话题</span>
                    <?php } ?>
                                            </ul>

                </div>

            </div>
            
			<?php }?>
        </div>
        <div class="blank"></div>
         <?php }?>
        <!--分区结束-->
	</div>
    <?php } ?>
<?php if($c=='index'&&$groupid) { ?>
<table class="notice_table">
<tbody>

<tr style="background-color:#FFF; cursor:auto;">
    <td width="33px" align="left">
    </td>
    <td width="<?php if($_CO['groupid']==1||$str_group['uid']==$_CO['uid']) { ?>363<?php } else { ?>503<?php } ?>px" align="left">标题</td>
    <td width="150px" align="center">
       回复/浏览
    </td>
     <td width="154px" align="left">
       作者
    </td>
    <td width="100px" align="left">
       发布时间
    </td>
    
      <?php if($_CO['groupid']==1||$str_group['uid']==$_CO['uid']) { ?>
    <td width="104px" align="left">
       操作
    </td>
    <?php } ?>
</tr>
<?php if(is_array($arr_group_topics)) { ?>
<?php foreach((array)$arr_group_topics as $key=>$item) {?>
<tr class="notice_send">
    <td align="left">
    	<?php if($item['isask']) { ?>
        <span class="ico_forum i-status-ask" title="问答帖">
        </span>
        <?php } else { ?>
        <span class="ico_forum i-status-general" title="普通帖">
        </span>
        <?php } ?>
        
    </td>
    <td align="left">
        <a href="<?php echo SITEURL;?>?mod=group&do=group&c=topic&topicid=<?php echo $item['topicid'];?>" style="text-decoration:none">
            <div class="notice_t" style="width:360px">
                <h2 style="font-weight:lighter;">
                    <?php echo $item['title'];?>
                </h2>
                <span class="graytext">
                </span>
            </div>
        </a>
    </td>
    <td align="center" style="font: 12px Arial,Helvetica,sans-serif;;color: #999;">
        <span style="font-size:16px"><?php echo $item['count_comment'];?></span> /<?php echo $item['count_view'];?>
    </td>
    <td align="left" class="graytext">
      <?php if($item['user'][realname]) { ?>  <?php echo $item['user'][realname];?><?php } else { ?> 无名姓 <?php } ?>
    </td>
    <td align="left" style="font: 12px Arial,Helvetica,sans-serif;;color: #999;">
        <?php echo Ue_time($item['addtime'])?>
    </td>
    <?php if($_CO['groupid']==1||$str_group['uid']==$_CO['uid']) { ?>
    <td align="left">
        <a class="bt_del" title="删除" href="<?php echo SITEURL;?>?mod=group&do=group&c=deltopic&topicid=<?php echo $item['topicid'];?>"
        onclick="return confirm('您确定要删除吗，如不确定请点取消')">
        </a>
        &nbsp;&nbsp;
        <a class="bt_rename" title="编辑" href="<?php echo SITEURL;?>?mod=group&do=group&c=edit_topic&topicid=<?php echo $item['topicid'];?>">
        </a>
    </td>
    <?php } ?>
</tr>
 <?php }?>
 <?php } else { ?>
 
 <tr style="background-color:#FFF; cursor:auto;">
    <td style="border:none"></td>
    <td style="border:none">

            <div class="notice_t" style="width:360px">
                <span class="graytext">
                	暂无话题
                </span>
            </div>
    </td>
    <td  style="border:none">
        
    </td>
    <td style="border:none">
       
    </td>
    <td style="border:none">
       
    </td>
    
    <td style="border:none">
      
    </td>
</tr>
 
 <?php } ?>

</tbody>
</table>
<?php } ?>
<div class="notice_page">
	
	<div class="pagination">
			<?php echo $pageinfo;?>
		</div>
</div>

</div></div></div>
</div>

<?php include pTemplate("footer");?>

</body>
</html>