<?php
// Xinfeng Chen, 2002.11.06
// require_once('base_memo_file.php');
// require_once('class_forum_base.php');

class CBoard extends CBaseMemoFile {
 var $secret, $name, $desc, $owner, $o_mail, $o_url;
 var $owner1, $owner2, $time, $resv1, $resv2, $htmlt, $htmlb;

 function _explodeRecord($a_line){
  list($this->secret, $this->name, $this->desc, $this->owner,
   $this->o_mail, $this->o_url, $this->owner1, $this->owner2,
   $this->time, $this->resv1, $this->resv2, $this->htmlt, $this->htmlb)=explode(SP, $a_line);
 }

 function _composeRecord($a_line){
  $a_line=$this->secret.SP.$this->name.SP.$this->desc.SP.$this->owner
   .SP.$this->o_mail.SP.$this->o_url.SP.$this->owner1.SP.$this->owner2
   .SP.$this->time.SP.$this->resv1.SP.$this->resv2.SP.$this->htmlt.SP.$this->htmlb;
 }

 function load($a_bid){
  $fname=CForumBase::getFilePath('BOARD',$a_bid);
  return $this->readFile($fname);
 }

 function store($a_bid){
  $fname=CForumBase::getFilePath('BOARD',$a_bid);
  return $this->writeFile($fname);
 }

 function isModerator($a_user){
  if(!$a_user){return false;}
  return ($a_user==$this->owner || $a_user==$this->owner1 || $a_user==$this->owner2);
 }
}
?>