<?php
/*
\* ===========================================
\* 项目: CTB文本论坛
\* 版本:1.4
\* 团队: 实易数码
\* 小组: CTB文本论坛小组
\* 作者: 险情
\* 功能: 后台版块处理程式
\* ===========================================
\* Copyright (c) 2002
\* 团队主页: http://www.11cn.org
\* 团队信箱: ------
\* 创建日期: 2002/7/19
\* 修改日期: 2003-3-27 0:41 windnets
\* 修改说明: ------
\* 版权声明: 这个程序是免费软件.
\* ===========================================
*/

class Module extends CommonClass
{
    //构造函数
    function execute()
    {
      switch($this->input['action']) {

		case 'showAllForum':
            $this->showAllForum();
            break;
        //
      }    
    } // end func

//-----------------------------------------------------------------
//---1、显示所有版块模块。------作者：险情
//---2、
//-----------------------------------------------------------------

//===================================================================
//显示所有版块函数
    function showAllForum()
    {
      $this->site_title .= $this->set[ctbTitle]." - 首页";
      $this->file = "../".$this->set[dataPath]."/forums.php";
        $forums = $this->read_file();
        foreach ($forums as $forumLine) {
            $forum = $this->make_array($forumLine);
            // 显示论坛的分类信息,版块统计信息
            if ($forum[1] == "cat") {
              $num++;
              $catTitle = $forum[3];
              $catInfo = $forum[4];
              $forumId = $forum[2];
              eval ("\$main .= \"".$this->getTemplate("forumShowAllCats")."\";");
            } 
            //显示论坛版块信息
            else {
              $forumId = $forum[2];
              $forumName = $forum[3];
			  $moderatorList = "";
			  //
				if ($forum[8] != "") {
					$moderators = explode("|",$forum[8]);
					foreach ($moderators as $moderator) {
						if ($moderator != "") {
							$moderatorInfo = explode(",",$moderator);
							$moderatorId = $moderatorInfo[0];
							$moderatorName = $moderatorInfo[1];
							$moderatorList .= "<a href='../index.php?mods=member&action=info&id=$moderatorId' target=_blank>".$moderatorName."</a>&nbsp;"; 
						}
					}
				} else {
					$moderatorList = "诚邀版主";
				}
              $forumInfo = $moderatorList;
              //获取论坛类别
              $forumLimit = $forum[6];
              if ($forumLimit ==1 ) {
                $forumKind = "<font color=red>加密</font>";
              }
              $forumGood = $forum[5];
              if ($forumGood == 1) {
                $forumKind = "<font color=green>精华</font>";
              }
              if ($forumGood != 1 && $forumLimit != 1) {
                $forumKind = "普通";
              }
              if ($forum[7] == 1) {
                $forumMode = "<font color=green>注册访问</font>";
              }else {
                $forumMode = "访客访问";
              }

			  eval ("\$main .= \"".$this->getTemplate("forumShowAllForum")."\";");
            }
        }
      eval("\$this->outPut(\"".$this->getTemplate("forumShowAll")."\");");

    } // end func

//=============================================================================
} // end class
