function __construct($no, Board $board) { if (is_array($no)) { $arr = $no; $this->doc_id = $arr['doc_id'] ?? 0; $this->no = $arr['no']; $this->threadid = $arr['resto']; $this->time = $arr['time']; $this->tim = $arr['tim'] ?? 0; $this->id = isset($arr['id']) && $arr['id'] != '' ? $arr['id'] : (isset($arr['ns_id']) && $arr['ns_id'] != '' ? $arr['ns_id'] : null); $this->name = $arr['name']; $this->email = $arr['email']; $this->sub = $arr['sub']; $this->trip = $arr['trip']; $this->com = $arr['com']; $this->md5 = base64_encode($arr['md5']) ?? null; $this->md5bin = $arr['md5'] ?? null; $this->filename = $arr['filename'] ?? ""; $this->fsize = $arr['fsize'] ?? 0; $this->ext = $arr['ext'] ?? ""; $this->w = $arr['w'] ?? 0; $this->h = $arr['h'] ?? 0; list($this->tn_w, $this->tn_h) = tn_Size($this->w, $this->h); $this->dnt = $arr['dnt'] ?? 0; $this->images = $arr['images'] ?? 0; $this->replies = $arr['replies'] ?? 0; $this->tag = $arr['tag'] ?? ""; $this->deleted = $arr['deleted']; $this->capcode = $arr['capcode']; $this->filedeleted = $arr['filedeleted']; } if ($this->md5 != '' && in_array(bin2hex(base64_decode(str_replace("-", "/", $this->md5))), OldModel::getBannedHashes())) { $this->imgbanned = true; } else { $this->imgbanned = false; } $this->owner = null; $this->backlinks = array(); $this->board = $board; }