<?php /* Smarty version 2.6.22, created on 2016-01-06 17:34:16
         compiled from E:/xampp/htdocs/templates/home/default%5Citems%5Ccomments.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'nl2br', 'E:/xampp/htdocs/templates/home/default\\items\\comments.html', 75, false),array('modifier', 'date_format', 'E:/xampp/htdocs/templates/home/default\\items\\comments.html', 77, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['template_path'])."/html/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<link href="<?php echo $this->_tpl_vars['template_data']; ?>
css/custom/resource.css" rel="stylesheet" />
<link href="<?php echo $this->_tpl_vars['template_data']; ?>
css/custom/mobile.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['template_path'])."/html/pagenav.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<div class="pagetit pagetabs">
  <div class="navblock">
    <ul class="titnav clr">
      <li><a href="/" title="主页">主页</a></li>
      <li class="pipe">&gt;</li>
      <li><a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
categories/all/" title="文件">文件</a></li>
      <li class="pipe">&gt;</li>
      <?php $_from = $this->_tpl_vars['item']['categories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['e']):
?>
        <?php $_from = $this->_tpl_vars['e']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['c']):
        $this->_foreach['foo']['iteration']++;
?>
          <li><a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
categories/<?php echo $this->_tpl_vars['categories'][$this->_tpl_vars['c']]['id']; ?>
" title="<?php echo $this->_tpl_vars['categories'][$this->_tpl_vars['c']]['name']; ?>
"><?php echo $this->_tpl_vars['categories'][$this->_tpl_vars['c']]['name']; ?>
</a></li>
          <?php if (! ($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?><li class="pipe">&gt;</li><?php endif; ?>
        <?php endforeach; endif; unset($_from); ?>
      <?php endforeach; endif; unset($_from); ?>
    </ul>
    <h2><?php echo $this->_tpl_vars['item']['name']; ?>
</h2>
    <ul class="pagetab clr">
      <li><a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
items/<?php echo $this->_tpl_vars['item']['id']; ?>
" title="文件详情">作品详情</a></li>
      <?php if ($this->_tpl_vars['faqs'] > 0 || check_login_bool ( ) && $this->_tpl_vars['item']['user_id'] == $_SESSION['user']['user_id']): ?>
      <li><a<?php if ($_GET['controller'] == 'faq'): ?> class="active"<?php endif; ?> href="/<?php echo $this->_tpl_vars['languageURL']; ?>
items/faq/<?php echo $this->_tpl_vars['item']['id']; ?>
" title="常见问题解答">常见问题解答</a></li>
      <?php endif; ?>
      <?php if (check_login_bool ( ) && $this->_tpl_vars['item']['user_id'] == $_SESSION['user']['user_id']): ?>
      <li><a<?php if ($_GET['controller'] == 'edit'): ?> class="active"<?php endif; ?> href="/<?php echo $this->_tpl_vars['languageURL']; ?>
items/edit/<?php echo $this->_tpl_vars['item']['id']; ?>
" title="编辑">编辑</a></li>
      <?php endif; ?>
        <?php if (check_login_bool ( ) && $this->_tpl_vars['item']['user_id'] == $_SESSION['user']['user_id']): ?>
        <li><a<?php if ($_GET['controller'] == 'record'): ?> class="active"<?php endif; ?> href="/<?php echo $this->_tpl_vars['languageURL']; ?>
items/record/<?php echo $this->_tpl_vars['item']['id']; ?>
" title="购买记录">购买记录</a></li>
        <?php endif; ?>
      <li><a<?php if ($_GET['controller'] == 'comments'): ?> class="active"<?php endif; ?> href="/<?php echo $this->_tpl_vars['languageURL']; ?>
items/comments/<?php echo $this->_tpl_vars['item']['id']; ?>
" title="评论">评论</a></li>
    </ul>
  </div>
</div>
<div class="resourcebg">
  <div class="pageblock clr">
    <?php echo $this->_tpl_vars['errorMessage']; ?>

    <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['root_path'])."/apps/items/views/purchase_panel.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
    <div class="leftdetail">

<div class="commentblock">
  <?php if ($this->_tpl_vars['paging']): ?>
  <div class="pagenums clr">
    <div class="pagination">
    <?php echo $this->_tpl_vars['paging']; ?>

    </div>
  </div>
  <?php endif; ?>
  <?php if ($this->_tpl_vars['comments']): ?>
  <div class="commentlist">
    <?php $_from = $this->_tpl_vars['comments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['c']):
?>
    <div class="comment clr">
      <div class="comment__user">
        <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
user/<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['username']; ?>
" class="avatar" title="<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['username']; ?>
">
        <?php if ($this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['avatar'] != ''): ?> 
        <img alt="<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['username']; ?>
" class="" src="<?php echo $this->_tpl_vars['data_server']; ?>
uploads/users/<?php echo $this->_tpl_vars['c']['user_id']; ?>
/A_<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['avatar']; ?>
" />
        <?php else: ?>
        <img alt="<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['username']; ?>
" class="" src="<?php echo $this->_tpl_vars['template_data']; ?>
img/default-user.jpg" />
        <?php endif; ?>
        <span><?php echo $this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['username']; ?>
</span>
        </a>
      </div>
      <div class="comment__container">
        <div class="content-box comment__body">
          <div class="comment__header">
            <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
user/<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['username']; ?>
" class="comment__username"><?php echo $this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['nickname']; ?>
</a>
            <?php if ($this->_tpl_vars['item']['user_id'] == $this->_tpl_vars['c']['user_id']): ?>
              <strong class="comment__user-type--author">作者</strong>
            <?php elseif (isset ( $this->_tpl_vars['buyFromUsers'][$this->_tpl_vars['c']['user_id']] )): ?>
              <strong class="comment__user-type--purchased">买家</strong>
            <?php endif; ?>
          </div>
          <p><?php echo ((is_array($_tmp=$this->_tpl_vars['c']['comment'])) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)); ?>
</p>
          <div class="comment__meta">
            发表于 <?php echo ((is_array($_tmp=$this->_tpl_vars['c']['datetime'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>

            <?php if ($this->_tpl_vars['c']['report_by'] == '0'): ?>
            <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
items/comments/<?php echo $this->_tpl_vars['item']['id']; ?>
/?report=<?php echo $this->_tpl_vars['c']['id']; ?>
" class="glyph-flag fancybox"><span class="glyph-alt">报告评论问题</span></a>
            <?php endif; ?> 
          </div>
        </div>
        <?php if (isset ( $this->_tpl_vars['c']['reply'] )): ?>
        <?php $_from = $this->_tpl_vars['c']['reply']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['cc']):
?>
        <div class="comment__reply ">
          <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
user/<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['cc']['user_id']]['username']; ?>
" class='comment__reply__avatar'>
            <?php if ($this->_tpl_vars['users'][$this->_tpl_vars['cc']['user_id']]['avatar'] != ''): ?> 
            <img alt="<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['cc']['user_id']]['username']; ?>
" height="30" src="<?php echo $this->_tpl_vars['data_server']; ?>
uploads/users/<?php echo $this->_tpl_vars['cc']['user_id']; ?>
/A_<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['cc']['user_id']]['avatar']; ?>
" width="30" />
            <?php else: ?>
            <img alt="<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['cc']['user_id']]['username']; ?>
" class="avt" height="30" src="<?php echo $this->_tpl_vars['template_data']; ?>
img/default-user.jpg" width="30" />
            <?php endif; ?>
          </a>
          <div class="comment__reply__body">
            <div class="comment__header">
              <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
user/<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['cc']['user_id']]['username']; ?>
" class="comment__username"><?php echo $this->_tpl_vars['users'][$this->_tpl_vars['cc']['user_id']]['nickname']; ?>
</a>
              <?php if ($this->_tpl_vars['item']['user_id'] == $this->_tpl_vars['cc']['user_id']): ?>
              <strong class="comment__user-type--author">作者</strong>
              <?php elseif (isset ( $this->_tpl_vars['buyFromUsers'][$this->_tpl_vars['cc']['user_id']] )): ?>
              <strong class="comment__user-type--purchased">买家</strong>
              <?php endif; ?>
            </div>
            <p><?php echo ((is_array($_tmp=$this->_tpl_vars['cc']['comment'])) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)); ?>
</p>
          </div>
          <div class="comment__meta">
            发表于 <?php echo ((is_array($_tmp=$this->_tpl_vars['cc']['datetime'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>

            <?php if ($this->_tpl_vars['cc']['report_by'] == '0'): ?>
            <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
items/comments/<?php echo $this->_tpl_vars['item']['id']; ?>
/?report=<?php echo $this->_tpl_vars['cc']['id']; ?>
" onclick="return confirm('<?php echo $this->_tpl_vars['lang']['are_you_sure_report']; ?>
');" class="glyph-flag fancybox"><span class="glyph-alt">报告评论问题</span></a>
            <?php endif; ?>
          </div>
        </div>
        <?php endforeach; endif; unset($_from); ?>
        <?php endif; ?>
        <div id="replyhere_<?php echo $this->_tpl_vars['c']['id']; ?>
"></div>
        <?php echo '
        <script language="javascript">
        seajs.use(["jq"], function($){
          $("'; ?>
#replyhere_<?php echo $this->_tpl_vars['c']['id']; ?>
<?php echo '").load("'; ?>
/<?php echo $this->_tpl_vars['languageURL']; ?>
items/reply/<?php echo $this->_tpl_vars['c']['id']; ?>
<?php echo '");
        });
        </script>
        '; ?>

      </div>
    </div> 
    <?php endforeach; endif; unset($_from); ?>   
  </div>
  <?php else: ?>
  <div class="content-box vertical-space">暂时没有评论</div>
  <?php endif; ?>
  <?php if (check_login_bool ( )): ?>
  <h2 class="box-heading">添加评论</h2>
  <div class="content-box">
    <form action="" method="post">
      <fieldset class="horizontal-form">
        <div class="input-group">
          <label for="item_comment_content">评论内容</label>
          <div class="inputs">
            <textarea class="big input supertall" name="comment" rows="1"></textarea>
          </div>
        </div>
        <div class="input-group">
          <label for="reply_notification">回复提醒？</label>
          <div class="inputs">
            <label for="reply_notification">
              <input class="checkbox" id="reply_notification" name="reply_notification" type="checkbox" value="1" />
              当我收到一个回复时提醒我
            </label>
          </div>
        </div>
      </fieldset>
      <div class="form-submit">
        <button type="submit" name="add" class="btntheme btnsize">提交评论</button>
      </div>
    </form>
  </div>
  <?php echo '
  <script type="text/javascript">
  seajs.use(["jq"], function($){
    $(function(){
      $("textarea.comment__new-reply-field").live("keyup keydown",function(){
        var h=$(this);
        h.height(20).height(h[0].scrollHeight); 
      });
    });
  });
  </script>
  '; ?>

  <?php endif; ?>
</div>

    </div>
    <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['root_path'])."/apps/items/views/rightside.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  </div>
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['template_path'])."/html/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</body>
</html>