function detail() { $id = (int) $_GET['id']; $_blog = createModel('UserLogs'); $blog = $_blog->get($id); if (empty($_COOKIE['look']) and $_COOKIE['look'] != $id) { $blog->look_count++; $blog->save(); Swoole\Cookie::set('look', $id, time() + 3600); } $uid = $blog['uid']; $this->userinfo($uid); $_c = createModel('UserComment'); $comments = $_c->getByAid('blog', $id); $this->swoole->tpl->assign('comments', $comments); $this->swoole->tpl->assign('blog', $blog->get()); return $this->swoole->tpl->fetch('blog_detail.html'); }
private function ifDeny() { $owners = explode(',', $this->project['owner']); if (!in_array($_SESSION['user_id'], $owners)) { return true; } else { if (!isset($_COOKIE['wiki_admin'])) { Swoole\Cookie::set('wiki_admin', '1', 86400 * 30); } return false; } }
private function setLoginStat() { $tm = time(); Swoole\Cookie::set('uname', $_SESSION['user']['nickname'], $tm + 86400 * 30, '/'); Swoole\Cookie::set('uid', $_SESSION['user_id'], $tm + 86400 * 30, '/'); }