<?php
// Xinfeng Chen, 2002.11.04
// require_once('base_array_file.php');
// require_once('class_forum_base.php');

class CNews extends CBaseArrayFile {
 var $id,$time,$user,$title,$body;

 function _explodeRecord($a_line){
  list($this->id,$this->time,$this->user,$this->title,$this->body)
   =explode(SP, $a_line);
 }

 function _composeRecord($a_line){
  $a_line=$this->id.SP.$this->time.SP.$this->user.SP.$this->title.SP.$this->body;
 }

 function _compareRecord($a_key){ return ($a_key==$this->id); }

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

 function store($a_bid=''){
  while($this->moveTo(10)) $this->delete();
  $fname=CForumBase::getFilePath('NEWS',$a_bid);
  return $this->writeFile($fname);
 }

}
?>