You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
3.4 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  2. <title><?php if(isset($post)){echo $post["name"].'_'.sysconfig('CMS_WEBNAME');}else{echo '动态';} ?></title><meta name="keywords" content="{dede:field.keywords/}" /><meta name="description" content="{dede:field.description function='html2text(@me)'/}" /><link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/style.css"><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/ad.js"></script></head><body>
  3. @include('home.common.header')
  4. <div class="box" style="padding-top:20px;" id="arclist">
  5. <?php if($list){foreach($list as $k=>$v){ ?><div class="list"><?php if(!empty($v['litpic'])){ ?><a class="limg" href="<?php echo get_front_url(array("id"=>$v['id'],"catid"=>$v['typeid'],"type"=>'content')); ?>"><img alt="<?php echo $v['title']; ?>" src="<?php echo $v['litpic']; ?>"></a><?php } ?>
  6. <strong class="tit"><a href="<?php echo get_front_url(array("id"=>$v['id'],"catid"=>$v['typeid'],"type"=>'content')); ?>"><?php echo $v['title']; ?></a></strong><p><?php echo mb_strcut($v['description'],0,150,'UTF-8'); ?>..</p>
  7. <div class="info"><span class="fl"><?php $taglist=taglist($v['id']);if($taglist){foreach($taglist as $row){ ?><a href="<?php echo get_front_url(array("tagid"=>$row['id'],"type"=>'tags')); ?>"><?php echo $row['tag']; ?></a><?php }} ?><em><?php echo date("m-d H:i",$v['pubdate']); ?></em></span><span class="fr"><em><?php echo $v['click']; ?></em>人阅读</span></div><div class="cl"></div></div><?php }} ?>
  8. </div>
  9. <script>
  10. $(function(){
  11. var ajaxload = false;
  12. var maxpage = false;
  13. var startpage = 1;
  14. var totalpage = <?php echo $totalpage; ?>;
  15. var tmp_url = window.location.href;
  16. msg = tmp_url.split("#");
  17. tmp_url = msg[0];
  18. $(window).scroll(function ()
  19. {
  20. var listheight = $("#arclist").outerHeight();
  21. if ($(document).scrollTop() + $(window).height() >= listheight)
  22. {
  23. if(startpage >= totalpage)
  24. {
  25. //$("#submit_bt_one").html("已是最后一页,没有更多数据!");
  26. return false;
  27. }
  28. if(!ajaxload && !maxpage)
  29. {
  30. ajaxload = true;
  31. //$("#submit_bt_one").html("努力加载中...");
  32. var url = tmp_url;
  33. var nextpage = startpage+1;
  34. $.get(url,{page_ajax:1,page:nextpage},function(res)
  35. {
  36. if(res)
  37. {
  38. $("#arclist").append(res);
  39. startpage++;
  40. if(startpage >= totalpage)
  41. {
  42. maxpage = true;
  43. //$("#submit_bt_one").html("已是最后一页,没有更多数据!");
  44. }
  45. else
  46. {
  47. //$("#submit_bt_one").html("点击加载更多");
  48. }
  49. ajaxload = false;
  50. }
  51. else
  52. {
  53. //$("#submit_bt_one").html("请求失败,请稍候再试!");
  54. ajaxload = false;
  55. }
  56. },'json');
  57. }
  58. }
  59. });
  60. });
  61. </script>
  62. @include('home.common.footer')</body></html>