public function actionCreate() { if (!$this->checkSignature()) { return false; } $from = $this->getSource(); $domains = Yii::$app->params['domains']; $domain_m = $domains['m']; $domain_blog = $domains['blog']; $menu = ["button" => [["name" => "博客", "sub_button" => [["type" => "click", "name" => "原创文章", "key" => "blog_original"], ["name" => "文章列表", "type" => "view", "url" => UrlService::buildWapUrl("/default/index", ["from" => $from])], ["type" => "view", "name" => "图书馆", "url" => UrlService::buildWapUrl("/library/index", ["from" => $from])], ["name" => "富媒体", "type" => "view", "url" => UrlService::buildWapUrl("/richmedia/index", ["from" => $from])]]], ["name" => "小玩意", "sub_button" => [["type" => "click", "name" => "点歌", "key" => "ktv"], ["type" => "view", "name" => "密码生成", "url" => UrlService::buildGameUrl("/tools/index", ['from' => $from])], ["type" => "view", "name" => "微信墙", "url" => UrlService::buildWapUrl("/wechat_wall/index", ['from' => $from])]]], ["name" => "关于", "sub_button" => [["type" => "view", "name" => "关于", "url" => UrlService::buildWapUrl("/my/about", ["from" => $from])], ["type" => "view", "name" => "赞助", "url" => UrlService::buildWapUrl("/my/about", ["from" => $from, "#" => "contact"])]]]]]; $access_token = WxrequestController::getAccessToken(); if (!$access_token) { $access_token = WxrequestController::getAccessToken(true); } return WxrequestController::send("menu/create?access_token=" . $access_token, json_encode($menu, JSON_UNESCAPED_UNICODE), 'POST'); }
?> <a href="<?php echo UrlService::buildGameUrl("/mv/index", ['p' => $p - 1]); ?> " class="am-btn am-btn-primary am-fl">上一组</a> <?php } else { ?> <a href="javascript:void(0);" class="am-btn am-btn-default am-fl">上一组</a> <?php } ?> <?php if ($urls['has_next']) { ?> <a href="<?php echo UrlService::buildGameUrl("/mv/index", ['p' => $p + 1]); ?> " class="am-btn am-btn-primary am-fr">下一组</a> <?php } else { ?> <a href="javascript:void(0);" class="am-btn am-btn-default am-fr">下一组</a> <?php } ?> </div> </div> </div>
public static function getSongInfo($song_id) { $ret = []; $url = "http://s.plcloud.music.qq.com/fcgi-bin/fcg_list_songinfo.fcg?idlist=%s&callback=jsonCallback&url=1"; $url = sprintf($url, $song_id); $data_jsonp = trim(HttpClient::get($url)); $data_json = mb_substr($data_jsonp, 13, -1); $find = ['code:', 'data:', 'url:', 'url1:']; $replace = ['"code":', '"data":', '"url":', '"url1":']; $data_json = str_replace($find, $replace, $data_json); $data = @json_decode($data_json, true); if ($data && isset($data['code']) && $data['code'] == 0) { $song_attr_f = explode("|", $data['data'][$song_id]); if (isset($song_attr_f[4])) { $tmp_song_id = $song_attr_f[0]; $tmp_img_id = $song_attr_f[4]; $tmp_mid = $song_attr_f[20]; $ret = ['song_id' => $tmp_song_id, 'type' => 2, 'cover_image' => self::getCoverImageUrl($tmp_img_id), "lrc" => "", "song_url" => self::getSongUrl($tmp_song_id, ".mp3"), "song_title" => $song_attr_f[1], "song_author" => $song_attr_f[3], "text" => $data, "format_data" => ['image_id' => $tmp_img_id, 'mid' => $tmp_mid], "status" => 1, "view_url" => UrlService::buildGameUrl("/music/info", ['song_id' => $tmp_song_id])]; } } return $ret; }
<span class="am-icon-picture-o"></span> <span class="am-navbar-label">富媒体</span> </a> </li> <li> <a href="<?php echo UrlService::buildWapUrl("/my/about"); ?> " class="am-btn-default"> <span class="am-icon-user"></span> <span class="am-navbar-label">关于</span> </a> </li> <li> <a href="<?php echo UrlService::buildGameUrl("/tools/index"); ?> " class="am-btn-default"> <span class="am-icon-gamepad"></span> <span class="am-navbar-label">小玩意</span> </a> </li> </ul> </div> <div data-am-widget="gotop" class="am-gotop am-gotop-fixed" style="display: none;"> <a href="#top" title="回到顶部"> <span class="am-gotop-title">回到顶部</span> <i class="am-gotop-icon am-icon-chevron-up"></i> </a>
<span class="am-icon-picture-o"></span> <span class="am-navbar-label">美女</span> </a> </li> <li id="menu_tools"> <a href="<?php echo UrlService::buildGameUrl("/tools/index"); ?> " class="am-btn-default"> <span class="am-icon-paper-plane"></span> <span class="am-navbar-label">工具</span> </a> </li> <li id="menu_music"> <a href="<?php echo UrlService::buildGameUrl("/music/index"); ?> " class="am-btn-default"> <span class="am-icon-music"></span> <span class="am-navbar-label">点歌</span> </a> </li> </ul> </div> <div data-am-widget="gotop" class="am-gotop am-gotop-fixed" style="display: none;"> <a href="#top" title="回到顶部"> <span class="am-gotop-title">回到顶部</span> <i class="am-gotop-icon am-icon-chevron-up"></i> </a> </div> <input type="hidden" id="access_domain" value="<?php
public function actionClear() { $this->removeAuthToken(); $url_blog = UrlService::buildWapUrl("/default/index"); $url_game = UrlService::buildGameUrl("/mv/index"); return <<<EOT <style> body{ font-size:3em; } </style> <a href="{$url_blog}">博客首页</a> <a href="{$url_game}">游戏中心</a> EOT; }