cms_index.template.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php defined('InShopNC') or exit('Access Invalid!');?>
  2. <?php if($_GET['op'] === 'cms_index_preview') { ?>
  3. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.js" charset="utf-8"></script>
  4. <script type="text/javascript" src="<?php echo CMS_SITE_URL;?>/resource/js/common.js" charset="utf-8"></script>
  5. <link href="<?php echo CMS_SITE_URL.DS;?>templates/default/css/base.css" rel="stylesheet" type="text/css"/>
  6. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.VMiddleImg.js"></script>
  7. <?php } ?>
  8. <link href="<?php echo CMS_SITE_URL.DS;?>templates/cms_special.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jcarousel/jquery.jcarousel.min.js" charset="utf-8"></script>
  10. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/slidesjs/jquery.slides.min.js" charset="utf-8"></script>
  11. <link href="<?php echo RESOURCE_SITE_URL;?>/js/jcarousel/skins/personal/skin.css" rel="stylesheet" type="text/css">
  12. <script type="text/javascript">
  13. $(document).ready(function() {
  14. if($('#index1_1_1_content').children().length > 0) {
  15. $('#index1_1_1_content').slidesjs({
  16. play: {
  17. active: true,
  18. interval: 5000,
  19. auto: true,
  20. pauseOnHover: false,
  21. restartDelay: 2500
  22. },
  23. callback: {
  24. complete: function(number) {
  25. var $item = $(".slidesjs-pagination-item");
  26. $item.removeClass("current");
  27. $item.eq(number - 1).addClass("current");
  28. }
  29. },
  30. width: 380,
  31. height: 260
  32. });
  33. $(".slidesjs-pagination-item").eq(0).addClass("current");
  34. }
  35. //图片延迟加载
  36. $(".lazyload_container").nc_lazyload_init();
  37. $("img").nc_lazyload();
  38. //计算自定义块高度
  39. var frames = $('.cms-module-frame');
  40. $.each(frames, function(index, frame) {
  41. var boxs = $(frame).find('[nctype="cms_module_content"]');
  42. var height = 0;
  43. $.each(boxs, function(index2, box) {
  44. var box_height = $(box).height();
  45. if(box_height > height) {
  46. height = box_height;
  47. }
  48. });
  49. boxs.height(height);
  50. });
  51. });
  52. </script>
  53. <?php if($_GET['op'] === 'cms_index_preview') { ?>
  54. <div style="width:1000px;margin:0 auto;">
  55. <?php } ?>
  56. <?php if(!empty($output['module_list']) && is_array($output['module_list'])) {?>
  57. <?php foreach($output['module_list'] as $key=>$value) {?>
  58. <?php $module_content = unserialize(base64_decode($value['module_content']));?>
  59. <?php if($value['module_type'] != 'index' && $value['module_type'] != 'micro') { ?>
  60. <textarea class="lazyload_container" rows="10" cols="30" style="display:none;">
  61. <?php } ?>
  62. <?php require($value['module_template']);?>
  63. <?php if($value['module_type'] != 'index' && $value['module_type'] != 'micro') { ?>
  64. </textarea>
  65. <?php } ?>
  66. <?php } ?>
  67. <?php } ?>
  68. <?php if($_GET['op'] === 'cms_index_preview') { ?>
  69. </div>
  70. <?php } ?>