{"id":3307,"date":"2017-02-14T11:22:04","date_gmt":"2017-02-14T03:22:04","guid":{"rendered":"https:\/\/www.ecjtu.com\/keith\/?p=3307"},"modified":"2017-05-10T10:42:47","modified_gmt":"2017-05-10T02:42:47","slug":"phpcms-v9-%e6%a8%a1%e6%9d%bf%e6%a0%87%e7%ad%be%e8%af%b4%e6%98%8e%e6%95%b4%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.ecjtu.com\/keith\/archives\/3307","title":{"rendered":"phpcms v9 \u6a21\u677f\u6807\u7b7e\u8bf4\u660e\u6574\u7406\u53ca\u8def\u5f84\u8c03\u7528"},"content":{"rendered":"<pre class=\"sh_html sh_sourceCode\" name=\"code\">{template \"content\",\"header\"}<\/pre>\n<p>\u8c03\u7528\u6839\u76ee\u5f55\u4e0bphpcms\\template\\content\\header\u6587\u4ef6<\/p>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\">{CHARSET}<\/pre>\n<p>\u5b57\u7b26\u96c6\u00a0\uff08gbk\u6216\u8005utf-8\uff09<\/p>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\">{if isset($SEO['title']) &amp;&amp; !empty($SEO['title'])}\r\n{$SEO['title']}{\/if}\r\n{$SEO['site_title']}\r\n{$SEO['keyword']}\r\n{$SEO['description']}<\/pre>\n<p>\u6807\u9898\u548c\u6807\u9898seo\u4f18\u5316<\/p>\n<pre class=\"lang:default decode:true \">{APP_PATH} \u5b8c\u6574\u9996\u9875\u7f51\u5740 https:\/\/www.ecjtu.com\/\r\n{siteurl($siteid)} \u5e26http\u7684\u9996\u9875\u7f51\u5740\uff0chttps:\/\/www.ecjtu.com\r\n{SITE_URL} \u4e0d\u5e26http\u7684\u9996\u9875\u7f51\u5740 www.ecjtu.com \u4efb\u4f55\u4f4d\u7f6e\u90fd\u53ef\u8c03\u7528\r\n{WEB_PATH}  \u7f51\u7ad9\u6839\u8def\u5f84\uff0c\u5982\u679c\u7f51\u7ad9\u5b89\u88c5\u5728\u6839\u76ee\u5f55\uff0c\u76f4\u63a5\u663e\u793a \/\r\n{CSS_PATH} CSS\u6587\u4ef6\u5939\u8def\u5f84\uff0c\u9ed8\u8ba4\u4e3a\\statics\\css\r\n{JS_PATH}  JS\u6587\u4ef6\u5939\u8def\u5f84\uff0c\u9ed8\u8ba4\u4e3a\\statics\\js\r\n{IMG_PATH} \u56fe\u7247\u8def\u5f84\r\n{CACHE_PATH} \u7f13\u5b58\u6587\u4ef6\u5939\u5730\u5740\r\n{LUGIN_STATICS_PATH} \u5e94\u7528\u9759\u6001\u6587\u4ef6\u8def\u5f84\r\n\u6700\u540e\u8bf4\u4e0b\u6700\u5e38\u7528\u7684{siteurl($siteid)}\uff0c\u5728\u6807\u7b7e\u5217\u8868\u9875tag_list\u65e0\u6cd5\u83b7\u53d6\u5f53\u524d\u7ad9\u70b9ID\uff0c\u800c\u4e14\u4f1a\u62d6\u6162\u6807\u7b7e\u5217\u8868\u9875\u6253\u5f00\u901f\u5ea6\uff0c\u624b\u52a8\u6307\u5b9a\u7ad9\u70b9ID\u53ef\u89e3\u51b3\u95ee\u9898\u3002<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\">{pc:content  action=\"position\" posid=\"9\" order=\"id\" num=\"10\" cache=\"3600\"}<\/pre>\n<p>pc\u6807\u7b7e{pc:content\u00a0\u53c2\u6570\u540d=&#8221;\u53c2\u6570\u503c&#8221;\u53c2\u6570\u540d=&#8221;\u53c2\u6570\u503c&#8221;\u53c2\u6570\u540d=&#8221;\u53c2\u6570\u503c&#8221;}<\/p>\n<pre class=\"sh_html sh_sourceCode \" name=\"code\">{loop $data $k $v}\r\n      <span class=\"sh_keyword\">&lt;li&gt;&lt;a<\/span> <span class=\"sh_type\">href<\/span><span class=\"sh_symbol\">=<\/span><span class=\"sh_string\">\"{$v[url]}\"<\/span><span class=\"sh_keyword\">&gt;<\/span>{$v[title]}<span class=\"sh_keyword\">&lt;\/a&gt;&lt;\/li&gt;<\/span>\r\n{\/loop}<\/pre>\n<p><strong>pc\u6807\u7b7e\u503c<\/strong><\/p>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\">action=\"position\"--------------\u5bf9\u8bdd\u6846\u7684\u7c7b\u578b=\u201c\u5185\u5bb9\u63a8\u8350\u4f4d\u5217\u8868\u201d\r\nposid=\"9\"----------------------\u63a8\u8350\u4f4dID=\"9\"\r\norder=\"id\"---------------------\u6392\u5e8f\u7c7b\u578b=\"id\"\r\nnum=\"10\" ----------------------\u6570\u636e\u8c03\u7528\u6570\u91cf=\"10\"\r\ncache=\"3600\"-------------------\u7f13\u5b58=\"3600\"\u6beb\u79d2\r\n\r\n{get_siteid()}\r\n{IMG_PATH}\r\naction=\"hits\"\u00a0\u6392\u884c\uff0c\u70ed\u70b9\u7b49\r\naction=\"lists\"\u00a0\u4e3b\u8981\u7528\u4e8e\u5217\u8868\u7b49\u3002\r\ncatid=\"$catid\"\u00a0\u5f53\u524d\u680f\u76eeID\u00a0\u00a0\u00a0\u6307\u5b9a\u6570\u5b57\uff0c\u5373\u4e3a\u6307\u5b9a\u7684\u680f\u76ee\r\nnum=\"\"\u00a0\u00a0\u8c03\u7528\u6587\u7ae0\u7684\u6570\u91cf\r\norder=\"id DESC\"\u00a0\u6309ID\u964d\u5e8f\u6392\u5217\r\norder=\"id ASC\"\u00a0\u00a0\u6309ID\u5347\u5e8f\u6392\u5217\r\n\"views DESC\"\u00a0\r\nsort=\"\"\r\n\"1\"\u00a0\u7f29\u7565\u56fe\r\nreturn=\"\"\r\npage=\"$page\"\u00a0\u9700\u8981\u5206\u9875<\/pre>\n<p><strong>\u6bcf\u5f53\u5217\u8868\u51e0\u884c\u7684\u65f6\u5019\u51fa\u73b0\u4e00\u6b21\u8fd9\u4e2a<\/strong><\/p>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\">{if $num%2==0}   {\/if}<\/pre>\n<p><strong>\u5faa\u73af\u6807\u7b7e<\/strong><\/p>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\">{loop $data $r}  {\/loop}\r\n{loop $info $r}  {\/loop}<\/pre>\n<pre class=\"lang:default decode:true\">\u65e5\u671f-------------{date('Y-m-d H:i:s',$r[inputtime])}\r\n\u6587\u7ae0\u94fe\u63a5------{$r[url]}\r\n\u6587\u7ae0\u6807\u9898------{$r[title]}\r\n\u6807\u9898\u622a\u53d6------{str_cut($r[title],40,'...')}\r\n\u6587\u7ae0\u6458\u8981------{$r[description]}\r\n\u5206\u9875\u6807\u7b7e------{$pages}<\/pre>\n<p><strong>\u7f29\u7565\u56fe<\/strong>&#8212;&#8212;&#8212;loop\u662finfo\u7684\u65f6\u5019\u7528\u00a0\u00a0{thumb($r[thumb],110,0)}\u00a0\u00a0\u00a0\u00a0\u00a0loop\u662fdata\u7684\u65f6\u5019\u7528{thumb($v[thumb],90,0)}<br \/>\n\u6b64\u51fd\u6570\u7c7b\u4f3cphp\u624b\u518c\u7684\u8868\u73b0\u5f62\u5f0f\u4e3a\uff1a<br \/>\nstring thumb( string $imgurl, [int $width = 100], [int $height = 100], [int $autocut = 1], [string $smallpic = &#8216;images\/nopic_small.gif&#8217;]\u00a0 )<br \/>\n\u529f\u80fd\uff1a<br \/>\n\u8c03\u7528\u7f29\u7565\u56fe<br \/>\n\u53c2\u6570\uff1a<br \/>\nstring $imgurl:\u56fe\u7247\u5730\u5740<br \/>\nint $width:\u56fe\u7247\u5bbd\u5ea6\uff0c\u53ef\u9009\u53c2\u6570\uff0c\u9ed8\u8ba4\u4e3a100<br \/>\nint $height:\u56fe\u7247\u9ad8\u5ea6\uff0c\u53ef\u9009\u53c2\u6570\uff0c\u9ed8\u8ba4\u4e3a100<br \/>\nint $autocut:\u662f\u5426\u81ea\u52a8\u88c1\u5207\uff0c\u53ef\u9009\u53c2\u6570\uff0c\u9ed8\u8ba4\u4e3a1\uff0c\u4e3a0\u65f6\uff0c\u5c06\u53ea\u7b49\u6bd4\u538b\u7f29\uff0c\u53ef\u80fd\u51fa\u73b0\u56fe\u7247\u53d8\u5f62<br \/>\nstring $smallpic:\u65e0\u56fe\u7247\u65f6\u663e\u793a\u7684\u5c0f\u56fe\u7247\u5730\u5740\uff0c\u53ef\u9009\u53c2\u6570\uff0c\u9ed8\u8ba4\u4e3a images\/nopic_small.gif<br \/>\n\u793a\u4f8b\uff1a<br \/>\n{thumb($r[thumb], 160, 100,0)}<br \/>\n\u89e3\u6790\uff1a<br \/>\n\u8c03\u7528\u7f29\u7565\u56fe\uff1a{thumb(\u56fe\u7247\u8def\u5f84,\u5bbd\u4e3a160,\u9ad8\u4e3a100,0\u4e3a\u7b49\u6bd4\u538b\u7f29)}<\/p>\n<pre class=\"lang:php decode:true  \">{if $r[thumb]}\r\n\u6709\u7f29\u7565\u56fe\r\n{else}\r\n\u6ca1\u6709\u7f29\u7565\u56fe\r\n{\/if}<\/pre>\n<p><strong>\u6587\u7ae0\u9875\u6807\u7b7e<\/strong><\/p>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\">\u6807\u9898-------{$title}\r\n\u5185\u5bb9-------{$content}\r\n\u65e5\u671f-------{$inputtime}\r\n\u6765\u6e90-------{$copyfrom}\r\n\u70b9\u51fb\u6570------<span class=\"sh_keyword\">&lt;span<\/span> <span class=\"sh_type\">id<\/span><span class=\"sh_symbol\">=<\/span><span class=\"sh_string\">\"hits\"<\/span><span class=\"sh_keyword\">&gt;&lt;\/span&gt;<\/span><\/pre>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\"><span class=\"sh_keyword\">&lt;script<\/span> <span class=\"sh_type\">language<\/span><span class=\"sh_symbol\">=<\/span><span class=\"sh_string\">\"JavaScript\"<\/span> <span class=\"sh_type\">src<\/span><span class=\"sh_symbol\">=<\/span><span class=\"sh_string\">\"{APP_PATH}api.php?op=count&amp;id={$id}&amp;modelid={$modelid}\"<\/span><span class=\"sh_keyword\">&gt;&lt;\/script&gt;<\/span><\/pre>\n<p><strong>\u7f51\u7ad9\u9996\u9875<\/strong>&#8212;&#8212;&#8212;&#8212;&#8212;-{siteurl($siteid)}<br \/>\n<strong>\u5f53\u524d\u4f4d\u7f6e<\/strong>&#8212;&#8212;&#8212;&#8212;&#8212;-{catpos($catid)}<br \/>\n<strong>\u680f\u76ee\u540d\u79f0<\/strong>&#8212;&#8212;&#8212;&#8212;&#8212;-{$CAT[catname]}<br \/>\n<strong>\u680f\u76ee\u62fc\u97f3<\/strong>&#8212;&#8212;&#8212;&#8212;&#8212;-{$CAT[letter]}<br \/>\n<strong>\u680f\u76ee\u94fe\u63a5<\/strong>&#8212;&#8212;&#8212;&#8212;&#8212;-{$CAT[url]}<br \/>\n<strong>\u7236\u680f\u76ee\u540d\u79f0<\/strong>&#8212;&#8212;&#8212;&#8212;&#8211;{$CATEGORYS[$CAT[parentid]][catname]}<br \/>\n<strong>\u7236\u680f\u76ee\u94fe\u63a5<\/strong>&#8212;&#8212;&#8212;&#8212;&#8211;{$CATEGORYS[$CAT[parentid]][url]}<br \/>\n<strong>\u4e0a\u4e0a\u7ea7\u680f\u76ee\u540d\u79f0<\/strong>&#8212;&#8212;&#8211;{$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][catname]}<br \/>\n<strong>\u4e0a\u4e0a\u7ea7\u680f\u76ee\u94fe\u63a5<\/strong>&#8212;&#8212;&#8211;{$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][url]}<\/p>\n<pre class=\"lang:default decode:true \">{$CATEGORY[$catid]['url']} \u6307\u5b9a\u680f\u76eeURL\u4ee3\u7801\r\n{$CATEGORY[$catid]['catname']} \u6307\u5b9a\u680f\u76ee\u540d\u79f0\u4ee3\u7801\r\n{$CATEGORYS[6][url]}\u00a0\u00a0\u6307\u5b9a\u680f\u76eeID\u4e3a6\u7684URL\r\n{$CATEGORYS[6][catname]}\u6307\u5b9a\u680f\u76eeID\u4e3a6\u7684\u680f\u76ee\u540d<\/pre>\n<p><strong>\u4e00\u7ea7\u7236\u680f\u76ee\u5217\u8868<\/strong><\/p>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\">{pc:content action=\"category\" catid=\"0\" num=\"34\" siteid=\"$siteid\" order=\"listorder ASC\"}\r\n      {loop $data $r}\r\n            <span class=\"sh_keyword\">&lt;li&gt;&lt;a<\/span> <span class=\"sh_type\">href<\/span><span class=\"sh_symbol\">=<\/span><span class=\"sh_string\">\"{$r[url]}\"<\/span><span class=\"sh_keyword\">&gt;<\/span>{$r[catname]}<span class=\"sh_keyword\">&lt;\/a&gt;&lt;\/li&gt;<\/span>\r\n      {\/loop}\r\n{\/pc}<\/pre>\n<p><strong>\u540c\u7ea7\u680f\u76ee\u5217\u8868<\/strong><\/p>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\">{pc:content action=\"category\" catid=\"$parentid\" num=\"12\" siteid=\"$siteid\" order=\"listorder ASC\"}\r\n      {loop $data $r}\r\n            <span class=\"sh_keyword\">&lt;li&gt;&lt;a<\/span> <span class=\"sh_type\">href<\/span><span class=\"sh_symbol\">=<\/span><span class=\"sh_string\">\"{$r[url]}\"<\/span><span class=\"sh_keyword\">&gt;<\/span>{$r[catname]}<span class=\"sh_keyword\">&lt;\/a&gt;&lt;\/li&gt;<\/span>\r\n       {\/loop}\r\n{\/pc}<\/pre>\n<p><strong>\u7ec4\u56fe\u5217\u8868<\/strong><\/p>\n<pre class=\"sh_html sh_sourceCode\" name=\"code\">{loop $photos $r} \r\n<span class=\"sh_keyword\">&lt;li&gt;&lt;a<\/span> <span class=\"sh_type\">href<\/span><span class=\"sh_symbol\">=<\/span><span class=\"sh_string\">\"{$r[url]}\"<\/span><span class=\"sh_keyword\">&gt;&lt;img<\/span> <span class=\"sh_type\">src<\/span><span class=\"sh_symbol\">=<\/span><span class=\"sh_string\">\"{thumb($r[url], 75, 45, 0)}\"<\/span> <span class=\"sh_type\">alt<\/span><span class=\"sh_symbol\">=<\/span><span class=\"sh_string\">\"{$r[alt]}\"<\/span> <span class=\"sh_keyword\">\/&gt;&lt;\/a&gt;&lt;\/li&gt;<\/span>\r\n{\/loop}<\/pre>\n<p>\u6ce8\u91ca\uff1a\u5176\u4e2d$photos\u4e3a\u81ea\u5b9a\u4e49\u7ec4\u56fe\u5b57\u6bb5\uff0c{$r[url]}\u4e3a\u56fe\u7247\u5730\u5740\uff0c{thumb($r[url], 75, 45, 0)}\u4e3a\u56fe\u7247\u7f29\u7565\u56fe\uff0c{$r[alt]}\u4e3a\u56fe\u7247\u63cf\u8ff0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>{template &#8220;content&#8221;,&#8221;header&#8221;} \u8c03\u7528\u6839\u76ee\u5f55\u4e0bphpcms\\template\\con [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66,905],"tags":[960],"_links":{"self":[{"href":"https:\/\/www.ecjtu.com\/keith\/wp-json\/wp\/v2\/posts\/3307"}],"collection":[{"href":"https:\/\/www.ecjtu.com\/keith\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecjtu.com\/keith\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecjtu.com\/keith\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecjtu.com\/keith\/wp-json\/wp\/v2\/comments?post=3307"}],"version-history":[{"count":0,"href":"https:\/\/www.ecjtu.com\/keith\/wp-json\/wp\/v2\/posts\/3307\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ecjtu.com\/keith\/wp-json\/wp\/v2\/media?parent=3307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecjtu.com\/keith\/wp-json\/wp\/v2\/categories?post=3307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecjtu.com\/keith\/wp-json\/wp\/v2\/tags?post=3307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}