public function onedaysummaryAction() { $now = time(); $onedaybefore = $now - 60 * 60 * 24; $threadModel = new ThreadModel(); $newThread = $threadModel->newThreadsFrom($onedaybefore); $topThread = $threadModel->topThreadsFrom(10, $onedaybefore); $bbsHero = $threadModel->topBbsHero(10, $onedaybefore); $newscenter = new NewscenterModel(); $news = $newscenter->news(1, 10, "apple"); $data = array(); $data["newThread"] = $newThread; $data["topThread"] = $topThread; $data["bbsHero"] = $bbsHero; $data["news"] = $news; $mail = new MailModel(); $userModel = new UserModel(); $users = $userModel->dailyNewsUser(); foreach ($users as $user) { $data["user"] = $user; $page = $this->makePage("MailTemplate", "dailysummary", $data); $mail->generateMail($user["email"], "OurCoders社区 <*****@*****.**>", "OurCoders社区每日精选", $page, 0); } echo "ok"; }
public function markapplenewsAction() { $page = $_GET["page"]; $filter = $_GET["filter"]; $newscenter = new NewscenterModel(); if ($_POST) { $ids = $_POST["ids"]; $newscenter->checked($ids); header("location:/homeadmin/applenews/{$filter}/{$page}/"); } $id = $_GET["newsid"]; $apple = $_GET["apple"]; $newscenter->markApple($id, $apple); header("location:/homeadmin/applenews/{$filter}/{$page}/"); }
public function newsdataAction() { $id = $this->intVal(3); $newscenter = new NewscenterModel(); $news = $newscenter->data($id); $news["content"] = strip_tags($news["content"]); //$news["content"] = str_replace("\n","",$news["content"]); $news["content"] = str_replace("\\n", " ", $news["content"]); $this->_mainContent->assign("news", $news); $this->_layout = "empty"; $this->display(); }