Show
Ignore:
Timestamp:
05/08/08 18:45:50 (8 months ago)
Author:
aarkerio
Message:

Forums and topics improveds

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/models/treasure.php

    r441 r465  
    3737      'user_id' => VALID_NOT_EMPTY, 
    3838      'title' => VALID_NOT_EMPTY 
    39    );  
     39   ); 
     40/* 
     41 *  check if studen already found treasure 
     42 *  int treasure_id  
     43 *  int user_id       
     44 *  return boolean 
     45 */ 
     46 public function chk($treasure_id, $user_id) 
     47 { 
     48  
     49   $conditons = array("ResultTreasure.user_id"=>$user_id, "ResultTreasure.treasure_id"=>$treasure_id);  
    4050 
     51   $data      = $this->ResultTreasure->field('ResultTreasure.id', $conditions)); 
     52    
     53   if ($data != null ): 
     54          return false;    
     55   else: 
     56          return true; 
     57   endif; 
     58  } 
    4159} 
    4260?>