%%F5^F51^F51A8D6B%%events_article.html.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php /* Smarty version 2.6.17, created on 2018-04-19 17:52:59
  2. compiled from events_article.html */ ?>
  3. <?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
  4. smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'events_article.html', 14, false),)), $this); ?>
  5. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  6. $this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
  7. $this->_tpl_vars = $_smarty_tpl_vars;
  8. unset($_smarty_tpl_vars);
  9. ?>
  10. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  11. $this->_smarty_include(array('smarty_include_tpl_file' => "nav.html", 'smarty_include_vars' => array()));
  12. $this->_tpl_vars = $_smarty_tpl_vars;
  13. unset($_smarty_tpl_vars);
  14. ?>
  15. <style>
  16. .praise {cursor: pointer;}
  17. </style>
  18. <!--公用标题居中显示-->
  19. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  20. $this->_smarty_include(array('smarty_include_tpl_file' => "common_header.html", 'smarty_include_vars' => array()));
  21. $this->_tpl_vars = $_smarty_tpl_vars;
  22. unset($_smarty_tpl_vars);
  23. ?>
  24. <div class="wrapper clear">
  25. <div class="arti_body">
  26. <div class="arti_title"><?php echo $this->_tpl_vars['article']['article_title']; ?>
  27. </div>
  28. <div class="arti_info">
  29. <span><?php echo ((is_array($_tmp=$this->_tpl_vars['article']['begin_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
  30. </span><span><?php if ($this->_tpl_vars['article']['article_author']): ?>作者:<?php echo $this->_tpl_vars['article']['article_author']; ?>
  31. <?php endif; ?></span>
  32. </div>
  33. <div class="arti_content clear"><?php echo $this->_tpl_vars['article']['article_text']; ?>
  34. </div>
  35. <div class="clear"></div>
  36. <div class="vogue_read"><a href="">阅读原文</a> 阅读 <?php echo $this->_tpl_vars['clickNum']; ?>
  37. <span class="praise"><i class="fa <?php if ($this->_tpl_vars['isHasLikes']): ?>fa-thumbs-up<?php else: ?>fa-thumbs-o-up<?php endif; ?>"></i> <em><?php echo $this->_tpl_vars['likes']; ?>
  38. </em></span></div>
  39. <div class="clear"></div>
  40. </div>
  41. </div>
  42. <input name="events_id" type="hidden" value="<?php echo $this->_tpl_vars['article']['id']; ?>
  43. "/>
  44. <script>
  45. KISSY.use('node, io', function (S, Node, IO) {
  46. var $ = S.all;
  47. //视频自适应
  48. var screenWidth = $(window).width();
  49. var baseWidth = 510;
  50. var video_scale = screenWidth / baseWidth;
  51. $(".video_iframe").each(function () {
  52. var new_width = $(this).width() * video_scale;
  53. $(this).width(new_width - 20);
  54. var new_height = $(this).height() * video_scale;
  55. $(this).height(new_height - 20);
  56. });
  57. $('.vogue_add_btn').on('click', function() {
  58. $('#add_tips').show();
  59. });
  60. $('.add_join_btn').on('click', function () {
  61. $('#add_tips').hide();
  62. });
  63. $(".praise").on('click', function () {
  64. var num = $('em', $(this)).text();
  65. if ($('i', $(this)).hasClass('fa-thumbs-up')) { //已赞过
  66. $('em', $(this)).text(--num);
  67. submit(2);
  68. $('i', $(this)).replaceClass('fa-thumbs-up', 'fa-thumbs-o-up');
  69. } else { //未赞过
  70. $('em', $(this)).text(++num);
  71. submit(1);
  72. $('i', $(this)).replaceClass('fa-thumbs-o-up', 'fa-thumbs-up');
  73. }
  74. });
  75. function submit(type) {
  76. var events_id = $("input[name=events_id]").val();
  77. new IO({
  78. type: "post"
  79. , url: VG.conf.root_domain + '/?c=EventsArticle&a=Likes'
  80. , data: {'events_id':events_id, 'type': type}
  81. , success: function (data) {}
  82. , error: function (NULL, textStatus) {
  83. alert("请求服务器失败,原因:"+textStatus);
  84. }
  85. , dataType: "json"
  86. });
  87. }
  88. });
  89. </script>
  90. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  91. $this->_smarty_include(array('smarty_include_tpl_file' => "bottom.html", 'smarty_include_vars' => array()));
  92. $this->_tpl_vars = $_smarty_tpl_vars;
  93. unset($_smarty_tpl_vars);
  94. ?>