protected function _initialize() { //消除所有的magic_quotes_gpc转义 \Common\ORG\Input::noGPC(); //初始化网站配置 if (false === ($setting = F('setting'))) { $setting = D('setting')->setting_cache(); } C($setting); //发送邮件 $this->assign('async_sendmail', session('async_sendmail')); }
public function publish_item() { $item = unserialize(input('post.item', 'trim')); !$item['key_id'] && $this->ajaxReturn(0, L('publish_item_failed')); $album_id = input('post.album_id', 'intval', 0); $ac_id = input('post.ac_id', 'intval', 0); $item['intro'] = input('post.intro', 'trim'); $item['info'] = \Common\ORG\Input::deleteHtmlTags($item['info']); $item['uid'] = $this->visitor->info['id']; $item['uname'] = $this->visitor->info['username']; $item['status'] = C('pin_item_check') ? 0 : 1; //添加商品 $itemMod = D('item'); $result = $itemMod->publish($item, $album_id, $ac_id); if ($result) { //发布商品钩子 $tag_arg = array('uid' => $item['uid'], 'uname' => $item['uname'], 'action' => 'pubitem'); tag('pubitem_end', $tag_arg); $this->ajaxReturn(1, L('publish_item_success')); } else { $this->ajaxReturn(0, $itemMod->getError()); } }
/** +---------------------------------------------------------- * 从$_POST,$_GET,$_COOKIE,$_REQUEST等数组中获得数据 +---------------------------------------------------------- * @access public +---------------------------------------------------------- * @param string $string 要处理的字符串 +---------------------------------------------------------- * @return string +---------------------------------------------------------- */ public static function getVar($string) { return \Common\ORG\Input::stripSlashes($string); }