<?php
/*
* 项目: iOrange(橘子)
* 作者: 离家出走(yzxh24)
* Email: yzxh24@gmail.com
* 主页: www.iorange.cc
*/
/* vim: set ts=4 sw=4: */
class MarkAction extends BbsAction
{
    public function run()
    {
        $tid = $this->getTid();
        $thread = $this->getExistsThread($tid);

        $allows = $this->getAllows($thread);
        !$allows['mark'] && $this->NoPermission();

        $this->db()->update(Threads::table())->value(array('ismark'=>1,'markuid'=>$this->uid()))->where('id='.$tid)->q();

        iforward(url('system', array('s'=>'bbs','a'=>'thread','tid'=>$tid)));
    }
}