public function __construct(Board $board) { parent::__construct("/{$board->getName()}/ - {$board->getLongName()}", "", $board->getPrivilege()); $boardBanner = div("", "boardBanner centertext")->append(div("/{$board->getName()}/ - {$board->getLongName()}", "boardTitle")); if ($board->isArchive()) { $boardBanner->append(a("View this board on 4chan", '//boards.4chan.org/' . $board->getName())); } $this->appendToBody("<hr>" . $boardBanner . "<hr>"); $this->board = $board; }
/** * Gets a query for the board catalog. * @param Board $board * @param boolean $active * @return mysqli::query */ static function getCatalog($board, $active = true) { $dbl = Config::getMysqliConnection(); $board_shortname = $dbl->real_escape_string($board->getName()); $prefix = $board_shortname . "_"; $pTable = $prefix . "post"; $tTable = $prefix . "thread"; $pageQuery = "SELECT {$tTable}.*, {$pTable}.* FROM {$tTable} LEFT JOIN {$pTable} ON {$pTable}.no = {$tTable}.threadid "; if ($active) { $pageQuery .= "WHERE {$tTable}.active = 1 "; } $pageQuery .= "ORDER BY {$tTable}.lastreply DESC LIMIT 0,{$board->getMaxActiveThreads()}"; $q = $dbl->query($pageQuery); return $q; }
function asArray() : array { return ["board" => $this->board->getName(), "num" => $this->threadId, "replies" => $this->chan_posts, "images" => $this->chan_images]; }
public function archiveReport(ImageBoard\Board $board, int $post) { $this->conn_rw->prepare("UPDATE `reports` SET `archived`=1 WHERE `board`=:b AND `no`=:no")->execute([':b' => $board->getName(), ':no' => $post]); }