Maccms.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  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. $parse='';
  59. $parse .= '{foreach name="'.$tag['name'].'" id="'.$tag['id'].'" key="'.$tag['key'].'"}';
  60. $parse .= $content;
  61. $parse .= '{/foreach}';
  62. return $parse;
  63. }
  64. public function tagArea($tag,$content)
  65. {
  66. if(empty($tag['id'])){
  67. $tag['id'] = 'vo';
  68. }
  69. if(empty($tag['key'])){
  70. $tag['key'] = 'key';
  71. }
  72. $parse = '<?php ';
  73. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  74. $parse .= '$__LIST__ = model("Extend")->areaData($__TAG__);';
  75. $parse .= ' ?>';
  76. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  77. if(!empty($tag['offset'])){
  78. $parse .= ' offset="'.$tag['offset'].'"';
  79. }
  80. if(!empty($tag['length'])){
  81. $parse .= ' length="'.$tag['length'].'"';
  82. }
  83. if(!empty($tag['mod'])){
  84. $parse .= ' mod="'.$tag['mod'].'"';
  85. }
  86. if(!empty($tag['empty'])){
  87. $parse .= ' empty="'.$tag['empty'].'"';
  88. }
  89. $parse .= '}';
  90. $parse .= $content;
  91. $parse .= '{/volist}';
  92. return $parse;
  93. }
  94. public function tagLang($tag,$content)
  95. {
  96. if(empty($tag['id'])){
  97. $tag['id'] = 'vo';
  98. }
  99. if(empty($tag['key'])){
  100. $tag['key'] = 'key';
  101. }
  102. $parse = '<?php ';
  103. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  104. $parse .= '$__LIST__ = model("Extend")->langData($__TAG__);';
  105. $parse .= ' ?>';
  106. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  107. if(!empty($tag['offset'])){
  108. $parse .= ' offset="'.$tag['offset'].'"';
  109. }
  110. if(!empty($tag['length'])){
  111. $parse .= ' length="'.$tag['length'].'"';
  112. }
  113. if(!empty($tag['mod'])){
  114. $parse .= ' mod="'.$tag['mod'].'"';
  115. }
  116. if(!empty($tag['empty'])){
  117. $parse .= ' empty="'.$tag['empty'].'"';
  118. }
  119. $parse .= '}';
  120. $parse .= $content;
  121. $parse .= '{/volist}';
  122. return $parse;
  123. }
  124. public function tagClass($tag,$content)
  125. {
  126. if(empty($tag['id'])){
  127. $tag['id'] = 'vo';
  128. }
  129. if(empty($tag['key'])){
  130. $tag['key'] = 'key';
  131. }
  132. $parse = '<?php ';
  133. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  134. $parse .= '$__LIST__ = model("Extend")->classData($__TAG__);';
  135. $parse .= ' ?>';
  136. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  137. if(!empty($tag['offset'])){
  138. $parse .= ' offset="'.$tag['offset'].'"';
  139. }
  140. if(!empty($tag['length'])){
  141. $parse .= ' length="'.$tag['length'].'"';
  142. }
  143. if(!empty($tag['mod'])){
  144. $parse .= ' mod="'.$tag['mod'].'"';
  145. }
  146. if(!empty($tag['empty'])){
  147. $parse .= ' empty="'.$tag['empty'].'"';
  148. }
  149. $parse .= '}';
  150. $parse .= $content;
  151. $parse .= '{/volist}';
  152. return $parse;
  153. }
  154. public function tagYear($tag,$content)
  155. {
  156. if(empty($tag['id'])){
  157. $tag['id'] = 'vo';
  158. }
  159. if(empty($tag['key'])){
  160. $tag['key'] = 'key';
  161. }
  162. $parse = '<?php ';
  163. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  164. $parse .= '$__LIST__ = model("Extend")->YearData($__TAG__);';
  165. $parse .= ' ?>';
  166. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  167. if(!empty($tag['offset'])){
  168. $parse .= ' offset="'.$tag['offset'].'"';
  169. }
  170. if(!empty($tag['length'])){
  171. $parse .= ' length="'.$tag['length'].'"';
  172. }
  173. if(!empty($tag['mod'])){
  174. $parse .= ' mod="'.$tag['mod'].'"';
  175. }
  176. if(!empty($tag['empty'])){
  177. $parse .= ' empty="'.$tag['empty'].'"';
  178. }
  179. $parse .= '}';
  180. $parse .= $content;
  181. $parse .= '{/volist}';
  182. return $parse;
  183. }
  184. public function tagVersion($tag,$content)
  185. {
  186. if(empty($tag['id'])){
  187. $tag['id'] = 'vo';
  188. }
  189. if(empty($tag['key'])){
  190. $tag['key'] = 'key';
  191. }
  192. $parse = '<?php ';
  193. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  194. $parse .= '$__LIST__ = model("Extend")->versionData($__TAG__);';
  195. $parse .= ' ?>';
  196. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  197. if(!empty($tag['offset'])){
  198. $parse .= ' offset="'.$tag['offset'].'"';
  199. }
  200. if(!empty($tag['length'])){
  201. $parse .= ' length="'.$tag['length'].'"';
  202. }
  203. if(!empty($tag['mod'])){
  204. $parse .= ' mod="'.$tag['mod'].'"';
  205. }
  206. if(!empty($tag['empty'])){
  207. $parse .= ' empty="'.$tag['empty'].'"';
  208. }
  209. $parse .= '}';
  210. $parse .= $content;
  211. $parse .= '{/volist}';
  212. return $parse;
  213. }
  214. public function tagState($tag,$content)
  215. {
  216. if(empty($tag['id'])){
  217. $tag['id'] = 'vo';
  218. }
  219. if(empty($tag['key'])){
  220. $tag['key'] = 'key';
  221. }
  222. $parse = '<?php ';
  223. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  224. $parse .= '$__LIST__ = model("Extend")->stateData($__TAG__);';
  225. $parse .= ' ?>';
  226. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  227. if(!empty($tag['offset'])){
  228. $parse .= ' offset="'.$tag['offset'].'"';
  229. }
  230. if(!empty($tag['length'])){
  231. $parse .= ' length="'.$tag['length'].'"';
  232. }
  233. if(!empty($tag['mod'])){
  234. $parse .= ' mod="'.$tag['mod'].'"';
  235. }
  236. if(!empty($tag['empty'])){
  237. $parse .= ' empty="'.$tag['empty'].'"';
  238. }
  239. $parse .= '}';
  240. $parse .= $content;
  241. $parse .= '{/volist}';
  242. return $parse;
  243. }
  244. public function tagLetter($tag,$content)
  245. {
  246. if(empty($tag['id'])){
  247. $tag['id'] = 'vo';
  248. }
  249. if(empty($tag['key'])){
  250. $tag['key'] = 'key';
  251. }
  252. $parse = '<?php ';
  253. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  254. $parse .= '$__LIST__ = model("Extend")->letterData($__TAG__);';
  255. $parse .= ' ?>';
  256. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  257. if(!empty($tag['offset'])){
  258. $parse .= ' offset="'.$tag['offset'].'"';
  259. }
  260. if(!empty($tag['length'])){
  261. $parse .= ' length="'.$tag['length'].'"';
  262. }
  263. if(!empty($tag['mod'])){
  264. $parse .= ' mod="'.$tag['mod'].'"';
  265. }
  266. if(!empty($tag['empty'])){
  267. $parse .= ' empty="'.$tag['empty'].'"';
  268. }
  269. $parse .= '}';
  270. $parse .= $content;
  271. $parse .= '{/volist}';
  272. return $parse;
  273. }
  274. public function tagLink($tag,$content)
  275. {
  276. if(empty($tag['id'])){
  277. $tag['id'] = 'vo';
  278. }
  279. if(empty($tag['key'])){
  280. $tag['key'] = 'key';
  281. }
  282. $parse = '<?php ';
  283. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  284. $parse .= '$__LIST__ = model("Link")->listCacheData($__TAG__);';
  285. $parse .= ' ?>';
  286. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  287. if(!empty($tag['offset'])){
  288. $parse .= ' offset="'.$tag['offset'].'"';
  289. }
  290. if(!empty($tag['length'])){
  291. $parse .= ' length="'.$tag['length'].'"';
  292. }
  293. if(!empty($tag['mod'])){
  294. $parse .= ' mod="'.$tag['mod'].'"';
  295. }
  296. if(!empty($tag['empty'])){
  297. $parse .= ' empty="'.$tag['empty'].'"';
  298. }
  299. $parse .= '}';
  300. $parse .= $content;
  301. $parse .= '{/volist}';
  302. return $parse;
  303. }
  304. public function tagType($tag,$content)
  305. {
  306. if(empty($tag['id'])){
  307. $tag['id'] = 'vo';
  308. }
  309. if(empty($tag['key'])){
  310. $tag['key'] = 'key';
  311. }
  312. $parse = '<?php ';
  313. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  314. $parse .= '$__LIST__ = model("Type")->listCacheData($__TAG__);';
  315. $parse .= ' ?>';
  316. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  317. if(!empty($tag['offset'])){
  318. $parse .= ' offset="'.$tag['offset'].'"';
  319. }
  320. if(!empty($tag['length'])){
  321. $parse .= ' length="'.$tag['length'].'"';
  322. }
  323. if(!empty($tag['mod'])){
  324. $parse .= ' mod="'.$tag['mod'].'"';
  325. }
  326. if(!empty($tag['empty'])){
  327. $parse .= ' empty="'.$tag['empty'].'"';
  328. }
  329. $parse .= '}';
  330. $parse .= $content;
  331. $parse .= '{/volist}';
  332. return $parse;
  333. }
  334. public function tagComment($tag,$content)
  335. {
  336. if(empty($tag['id'])){
  337. $tag['id'] = 'vo';
  338. }
  339. if(empty($tag['key'])){
  340. $tag['key'] = 'key';
  341. }
  342. $parse = '<?php ';
  343. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  344. $parse .= '$__LIST__ = model("Comment")->listCacheData($__TAG__);';
  345. if($tag['paging']=='yes'){
  346. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  347. }
  348. $parse .= ' ?>';
  349. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  350. if(!empty($tag['offset'])){
  351. $parse .= ' offset="'.$tag['offset'].'"';
  352. }
  353. if(!empty($tag['length'])){
  354. $parse .= ' length="'.$tag['length'].'"';
  355. }
  356. if(!empty($tag['mod'])){
  357. $parse .= ' mod="'.$tag['mod'].'"';
  358. }
  359. if(!empty($tag['empty'])){
  360. $parse .= ' empty="'.$tag['empty'].'"';
  361. }
  362. $parse .= '}';
  363. $parse .= $content;
  364. $parse .= '{/volist}';
  365. return $parse;
  366. }
  367. public function tagGbook($tag,$content)
  368. {
  369. if(empty($tag['id'])){
  370. $tag['id'] = 'vo';
  371. }
  372. if(empty($tag['key'])){
  373. $tag['key'] = 'key';
  374. }
  375. $parse = '<?php ';
  376. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  377. $parse .= '$__LIST__ = model("Gbook")->listCacheData($__TAG__);';
  378. if($tag['paging']=='yes'){
  379. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  380. }
  381. $parse .= ' ?>';
  382. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  383. if(!empty($tag['offset'])){
  384. $parse .= ' offset="'.$tag['offset'].'"';
  385. }
  386. if(!empty($tag['length'])){
  387. $parse .= ' length="'.$tag['length'].'"';
  388. }
  389. if(!empty($tag['mod'])){
  390. $parse .= ' mod="'.$tag['mod'].'"';
  391. }
  392. if(!empty($tag['empty'])){
  393. $parse .= ' empty="'.$tag['empty'].'"';
  394. }
  395. $parse .= '}';
  396. $parse .= $content;
  397. $parse .= '{/volist}';
  398. return $parse;
  399. }
  400. public function tagTopic($tag,$content)
  401. {
  402. if(empty($tag['id'])){
  403. $tag['id'] = 'vo';
  404. }
  405. if(empty($tag['key'])){
  406. $tag['key'] = 'key';
  407. }
  408. $parse = '<?php ';
  409. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  410. $parse .= '$__LIST__ = model("Topic")->listCacheData($__TAG__);';
  411. if($tag['paging']=='yes'){
  412. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  413. }
  414. $parse .= ' ?>';
  415. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  416. if(!empty($tag['offset'])){
  417. $parse .= ' offset="'.$tag['offset'].'"';
  418. }
  419. if(!empty($tag['length'])){
  420. $parse .= ' length="'.$tag['length'].'"';
  421. }
  422. if(!empty($tag['mod'])){
  423. $parse .= ' mod="'.$tag['mod'].'"';
  424. }
  425. if(!empty($tag['empty'])){
  426. $parse .= ' empty="'.$tag['empty'].'"';
  427. }
  428. $parse .= '}';
  429. $parse .= $content;
  430. $parse .= '{/volist}';
  431. return $parse;
  432. }
  433. public function tagActor($tag,$content)
  434. {
  435. if(empty($tag['id'])){
  436. $tag['id'] = 'vo';
  437. }
  438. if(empty($tag['key'])){
  439. $tag['key'] = 'key';
  440. }
  441. $parse = '<?php ';
  442. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  443. $parse .= '$__LIST__ = model("Actor")->listCacheData($__TAG__);';
  444. if($tag['paging']=='yes'){
  445. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  446. }
  447. $parse .= ' ?>';
  448. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  449. if(!empty($tag['offset'])){
  450. $parse .= ' offset="'.$tag['offset'].'"';
  451. }
  452. if(!empty($tag['length'])){
  453. $parse .= ' length="'.$tag['length'].'"';
  454. }
  455. if(!empty($tag['mod'])){
  456. $parse .= ' mod="'.$tag['mod'].'"';
  457. }
  458. if(!empty($tag['empty'])){
  459. $parse .= ' empty="'.$tag['empty'].'"';
  460. }
  461. $parse .= '}';
  462. $parse .= $content;
  463. $parse .= '{/volist}';
  464. return $parse;
  465. }
  466. public function tagRole($tag,$content)
  467. {
  468. if(empty($tag['id'])){
  469. $tag['id'] = 'vo';
  470. }
  471. if(empty($tag['key'])){
  472. $tag['key'] = 'key';
  473. }
  474. $parse = '<?php ';
  475. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  476. $parse .= '$__LIST__ = model("Role")->listCacheData($__TAG__);';
  477. if($tag['paging']=='yes'){
  478. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  479. }
  480. $parse .= ' ?>';
  481. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  482. if(!empty($tag['offset'])){
  483. $parse .= ' offset="'.$tag['offset'].'"';
  484. }
  485. if(!empty($tag['length'])){
  486. $parse .= ' length="'.$tag['length'].'"';
  487. }
  488. if(!empty($tag['mod'])){
  489. $parse .= ' mod="'.$tag['mod'].'"';
  490. }
  491. if(!empty($tag['empty'])){
  492. $parse .= ' empty="'.$tag['empty'].'"';
  493. }
  494. $parse .= '}';
  495. $parse .= $content;
  496. $parse .= '{/volist}';
  497. return $parse;
  498. }
  499. public function tagArt($tag,$content)
  500. {
  501. if(empty($tag['id'])){
  502. $tag['id'] = 'vo';
  503. }
  504. if(empty($tag['key'])){
  505. $tag['key'] = 'key';
  506. }
  507. $parse = '<?php ';
  508. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  509. $parse .= '$__LIST__ = model("Art")->listCacheData($__TAG__);';
  510. if($tag['paging']=='yes'){
  511. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  512. }
  513. $parse .= ' ?>';
  514. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  515. if(!empty($tag['offset'])){
  516. $parse .= ' offset="'.$tag['offset'].'"';
  517. }
  518. if(!empty($tag['length'])){
  519. $parse .= ' length="'.$tag['length'].'"';
  520. }
  521. if(!empty($tag['mod'])){
  522. $parse .= ' mod="'.$tag['mod'].'"';
  523. }
  524. if(!empty($tag['empty'])){
  525. $parse .= ' empty="'.$tag['empty'].'"';
  526. }
  527. $parse .= '}';
  528. $parse .= $content;
  529. $parse .= '{/volist}';
  530. return $parse;
  531. }
  532. public function tagVod($tag,$content)
  533. {
  534. if(empty($tag['id'])){
  535. $tag['id'] = 'vo';
  536. }
  537. if(empty($tag['key'])){
  538. $tag['key'] = 'key';
  539. }
  540. $parse = '<?php ';
  541. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  542. $parse .= '$__LIST__ = model("Vod")->listCacheData($__TAG__);';
  543. if($tag['paging']=='yes'){
  544. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  545. }
  546. $parse .= ' ?>';
  547. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  548. if(!empty($tag['offset'])){
  549. $parse .= ' offset="'.$tag['offset'].'"';
  550. }
  551. if(!empty($tag['length'])){
  552. $parse .= ' length="'.$tag['length'].'"';
  553. }
  554. if(!empty($tag['mod'])){
  555. $parse .= ' mod="'.$tag['mod'].'"';
  556. }
  557. if(!empty($tag['empty'])){
  558. $parse .= ' empty="'.$tag['empty'].'"';
  559. }
  560. $parse .= '}';
  561. $parse .= $content;
  562. $parse .= '{/volist}';
  563. return $parse;
  564. }
  565. public function tagWebsite($tag,$content)
  566. {
  567. if(empty($tag['id'])){
  568. $tag['id'] = 'vo';
  569. }
  570. if(empty($tag['key'])){
  571. $tag['key'] = 'key';
  572. }
  573. $parse = '<?php ';
  574. $parse .= '$__TAG__ = \'' . json_encode($tag) . '\';';
  575. $parse .= '$__LIST__ = model("Website")->listCacheData($__TAG__);';
  576. if($tag['paging']=='yes'){
  577. $parse .= '$__PAGING__ = mac_page_param($__LIST__[\'total\'],$__LIST__[\'limit\'],$__LIST__[\'page\'],$__LIST__[\'pageurl\'],$__LIST__[\'half\']);';
  578. }
  579. $parse .= ' ?>';
  580. $parse .= '{volist name="__LIST__[\'list\']" id="'.$tag['id'].'" key="'.$tag['key'].'"';
  581. if(!empty($tag['offset'])){
  582. $parse .= ' offset="'.$tag['offset'].'"';
  583. }
  584. if(!empty($tag['length'])){
  585. $parse .= ' length="'.$tag['length'].'"';
  586. }
  587. if(!empty($tag['mod'])){
  588. $parse .= ' mod="'.$tag['mod'].'"';
  589. }
  590. if(!empty($tag['empty'])){
  591. $parse .= ' empty="'.$tag['empty'].'"';
  592. }
  593. $parse .= '}';
  594. $parse .= $content;
  595. $parse .= '{/volist}';
  596. return $parse;
  597. }
  598. }