From 3bc4c88d03fbb5da0f9a916490734b3a71efaf52 Mon Sep 17 00:00:00 2001 From: gogobody <138950128@qq.com> Date: Mon, 27 Sep 2021 19:39:36 +0800 Subject: [PATCH] v4.6 --- README.md | 5 +- archive.php | 2 +- assets/css/onecircle.min.css | 2 +- assets/css/onecircle.scss | 21 ++++++ assets/img/wormhole_1.gif | Bin 0 -> 56380 bytes assets/js/onecircle.js | 139 +++++++++++++++++++++++++++++++++-- assets/js/onecircle.min.js | 49 ++++++------ index.php | 40 +++++++--- libs/admin/core.php | 28 +++++++ libs/options.php | 9 ++- libs/route.php | 10 +++ 11 files changed, 260 insertions(+), 45 deletions(-) create mode 100644 assets/img/wormhole_1.gif diff --git a/README.md b/README.md index c35b11c..d9d5b9d 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ ## onecircle 一个圈子,基于typecho ## 名字就叫一个圈子。 -## version:4.4 +## version:4.6 ## 平台:typecho ### 想弄一个类社交圈子,开发了一部分,剩下慢慢折腾 ## 下载说明: -4.0 之后懒得发 release 了,直接下载。如果是更新,把主题插件全部禁用启用一遍。 +4.0 之后懒得发 release 了,直接下载。如果是更新,把主题插件全部禁用启用一遍。 更新建议看看 changeLog 必须装的: [主题最新版下载](https://github.com/gogobody/onecircle/archive/refs/heads/master.zip) [主题配套插件下载](https://github.com/gogobody/OneCircle_Plugin/archive/refs/heads/main.zip) @@ -63,6 +63,7 @@ v2.8 添加 lazyload ,将默认的gallery 原始的background显示方式迁 v3.0 支持博客页 ... v4.3 支持私聊,支持 joe 主题编辑器(已获得作者授权),xxx 一系列更新 +v4.6 修复登录bug,添加十年之约(更新,插件、主题) ## 关于文章类型 目前文章有一个自定义字段: diff --git a/archive.php b/archive.php index 5349b0b..0f8be4d 100644 --- a/archive.php +++ b/archive.php @@ -43,7 +43,7 @@
-
":'
'+h[0]+"
"},onSelect:function(h,m,p){m=m.replace(/'/g,'"');h=JSON.parse(m);m=h[1];p=$("#category");-1===m?($("#topic-search-downshift-input").val(""),p.val(1)):(b.val(h[0]),p.val(m))}});$(".post-content-inner-link a").click(function(h){h.stopPropagation()}); -document.addEventListener("lazybeforeunveil",function(h){var m=h.target.getAttribute("data-bg");m&&(h.target.style.backgroundImage="url("+m+")")});if(!gconf.IS_MOBILE){var c=!0,d=$("header").height(),e=function(h){window.pageYOffset>=d&&0>=h?c||(c=!0):c&&($("#sidebar div.card:last-child").css("top",d+15),c=!1)},f=window.pageYOffset;e(f);var g=Date.now();document.addEventListener("scroll",function(){var h=Date.now();15$1"));$(".joe_aside__item.flatterer .content").attr("class","content type"+l(1,6))};n();$(".joe_aside__item.flatterer .change").on("click",function(){return n()})}},searchEventInit:function(){var a=$(".search-block-icon"),b=$("#search-block");a.unbind("click").bind("click",function(){"none"=== -b.css("display")?b.slideDown():$(".search-block").slideUp()});$(".close").unbind("click").bind("click",function(){$(".search-block").slideUp()})},login_ajax:function(){function a(){d.attr("disabled",!0).fadeTo("",1)}function b(){d.attr("disabled",!1).fadeTo("",1)}var c=this,d=$("#login-submit"),e=$("#navbar-login-user"),f=$("#navbar-login-password");this.canLogin=!0;$("#Login_form").submit(function(){if(c.canLogin){c.canLogin=!1;var g=this;if($(this).hasClass("banLogin"))return location.reload(), -!1;d.attr("disabled",!0).fadeTo("slow",.5);var k=e.val(),l=f.val();return""===k?(c.canLogin=!0,$.message({title:"\u767b\u5f55\u901a\u77e5",message:"\u5fc5\u987b\u586b\u5199\u7528\u6237\u540d",type:"warning"}),e.focus(),a(),!1):""===l?(c.canLogin=!0,$.message({title:"\u767b\u5f55\u901a\u77e5",message:"\u8bf7\u586b\u5199\u5bc6\u7801",type:"warning"}),f.focus(),a(),!1):(d.addClass("active"),$("#spin-login").addClass("show inline"),$.post(gconf.oneaction,{type:"getsecurl",url:window.location.href},function(n){if(!n.code)return $.message({title:"\u63d0\u793a", -message:"\u83b7\u53d6securl\u5931\u8d25",type:"error"});$("#Login_form").attr("action",n.data);$.ajax({url:n.data,type:$(g).attr("method"),data:$(g).serializeArray(),error:function(){c.canLogin=!0;return $.message({title:"\u767b\u5f55\u901a\u77e5",message:"\u63d0\u4ea4\u51fa\u9519",type:"error"}),b()},success:function(h){h=$.parseHTML(h);d.removeClass("active");$("#spin-login").removeClass("show inline");try{if(0>=$("#Logged-in",h).length)return c.canLogin=!0,b(),$.message({title:"\u767b\u5f55\u901a\u77e5", -message:"\u7528\u6237\u540d\u6216\u8005\u5bc6\u7801\u9519\u8bef\uff0c\u8bf7\u91cd\u8bd5",type:"error"});a();h=$("#easyLogin",h).html();$("#easyLogin").html(h);$.message({title:"\u767b\u5f55\u901a\u77e5",message:'\u767b\u5f55\u6210\u529f: \u70b9\u51fb\u8fd9\u91cc\u5237\u65b0\u9875\u9762\uff0c\u6216\u7b49\u5f85\u81ea\u52a8\u5237\u65b0',type:"success"});c.canLogin=!0;c.loginUserName=k;setTimeout(function(){location.reload()},500)}catch(m){alert("\u6309\u4e0bF12\uff0c\u67e5\u770b\u8f93\u51fa\u9519\u8bef\u4fe1\u606f"), +a.val("");$(".show-close").unbind("click").bind("click",function(){var d=$(this).siblings().text();b.additionArray.splice($.inArray(d,b.additionArray),1);$(this).parent().remove();0===b.additionArray.length&&b.addBilibiliBtn.siblings().removeClass("btn-disable")})},load_10years_blog:function(a,b){(b=void 0===b?!1:b)&&$(".j-loadmore a").text("loading...");$.post({url:gconf.index,data:{recommendRest:1,type:"fetch10apis",page:a},success:function(c){c=JSON.parse(c);if(1===c.code){var d=c.data.current_page, +e=c.data.last_page,f="";c.data.data.forEach(function(g){g='";f+=g});c=d+1;c
');b?($(".j-loadmore").remove(), +$(".item-container").append(f)):$(".item-container").html(f)}$.rmloading();index_tab_loadfinish=!0;$(".j-loadmore a").text("\u67e5\u770b\u66f4\u591a")}})},indexEventInit:function(){var a=this;$("#addpic").unbind("click").bind("click",function(){$(".add-area input").attr("placeholder","\u8bf7\u8f93\u5165\u56fe\u7247\u94fe\u63a5");"default"!==a.nowtype?(a.addArea.show(),a.uploadPic.show()):(a.addArea.toggle(),a.uploadPic.toggle());a.changeType("default")});$("#addlink,#addvideo,#addbilibili").unbind("click").bind("click", +function(){a.uploadPic.hide();var h=$(this).data("type");"link"===h?$(".add-area input").attr("placeholder","\u8bf7\u8f93\u5165\u94fe\u63a5"):"video"===h?$(".add-area input").attr("placeholder","\u8bf7\u8f93\u5165\u89c6\u9891\u94fe\u63a5"):"bilibili"===h&&$(".add-area input").attr("placeholder","\u8bf7\u8f93\u5165bv\u53f7");a.nowtype!==h?a.addArea.show():a.addArea.toggle();a.changeType(h)});this.addAreaBtn.unbind("click").bind("click",function(){"default"===a.nowtype?a.doParseDefaultFunc(this,a): +"link"===a.nowtype?a.doParseLinkFunc(this,a):"video"===a.nowtype?a.doParseVideoFunc(this,a):"bilibili"===a.nowtype&&a.doParseBilibiliFunc(this,a)});$("#text").bind("input propertychange",function(){var h=$(".pub.eynkqj");$(this).val()?h.removeAttr("disabled"):(h.attr("disabled",!0),h.css("background-color","rgb(255, 241, 147)"))});$(".sc-AxjAm.bwpEWU.gsmhQy").bind("input propertychange",function(){var h=$(".sc-AxjAm.eVNRGW");$(this).val()?h.removeAttr("disabled"):h.attr("disabled",!0)});var b=$("#topic-search-downshift-input"); +b&&b.autoComplete({minChars:0,source:function(h,l){h=h.toLowerCase();for(var q=allCategories,r=[],t=0;t
'+h[0]+"
":'
'+h[0]+"
"},onSelect:function(h,l,q){l=l.replace(/'/g,'"');h=JSON.parse(l);l=h[1];q=$("#category");-1===l?($("#topic-search-downshift-input").val(""),q.val(1)):(b.val(h[0]),q.val(l))}});$(".post-content-inner-link a").click(function(h){h.stopPropagation()});document.addEventListener("lazybeforeunveil",function(h){var l=h.target.getAttribute("data-bg");l&&(h.target.style.backgroundImage= +"url("+l+")")});if(!gconf.IS_MOBILE){var c=!0,d=$("header").height(),e=function(h){window.pageYOffset>=d&&0>=h?c||(c=!0):c&&($("#sidebar div.card:last-child").css("top",d+15),c=!1)},f=window.pageYOffset;e(f);var g=Date.now();document.addEventListener("scroll",function(){var h=Date.now();15$1"));$(".joe_aside__item.flatterer .content").attr("class","content type"+m(1,6))};p();$(".joe_aside__item.flatterer .change").on("click",function(){return p()})}var n=$("#recommend-tabs");if(0= +w.length)return $.message({title:"\u901a\u77e5",message:"\u670d\u52a1\u5668\u8fd4\u56de\u9519\u8bef\uff0c\u8bf7\u91cd\u8bd5",type:"error"});var z=w.html();$(".item-container").html(z);var x=$(".archive-content");x.removeClass(function(y,A){return(A.match(/(^|\s)tabindex-\S+/g)||[]).join("")});x.addClass("tabindex-"+r)}catch(y){console.log(y)}$.rmloading();index_tab_loadfinish=!0}}):1===r&&indexInput.load_10years_blog(1)})})}},searchEventInit:function(){var a=$(".search-block-icon"),b=$("#search-block"); +a.unbind("click").bind("click",function(){"none"===b.css("display")?b.slideDown():$(".search-block").slideUp()});$(".close").unbind("click").bind("click",function(){$(".search-block").slideUp()})},login_ajax:function(){function a(){d.attr("disabled",!0).fadeTo("",1)}function b(){d.attr("disabled",!1).fadeTo("",1)}var c=this,d=$("#login-submit"),e=$("#navbar-login-user"),f=$("#navbar-login-password");this.canLogin=!0;$("#Login_form").submit(function(){if(c.canLogin){c.canLogin=!1;var g=this;if($(this).hasClass("banLogin"))return location.reload(), +!1;d.attr("disabled",!0).fadeTo("slow",.5);var k=e.val(),m=f.val();return""===k?(c.canLogin=!0,$.message({title:"\u767b\u5f55\u901a\u77e5",message:"\u5fc5\u987b\u586b\u5199\u7528\u6237\u540d",type:"warning"}),e.focus(),a(),!1):""===m?(c.canLogin=!0,$.message({title:"\u767b\u5f55\u901a\u77e5",message:"\u8bf7\u586b\u5199\u5bc6\u7801",type:"warning"}),f.focus(),a(),!1):(d.addClass("active"),$("#spin-login").addClass("show inline"),$.post(gconf.oneaction,{type:"getsecurl",url:window.location.href},function(p){if(!p.code)return $.message({title:"\u63d0\u793a", +message:"\u83b7\u53d6securl\u5931\u8d25",type:"error"});$("#Login_form").attr("action",p.data);$.ajax({url:p.data,type:$(g).attr("method"),data:$(g).serializeArray(),error:function(){c.canLogin=!0;return $.message({title:"\u767b\u5f55\u901a\u77e5",message:"\u63d0\u4ea4\u51fa\u9519",type:"error"}),b()},success:function(n){n=$.parseHTML(n);d.removeClass("active");$("#spin-login").removeClass("show inline");try{if(0>=$("#Logged-in",n).length)return c.canLogin=!0,b(),$.message({title:"\u767b\u5f55\u901a\u77e5", +message:"\u7528\u6237\u540d\u6216\u8005\u5bc6\u7801\u9519\u8bef\uff0c\u8bf7\u91cd\u8bd5",type:"error"});a();n=$("#easyLogin",n).html();$("#easyLogin").html(n);$.message({title:"\u767b\u5f55\u901a\u77e5",message:'\u767b\u5f55\u6210\u529f: \u70b9\u51fb\u8fd9\u91cc\u5237\u65b0\u9875\u9762\uff0c\u6216\u7b49\u5f85\u81ea\u52a8\u5237\u65b0',type:"success"});c.canLogin=!0;c.loginUserName=k;setTimeout(function(){location.reload()},500)}catch(u){alert("\u6309\u4e0bF12\uff0c\u67e5\u770b\u8f93\u51fa\u9519\u8bef\u4fe1\u606f"), c.canLogin=!0}}})}),!1)}})},loginBan:function(){var a=$("#Login_form");a.hasClass("banLogin")||(a.addClass("banLogin"),$("#navbar-login-user").attr("disabled","disabled"),$("#navbar-login-password").attr("disabled","disabled"))},resetLoginAction:function(a){0=Math.random()){if($(d).attr("data-author_page")){e=$(d).parent().siblings().data("authorhref");var f=$(".author-avatar").attr("src");var g=$(".author_page-name").text();var k=$(".author-sign").text()}else k=$(d).parent().siblings(),e=k.attr("href"),f=k.children("img").attr("src"),g=k.children("div").children(".oDrAC").text(),k=k.children("div").children(".ezzhLs").text();a.postFansArticle(e,f,g,k)}$(d).attr("disabled",!1)})}}else $.message({title:"\u63d0\u793a",message:"\u6ca1\u6709\u767b\u5f55\uff01", type:"warning"})})},circleFuncInit:function(){$(".circle-event").unbind("click").bind("click",function(a){if(0=l.length)return $.message({title:"\u901a\u77e5",message:"\u670d\u52a1\u5668\u8fd4\u56de\u9519\u8bef\uff0c\u8bf7\u91cd\u8bd5",type:"error"});var n=l.html();0>=$(".pagination",k).length&&(1===g||2===g)?$(".pagination").css("display","none"):0<$(".pagination",k).length&&(0===g||3===g)&&$(".pagination").css("display","flex");$(".item-container").html(n);var h=$(".archive-content");h.removeClass(function(m,p){return(p.match(/(^|\s)tabindex-\S+/g)||[]).join("")});h.addClass("tabindex-"+g);archiveInit.archiveLoadRebindInit()}catch(m){console.log(m)}}})})})}}, +archAuthorTabsClickInit:function(){var a=$("#archive_tabs");if(0= +m.length)return $.message({title:"\u901a\u77e5",message:"\u670d\u52a1\u5668\u8fd4\u56de\u9519\u8bef\uff0c\u8bf7\u91cd\u8bd5",type:"error"});var p=m.html();0>=$(".pagination",k).length&&(1===g||2===g)?$(".pagination").css("display","none"):0<$(".pagination",k).length&&(0===g||3===g)&&$(".pagination").css("display","flex");$(".item-container").html(p);var n=$(".archive-content");n.removeClass(function(u,v){return(v.match(/(^|\s)tabindex-\S+/g)||[]).join("")});n.addClass("tabindex-"+g);archiveInit.archiveLoadRebindInit()}catch(u){console.log(u)}}})})})}}, archiveEventInit:function(){$("#agree-btn").on("click",function(){$(this).get(0).disabled=!0;$(this).children().css("fill","rgb(228, 88, 62)");$.ajax({url:gconf.index,type:"post",data:"agree="+$(this).attr("data-cid"),async:!0,timeout:3E4,cache:!1,success:function(a){/\d/.test(a)&&$(".agree-num").html(a)},error:function(){$(this).get(0).disabled=!1}})})},commentInit:function(){function a(){$(".comment-reply a").click(function(){d=$(this).parent().parent().parent().attr("id")});$("#cancel-comment-reply-link").click(function(){d= ""})}var b=$("html,body"),c="",d="";a();var e=$("#comment-form"),f=$(".submit.btn.comment-submit");f.unbind("click").bind("click",function(g){$(this).attr("disabled",!0);e.submit()});e.submit(function(){var g=$(this).serializeArray();g[0].value=safe.stripscript(g[0].value);""===$.trim(g[0].value)?($.message({title:"\u63d0\u793a",message:"\u8bf7\u8f93\u5165\u5185\u5bb9",type:"error"}),f.attr("disabled",!1)):$.ajax({url:$(this).attr("action"),type:"post",data:g,error:function(){alert("\u63d0\u4ea4\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u5e76\u91cd\u8bd5\u6216\u8005\u8054\u7cfb\u7ba1\u7406\u5458\u3002"); -f.attr("disabled",!1);return!1},success:function(k){f.attr("disabled",!1);if($(".comment-list",k).length){c=$(".comment-list",k).html().match(/id="?comment-\d+/g).join().match(/\d+/g).sort(function(n,h){return n-h}).pop();$(".page-navigator .prev").length&&""==d&&(c="");d?(k=$("#comment-"+c,k).hide(),0>=$("#"+d).find(".comment-children").length&&$("#"+d).append("
    "),c&&$("#"+d+" .comment-children .comment-list").prepend(k),d=""):(k= -$("#comment-"+c,k).hide(),$(".comment-list").length||$(".comment-detail").prepend("

    0 \u6761\u8bc4\u8bba

      "),$(".comment-list").prepend(k));$("#comment-"+c).fadeIn();var l;$(".comment-num").length?(l=parseInt($(".comment-num").text().match(/\d+/)),$(".comment-num").html($(".comment-num").html().replace(l,l+1))):0;TypechoComment.cancelReply();$("#textarea").val("");$(".comment-reply a, #cancel-comment-reply-link").unbind("click");a();c?b.animate({scrollTop:$("#comment-"+ +f.attr("disabled",!1);return!1},success:function(k){f.attr("disabled",!1);if($(".comment-list",k).length){c=$(".comment-list",k).html().match(/id="?comment-\d+/g).join().match(/\d+/g).sort(function(p,n){return p-n}).pop();$(".page-navigator .prev").length&&""==d&&(c="");d?(k=$("#comment-"+c,k).hide(),0>=$("#"+d).find(".comment-children").length&&$("#"+d).append("
        "),c&&$("#"+d+" .comment-children .comment-list").prepend(k),d=""):(k= +$("#comment-"+c,k).hide(),$(".comment-list").length||$(".comment-detail").prepend("

        0 \u6761\u8bc4\u8bba

          "),$(".comment-list").prepend(k));$("#comment-"+c).fadeIn();var m;$(".comment-num").length?(m=parseInt($(".comment-num").text().match(/\d+/)),$(".comment-num").html($(".comment-num").html().replace(m,m+1))):0;TypechoComment.cancelReply();$("#textarea").val("");$(".comment-reply a, #cancel-comment-reply-link").unbind("click");a();c?b.animate({scrollTop:$("#comment-"+ c).offset().top-50},300):b.animate({scrollTop:$("#comments").offset().top-50},300)}else return alert("\u60a8\u8f93\u5165\u7684\u5185\u5bb9\u4e0d\u7b26\u5408\u89c4\u5219\u6216\u8005\u56de\u590d\u592a\u9891\u7e41\uff0c\u8bf7\u4fee\u6539\u5185\u5bb9\u6216\u8005\u7a0d\u7b49\u7247\u523b\u3002"),!1}});return!1})},lazyloadInit:function(){},iasInit:function(){var a=$(".a-pageLink .next");0\u52a0\u8f7d\u5b8c\u6bd5'));archiveInit.archiveLoadRebindInit()}});return!1});var b=$(".a-pageLink .comments-next");0.comment-list>.comment-list-item");d.hide();$(".comment-detail>.comment-list").append(f).fadeIn();e=$(e).find(".a-pageLink .comments-next").attr("href");void 0!==e?(b.attr("href",e),b.fadeIn()):(b.attr("style","display:none"), @@ -78,7 +83,7 @@ function(c){$(this).attr("disabled",!0);a.submit()});a.submit(function(){var c=$ a.fabtns.hasClass("fabtns-float-left")?localStorage.Argon_fabs_Floating_Status="left":localStorage.Argon_fabs_Floating_Status="right";a.fabtns.removeClass("fabtns-unloaded");a.hideAlltoolTip()},300)});this.fabtns.removeClass("fabtns-unloaded")},changefabtnDisplayStatus:function(){var a=$(window).scrollTop()/Math.max($(document).height()-$(window).height(),.01);this.readingProgressDetails.html((100*a).toFixed(0)+"%");this.readingProgressBar.css("width",(100*a).toFixed(0)+"%");400<=$(window).scrollTop()|| .5<=a?this.backToTopBtn.removeClass("fabtn-hidden"):this.backToTopBtn.addClass("fabtn-hidden")},hideAlltoolTip:function(){$("#float_action_buttons button").tooltip("hide")}},blog={init:function(){this.init_load_more()},pjax_complete:function(){this.init_load_more()},eventInit:function(){},init_load_more:function(){var a=$(".j-loadmore a");a.attr("data-href",a.attr("href"));a.removeAttr("href");a.on("click",function(){if(!$(this).attr("disabled")){$(this).html("loading...");$(this).attr("disabled", !0);var b=$(this).attr("data-href"),c=this;b&&$.ajax({url:b,type:"get",success:function(d){$(c).removeAttr("disabled");$(c).html("\u67e5\u770b\u66f4\u591a");var e=$(d).find(".article-list:not(.sticky)");$(".j-index-article.article").append(e);(d=$(d).find(".j-loadmore a").attr("href"))?$(c).attr("data-href",d):$(".j-loadmore").remove()}})}})}},utils={getQueryString:function(a){a=a.replace(/[]/,"[").replace(/[]/,"[").replace(/[]/,"\\]");a=(new RegExp("[\\?&]"+a+"=([^&#]*)")).exec(window.parent.location.href); -return null==a?"":decodeURI(a[1])},debounce:function(a,b,c){function d(){var h=Date.now()-k;h\n \n \n \n'), $(b).children().children("span:last-child").text("\u6536\u7f29"),$(b).removeClass("video-slim")):($(b).children().children("span:first-child").html('\n\n'), diff --git a/index.php b/index.php index e5f2270..23160d3 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ * OneCircle theme,也许是 typecho 第一个社交圈子主题,编辑器移植于joe,经过 joe 授权,感谢 joe * @package OneCircle * @author gogobody 即刻学术 - * @version 4.5 + * @version 4.6 * @link check https://github.com/gogobody/onecircle */ @@ -15,7 +15,7 @@ if (count($tArr) == 0) { $recommend = NULL; } else { - $recommend = $tArr['recommend']; + $recommend = array_key_exists('recommend',$tArr) ? $tArr['recommend']:''; } // if login show index if ($this->user->hasLogin()){ @@ -77,17 +77,33 @@
          options->index_middle_ads);?>
          -
          - - next()): ?> - need('components/index/article-content.php'); ?> - -
          options->list_middle_ads);?>
          - - +
          + options->enableTravel):?> +
          +
            +
          • 本站
          • +
          • 十年
          • +
          + +
          +
          随机访问十年之约友链博客 »
          +
          +
          + +
          +
          + + next()): ?> + need('components/index/article-content.php'); ?> + +
          options->list_middle_ads);?>
          + + +
          + + need('includes/post-pagination.php');?> +
          - - need('includes/post-pagination.php');?>
          + 点我去插件设置
          • 最新公告
          • 公共设置
          • @@ -36,6 +36,13 @@ function themeConfig($form)
            _t('启用'), + 0 => _t('关闭')), + 1, _t('是否启用十年之约'), _t('开启后会在动态显示十年之约的内容,了解十年之约:https://www.foreverblog.cn/')); + $enableTravel->setAttribute('class', 'j-setting-content j-setting-global'); + $form->addInput($enableTravel); + $enableMessage = new Typecho_Widget_Helper_Form_Element_Radio('enableMessage', array(1 => _t('启用'), 0 => _t('关闭')), diff --git a/libs/route.php b/libs/route.php index 51e7c5e..8bb040e 100644 --- a/libs/route.php +++ b/libs/route.php @@ -107,6 +107,16 @@ function rootRouteFunc($archive) } exit('error handle msg'); } + else if($archive->request->recommendRest){ + if($archive->request->type=='fetch10apis'){ + $page = $archive->request->page; + if(!$page) $page=1; + $baseUrl = "https://www.foreverblog.cn/api/v1/blog/feeds?page=".$page; + $ret = curl_get($baseUrl); + exit($ret); + } + exit('error handle msg'); + } // header("HTTP/1.1 404 OK"); // exit('error'); }