public function indexAction() { header('Pragma: '); header("cache-control: s-maxage=600"); $allModel = new AllModel(); $page = $this->intVal(3); if ($page == 0) { $page = 1; } $size = 30; $cacheModel = new FilecacheModel(); $thread = new ThreadModel(); $threadCount = $thread->threadCount(); $threadPageSize = 40; $threads = $thread->threads(1, $threadPageSize); $pageControl = ToolModel::pageControl(1, $threadCount, $threadPageSize, "<a href='/thread/index/#page#/'>", 0); $object["threads"] = $threads; $object["pageControl"] = $pageControl; $content = $this->doTemplate("Module", "thread", $object); $this->_mainContent->assign("content", $content); $users = $cacheModel->getCache("topusers", "home"); if (!$users) { $userModel = new UserModel(); $users = $userModel->users(1, 10); $cacheModel->createCache("topusers", "home", $users); } $this->_mainContent->assign("users", $users); $threadModel = new ThreadModel(); $this->_mainContent->assign("pageControl", $pageControl); $this->_mainContent->assign("threads", $threads); $this->_mainContent->assign("userid", $this->userid); //experiment02 $isBot = ToolModel::isBot(); if ($this->userid == 0 && !$isBot) { if (rand(0, 1) == 0) { $experiment002 = "origin"; } else { $experiment002 = "_blank"; } $this->_view->assign("experiment002", $experiment002); $this->_mainContent->assign("experiment002", $experiment002); } $this->viewFile = "Home/index.html"; if ($page > 1) { $this->setTitle("本站新闻 第" . $page . "页"); } $this->display(); }
public function dataindexAction() { $threadModel = new ThreadModel(); $threadCount = $threadModel->threadCount(); $threads = $threadModel->select("threads")->fields("id")->where("del = 0")->fetchAll(); foreach ($threads as $key => $thread) { echo "http://ourcoders.com/thread/data/{$thread['id']}/\r\n"; } }