<?php
//require_once("class_basic_record_file.php");

class CMessageList extends CBasicRecordFile {
 var $msgid,$searchmode=false;
 var $user,$email,$url,$comment,$ip,$time,$secret,$reply,$replysecret,$icon;

 function _explodeRecord($a_line){
  if($this->searchmode){return;}
  list($this->user,$this->email,$this->url,$this->comment,$this->ip,
       $this->time,$this->secret,$this->reply,$this->replysecret,$this->icon)
       = explode("\r",$a_line);
  $this->msgid=$this->getAbsolutePosition();
 }

 function _composeRecord($a_line){
  $a_line=$this->user."\r".$this->email."\r".$this->url."\r".$this->comment."\r".$this->ip
    ."\r".$this->time."\r".$this->secret."\r".$this->reply."\r".$this->replysecret."\r".$this->icon."\r";
 }

 function _compareRecord($a_key){return false;}

 function create($a_bname){
  global $filepath;
  return parent::createFile("$filepath/$a_bname.bok",512);
 }

 function open($a_bname){
  global $filepath;
  if(parent::open("$filepath/$a_bname.bok")){  
   return true;
  }else{
   return false;
  }
 }

 function search($a_keyword) {
  $this->searchmode=true;
  $tmparr=array();

  $flag=$this->moveLast();
  while ($flag){
   if(strstr($this->recordBuffer,$a_keyword)){
    $tmparr[]=$this->getAbsolutePosition();
   }
   $flag=$this->movePrev();
  }

  $this->searchmode=false;
  return $tmparr;
 }
}

?>