I assume it's this part?
Code:
private function checknumber(){
$data = $GLOBALS['adopts']->select("messages", array(), "touser='{$loggedinname}' and status='unread'")->fetchAll();
if($this->availability == 0){
// The promocode has been used, so it is unavailable now...
$this->message .= "The promocode has been used before and is now unavailable. Please contact the admin if you believe this is a mistake.<br>";
return FALSE;
}
else return TRUE;
}