本文整理汇总了PHP中Board::search方法的典型用法代码示例。如果您正苦于以下问题:PHP Board::search方法的具体用法?PHP Board::search怎么用?PHP Board::search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Board
的用法示例。
在下文中一共展示了Board::search方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: board
public function board()
{
App::import('vendor', 'model/board');
$b = isset($this->params['url']['board']) ? $this->params['url']['board'] : "";
$boards = Board::search(trim($b));
$wrapper = Wrapper::getInstance();
$data = array();
$data['board'] = $data['section'] = array();
foreach ($boards as $brd) {
if ($brd->isDir()) {
$data['section'][] = $brd->NAME;
} else {
$data['board'][] = $wrapper->board($brd, array('status' => true));
}
}
$this->set('data', $data);
}
示例2: searchBoard
public function searchBoard()
{
$bName = "";
if (isset($this->params['url']['name'])) {
$bName = trim($this->params['url']['name']);
}
$bName = nforum_iconv($this->encoding, $this->appEncoding, $bName);
$boards = Board::search($bName);
if (count($boards) == 1) {
$this->redirect($this->_mbase . "/board/" . $boards[0]->NAME);
} else {
$ret = false;
foreach ($boards as $b) {
$ret[] = array("name" => $b->DESC, "desc" => $b->NAME, "url" => ($b->isDir() ? "/section/" : "/board/") . $b->NAME, "dir" => $b->isDir());
}
$this->set("boards", $ret);
$this->set("parent", false);
$this->autoRender = false;
$this->render("index", "/section/");
}
}
示例3: board
public function board()
{
$this->css[] = "board.css";
$this->js[] = "forum.board.js";
$this->notice[] = array("url" => "", "text" => "ËÑË÷½á¹û");
App::import('Sanitize');
$b = isset($this->params['url']['b']) ? $this->params['url']['b'] : "";
$ret = false;
$b = trim(rawurldecode($b));
$b = nforum_iconv('utf-8', $this->encoding, $b);
$boards = Board::search($b);
if (count($boards) == 1) {
$this->redirect("/board/" . $boards[0]->NAME);
}
foreach ($boards as $brd) {
$threads = $brd->getTypeArticles(0, 1, Board::$ORIGIN);
if (!empty($threads)) {
$threads = $threads[0];
$last = array("id" => $threads->ID, "title" => Sanitize::html($threads->TITLE), "owner" => $threads->isSubject() ? $threads->OWNER : "ÔÌûÒÑɾ³ý", "date" => date("Y-m-d H:i:s", $threads->POSTTIME));
} else {
$last["id"] = "";
$last["title"] = $last["owner"] = $last["date"] = "ÎÞ";
}
$bms = split(" ", $brd->BM);
foreach ($bms as &$bm) {
if (preg_match("/[^0-9a-zA-Z]/", $bm)) {
$bm = array($bm, false);
} else {
$bm = array($bm, true);
}
}
$ret[] = array("name" => $brd->NAME, "desc" => $brd->DESC, "type" => $brd->isDir() ? "section" : "board", "bms" => $bms, "curNum" => $brd->CURRENTUSERS, "todayNum" => $brd->getTodayNum(), "threadsNum" => $brd->getThreadsNum(), "articleNum" => $brd->ARTCNT, "last" => $last);
}
$this->set("sec", $ret);
$this->set("noBrd", ECode::msg(ECode::$SEC_NOBOARD));
$this->render("index", "section/");
}