public function run() { global $_W; global $_P; $keywordinfo = get_posttype_list('video'); if (empty($keywordinfo)) { $this->autoreply('auto'); } else { global $_K; $_K = $keywordinfo[0]; get_keyword_user_auth(true); $this->limit_top(); $this->cache($_K['id'], '', $_K['keyword_cache'], true); $this->response(); } }
public function run() { global $_W; global $_P; $keywordinfo = get_posttype_list('location'); if (empty($keywordinfo)) { $this->success("谢谢分享你的地址:\n" . $_W['label'] . "\n位于:\n维度:" . $_W['location_x'] . "\n经度:" . $_W['location_y']); //$this->autoreply('auto'); } else { global $_K; $_K = $keywordinfo[0]; get_keyword_user_auth(true); $this->limit_top(); $this->cache($_K['id'], '', $_K['keyword_cache'], true); $this->response(); } }
public function run() { global $_W; global $_P; $keywordinfo = get_posttype_list('location'); if (empty($keywordinfo)) { $link = "<a href='" . $_W['url'] . "'>" . $_W['title'] . "</a>"; $this->success("谢谢分享你的收藏:\n" . $link . "\n简介:" . $_W['description']); } else { global $_K; $_K = $keywordinfo[0]; get_keyword_user_auth(true); $this->limit_top(); $this->cache($_K['id'], '', $_K['keyword_cache'], true); $this->response(); } }
public function run() { global $_W; global $_P; //$this->trace($_W); $keyword_count = get_posttype_nums($_W['msgtype']); if ($keyword_count == 0) { //$this->log(); $this->error('Sorry!查询到0条有关【' . $_W['msgtype'] . '】类型的请求'); } $preg_keword = get_keyword_match(true); if (empty($preg_keword['id'])) { //TODO 切换到默认回复 $this->autoreply('auto'); } //关键词组和用户权限判断 get_keyword_user_auth(true); $this->limit_top(); $this->cache($preg_keword['id'], '', $preg_keword['keyword_cache'], true); $this->response(); }
public function run() { global $_W; global $_P; $keywordinfo = get_posttype_list('image'); if (empty($keywordinfo)) { $new_articles['Title'] = '亲,您发送的图片很不错哦'; $new_articles['Description'] = 'Sorry,我们暂无处理该图片的方法'; $new_articles['PicUrl'] = $_W['picurl']; $new_articles['Url'] = ""; $this->assign('dantw', $new_articles); $this->display(); } else { global $_K; $_K = $keywordinfo[0]; get_keyword_user_auth(true); $this->limit_top(); $this->cache($_K['id'], '', $_K['keyword_cache'], true); $this->response(); } }
public function index() { //判断是否存在模式锁定 global $_W; $event = empty($_W['event']) ? self::discrevent($_W['msgtype']) : $_W['event']; //新增芒果自定义参数 user_post $_W['post'] = ucfirst(strtolower($event)); $lastmodel = get_line_model(); $crosstime = time() - $lastmodel[1]; if (!empty($lastmodel[0]) && $crosstime <= 300) { $addonparam = explode('/', $lastmodel[0]); defined('AMANGO_ADDON_NAME') or define('AMANGO_ADDON_NAME', ucfirst($addonparam[0])); $publicpath = str_replace('./', 'http://' . $_SERVER['HTTP_HOST'] . '/', ONETHINK_ADDON_PATH . AMANGO_ADDON_NAME . '/Public/'); defined('ADDON_PUBLIC') or define('ADDON_PUBLIC', $publicpath); defined('ADDON_ROOT') or define('ADDON_ROOT', ONETHINK_ADDON_PATH . AMANGO_ADDON_NAME . '/'); Amango_Addons($addonparam[0], '', $addonparam[1], '', fasle); } else { //是否是通用请求 if (in_array($event, $this->Common_request)) { $keyword_count = get_posttype_nums($_W['msgtype']); if ($keyword_count == 0) { Reply::trace('Sorry!查询到0条有关【' . $_W['msgtype'] . '】类型的请求'); } $preg_keword = get_keyword_match(true); if (empty($preg_keword['id'])) { Reply::trace('查询不到关键词哦~'); } //关键词组和用户权限判断 get_keyword_user_auth(true); Reply::limit_top(); Reply::cache($preg_keword['id'], '', $preg_keword['keyword_cache'], true); Reply::response(); } else { Reply::runBundle(strtolower($event)); } } }
public function runBundle($name) { //判断是否为自定义Bundle if (!in_array($name, $this->event_type)) { $keywordinfo = get_posttype_list(strtolower($name)); if (empty($keywordinfo)) { $this->autoreply('auto'); } else { global $_K; $_K = $keywordinfo[0]; get_keyword_user_auth(true); $this->limit_top(); $this->cache($_K['id'], '', $_K['keyword_cache'], true); $this->response(); } } else { if (is_object($name)) { $factorymodel = $name; } else { if (isset(self::$factoryObj[$name])) { $factorymodel = self::$factoryObj[$name]; } else { $name = "Weixin\\Bundle\\" . ucfirst($name) . "Bundle"; $factorymodel = new $name(); self::$factoryObj[$name] = $factorymodel; } } $factorymodel->run(); } }