Maccms.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. <?php
  2. namespace app\common\taglib;
  3. use think\template\TagLib;
  4. use think\Db;
  5. class Maccms extends Taglib {
  6. protected $tags = [
  7. 'link'=> ['attr'=>'order,by,type,not,start,num,cachetime'],
  8. 'area'=> ['attr'=>'order,start,num'],
  9. 'lang'=> ['attr'=>'order,start,num'],
  10. 'year'=> ['attr'=>'order,start,num'],
  11. 'class'=> ['attr'=>'order,start,num'],
  12. 'version'=> ['attr'=>'order,start,num'],
  13. 'state'=> ['attr'=>'order,start,num'],
  14. 'letter'=> ['attr'=>'order,start,num'],
  15. 'type' => ['attr' =>'order,by,start,num,id,ids,not,parent,flag,mid,format,cachetime'],
  16. 'comment'=>['attr' =>'order,by,start,num,paging,pageurl,id,pid,rid,mid,uid,half'],
  17. 'gbook'=>['attr' =>'order,by,start,num,paging,pageurl,rid,uid,half'],
  18. 'role'=>['attr' =>'order,by,start,num,paging,pageurl,id,ids,not,rid,actor,name,level,letter,half,timeadd,timehits,time,cachetime'],
  19. 'actor'=>['attr' =>'order,by,start,num,paging,pageurl,id,ids,not,area,sex,name,level,letter,type,typenot,starsign,blood,half,timeadd,timehits,time,cachetime'],
  20. 'topic' => ['attr' =>'order,by,start,num,id,ids,not,paging,pageurl,class,tag,half,timeadd,timehits,time,cachetime'],
  21. 'art' => ['attr' =>'order,by,start,num,id,ids,not,paging,pageurl,type,typenot,class,tag,level,letter,half,rel,timeadd,timehits,time,hitsmonth,hitsweek,hitsday,hits,cachetime'],
  22. 'vod' => ['attr' =>'order,by,start,num,id,ids,not,paging,pageurl,type,typenot,class,tag,area,lang,year,level,letter,half,rel,version,state,tv,weekday,timeadd,timehits,time,hitsmonth,hitsweek,hitsday,hits,isend,cachetime'],
  23. 'website'=>['attr' =>'order,by,start,num,paging,pageurl,id,ids,not,area,lang,name,level,letter,type,typenot,half,timeadd,timehits,time,cachetime'],
  24. 'foreach' => ['attr'=>'name,id,key'],
  25. 'for' => ['attr'=>'start,end,comparison,step,name'],
  26. ];
  27. public function tagFor($tag,$content)
  28. {
  29. if(empty($tag['start'])){
  30. $tag['start'] = 1;
  31. }
  32. if(empty($tag['end'])){
  33. $tag['end'] = 5;
  34. }
  35. if(empty($tag['comparison'])){
  36. $tag['comparison'] = 'elt';
  37. }
  38. if(empty($tag['step'])){
  39. $tag['step'] = 1;
  40. }
  41. if(empty($tag['name'])){
  42. $tag['name'] = 'i';
  43. }
  44. $parse='';
  45. $parse .= '{for start="'.$tag['start'].'" end="'.$tag['end'].'" comparison="'.$tag['comparison'].'" step="'.$tag['step'].'" name="'.$tag['name'].'"}';
  46. $parse .= $content;
  47. $parse .= '{/for}';
  48. return $parse;
  49. }
  50. public function tagForeach($tag,$content)
  51. {
  52. if(empty($tag['id'])){
  53. $tag['id'] = 'vo';
  54. }
  55. if(empty($tag['key'])){
  56. $tag['key'] = 'key';
  57. }
  58. // foreach标签强化
  59. // https://github.com/magicblack/maccms10/issues/984
  60. $parse_addon = '';
  61. if(!empty($tag['offset'])){
  62. $parse_addon .= ' offset="'.$tag['offset'].'"';
  63. }
  64. if(!empty($tag['length'])){
  65. $parse_addon .= ' length="'.$tag['length'].'"';
  66. }
  67. if(!empty($tag['mod'])){
  68. $parse_addon .= ' mod="'.$tag['mod'].'"';
  69. }
  70. if(!empty($tag['empty'])){
  71. $parse_addon .= ' empty="'.$tag['empty'].'"';
  72. }
  73. $parse='';
  74. $parse .= '{foreach name="'.$tag['name'].'" id="'.$tag['id'].'" key="'.$tag['key'].'"' . $parse_addon . '}';
  75. $parse .= $content;
  76. $parse .= '{/foreach}';
  77. return $parse;
  78. }
  79. public function tagArea($tag,$content)
  80. {
  81. if(empty($tag['id'])){
  82. $tag['id'] = 'vo';
  83. }
  84. if(empty($tag['key'])){
  85. $tag['key'] = 'key';
  86. }
  87. $parse = '<?php ';
  88. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  89. $parse .= '$__LIST__ = model("Extend")->areaData($__TAG__);';
  90. $parse .= ' ?>';
  91. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  92. if(!empty($tag['offset'])){
  93. $parse .= ' offset="'.$tag['offset'].'"';
  94. }
  95. if(!empty($tag['length'])){
  96. $parse .= ' length="'.$tag['length'].'"';
  97. }
  98. if(!empty($tag['mod'])){
  99. $parse .= ' mod="'.$tag['mod'].'"';
  100. }
  101. if(!empty($tag['empty'])){
  102. $parse .= ' empty="'.$tag['empty'].'"';
  103. }
  104. $parse .= '}';
  105. $parse .= $content;
  106. $parse .= '{/volist}';
  107. return $parse;
  108. }
  109. public function tagLang($tag,$content)
  110. {
  111. if(empty($tag['id'])){
  112. $tag['id'] = 'vo';
  113. }
  114. if(empty($tag['key'])){
  115. $tag['key'] = 'key';
  116. }
  117. $parse = '<?php ';
  118. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  119. $parse .= '$__LIST__ = model("Extend")->langData($__TAG__);';
  120. $parse .= ' ?>';
  121. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  122. if(!empty($tag['offset'])){
  123. $parse .= ' offset="'.$tag['offset'].'"';
  124. }
  125. if(!empty($tag['length'])){
  126. $parse .= ' length="'.$tag['length'].'"';
  127. }
  128. if(!empty($tag['mod'])){
  129. $parse .= ' mod="'.$tag['mod'].'"';
  130. }
  131. if(!empty($tag['empty'])){
  132. $parse .= ' empty="'.$tag['empty'].'"';
  133. }
  134. $parse .= '}';
  135. $parse .= $content;
  136. $parse .= '{/volist}';
  137. return $parse;
  138. }
  139. public function tagClass($tag,$content)
  140. {
  141. if(empty($tag['id'])){
  142. $tag['id'] = 'vo';
  143. }
  144. if(empty($tag['key'])){
  145. $tag['key'] = 'key';
  146. }
  147. $parse = '<?php ';
  148. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  149. $parse .= '$__LIST__ = model("Extend")->classData($__TAG__);';
  150. $parse .= ' ?>';
  151. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  152. if(!empty($tag['offset'])){
  153. $parse .= ' offset="'.$tag['offset'].'"';
  154. }
  155. if(!empty($tag['length'])){
  156. $parse .= ' length="'.$tag['length'].'"';
  157. }
  158. if(!empty($tag['mod'])){
  159. $parse .= ' mod="'.$tag['mod'].'"';
  160. }
  161. if(!empty($tag['empty'])){
  162. $parse .= ' empty="'.$tag['empty'].'"';
  163. }
  164. $parse .= '}';
  165. $parse .= $content;
  166. $parse .= '{/volist}';
  167. return $parse;
  168. }
  169. public function tagYear($tag,$content)
  170. {
  171. if(empty($tag['id'])){
  172. $tag['id'] = 'vo';
  173. }
  174. if(empty($tag['key'])){
  175. $tag['key'] = 'key';
  176. }
  177. $parse = '<?php ';
  178. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  179. $parse .= '$__LIST__ = model("Extend")->YearData($__TAG__);';
  180. $parse .= ' ?>';
  181. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  182. if(!empty($tag['offset'])){
  183. $parse .= ' offset="'.$tag['offset'].'"';
  184. }
  185. if(!empty($tag['length'])){
  186. $parse .= ' length="'.$tag['length'].'"';
  187. }
  188. if(!empty($tag['mod'])){
  189. $parse .= ' mod="'.$tag['mod'].'"';
  190. }
  191. if(!empty($tag['empty'])){
  192. $parse .= ' empty="'.$tag['empty'].'"';
  193. }
  194. $parse .= '}';
  195. $parse .= $content;
  196. $parse .= '{/volist}';
  197. return $parse;
  198. }
  199. public function tagVersion($tag,$content)
  200. {
  201. if(empty($tag['id'])){
  202. $tag['id'] = 'vo';
  203. }
  204. if(empty($tag['key'])){
  205. $tag['key'] = 'key';
  206. }
  207. $parse = '<?php ';
  208. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  209. $parse .= '$__LIST__ = model("Extend")->versionData($__TAG__);';
  210. $parse .= ' ?>';
  211. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  212. if(!empty($tag['offset'])){
  213. $parse .= ' offset="'.$tag['offset'].'"';
  214. }
  215. if(!empty($tag['length'])){
  216. $parse .= ' length="'.$tag['length'].'"';
  217. }
  218. if(!empty($tag['mod'])){
  219. $parse .= ' mod="'.$tag['mod'].'"';
  220. }
  221. if(!empty($tag['empty'])){
  222. $parse .= ' empty="'.$tag['empty'].'"';
  223. }
  224. $parse .= '}';
  225. $parse .= $content;
  226. $parse .= '{/volist}';
  227. return $parse;
  228. }
  229. public function tagState($tag,$content)
  230. {
  231. if(empty($tag['id'])){
  232. $tag['id'] = 'vo';
  233. }
  234. if(empty($tag['key'])){
  235. $tag['key'] = 'key';
  236. }
  237. $parse = '<?php ';
  238. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  239. $parse .= '$__LIST__ = model("Extend")->stateData($__TAG__);';
  240. $parse .= ' ?>';
  241. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  242. if(!empty($tag['offset'])){
  243. $parse .= ' offset="'.$tag['offset'].'"';
  244. }
  245. if(!empty($tag['length'])){
  246. $parse .= ' length="'.$tag['length'].'"';
  247. }
  248. if(!empty($tag['mod'])){
  249. $parse .= ' mod="'.$tag['mod'].'"';
  250. }
  251. if(!empty($tag['empty'])){
  252. $parse .= ' empty="'.$tag['empty'].'"';
  253. }
  254. $parse .= '}';
  255. $parse .= $content;
  256. $parse .= '{/volist}';
  257. return $parse;
  258. }
  259. public function tagLetter($tag,$content)
  260. {
  261. if(empty($tag['id'])){
  262. $tag['id'] = 'vo';
  263. }
  264. if(empty($tag['key'])){
  265. $tag['key'] = 'key';
  266. }
  267. $parse = '<?php ';
  268. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  269. $parse .= '$__LIST__ = model("Extend")->letterData($__TAG__);';
  270. $parse .= ' ?>';
  271. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  272. if(!empty($tag['offset'])){
  273. $parse .= ' offset="'.$tag['offset'].'"';
  274. }
  275. if(!empty($tag['length'])){
  276. $parse .= ' length="'.$tag['length'].'"';
  277. }
  278. if(!empty($tag['mod'])){
  279. $parse .= ' mod="'.$tag['mod'].'"';
  280. }
  281. if(!empty($tag['empty'])){
  282. $parse .= ' empty="'.$tag['empty'].'"';
  283. }
  284. $parse .= '}';
  285. $parse .= $content;
  286. $parse .= '{/volist}';
  287. return $parse;
  288. }
  289. public function tagLink($tag,$content)
  290. {
  291. if(empty($tag['id'])){
  292. $tag['id'] = 'vo';
  293. }
  294. if(empty($tag['key'])){
  295. $tag['key'] = 'key';
  296. }
  297. $parse = '<?php ';
  298. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  299. $parse .= '$__LIST__ = model("Link")->listCacheData($__TAG__);';
  300. $parse .= ' ?>';
  301. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  302. if(!empty($tag['offset'])){
  303. $parse .= ' offset="'.$tag['offset'].'"';
  304. }
  305. if(!empty($tag['length'])){
  306. $parse .= ' length="'.$tag['length'].'"';
  307. }
  308. if(!empty($tag['mod'])){
  309. $parse .= ' mod="'.$tag['mod'].'"';
  310. }
  311. if(!empty($tag['empty'])){
  312. $parse .= ' empty="'.$tag['empty'].'"';
  313. }
  314. $parse .= '}';
  315. $parse .= $content;
  316. $parse .= '{/volist}';
  317. return $parse;
  318. }
  319. public function tagType($tag,$content)
  320. {
  321. if(empty($tag['id'])){
  322. $tag['id'] = 'vo';
  323. }
  324. if(empty($tag['key'])){
  325. $tag['key'] = 'key';
  326. }
  327. $parse = '<?php ';
  328. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  329. $parse .= '$__LIST__ = model("Type")->listCacheData($__TAG__);';
  330. $parse .= ' ?>';
  331. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  332. if(!empty($tag['offset'])){
  333. $parse .= ' offset="'.$tag['offset'].'"';
  334. }
  335. if(!empty($tag['length'])){
  336. $parse .= ' length="'.$tag['length'].'"';
  337. }
  338. if(!empty($tag['mod'])){
  339. $parse .= ' mod="'.$tag['mod'].'"';
  340. }
  341. if(!empty($tag['empty'])){
  342. $parse .= ' empty="'.$tag['empty'].'"';
  343. }
  344. $parse .= '}';
  345. $parse .= $content;
  346. $parse .= '{/volist}';
  347. return $parse;
  348. }
  349. public function tagComment($tag,$content)
  350. {
  351. if(empty($tag['id'])){
  352. $tag['id'] = 'vo';
  353. }
  354. if(empty($tag['key'])){
  355. $tag['key'] = 'key';
  356. }
  357. $parse = '<?php ';
  358. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  359. $parse .= '$__LIST__ = model("Comment")->listCacheData($__TAG__);';
  360. if($tag['paging']=='yes'){
  361. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  362. }
  363. $parse .= ' ?>';
  364. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  365. if(!empty($tag['offset'])){
  366. $parse .= ' offset="'.$tag['offset'].'"';
  367. }
  368. if(!empty($tag['length'])){
  369. $parse .= ' length="'.$tag['length'].'"';
  370. }
  371. if(!empty($tag['mod'])){
  372. $parse .= ' mod="'.$tag['mod'].'"';
  373. }
  374. if(!empty($tag['empty'])){
  375. $parse .= ' empty="'.$tag['empty'].'"';
  376. }
  377. $parse .= '}';
  378. $parse .= $content;
  379. $parse .= '{/volist}';
  380. return $parse;
  381. }
  382. public function tagGbook($tag,$content)
  383. {
  384. if(empty($tag['id'])){
  385. $tag['id'] = 'vo';
  386. }
  387. if(empty($tag['key'])){
  388. $tag['key'] = 'key';
  389. }
  390. $parse = '<?php ';
  391. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  392. $parse .= '$__LIST__ = model("Gbook")->listCacheData($__TAG__);';
  393. if($tag['paging']=='yes'){
  394. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  395. }
  396. $parse .= ' ?>';
  397. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  398. if(!empty($tag['offset'])){
  399. $parse .= ' offset="'.$tag['offset'].'"';
  400. }
  401. if(!empty($tag['length'])){
  402. $parse .= ' length="'.$tag['length'].'"';
  403. }
  404. if(!empty($tag['mod'])){
  405. $parse .= ' mod="'.$tag['mod'].'"';
  406. }
  407. if(!empty($tag['empty'])){
  408. $parse .= ' empty="'.$tag['empty'].'"';
  409. }
  410. $parse .= '}';
  411. $parse .= $content;
  412. $parse .= '{/volist}';
  413. return $parse;
  414. }
  415. public function tagTopic($tag,$content)
  416. {
  417. if(empty($tag['id'])){
  418. $tag['id'] = 'vo';
  419. }
  420. if(empty($tag['key'])){
  421. $tag['key'] = 'key';
  422. }
  423. $parse = '<?php ';
  424. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  425. $parse .= '$__LIST__ = model("Topic")->listCacheData($__TAG__);';
  426. if($tag['paging']=='yes'){
  427. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  428. }
  429. $parse .= ' ?>';
  430. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  431. if(!empty($tag['offset'])){
  432. $parse .= ' offset="'.$tag['offset'].'"';
  433. }
  434. if(!empty($tag['length'])){
  435. $parse .= ' length="'.$tag['length'].'"';
  436. }
  437. if(!empty($tag['mod'])){
  438. $parse .= ' mod="'.$tag['mod'].'"';
  439. }
  440. if(!empty($tag['empty'])){
  441. $parse .= ' empty="'.$tag['empty'].'"';
  442. }
  443. $parse .= '}';
  444. $parse .= $content;
  445. $parse .= '{/volist}';
  446. return $parse;
  447. }
  448. public function tagActor($tag,$content)
  449. {
  450. if(empty($tag['id'])){
  451. $tag['id'] = 'vo';
  452. }
  453. if(empty($tag['key'])){
  454. $tag['key'] = 'key';
  455. }
  456. $parse = '<?php ';
  457. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  458. $parse .= '$__LIST__ = model("Actor")->listCacheData($__TAG__);';
  459. if($tag['paging']=='yes'){
  460. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  461. }
  462. $parse .= ' ?>';
  463. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  464. if(!empty($tag['offset'])){
  465. $parse .= ' offset="'.$tag['offset'].'"';
  466. }
  467. if(!empty($tag['length'])){
  468. $parse .= ' length="'.$tag['length'].'"';
  469. }
  470. if(!empty($tag['mod'])){
  471. $parse .= ' mod="'.$tag['mod'].'"';
  472. }
  473. if(!empty($tag['empty'])){
  474. $parse .= ' empty="'.$tag['empty'].'"';
  475. }
  476. $parse .= '}';
  477. $parse .= $content;
  478. $parse .= '{/volist}';
  479. return $parse;
  480. }
  481. public function tagRole($tag,$content)
  482. {
  483. if(empty($tag['id'])){
  484. $tag['id'] = 'vo';
  485. }
  486. if(empty($tag['key'])){
  487. $tag['key'] = 'key';
  488. }
  489. $parse = '<?php ';
  490. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  491. $parse .= '$__LIST__ = model("Role")->listCacheData($__TAG__);';
  492. if($tag['paging']=='yes'){
  493. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  494. }
  495. $parse .= ' ?>';
  496. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  497. if(!empty($tag['offset'])){
  498. $parse .= ' offset="'.$tag['offset'].'"';
  499. }
  500. if(!empty($tag['length'])){
  501. $parse .= ' length="'.$tag['length'].'"';
  502. }
  503. if(!empty($tag['mod'])){
  504. $parse .= ' mod="'.$tag['mod'].'"';
  505. }
  506. if(!empty($tag['empty'])){
  507. $parse .= ' empty="'.$tag['empty'].'"';
  508. }
  509. $parse .= '}';
  510. $parse .= $content;
  511. $parse .= '{/volist}';
  512. return $parse;
  513. }
  514. public function tagArt($tag,$content)
  515. {
  516. if(empty($tag['id'])){
  517. $tag['id'] = 'vo';
  518. }
  519. if(empty($tag['key'])){
  520. $tag['key'] = 'key';
  521. }
  522. $parse = '<?php ';
  523. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  524. $parse .= '$__LIST__ = model("Art")->listCacheData($__TAG__);';
  525. if($tag['paging']=='yes'){
  526. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  527. }
  528. $parse .= ' ?>';
  529. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  530. if(!empty($tag['offset'])){
  531. $parse .= ' offset="'.$tag['offset'].'"';
  532. }
  533. if(!empty($tag['length'])){
  534. $parse .= ' length="'.$tag['length'].'"';
  535. }
  536. if(!empty($tag['mod'])){
  537. $parse .= ' mod="'.$tag['mod'].'"';
  538. }
  539. if(!empty($tag['empty'])){
  540. $parse .= ' empty="'.$tag['empty'].'"';
  541. }
  542. $parse .= '}';
  543. $parse .= $content;
  544. $parse .= '{/volist}';
  545. return $parse;
  546. }
  547. public function tagVod($tag,$content)
  548. {
  549. if(empty($tag['id'])){
  550. $tag['id'] = 'vo';
  551. }
  552. if(empty($tag['key'])){
  553. $tag['key'] = 'key';
  554. }
  555. $parse = '<?php ';
  556. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  557. $parse .= '$__LIST__ = model("Vod")->listCacheData($__TAG__);';
  558. if($tag['paging']=='yes'){
  559. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  560. }
  561. $parse .= ' ?>';
  562. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  563. if(!empty($tag['offset'])){
  564. $parse .= ' offset="'.$tag['offset'].'"';
  565. }
  566. if(!empty($tag['length'])){
  567. $parse .= ' length="'.$tag['length'].'"';
  568. }
  569. if(!empty($tag['mod'])){
  570. $parse .= ' mod="'.$tag['mod'].'"';
  571. }
  572. if(!empty($tag['empty'])){
  573. $parse .= ' empty="'.$tag['empty'].'"';
  574. }
  575. $parse .= '}';
  576. $parse .= $content;
  577. $parse .= '{/volist}';
  578. return $parse;
  579. }
  580. public function tagWebsite($tag,$content)
  581. {
  582. if(empty($tag['id'])){
  583. $tag['id'] = 'vo';
  584. }
  585. if(empty($tag['key'])){
  586. $tag['key'] = 'key';
  587. }
  588. $parse = '<?php ';
  589. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  590. $parse .= '$__LIST__ = model("Website")->listCacheData($__TAG__);';
  591. if($tag['paging']=='yes'){
  592. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  593. }
  594. $parse .= ' ?>';
  595. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  596. if(!empty($tag['offset'])){
  597. $parse .= ' offset="'.$tag['offset'].'"';
  598. }
  599. if(!empty($tag['length'])){
  600. $parse .= ' length="'.$tag['length'].'"';
  601. }
  602. if(!empty($tag['mod'])){
  603. $parse .= ' mod="'.$tag['mod'].'"';
  604. }
  605. if(!empty($tag['empty'])){
  606. $parse .= ' empty="'.$tag['empty'].'"';
  607. }
  608. $parse .= '}';
  609. $parse .= $content;
  610. $parse .= '{/volist}';
  611. return $parse;
  612. }
  613. }