{"id":71,"date":"2025-06-08T22:26:01","date_gmt":"2025-06-08T14:26:01","guid":{"rendered":"https:\/\/gihut.com\/?p=71"},"modified":"2025-06-17T11:10:25","modified_gmt":"2025-06-17T03:10:25","slug":"%e5%a6%82%e4%bd%95%e7%bb%99wp%e6%b7%bb%e5%8a%a0%e4%b8%80%e4%b8%aa%e7%ae%80%e5%8d%95%e7%9a%84%e4%b8%80%e8%a8%80","status":"publish","type":"post","link":"https:\/\/gihut.com\/71.html","title":{"rendered":"\u5982\u4f55\u7ed9wp\u6dfb\u52a0\u4e00\u4e2a\u7b80\u5355\u7684\u4e00\u8a00"},"content":{"rendered":"<p>\u9996\u5148\u5728\u4e3b\u9898\u76ee\u5f55\u4e0b\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939<code>yiyan<\/code><br \/>\n\u5728\u8be5\u76ee\u5f55\u4e0b\u65b0\u5efa\u4e00\u4e2a<code>qv-yiyan.php<\/code>\u6587\u4ef6\uff0c\u4ee3\u7801\u5982\u4e0b<\/p>\n<pre class=\"line-numbers\"><code class=\"language-php\">\r\n\/\/\u83b7\u53d6\u53e5\u5b50\u6587\u4ef6\u7684\u7edd\u5bf9\u8def\u5f84\r\n$path = dirname(__FILE__);\r\n$file = file($path.&quot;\/qv-yiyan.txt&quot;);\r\n\/\/\u968f\u673a\u8bfb\u53d6\u4e00\u884c\r\n$arr = mt_rand( 0, count( $file ) - 2 );\r\n$arr = ($arr % 2 === 0) ? $arr + 1 : $arr;\r\n$content  = trim($file[$arr]).'\/&amp;\/'.trim($file[$arr+1]);\r\n\/\/\u7f16\u7801\u5224\u65ad\uff0c\u7528\u4e8e\u8f93\u51fa\u76f8\u5e94\u7684\u54cd\u5e94\u5934\u90e8\u7f16\u7801\r\nif (isset($_GET['charset']) &amp;&amp; !empty($_GET['charset'])) {\r\n    $charset = $_GET['charset'];\r\n    if (strcasecmp($charset,&quot;gbk&quot;) == 0 ) {\r\n        $content = mb_convert_encoding($content,'gbk', 'utf-8');\r\n    }\r\n} else {\r\n    $charset = 'utf-8';\r\n}\r\nheader(&quot;Content-Type: text\/html; charset=$charset&quot;);\r\necho $content;\r\n<\/code><\/pre>\n<p>\u5728\u540c\u7ea7\u76ee\u5f55\u4e0b\u65b0\u5efa\u4e00\u4e2a<code>qv-yiyan.txt<\/code>\uff0c\u7528\u6765\u5b58\u653e\u6587\u5fc3<a href=\"https:\/\/gihut.com\/tag\/%e4%b8%80%e8%a8%80\" class=\"b2tooltipbox\"  data-title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e \u4e00\u8a00 \u7684\u6587\u7ae0\" target=\"_blank\">\u4e00\u8a00<\/a>\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre class=\"line-numbers\"><code class=\"language-php\">\r\n\u53cc\u8bed\u4e00\u8a00-\u503e\u5fae\u79d1\u6280\r\nNothing is more terrible than ignorance in action.\r\n\u6700\u53ef\u6015\u7684\u4e8b\u83ab\u8fc7\u4e8e\u65e0\u77e5\u800c\u884c\u52a8\r\nThe wise man is always a good listener.\r\n\u667a\u6167\u6bd4\u8d22\u5bcc\u66f4\u5b9d\u8d35\r\nThe greatest test of courage on earth is to bear defeat without losing heart.\r\n\u4e16\u754c\u4e0a\u5bf9\u52c7\u6c14\u7684\u6700\u5927\u8003\u9a8c\u662f\u5fcd\u53d7\u5931\u8d25\u800c\u4e0d\u4e27\u5931\u4fe1\u5fc3\r\n<\/code><\/pre>\n<p><strong>\u8c03\u7528\u65b9\u6cd5<\/strong><br \/>\n\u5728\u5408\u9002\u7684\u4f4d\u7f6e\u6dfb\u52a0\u4e0b\u9762\u4ee3\u7801\uff0c<code>random-sentence<\/code>\u662f\u8f93\u51fa\u4f4d\u7f6e\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-js\">\r\n&lt;div id=&quot;random-sentence&quot;&gt;&lt;\/div&gt;\r\n\r\n&lt;script&gt;\r\n    function yiyan_nr() {\r\n        var yylink = &quot;&lt;?php echo get_template_directory_uri(); ?&gt;\/yiyan\/qv-yiyan.php&quot;;\r\n        \/\/var yylink = THEME_URI.'\/yiyan\/qv-yiyan.php';\r\n        fetch(yylink)\r\n            .then(response =&gt; response.text())\r\n            .then(data =&gt; {\r\n                var lines = data.split(&quot;\/&amp;\/&quot;);\r\n                if (lines.length &gt;= 2) {\r\n                    var html = '&lt;div class=&quot;cn&quot;&gt;' + lines[0] + '&lt;\/div&gt;&lt;div class=&quot;en&quot;&gt;' + lines[1] + &quot;&lt;\/div&gt;&quot;;\r\n                    document.getElementById('random-sentence').innerHTML = html;\r\n                }\r\n            })\r\n            .catch(error =&gt; {\r\n                console.error('\u8bf7\u6c42\u5931\u8d25:', error);\r\n            });\r\n    }\r\n\r\n    yiyan_nr(); \/\/ \u9875\u9762\u52a0\u8f7d\u65f6\u6267\u884c\r\n&lt;\/script&gt;\r\n<\/code><\/pre>\n<p>\u6559\u7a0b\u7ed3\u675f\uff0c\u4e00\u4e2a\u53cc\u8bed\u4e00\u8a00\u5c31\u5b8c\u7f8e\u6dfb\u52a0\u6210\u529f\u4e86\uff01<\/p>\n<p>\u5982\u679c\u4f60\u53ea\u60f3\u4e00\u4e2a\u7b80\u5355\u7684\u4e00\u8a00\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u540e\u53f0\u8bbe\u7f6e\u4e00\u4e2a\u4e00\u8a00\u5b57\u6bb5\uff0c\u7136\u540e\u76f4\u63a5\u8c03\u7528\uff01<\/p>\n<p><div class=\"lock-content \" id=\"lock-content-HjXFxTw0Ix6850dca1bdb2e\">\n    <div class=\"lock-body\">\n        <div class=\"lock-body-roles\">\n            <div>\n                <div class=\"lock-tip\">\n                    <span><i class=\"hzfont hzfont-lock\"><\/i>\u9690\u85cf\u5185\u5bb9\uff0c\u652f\u4ed8\u540e\u9605\u8bfb<\/span>\n                <\/div>\n                <div class=\"lock-buy-count\">\n                    <span>\u5df2\u7ecf\u6709<b>0<\/b>\u4eba\u8d2d\u4e70\u67e5\u770b\u4e86\u6b64\u5185\u5bb9<\/span>\n                <\/div>\n                <div class=\"lock-reason\">\n                    <div class=\"price-wrap\"><i class=\"hzfont hzfont-cny price-currency\"><\/i><span class=\"price-num\">5.00<\/span><\/div><\/div><\/div><div class=\"lock-action flex\">\n                                    <div class=\"remind radius cursor-pointer user-login button btn-success\">\u7acb\u5373\u767b\u5f55<\/div>\n                <\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"\u9996\u5148\u5728\u4e3b\u9898\u76ee\u5f55\u4e0b\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939yiyan \u5728\u8be5\u76ee\u5f55\u4e0b\u65b0\u5efa\u4e00\u4e2aqv-yiyan.php\u6587\u4ef6\uff0c\u4ee3\u7801\u5982\u4e0b \/\/\u83b7\u53d6\u53e5\u5b50\u6587\u4ef6\u7684\u7edd\u5bf9\u8def\u5f84 $path = dirname(__FILE__); $file = f","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[18],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-worsdpress","tag-18"],"views":902,"_links":{"self":[{"href":"https:\/\/gihut.com\/api\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gihut.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gihut.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gihut.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gihut.com\/api\/wp\/v2\/comments?post=71"}],"version-history":[{"count":0,"href":"https:\/\/gihut.com\/api\/wp\/v2\/posts\/71\/revisions"}],"wp:attachment":[{"href":"https:\/\/gihut.com\/api\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gihut.com\/api\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gihut.com\/api\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}