LayoutModule.class.php 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729
  1. <?php
  2. namespace My;
  3. /**
  4. * 布局模块驱动
  5. * @author Devil
  6. * @blog http://gong.gg/
  7. * @version 0.0.1
  8. * @datetime 2017-01-10T21:51:08+0800
  9. */
  10. class LayoutModule
  11. {
  12. // 数据列表
  13. private $data;
  14. // 参数规则
  15. private $rules;
  16. // 拼接的html
  17. private $html;
  18. // 打开方式
  19. private $blank;
  20. // 图片host
  21. private $image_host;
  22. /**
  23. * [__construct 私有构造方法]
  24. * @author Devil
  25. * @blog http://gong.gg/
  26. * @version 0.0.1
  27. * @datetime 2017-02-20T17:59:50+0800
  28. */
  29. private function __construct()
  30. {
  31. // 图片host
  32. $this->image_host = C('IMAGE_HOST');
  33. }
  34. /**
  35. * [SetInstance 类静态方法入口]
  36. * @author Devil
  37. * @blog http://gong.gg/
  38. * @version 0.0.1
  39. * @datetime 2017-02-20T18:01:09+0800
  40. */
  41. public static function SetInstance()
  42. {
  43. static $object = null;
  44. if(!$object) $object = new self();
  45. return $object;
  46. }
  47. /**
  48. * [GetLayoutMouleWhere 获取布局模块条件]
  49. * @author Devil
  50. * @blog http://gong.gg/
  51. * @version 0.0.1
  52. * @datetime 2017-02-14T22:08:22+0800
  53. * @param [array] $data [参数条件]
  54. * @return [array] [条件列表]
  55. */
  56. public function GetLayoutMouleWhere($data)
  57. {
  58. // 条件初始化
  59. $where = array();
  60. // 是否启用
  61. $where['is_enable'] = 1;
  62. // 是否强制带图片
  63. if(isset($data['title_style']) && (in_array($data['title_style'], array(6, 8, 9, 10, 11, 12, 13, 14, 15)) || ($data['title_style'] >= 200)))
  64. {
  65. $where['image_count'] = array('egt', 1);
  66. }
  67. // 是否指定文章id
  68. if(empty($data['article_id']))
  69. {
  70. // 文章分类
  71. if(!empty($data['article_class_id']) && substr($data['article_class_id'], 0, 1) != 0)
  72. {
  73. $where['article_class_id'] = array('in', $data['article_class_id']);
  74. }
  75. // 发布时间
  76. if(!empty($data['add_time_interval']))
  77. {
  78. $where['add_time_interval'] = array('gt', time()-(L('common_view_time_list')[$data['add_time_interval']]['value'])*60);
  79. }
  80. // 更新时间
  81. if(!empty($data['upd_time_interval']))
  82. {
  83. $where['upd_time_interval'] = array('gt', time()-(L('common_view_time_list')[$data['upd_time_interval']]['value'])*60);
  84. }
  85. // 关键字
  86. if(!empty($data['keyword']))
  87. {
  88. $keyword = str_replace(array(';', '—'), array(';', '-'), $data['keyword']);
  89. if(strpos($keyword, ';') === false)
  90. {
  91. $where['title'][] = $this->TitleWhereJoin($keyword);
  92. } else {
  93. $keyword_all = explode(';', $keyword);
  94. foreach($keyword_all as $temp_keyword)
  95. {
  96. $where['title'][] = $this->TitleWhereJoin($temp_keyword);
  97. }
  98. }
  99. }
  100. } else {
  101. $where['id'] = array('in', str_replace(',', ',', $data['article_id']));
  102. }
  103. // 排序方式
  104. $sort = empty($data['sort_type']) ? '' : str_replace('-', ' ', L('common_view_sort_list')[$data['sort_type']]['value']);
  105. // 读取条数
  106. $n = max(1, isset($data['show_number']) ? intval($data['show_number']) : 10);
  107. // 返回数据
  108. return array('where' => $where, 'sort' => $sort, 'n' => $n);
  109. }
  110. /**
  111. * [TitleWhereJoin 关键字检索条件拼接]
  112. * @author Devil
  113. * @blog http://gong.gg/
  114. * @version 0.0.1
  115. * @datetime 2017-02-15T14:07:48+0800
  116. * @param [string] $keyword [需要解析的关键字]
  117. * @return [array] [拼接完成的关键字]
  118. */
  119. private function TitleWhereJoin($keyword)
  120. {
  121. // 标记判断, 并且-, 或|
  122. $tag = (strpos($keyword, '-') !== false) ? '-' : ((strpos($keyword, '|') !== false) ? '|' : '');
  123. // 数据处理
  124. if(empty($tag))
  125. {
  126. return array('eq', $keyword);
  127. } else {
  128. $join = ($tag == '-') ? 'AND' : (($tag == '|') ? 'OR' : '');
  129. $temp_all = explode($tag, $keyword);
  130. foreach($temp_all as $k=>$temp_keyword)
  131. {
  132. $temp_all[$k] = '%'.$temp_keyword.'%';
  133. }
  134. return array('like', $temp_all, $join);
  135. }
  136. }
  137. /**
  138. * [DataInit 数初始化]
  139. * @author Devil
  140. * @blog http://gong.gg/
  141. * @version 0.0.1
  142. * @datetime 2017-02-20T18:08:20+0800
  143. * @param [array] $data [数据列表]
  144. * @param [array] $rules [参数规则]
  145. */
  146. private function DataInit($data, $rules)
  147. {
  148. // 初始化
  149. $this->data = $data;
  150. $this->rules = $rules;
  151. $this->html = '';
  152. // 规则处理
  153. $this->rules['right_title'] = empty($this->rules['right_title']) ? array() : explode(';', str_replace(';', ';', $this->rules['right_title']));
  154. // 打开方式
  155. $this->blank = (isset($this->rules['link_open_way']) && L('common_view_link_open_way_list')[$this->rules['link_open_way']]['value'] == 'blank') ? 'target="_blank"' : '';
  156. }
  157. /**
  158. * [GetRules 获取模块规则数据]
  159. * @author Devil
  160. * @blog http://gong.gg/
  161. * @version 0.0.1
  162. * @datetime 2017-05-12T18:04:43+0800
  163. * @return [array] [模块规则]
  164. */
  165. public function GetRules()
  166. {
  167. $this->rules['blank'] = $this->blank;
  168. return $this->rules;
  169. }
  170. /**
  171. * [GetTitleContent 获取标题内容]
  172. * @author Devil
  173. * @blog http://gong.gg/
  174. * @version 0.0.1
  175. * @datetime 2017-02-22T18:12:12+0800
  176. * @param [string] $type [类型(slide幻灯片, list列表)]
  177. */
  178. private function GetTitleContent($type = '')
  179. {
  180. if(!empty($this->rules['name']) || !empty($this->rules['right_title']))
  181. {
  182. $this->html .= '<div class="am-list-news-hd am-cf ';
  183. switch($type)
  184. {
  185. // 幻灯片添加底部class边距
  186. case 'slide':
  187. $this->html .= 'm-b-10';
  188. break;
  189. }
  190. $this->html .= '">';
  191. if(!empty($this->rules['name']))
  192. {
  193. $this->html .= '<h2>'.$this->rules['name'].'</h2>';
  194. }
  195. if(!empty($this->rules['right_title']))
  196. {
  197. if(isset($this->rules['right_title'][0]))
  198. {
  199. if(isset($this->rules['right_title'][1]))
  200. {
  201. $this->html .= '<a href="'.$this->rules['right_title'][1].'" target="_blank"><span class="am-list-news-more am-fr">'.$this->rules['right_title'][0].'</span></a>';
  202. } else {
  203. $this->html .= '<span class="am-list-news-more am-fr">'.$this->rules['right_title'][0].'</span>';
  204. }
  205. }
  206. }
  207. $this->html .= '</div>';
  208. }
  209. }
  210. /**
  211. * [ViewTitle 纯标题]
  212. * @author Devil
  213. * @blog http://gong.gg/
  214. * @version 0.0.1
  215. * @datetime 2017-02-20T18:06:08+0800
  216. * @param [array] $data [数据列表]
  217. * @param [array] $rules [参数规则]
  218. */
  219. public function ViewTitle($data, $rules)
  220. {
  221. // 数据初始化
  222. $this->DataInit($data, $rules);
  223. // 开始处理数据
  224. $this->html = '<div class="am-list-news am-list-news-default">';
  225. // 标题
  226. $this->GetTitleContent();
  227. // 数据列表
  228. $this->html .= '<div class="am-list-news-bd">';
  229. // 自定义内容为空, 并且数据列表不为空
  230. if(empty($this->rules['summary']) && !empty($data))
  231. {
  232. $this->html .= '<ul class="am-list">';
  233. foreach($data as $k=>$v)
  234. {
  235. // 标题颜色
  236. $title_color = (!empty($v['title_color'])) ? 'style="color:'.$v['title_color'].';"' : '';
  237. // 内容
  238. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'" class="am-text-truncate" '.$title_color.'>'.$v['title'].'</a></li>';
  239. }
  240. $this->html .= '</ul>';
  241. } else {
  242. // 自定义内容
  243. $this->html .= $this->rules['summary'];
  244. }
  245. // 内容收尾处理
  246. $this->html .= '</div></div>';
  247. // 数据返回
  248. return $this->html;
  249. }
  250. /**
  251. * [ViewTitleAccess 标题+访问量]
  252. * @author Devil
  253. * @blog http://gong.gg/
  254. * @version 0.0.1
  255. * @datetime 2017-02-20T18:06:08+0800
  256. * @param [array] $data [数据列表]
  257. * @param [array] $rules [参数规则]
  258. */
  259. public function ViewTitleAccess($data, $rules)
  260. {
  261. // 数据初始化
  262. $this->DataInit($data, $rules);
  263. // 开始处理数据
  264. $this->html = '<div class="am-list-news am-list-news-default">';
  265. // 标题
  266. $this->GetTitleContent();
  267. // 数据列表
  268. $this->html .= '<div class="am-list-news-bd">';
  269. // 自定义内容为空, 并且数据列表不为空
  270. if(empty($this->rules['summary']) && !empty($data))
  271. {
  272. $this->html .= '<ul class="am-list">';
  273. foreach($data as $k=>$v)
  274. {
  275. // 标题颜色
  276. $title_color = (!empty($v['title_color'])) ? 'style="color:'.$v['title_color'].';"' : '';
  277. // 内容
  278. $this->html .= '<li class="am-g am-list-item-dated">';
  279. $this->html .= '<a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'" class="am-list-item-hd" '.$title_color.'>'.$v['title'].'</a>';
  280. $this->html .= '<span class="am-list-date">'.$v['access_count_text'].'</span>';
  281. $this->html .= '</li>';
  282. }
  283. } else {
  284. // 自定义内容
  285. $this->html .= $this->rules['summary'];
  286. }
  287. // 内容收尾处理
  288. $this->html .= '</div></div>';
  289. // 数据返回
  290. return $this->html;
  291. }
  292. /**
  293. * [ViewTitleCreateTime 标题+发布时间]
  294. * @author Devil
  295. * @blog http://gong.gg/
  296. * @version 0.0.1
  297. * @datetime 2017-02-20T18:06:08+0800
  298. * @param [array] $data [数据列表]
  299. * @param [array] $rules [参数规则]
  300. */
  301. public function ViewTitleCreateTime($data, $rules)
  302. {
  303. // 数据初始化
  304. $this->DataInit($data, $rules);
  305. // 开始处理数据
  306. $this->html = '<div class="am-list-news am-list-news-default">';
  307. // 标题
  308. $this->GetTitleContent();
  309. // 数据列表
  310. $this->html .= '<div class="am-list-news-bd">';
  311. // 自定义内容为空, 并且数据列表不为空
  312. if(empty($this->rules['summary']) && !empty($data))
  313. {
  314. $this->html .= '<ul class="am-list">';
  315. foreach($data as $k=>$v)
  316. {
  317. // 标题颜色
  318. $title_color = (!empty($v['title_color'])) ? 'style="color:'.$v['title_color'].';"' : '';
  319. // 内容
  320. $this->html .= '<li class="am-g am-list-item-dated">';
  321. $this->html .= '<a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'" class="am-list-item-hd" '.$title_color.'>'.$v['title'].'</a>';
  322. $this->html .= '<span class="am-list-date">'.$v['add_time_text'].'</span>';
  323. $this->html .= '</li>';
  324. }
  325. $this->html .= '</ul>';
  326. } else {
  327. // 自定义内容
  328. $this->html .= $this->rules['summary'];
  329. }
  330. // 内容收尾处理
  331. $this->html .= '</div></div>';
  332. // 数据返回
  333. return $this->html;
  334. }
  335. /**
  336. * [ViewTitleAbstract 标题+摘要]
  337. * @author Devil
  338. * @blog http://gong.gg/
  339. * @version 0.0.1
  340. * @datetime 2017-02-20T18:06:08+0800
  341. * @param [array] $data [数据列表]
  342. * @param [array] $rules [参数规则]
  343. */
  344. public function ViewTitleAbstract($data, $rules)
  345. {
  346. // 数据初始化
  347. $this->DataInit($data, $rules);
  348. // 开始处理数据
  349. $this->html = '<div class="am-list-news am-list-news-default">';
  350. // 标题
  351. $this->GetTitleContent();
  352. // 数据列表
  353. $this->html .= '<div class="am-list-news-bd">';
  354. // 自定义内容为空, 并且数据列表不为空
  355. if(empty($this->rules['summary']) && !empty($data))
  356. {
  357. $this->html .= '<ul class="am-list">';
  358. foreach($data as $k=>$v)
  359. {
  360. // 标题颜色
  361. $title_color = (!empty($v['title_color'])) ? 'style="color:'.$v['title_color'].';"' : '';
  362. // 内容
  363. $this->html .= '<li class="am-g am-list-item-desced">';
  364. $this->html .= '<a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'" class="am-text-truncate" '.$title_color.'>'.$v['title'].'</a>';
  365. // 摘要字数
  366. $this->html .= '<div class="am-list-item-text">'.$v['abstract'].'</div>';
  367. $this->html .= '</li>';
  368. }
  369. $this->html .= '</ul>';
  370. } else {
  371. // 自定义内容
  372. $this->html .= $this->rules['summary'];
  373. }
  374. // 内容收尾处理
  375. $this->html .= '</div></div>';
  376. // 数据返回
  377. return $this->html;
  378. }
  379. /**
  380. * [ViewTitleAbstractOne 标题+第一条摘要]
  381. * @author Devil
  382. * @blog http://gong.gg/
  383. * @version 0.0.1
  384. * @datetime 2017-02-20T18:06:08+0800
  385. * @param [array] $data [数据列表]
  386. * @param [array] $rules [参数规则]
  387. */
  388. public function ViewTitleAbstractOne($data, $rules)
  389. {
  390. // 数据初始化
  391. $this->DataInit($data, $rules);
  392. // 开始处理数据
  393. $this->html = '<div class="am-list-news am-list-news-default">';
  394. // 标题
  395. $this->GetTitleContent();
  396. // 数据列表
  397. $this->html .= '<div class="am-list-news-bd">';
  398. // 自定义内容为空, 并且数据列表不为空
  399. if(empty($this->rules['summary']) && !empty($data))
  400. {
  401. $this->html .= '<ul class="am-list">';
  402. foreach($data as $k=>$v)
  403. {
  404. // 标题颜色
  405. $title_color = (!empty($v['title_color'])) ? 'style="color:'.$v['title_color'].';"' : '';
  406. // 内容
  407. $this->html .= '<li class="am-g am-list-item-desced">';
  408. $this->html .= '<a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'" class="am-text-truncate" '.$title_color.'>'.$v['title'].'</a>';
  409. // 第一条带摘要
  410. if($k == 0)
  411. {
  412. $this->html .= '<div class="am-list-item-text">'.$v['abstract'].'</div>';
  413. }
  414. $this->html .= '</li>';
  415. }
  416. $this->html .= '</ul>';
  417. } else {
  418. // 自定义内容
  419. $this->html .= $this->rules['summary'];
  420. }
  421. // 内容收尾处理
  422. $this->html .= '</div></div>';
  423. // 数据返回
  424. return $this->html;
  425. }
  426. /**
  427. * [ViewImagesContent 图文]
  428. * @author Devil
  429. * @blog http://gong.gg/
  430. * @version 0.0.1
  431. * @datetime 2017-02-20T18:06:08+0800
  432. * @param [array] $data [数据列表]
  433. * @param [array] $rules [参数规则]
  434. */
  435. public function ViewImagesContent($data, $rules)
  436. {
  437. // 数据初始化
  438. $this->DataInit($data, $rules);
  439. // 开始处理数据
  440. $this->html = '<div class="am-list-news am-list-news-default">';
  441. // 标题
  442. $this->GetTitleContent();
  443. // 数据列表
  444. $this->html .= '<div class="am-list-news-bd">';
  445. // 自定义内容为空, 并且数据列表不为空
  446. if(empty($this->rules['summary']) && !empty($data))
  447. {
  448. $this->html .= '<ul class="am-list">';
  449. foreach($data as $k=>$v)
  450. {
  451. // 标题颜色
  452. $title_color = (!empty($v['title_color'])) ? 'style="color:'.$v['title_color'].';"' : '';
  453. // 内容
  454. if(empty($v['image'][0]))
  455. {
  456. $this->html .= '<li class="am-g am-list-item-desced">';
  457. $this->html .= '<div class="am-list-main">';
  458. } else {
  459. $this->html .= '<li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">';
  460. $this->html .= '<div class="am-u-sm-4 am-list-thumb"><a href="'.$v['url'].'" '.$this->blank.'><img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'"/></a></div>';
  461. $this->html .= '<div class="am-u-sm-8 am-list-main">';
  462. }
  463. $this->html .= '<h3 class="am-list-item-hd"><a href="'.$v['url'].'" '.$this->blank.'>'.$v['title'].'</a></h3><div class="am-list-item-text">'.$v['abstract'].'</div></div>';
  464. $this->html .= '</li>';
  465. }
  466. $this->html .= '</ul>';
  467. } else {
  468. // 自定义内容
  469. $this->html .= $this->rules['summary'];
  470. }
  471. // 内容收尾处理
  472. $this->html .= '</div></div>';
  473. // 数据返回
  474. return $this->html;
  475. }
  476. /**
  477. * [ViewOneIntroductionTwoTitle 一简介+两列标题]
  478. * @author Devil
  479. * @blog http://gong.gg/
  480. * @version 0.0.1
  481. * @datetime 2017-02-20T18:06:08+0800
  482. * @param [array] $data [数据列表]
  483. * @param [array] $rules [参数规则]
  484. */
  485. public function ViewOneIntroductionTwoTitle($data, $rules)
  486. {
  487. // 数据初始化
  488. $this->DataInit($data, $rules);
  489. // 开始处理数据
  490. $this->html = '<div class="am-list-news am-list-news-default">';
  491. // 标题
  492. $this->GetTitleContent();
  493. // 数据列表
  494. $this->html .= '<div class="am-list-news-bd">';
  495. // 自定义内容为空, 并且数据列表不为空
  496. if(empty($this->rules['summary']) && !empty($data))
  497. {
  498. $this->html .= '<ul class="am-list">';
  499. foreach($data as $k=>$v)
  500. {
  501. // 标题颜色
  502. $title_color = (!empty($v['title_color'])) ? 'style="color:'.$v['title_color'].';"' : '';
  503. // 内容
  504. $this->html .= '<li class="am-g am-list-item-desced">';
  505. $this->html .= '<a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'" class="am-text-truncate" '.$title_color.'>'.$v['title'].'</a>';
  506. // 第一条带摘要
  507. if($k%3 == 0)
  508. {
  509. $this->html .= '<div class="am-list-item-text">'.$v['abstract'].'</div>';
  510. }
  511. $this->html .= '</li>';
  512. }
  513. $this->html .= '</ul>';
  514. } else {
  515. // 自定义内容
  516. $this->html .= $this->rules['summary'];
  517. }
  518. // 内容收尾处理
  519. $this->html .= '</div></div>';
  520. // 数据返回
  521. return $this->html;
  522. }
  523. /**
  524. * [ViewImagesSlideDefault 幻灯片+幻灯片默认]
  525. * @author Devil
  526. * @blog http://gong.gg/
  527. * @version 0.0.1
  528. * @datetime 2017-02-20T18:06:08+0800
  529. * @param [array] $data [数据列表]
  530. * @param [array] $rules [参数规则]
  531. */
  532. public function ViewImagesSlideDefault($data, $rules)
  533. {
  534. // 数据初始化
  535. $this->DataInit($data, $rules);
  536. // 开始处理数据
  537. $this->html = '<div class="am-list-news am-list-news-default">';
  538. // 标题
  539. $this->GetTitleContent('slide');
  540. // 数据列表
  541. $this->html .= '<div class="am-list-news-bd">';
  542. // 自定义内容为空, 并且数据列表不为空
  543. if(empty($this->rules['summary']) && !empty($data))
  544. {
  545. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-default" data-am-slider=\'{}\' ><ul class="am-slides">';
  546. $count = count($data);
  547. foreach($data as $k=>$v)
  548. {
  549. // 内容
  550. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  551. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  552. $this->html .= '</a></li>';
  553. }
  554. $this->html .= '</ul></div>';
  555. } else {
  556. // 自定义内容
  557. $this->html .= $this->rules['summary'];
  558. }
  559. // 内容收尾处理
  560. $this->html .= '</div></div>';
  561. // 数据返回
  562. return $this->html;
  563. }
  564. /**
  565. * [ViewImagesSlideDefaultTitle 幻灯片+幻灯片默认+标题]
  566. * @author Devil
  567. * @blog http://gong.gg/
  568. * @version 0.0.1
  569. * @datetime 2017-02-20T18:06:08+0800
  570. * @param [array] $data [数据列表]
  571. * @param [array] $rules [参数规则]
  572. */
  573. public function ViewImagesSlideDefaultTitle($data, $rules)
  574. {
  575. // 数据初始化
  576. $this->DataInit($data, $rules);
  577. // 开始处理数据
  578. $this->html = '<div class="am-list-news am-list-news-default">';
  579. // 标题
  580. $this->GetTitleContent('slide');
  581. // 数据列表
  582. $this->html .= '<div class="am-list-news-bd">';
  583. // 自定义内容为空, 并且数据列表不为空
  584. if(empty($this->rules['summary']) && !empty($data))
  585. {
  586. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-default" data-am-slider=\'{}\' ><ul class="am-slides">';
  587. $count = count($data);
  588. foreach($data as $k=>$v)
  589. {
  590. // 内容
  591. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  592. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  593. $this->html .= '<div class="am-slider-desc">'.$v['title'].'</div>';
  594. $this->html .= '</a></li>';
  595. }
  596. $this->html .= '</ul></div>';
  597. } else {
  598. // 自定义内容
  599. $this->html .= $this->rules['summary'];
  600. }
  601. // 内容收尾处理
  602. $this->html .= '</div></div>';
  603. // 数据返回
  604. return $this->html;
  605. }
  606. /**
  607. * [ViewImagesSlideDefaultMoreImage 幻灯片+幻灯片默认+多图]
  608. * @author Devil
  609. * @blog http://gong.gg/
  610. * @version 0.0.1
  611. * @datetime 2017-02-20T18:06:08+0800
  612. * @param [array] $data [数据列表]
  613. * @param [array] $rules [参数规则]
  614. */
  615. public function ViewImagesSlideDefaultMoreImage($data, $rules)
  616. {
  617. // 数据初始化
  618. $this->DataInit($data, $rules);
  619. // 开始处理数据
  620. $this->html = '<div class="am-list-news am-list-news-default">';
  621. // 标题
  622. $this->GetTitleContent('slide');
  623. // 数据列表
  624. $this->html .= '<div class="am-list-news-bd">';
  625. // 自定义内容为空, 并且数据列表不为空
  626. if(empty($this->rules['summary']) && !empty($data))
  627. {
  628. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-default" data-am-slider=\'{&quot;animation&quot;:&quot;slide&quot;,&quot;animationLoop&quot;:false,&quot;itemWidth&quot;:200,&quot;itemMargin&quot;:5}\' ><ul class="am-slides">';
  629. $count = count($data);
  630. foreach($data as $k=>$v)
  631. {
  632. // 内容
  633. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  634. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  635. $this->html .= '</a></li>';
  636. }
  637. $this->html .= '</ul></div>';
  638. } else {
  639. // 自定义内容
  640. $this->html .= $this->rules['summary'];
  641. }
  642. // 内容收尾处理
  643. $this->html .= '</div></div>';
  644. // 数据返回
  645. return $this->html;
  646. }
  647. /**
  648. * [ViewImagesSlideDefaultThumbnailImage 幻灯片+缩略图]
  649. * @author Devil
  650. * @blog http://gong.gg/
  651. * @version 0.0.1
  652. * @datetime 2017-02-20T18:06:08+0800
  653. * @param [array] $data [数据列表]
  654. * @param [array] $rules [参数规则]
  655. */
  656. public function ViewImagesSlideDefaultThumbnailImage($data, $rules)
  657. {
  658. // 数据初始化
  659. $this->DataInit($data, $rules);
  660. // 开始处理数据
  661. $this->html = '<div class="am-list-news am-list-news-default">';
  662. // 标题
  663. $this->GetTitleContent('slide');
  664. // 数据列表
  665. $this->html .= '<div class="am-list-news-bd">';
  666. // 自定义内容为空, 并且数据列表不为空
  667. if(empty($this->rules['summary']) && !empty($data))
  668. {
  669. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-default" data-am-slider=\'{&quot;animation&quot;:&quot;slide&quot;,&quot;controlNav&quot;:&quot;thumbnails&quot;}\'><ul class="am-slides">';
  670. $count = count($data);
  671. foreach($data as $k=>$v)
  672. {
  673. // 内容
  674. $this->html .= '<li data-thumb="'.$this->image_host.$v['image'][0].'"><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  675. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  676. $this->html .= '</a></li>';
  677. }
  678. $this->html .= '</ul></div>';
  679. } else {
  680. // 自定义内容
  681. $this->html .= $this->rules['summary'];
  682. }
  683. // 内容收尾处理
  684. $this->html .= '</div></div>';
  685. // 数据返回
  686. return $this->html;
  687. }
  688. /**
  689. * [ViewImagesSlideRoundPoint 幻灯片+圆形控制点]
  690. * @author Devil
  691. * @blog http://gong.gg/
  692. * @version 0.0.1
  693. * @datetime 2017-02-20T18:06:08+0800
  694. * @param [array] $data [数据列表]
  695. * @param [array] $rules [参数规则]
  696. */
  697. public function ViewImagesSlideRoundPoint($data, $rules)
  698. {
  699. // 数据初始化
  700. $this->DataInit($data, $rules);
  701. // 开始处理数据
  702. $this->html = '<div class="am-list-news am-list-news-default">';
  703. // 标题
  704. $this->GetTitleContent('slide');
  705. // 数据列表
  706. $this->html .= '<div class="am-list-news-bd">';
  707. // 自定义内容为空, 并且数据列表不为空
  708. if(empty($this->rules['summary']) && !empty($data))
  709. {
  710. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider=\'{&quot;directionNav&quot;:false}\'><ul class="am-slides">';
  711. $count = count($data);
  712. foreach($data as $k=>$v)
  713. {
  714. // 内容
  715. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  716. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  717. $this->html .= '</a></li>';
  718. }
  719. $this->html .= '</ul></div>';
  720. } else {
  721. // 自定义内容
  722. $this->html .= $this->rules['summary'];
  723. }
  724. // 内容收尾处理
  725. $this->html .= '</div></div>';
  726. // 数据返回
  727. return $this->html;
  728. }
  729. /**
  730. * [ViewImagesSlidePartyPoint 幻灯片+方形控制点]
  731. * @author Devil
  732. * @blog http://gong.gg/
  733. * @version 0.0.1
  734. * @datetime 2017-02-20T18:06:08+0800
  735. * @param [array] $data [数据列表]
  736. * @param [array] $rules [参数规则]
  737. */
  738. public function ViewImagesSlidePartyPoint($data, $rules)
  739. {
  740. // 数据初始化
  741. $this->DataInit($data, $rules);
  742. // 开始处理数据
  743. $this->html = '<div class="am-list-news am-list-news-default">';
  744. // 标题
  745. $this->GetTitleContent('slide');
  746. // 数据列表
  747. $this->html .= '<div class="am-list-news-bd">';
  748. // 自定义内容为空, 并且数据列表不为空
  749. if(empty($this->rules['summary']) && !empty($data))
  750. {
  751. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-a2" data-am-slider=\'{&quot;directionNav&quot;:false}\'><ul class="am-slides">';
  752. $count = count($data);
  753. foreach($data as $k=>$v)
  754. {
  755. // 内容
  756. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  757. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  758. $this->html .= '</a></li>';
  759. }
  760. $this->html .= '</ul></div>';
  761. } else {
  762. // 自定义内容
  763. $this->html .= $this->rules['summary'];
  764. }
  765. // 内容收尾处理
  766. $this->html .= '</div></div>';
  767. // 数据返回
  768. return $this->html;
  769. }
  770. /**
  771. * [ViewImagesSlideRoundPointBackBlack 幻灯片+底部黑边圆形控制点]
  772. * @author Devil
  773. * @blog http://gong.gg/
  774. * @version 0.0.1
  775. * @datetime 2017-02-20T18:06:08+0800
  776. * @param [array] $data [数据列表]
  777. * @param [array] $rules [参数规则]
  778. */
  779. public function ViewImagesSlideRoundPointBackBlack($data, $rules)
  780. {
  781. // 数据初始化
  782. $this->DataInit($data, $rules);
  783. // 开始处理数据
  784. $this->html = '<div class="am-list-news am-list-news-default">';
  785. // 标题
  786. $this->GetTitleContent('slide');
  787. // 数据列表
  788. $this->html .= '<div class="am-list-news-bd">';
  789. // 自定义内容为空, 并且数据列表不为空
  790. if(empty($this->rules['summary']) && !empty($data))
  791. {
  792. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-a3" data-am-slider=\'{&quot;directionNav&quot;:false}\'><ul class="am-slides">';
  793. $count = count($data);
  794. foreach($data as $k=>$v)
  795. {
  796. // 内容
  797. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  798. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  799. $this->html .= '</a></li>';
  800. }
  801. $this->html .= '</ul></div>';
  802. } else {
  803. // 自定义内容
  804. $this->html .= $this->rules['summary'];
  805. }
  806. // 内容收尾处理
  807. $this->html .= '</div></div>';
  808. // 数据返回
  809. return $this->html;
  810. }
  811. /**
  812. * [ViewImagesSlideRoundPointBackWhite 幻灯片+底部白边圆形控制点]
  813. * @author Devil
  814. * @blog http://gong.gg/
  815. * @version 0.0.1
  816. * @datetime 2017-02-20T18:06:08+0800
  817. * @param [array] $data [数据列表]
  818. * @param [array] $rules [参数规则]
  819. */
  820. public function ViewImagesSlideRoundPointBackWhite($data, $rules)
  821. {
  822. // 数据初始化
  823. $this->DataInit($data, $rules);
  824. // 开始处理数据
  825. $this->html = '<div class="am-list-news am-list-news-default">';
  826. // 标题
  827. $this->GetTitleContent('slide');
  828. // 数据列表
  829. $this->html .= '<div class="am-list-news-bd">';
  830. // 自定义内容为空, 并且数据列表不为空
  831. if(empty($this->rules['summary']) && !empty($data))
  832. {
  833. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-a4" data-am-slider=\'{&quot;directionNav&quot;:false}\'><ul class="am-slides">';
  834. $count = count($data);
  835. foreach($data as $k=>$v)
  836. {
  837. // 内容
  838. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  839. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  840. $this->html .= '</a></li>';
  841. }
  842. $this->html .= '</ul></div>';
  843. } else {
  844. // 自定义内容
  845. $this->html .= $this->rules['summary'];
  846. }
  847. // 内容收尾处理
  848. $this->html .= '</div></div>';
  849. // 数据返回
  850. return $this->html;
  851. }
  852. /**
  853. * [ViewImagesSlideLongPoint 幻灯片+长条等分控制点]
  854. * @author Devil
  855. * @blog http://gong.gg/
  856. * @version 0.0.1
  857. * @datetime 2017-02-20T18:06:08+0800
  858. * @param [array] $data [数据列表]
  859. * @param [array] $rules [参数规则]
  860. */
  861. public function ViewImagesSlideLongPoint($data, $rules)
  862. {
  863. // 数据初始化
  864. $this->DataInit($data, $rules);
  865. // 开始处理数据
  866. $this->html = '<div class="am-list-news am-list-news-default">';
  867. // 标题
  868. $this->GetTitleContent('slide');
  869. // 数据列表
  870. $this->html .= '<div class="am-list-news-bd">';
  871. // 自定义内容为空, 并且数据列表不为空
  872. if(empty($this->rules['summary']) && !empty($data))
  873. {
  874. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-a5" data-am-slider=\'{&quot;directionNav&quot;:false}\'><ul class="am-slides">';
  875. $count = count($data);
  876. foreach($data as $k=>$v)
  877. {
  878. // 内容
  879. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  880. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  881. $this->html .= '</a></li>';
  882. }
  883. $this->html .= '</ul></div>';
  884. } else {
  885. // 自定义内容
  886. $this->html .= $this->rules['summary'];
  887. }
  888. // 内容收尾处理
  889. $this->html .= '</div></div>';
  890. // 数据返回
  891. return $this->html;
  892. }
  893. /**
  894. * [ViewImagesSlideSquareArrow 幻灯片+方形居中左右箭头]
  895. * @author Devil
  896. * @blog http://gong.gg/
  897. * @version 0.0.1
  898. * @datetime 2017-02-20T18:06:08+0800
  899. * @param [array] $data [数据列表]
  900. * @param [array] $rules [参数规则]
  901. */
  902. public function ViewImagesSlideSquareArrow($data, $rules)
  903. {
  904. // 数据初始化
  905. $this->DataInit($data, $rules);
  906. // 开始处理数据
  907. $this->html = '<div class="am-list-news am-list-news-default">';
  908. // 标题
  909. $this->GetTitleContent('slide');
  910. // 数据列表
  911. $this->html .= '<div class="am-list-news-bd">';
  912. // 自定义内容为空, 并且数据列表不为空
  913. if(empty($this->rules['summary']) && !empty($data))
  914. {
  915. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-b1" data-am-slider=\'{&quot;controlNav&quot;:false}\'><ul class="am-slides">';
  916. $count = count($data);
  917. foreach($data as $k=>$v)
  918. {
  919. // 内容
  920. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  921. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  922. $this->html .= '</a></li>';
  923. }
  924. $this->html .= '</ul></div>';
  925. } else {
  926. // 自定义内容
  927. $this->html .= $this->rules['summary'];
  928. }
  929. // 内容收尾处理
  930. $this->html .= '</div></div>';
  931. // 数据返回
  932. return $this->html;
  933. }
  934. /**
  935. * [ViewImagesSlideRoundArrow 幻灯片+圆形居中左右箭头]
  936. * @author Devil
  937. * @blog http://gong.gg/
  938. * @version 0.0.1
  939. * @datetime 2017-02-20T18:06:08+0800
  940. * @param [array] $data [数据列表]
  941. * @param [array] $rules [参数规则]
  942. */
  943. public function ViewImagesSlideRoundArrow($data, $rules)
  944. {
  945. // 数据初始化
  946. $this->DataInit($data, $rules);
  947. // 开始处理数据
  948. $this->html = '<div class="am-list-news am-list-news-default">';
  949. // 标题
  950. $this->GetTitleContent('slide');
  951. // 数据列表
  952. $this->html .= '<div class="am-list-news-bd">';
  953. // 自定义内容为空, 并且数据列表不为空
  954. if(empty($this->rules['summary']) && !empty($data))
  955. {
  956. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-b2" data-am-slider=\'{&quot;controlNav&quot;:false}\'><ul class="am-slides">';
  957. $count = count($data);
  958. foreach($data as $k=>$v)
  959. {
  960. // 内容
  961. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  962. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  963. $this->html .= '</a></li>';
  964. }
  965. $this->html .= '</ul></div>';
  966. } else {
  967. // 自定义内容
  968. $this->html .= $this->rules['summary'];
  969. }
  970. // 内容收尾处理
  971. $this->html .= '</div></div>';
  972. // 数据返回
  973. return $this->html;
  974. }
  975. /**
  976. * [ViewImagesSlideOutsideArrow 幻灯片+图片外左右箭头]
  977. * @author Devil
  978. * @blog http://gong.gg/
  979. * @version 0.0.1
  980. * @datetime 2017-02-20T18:06:08+0800
  981. * @param [array] $data [数据列表]
  982. * @param [array] $rules [参数规则]
  983. */
  984. public function ViewImagesSlideOutsideArrow($data, $rules)
  985. {
  986. // 数据初始化
  987. $this->DataInit($data, $rules);
  988. // 开始处理数据
  989. $this->html = '<div class="am-list-news am-list-news-default">';
  990. // 标题
  991. $this->GetTitleContent('slide');
  992. // 数据列表
  993. $this->html .= '<div class="am-list-news-bd">';
  994. // 自定义内容为空, 并且数据列表不为空
  995. if(empty($this->rules['summary']) && !empty($data))
  996. {
  997. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-b3" data-am-slider=\'{&quot;controlNav&quot;:false}\'><ul class="am-slides">';
  998. $count = count($data);
  999. foreach($data as $k=>$v)
  1000. {
  1001. // 内容
  1002. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  1003. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  1004. $this->html .= '</a></li>';
  1005. }
  1006. $this->html .= '</ul></div>';
  1007. } else {
  1008. // 自定义内容
  1009. $this->html .= $this->rules['summary'];
  1010. }
  1011. // 内容收尾处理
  1012. $this->html .= '</div></div>';
  1013. // 数据返回
  1014. return $this->html;
  1015. }
  1016. /**
  1017. * [ViewImagesSlideOutsideRoundArrow 幻灯片+图片外左右圆形箭头]
  1018. * @author Devil
  1019. * @blog http://gong.gg/
  1020. * @version 0.0.1
  1021. * @datetime 2017-02-20T18:06:08+0800
  1022. * @param [array] $data [数据列表]
  1023. * @param [array] $rules [参数规则]
  1024. */
  1025. public function ViewImagesSlideOutsideRoundArrow($data, $rules)
  1026. {
  1027. // 数据初始化
  1028. $this->DataInit($data, $rules);
  1029. // 开始处理数据
  1030. $this->html = '<div class="am-list-news am-list-news-default">';
  1031. // 标题
  1032. $this->GetTitleContent('slide');
  1033. // 数据列表
  1034. $this->html .= '<div class="am-list-news-bd">';
  1035. // 自定义内容为空, 并且数据列表不为空
  1036. if(empty($this->rules['summary']) && !empty($data))
  1037. {
  1038. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-b4" data-am-slider=\'{&quot;controlNav&quot;:false}\'><ul class="am-slides">';
  1039. $count = count($data);
  1040. foreach($data as $k=>$v)
  1041. {
  1042. // 内容
  1043. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  1044. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  1045. $this->html .= '</a></li>';
  1046. }
  1047. $this->html .= '</ul></div>';
  1048. } else {
  1049. // 自定义内容
  1050. $this->html .= $this->rules['summary'];
  1051. }
  1052. // 内容收尾处理
  1053. $this->html .= '</div></div>';
  1054. // 数据返回
  1055. return $this->html;
  1056. }
  1057. /**
  1058. * [ViewImagesSlideTitleLongPoint 幻灯片+标题+长条控制点]
  1059. * @author Devil
  1060. * @blog http://gong.gg/
  1061. * @version 0.0.1
  1062. * @datetime 2017-02-20T18:06:08+0800
  1063. * @param [array] $data [数据列表]
  1064. * @param [array] $rules [参数规则]
  1065. */
  1066. public function ViewImagesSlideTitleLongPoint($data, $rules)
  1067. {
  1068. // 数据初始化
  1069. $this->DataInit($data, $rules);
  1070. // 开始处理数据
  1071. $this->html = '<div class="am-list-news am-list-news-default">';
  1072. // 标题
  1073. $this->GetTitleContent('slide');
  1074. // 数据列表
  1075. $this->html .= '<div class="am-list-news-bd">';
  1076. // 自定义内容为空, 并且数据列表不为空
  1077. if(empty($this->rules['summary']) && !empty($data))
  1078. {
  1079. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-c1" data-am-slider=\'{&quot;directionNav&quot;:false}\'><ul class="am-slides">';
  1080. $count = count($data);
  1081. foreach($data as $k=>$v)
  1082. {
  1083. // 内容
  1084. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  1085. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  1086. $this->html .= '<div class="am-slider-desc">'.$v['title'].'</div>';
  1087. $this->html .= '</a></li>';
  1088. }
  1089. $this->html .= '</ul></div>';
  1090. } else {
  1091. // 自定义内容
  1092. $this->html .= $this->rules['summary'];
  1093. }
  1094. // 内容收尾处理
  1095. $this->html .= '</div></div>';
  1096. // 数据返回
  1097. return $this->html;
  1098. }
  1099. /**
  1100. * [ViewImagesSlideTitlePartyPoint 幻灯片+标题+方形控制点]
  1101. * @author Devil
  1102. * @blog http://gong.gg/
  1103. * @version 0.0.1
  1104. * @datetime 2017-02-20T18:06:08+0800
  1105. * @param [array] $data [数据列表]
  1106. * @param [array] $rules [参数规则]
  1107. */
  1108. public function ViewImagesSlideTitlePartyPoint($data, $rules)
  1109. {
  1110. // 数据初始化
  1111. $this->DataInit($data, $rules);
  1112. // 开始处理数据
  1113. $this->html = '<div class="am-list-news am-list-news-default">';
  1114. // 标题
  1115. $this->GetTitleContent('slide');
  1116. // 数据列表
  1117. $this->html .= '<div class="am-list-news-bd">';
  1118. // 自定义内容为空, 并且数据列表不为空
  1119. if(empty($this->rules['summary']) && !empty($data))
  1120. {
  1121. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-c2" data-am-slider=\'{&quot;directionNav&quot;:false}\'><ul class="am-slides">';
  1122. $count = count($data);
  1123. foreach($data as $k=>$v)
  1124. {
  1125. // 内容
  1126. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  1127. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  1128. $this->html .= '<div class="am-slider-desc">'.$v['title'].'</div>';
  1129. $this->html .= '</a></li>';
  1130. }
  1131. $this->html .= '</ul></div>';
  1132. } else {
  1133. // 自定义内容
  1134. $this->html .= $this->rules['summary'];
  1135. }
  1136. // 内容收尾处理
  1137. $this->html .= '</div></div>';
  1138. // 数据返回
  1139. return $this->html;
  1140. }
  1141. /**
  1142. * [ViewImagesSlideTitleArrow 幻灯片+标题+居中左右箭头]
  1143. * @author Devil
  1144. * @blog http://gong.gg/
  1145. * @version 0.0.1
  1146. * @datetime 2017-02-20T18:06:08+0800
  1147. * @param [array] $data [数据列表]
  1148. * @param [array] $rules [参数规则]
  1149. */
  1150. public function ViewImagesSlideTitleArrow($data, $rules)
  1151. {
  1152. // 数据初始化
  1153. $this->DataInit($data, $rules);
  1154. // 开始处理数据
  1155. $this->html = '<div class="am-list-news am-list-news-default">';
  1156. // 标题
  1157. $this->GetTitleContent('slide');
  1158. // 数据列表
  1159. $this->html .= '<div class="am-list-news-bd">';
  1160. // 自定义内容为空, 并且数据列表不为空
  1161. if(empty($this->rules['summary']) && !empty($data))
  1162. {
  1163. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-c3" data-am-slider=\'{&quot;controlNav&quot;:false}\'><ul class="am-slides">';
  1164. $count = count($data);
  1165. foreach($data as $k=>$v)
  1166. {
  1167. // 内容
  1168. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'"><img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" /></a>';
  1169. $this->html .= '<div class="am-slider-desc"><div class="am-slider-counter"><span class="am-active">'.($k+1).'</span>/'.$count.'</div>'.$v['title'].'</div>';
  1170. $this->html .= '</li>';
  1171. }
  1172. $this->html .= '</ul></div>';
  1173. } else {
  1174. // 自定义内容
  1175. $this->html .= $this->rules['summary'];
  1176. }
  1177. // 内容收尾处理
  1178. $this->html .= '</div></div>';
  1179. // 数据返回
  1180. return $this->html;
  1181. }
  1182. /**
  1183. * [ViewImagesSlideTitleBottomArrow 幻灯片+标题+居底左右箭头]
  1184. * @author Devil
  1185. * @blog http://gong.gg/
  1186. * @version 0.0.1
  1187. * @datetime 2017-02-20T18:06:08+0800
  1188. * @param [array] $data [数据列表]
  1189. * @param [array] $rules [参数规则]
  1190. */
  1191. public function ViewImagesSlideTitleBottomArrow($data, $rules)
  1192. {
  1193. // 数据初始化
  1194. $this->DataInit($data, $rules);
  1195. // 开始处理数据
  1196. $this->html = '<div class="am-list-news am-list-news-default">';
  1197. // 标题
  1198. $this->GetTitleContent('slide');
  1199. // 数据列表
  1200. $this->html .= '<div class="am-list-news-bd">';
  1201. // 自定义内容为空, 并且数据列表不为空
  1202. if(empty($this->rules['summary']) && !empty($data))
  1203. {
  1204. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-c4" data-am-slider=\'{&quot;controlNav&quot;:false}\'><ul class="am-slides">';
  1205. $count = count($data);
  1206. foreach($data as $k=>$v)
  1207. {
  1208. // 内容
  1209. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  1210. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  1211. $this->html .= '<div class="am-slider-desc">'.$v['title'].'</div>';
  1212. $this->html .= '</a></li>';
  1213. }
  1214. $this->html .= '</ul></div>';
  1215. } else {
  1216. // 自定义内容
  1217. $this->html .= $this->rules['summary'];
  1218. }
  1219. // 内容收尾处理
  1220. $this->html .= '</div></div>';
  1221. // 数据返回
  1222. return $this->html;
  1223. }
  1224. /**
  1225. * [ViewImagesSlideTitleBottomRoundArrow 幻灯片+标题+底部圆形左右箭头]
  1226. * @author Devil
  1227. * @blog http://gong.gg/
  1228. * @version 0.0.1
  1229. * @datetime 2017-02-20T18:06:08+0800
  1230. * @param [array] $data [数据列表]
  1231. * @param [array] $rules [参数规则]
  1232. */
  1233. public function ViewImagesSlideTitleBottomRoundArrow($data, $rules)
  1234. {
  1235. // 数据初始化
  1236. $this->DataInit($data, $rules);
  1237. // 开始处理数据
  1238. $this->html = '<div class="am-list-news am-list-news-default">';
  1239. // 标题
  1240. $this->GetTitleContent('slide');
  1241. // 数据列表
  1242. $this->html .= '<div class="am-list-news-bd">';
  1243. // 自定义内容为空, 并且数据列表不为空
  1244. if(empty($this->rules['summary']) && !empty($data))
  1245. {
  1246. $more = L('common_layout_slider_more_text');
  1247. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-d1" data-am-slider=\'{&quot;controlNav&quot;:false}\'><ul class="am-slides">';
  1248. $count = count($data);
  1249. foreach($data as $k=>$v)
  1250. {
  1251. // 内容
  1252. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  1253. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  1254. $this->html .= '<div class="am-slider-desc"><h2 class="am-slider-title" style="color:#fff;">'.$v['title'].'</h2><a href="'.$v['url'].'" '.$this->blank.' class="am-slider-more">'.$more.'</a></div>';
  1255. $this->html .= '</a></li>';
  1256. }
  1257. $this->html .= '</ul></div>';
  1258. } else {
  1259. // 自定义内容
  1260. $this->html .= $this->rules['summary'];
  1261. }
  1262. // 内容收尾处理
  1263. $this->html .= '</div></div>';
  1264. // 数据返回
  1265. return $this->html;
  1266. }
  1267. /**
  1268. * [ViewImagesSlideFloatTitleBottomRoundArrow 幻灯片+标题+底部圆形控制点]
  1269. * @author Devil
  1270. * @blog http://gong.gg/
  1271. * @version 0.0.1
  1272. * @datetime 2017-02-20T18:06:08+0800
  1273. * @param [array] $data [数据列表]
  1274. * @param [array] $rules [参数规则]
  1275. */
  1276. public function ViewImagesSlideFloatTitleBottomRoundArrow($data, $rules)
  1277. {
  1278. // 数据初始化
  1279. $this->DataInit($data, $rules);
  1280. // 开始处理数据
  1281. $this->html = '<div class="am-list-news am-list-news-default">';
  1282. // 标题
  1283. $this->GetTitleContent('slide');
  1284. // 数据列表
  1285. $this->html .= '<div class="am-list-news-bd">';
  1286. // 自定义内容为空, 并且数据列表不为空
  1287. if(empty($this->rules['summary']) && !empty($data))
  1288. {
  1289. $more = L('common_layout_slider_more_text');
  1290. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-d2" data-am-slider=\'{&quot;directionNav&quot;:false}\'><ul class="am-slides">';
  1291. $count = count($data);
  1292. foreach($data as $k=>$v)
  1293. {
  1294. // 内容
  1295. $this->html .= '<li><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  1296. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  1297. $this->html .= '<div class="am-slider-desc"><div class="am-slider-content"><h2 class="am-slider-title" style="color:#fff;">'.$v['title'].'</h2><a href="'.$v['url'].'" '.$this->blank.' class="am-slider-more">'.$more.'</a></div>';
  1298. $this->html .= '</a></li>';
  1299. }
  1300. $this->html .= '</ul></div>';
  1301. } else {
  1302. // 自定义内容
  1303. $this->html .= $this->rules['summary'];
  1304. }
  1305. // 内容收尾处理
  1306. $this->html .= '</div></div>';
  1307. // 数据返回
  1308. return $this->html;
  1309. }
  1310. /**
  1311. * [ViewImagesSlideTitleThumbnailImageNav 幻灯片+标题+缩略图导航]
  1312. * @author Devil
  1313. * @blog http://gong.gg/
  1314. * @version 0.0.1
  1315. * @datetime 2017-02-20T18:06:08+0800
  1316. * @param [array] $data [数据列表]
  1317. * @param [array] $rules [参数规则]
  1318. */
  1319. public function ViewImagesSlideTitleThumbnailImageNav($data, $rules)
  1320. {
  1321. // 数据初始化
  1322. $this->DataInit($data, $rules);
  1323. // 开始处理数据
  1324. $this->html = '<div class="am-list-news am-list-news-default">';
  1325. // 标题
  1326. $this->GetTitleContent('slide');
  1327. // 数据列表
  1328. $this->html .= '<div class="am-list-news-bd">';
  1329. // 自定义内容为空, 并且数据列表不为空
  1330. if(empty($this->rules['summary']) && !empty($data))
  1331. {
  1332. $this->html .= '<div data-am-widget="slider" class="am-slider am-slider-d3" data-am-slider=\'{&quot;controlNav&quot;:&quot;thumbnails&quot;,&quot;directionNav&quot;:false}\'><ul class="am-slides">';
  1333. $count = count($data);
  1334. foreach($data as $k=>$v)
  1335. {
  1336. // 内容
  1337. $this->html .= '<li data-thumb="'.$this->image_host.$v['image'][0].'"><a href="'.$v['url'].'" '.$this->blank.' title="'.$v['title'].'">';
  1338. $this->html .= '<img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'" />';
  1339. $this->html .= '<div class="am-slider-desc"><div class="am-slider-content"><h2 class="am-slider-title" style="color:#fff;">'.$v['title'].'</h2></div>';
  1340. $this->html .= '</a></li>';
  1341. }
  1342. $this->html .= '</ul></div>';
  1343. } else {
  1344. // 自定义内容
  1345. $this->html .= $this->rules['summary'];
  1346. }
  1347. // 内容收尾处理
  1348. $this->html .= '</div></div>';
  1349. // 数据返回
  1350. return $this->html;
  1351. }
  1352. /**
  1353. * [ViewImagesList112 文章图片列表-112]
  1354. * @author Devil
  1355. * @blog http://gong.gg/
  1356. * @version 0.0.1
  1357. * @datetime 2017-02-20T18:06:08+0800
  1358. * @param [array] $data [数据列表]
  1359. * @param [array] $rules [参数规则]
  1360. */
  1361. public function ViewImagesList112($data, $rules)
  1362. {
  1363. return $this->ViewImagesList($data, $rules, 1, 1, 2);
  1364. }
  1365. /**
  1366. * [ViewImagesList122 文章图片列表-122]
  1367. * @author Devil
  1368. * @blog http://gong.gg/
  1369. * @version 0.0.1
  1370. * @datetime 2017-02-20T18:06:08+0800
  1371. * @param [array] $data [数据列表]
  1372. * @param [array] $rules [参数规则]
  1373. */
  1374. public function ViewImagesList122($data, $rules)
  1375. {
  1376. return $this->ViewImagesList($data, $rules, 1, 2, 2);
  1377. }
  1378. /**
  1379. * [ViewImagesList123 文章图片列表-123]
  1380. * @author Devil
  1381. * @blog http://gong.gg/
  1382. * @version 0.0.1
  1383. * @datetime 2017-02-20T18:06:08+0800
  1384. * @param [array] $data [数据列表]
  1385. * @param [array] $rules [参数规则]
  1386. */
  1387. public function ViewImagesList123($data, $rules)
  1388. {
  1389. return $this->ViewImagesList($data, $rules, 1, 2, 3);
  1390. }
  1391. /**
  1392. * [ViewImagesList222 文章图片列表-222]
  1393. * @author Devil
  1394. * @blog http://gong.gg/
  1395. * @version 0.0.1
  1396. * @datetime 2017-02-20T18:06:08+0800
  1397. * @param [array] $data [数据列表]
  1398. * @param [array] $rules [参数规则]
  1399. */
  1400. public function ViewImagesList222($data, $rules)
  1401. {
  1402. return $this->ViewImagesList($data, $rules, 2, 2, 2);
  1403. }
  1404. /**
  1405. * [ViewImagesList223 文章图片列表-223]
  1406. * @author Devil
  1407. * @blog http://gong.gg/
  1408. * @version 0.0.1
  1409. * @datetime 2017-02-20T18:06:08+0800
  1410. * @param [array] $data [数据列表]
  1411. * @param [array] $rules [参数规则]
  1412. */
  1413. public function ViewImagesList223($data, $rules)
  1414. {
  1415. return $this->ViewImagesList($data, $rules, 2, 2, 3);
  1416. }
  1417. /**
  1418. * [ViewImagesList234 文章图片列表-234]
  1419. * @author Devil
  1420. * @blog http://gong.gg/
  1421. * @version 0.0.1
  1422. * @datetime 2017-02-20T18:06:08+0800
  1423. * @param [array] $data [数据列表]
  1424. * @param [array] $rules [参数规则]
  1425. */
  1426. public function ViewImagesList234($data, $rules)
  1427. {
  1428. return $this->ViewImagesList($data, $rules, 2, 3, 4);
  1429. }
  1430. /**
  1431. * [ViewImagesList236 文章图片列表-236]
  1432. * @author Devil
  1433. * @blog http://gong.gg/
  1434. * @version 0.0.1
  1435. * @datetime 2017-02-20T18:06:08+0800
  1436. * @param [array] $data [数据列表]
  1437. * @param [array] $rules [参数规则]
  1438. */
  1439. public function ViewImagesList236($data, $rules)
  1440. {
  1441. return $this->ViewImagesList($data, $rules, 2, 3, 6);
  1442. }
  1443. /**
  1444. * [ViewImagesList 文章图片列表]
  1445. * @author Devil
  1446. * @blog http://gong.gg/
  1447. * @version 0.0.1
  1448. * @datetime 2017-02-20T18:06:08+0800
  1449. * @param [array] $data [数据列表]
  1450. * @param [array] $rules [参数规则]
  1451. */
  1452. private function ViewImagesList($data, $rules, $sm, $md, $lg)
  1453. {
  1454. // 数据初始化
  1455. $this->DataInit($data, $rules);
  1456. // 开始处理数据
  1457. $this->html = '<div class="am-list-news layout-images-list">';
  1458. // 标题
  1459. $this->GetTitleContent();
  1460. // 数据列表
  1461. $this->html .= '<div class="am-list-news-bd">';
  1462. // 自定义内容为空, 并且数据列表不为空
  1463. if(empty($this->rules['summary']) && !empty($data))
  1464. {
  1465. $this->html .= '<ul data-am-widget="gallery" class="am-gallery am-avg-sm-'.$sm.' am-avg-md-'.$md.' am-avg-lg-'.$lg.' am-gallery-overlay layout-gallery-overlay-'.$sm.$md.$lg.'" data-am-gallery="{}">';
  1466. foreach($data as $k=>$v)
  1467. {
  1468. // 内容
  1469. $this->html .= '<li><div class="am-gallery-item o-h">';
  1470. $this->html .= '<a href="'.$v['url'].'" '.$this->blank.'><img src="'.$this->image_host.$v['image'][0].'" alt="'.$v['title'].'"/><h3 class="am-gallery-title">'.$v['title'].'</h3></a>';
  1471. $this->html .= '</div></li>';
  1472. }
  1473. $this->html .= '</ul>';
  1474. } else {
  1475. // 自定义内容
  1476. $this->html .= $this->rules['summary'];
  1477. }
  1478. // 内容收尾处理
  1479. $this->html .= '</div></div>';
  1480. // 数据返回
  1481. return $this->html;
  1482. }
  1483. }
  1484. ?>