function cache_all() { cache_module(); cache_area(); cache_category(); cache_fields(); cache_group(); cache_pay(); cache_oauth(); cache_type(); cache_keylink(); cache_pay(); cache_weixin(); return true; }
} } } } $btn['button'] = $menu; $par = stripslashes(urldecode(json_encode($btn))); $url = 'https://api.weixin.qq.com/cgi-bin/menu/create?access_token=' . $access_token; $arr = $wx->http_post($url, $par); if ($arr['errcode'] == 0) { dmsg('同步成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=' . $action); } else { msg('同步失败 - ' . $arr['errcode'] . ':' . $arr['errmsg']); } } else { #print_r($wx->http_get('https://api.weixin.qq.com/cgi-bin/menu/get?access_token='.$access_token)); cache_weixin(); $menu = cache_read('weixin-menu.php'); if (!is_array($menu) || count($menu) < 1 || count($menu) > 3) { $menu = array(); for ($i = 0; $i < 3; $i++) { for ($j = 0; $j < 6; $j++) { $menu[$i][$j]['name'] = ''; $menu[$i][$j]['key'] = ''; } } } include tpl('weixin_menu', $module); } break; default: $sfields = array('按条件', '消息内容', '微信昵称', '会员名', '网站编辑');