public function addWorlds() { $db = new WorldsModel(); $db->create(); if ($db->add($data)) { $this->sina_update($_POST['text'] . ' http://t-y.me'); $this->redirect('WapAdmin/index'); } else { $this->gError("呃," . $db->getError(), "index"); } }
public function addResponse() { import('ORG.Util.Input'); $db = new WorldsResponsesModel(); $data['text'] = Input::deleteHtmlTags($_POST['text']); $data['w_id'] = $_POST['w_id']; $data['ip'] = $_SESSION['user_ip']; if ($db->add($data)) { unset($data); $db = new WorldsModel(); $data['last_time'] = date("Y-m-d H:i:s"); $map['id'] = $_POST['w_id']; $db->where($map)->save($data); $this->gSuccess("你的评论“" . $_POST['text'] . "“发表成功!", "viewWorlds?id=" . $_POST['w_id']); } else { $this->gError("呃," . $db->getError(), "viewWorlds?id=" . $_POST['w_id']); } }