<include file="__THEME__/public_header" />


<div id="page-wrap">
  <div id="main-wrap">
    <div id="st-index-grid">
    <!--左边 -->
      <include file="__THEME__/public_left" />
      <div id="col8" class="content-bg clearfix st-bg-b">
        <div id="col4" class="main-left">
          <div id="aside" class="pad">
            <dl class="nav-left mt10 border-no">
              <dd><a href="{:U('public/Mention')}">@提到我的</a></dd>
              <dd <neq name='_GET.type' value='send'>class="current"</neq>>
                <a href="{:U('public/Comment/index',array('app_name'=>t($_GET['app_name']),'type'=>'receive'))}">收到的评论</a>
              </dd>
              <dd <eq name='_GET.type' value='send'>class="current"</eq>>
                <a href="{:U('public/Comment/index',array('app_name'=>t($_GET['app_name']),'type'=>'send'))}">发出的评论</a>
              </dd>
              <dd><a href="{:U('public/Message')}">我的私信</a></dd>
              <dd><a href="{:U('public/Message/notify')}">系统消息</a></dd>
            </dl>
          </div>
        </div>
        <div id="col7" class="main-right">
          <div class="extend minh person-set">
            <div class="feed-nav">
              <div class="set-hd">
                <h3><neq name='_GET.type' value='send'>{:L('PUBLIC_RECEIVE_COMMENT')}</neq><eq name='_GET.type' value='send'>{:L('PUBLIC_SEND_COMMENT')}</eq></h3>
              </div>
              <div class="mod-feed-tab">
                <ul class="inner-feed-nav">
                  <li <eq name='_GET.t' value=''>class="current"</eq>>
                    <a href="{:U('public/Comment',array('type'=>t($_GET['type'])))}">{:L('PUBLIC_ALL_STREAM')}</a>
                  </li>
                  <volist name='tab' id='t'>
                    <php>if($tabHash[$key]){</php>
                      <li <eq name='_GET.t' value='$key'>class="current"</eq>>
                        <a href="{:U('public/Comment',array('t'=>$key,'type'=>t($_GET['type'])))}">{$tabHash[$key]}</a>
                      </li>
                    <php>}</php>
                  </volist>
                </ul>
              </div>
            </div>
            <php> $cancomment1 = intval(CheckPermission('core_normal','feed_comment')); </php>
            <!-- 收到的评论 -->
            <php>if($_GET['type'] == 'receive'):</php>
            <div class="feed_lists" >
              <neq name='list.data' value=''>
              <volist name='list.data' id='vo'>
              <dl class="feed_list clearfix" model-node='comment_list'>
                <dt class="face"><a href="{$vo.user_info.space_url}"><img src="{$vo.user_info.avatar_small}" width="50" height="50"></a></dt>
                <dd class="content">
                  <?php $source_user_at = '@{uid='.$vo['sourceInfo']['source_user_info']['uid'].'|uname='.$vo['sourceInfo']['source_user_info']['uname'].'}：';?>
                  <php>if($vo['sourceInfo']['feedtype'] == 'post' || $vo['sourceInfo']['feedtype'] == 'weiba_post'):</php>
                  <p class="hd"><space uid="vo.user_info.uid">{uname}</space>：{$vo.content}
                  </p>
                  <dl class="comment comment-mes">
                    <!-- <dt class="arrow bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt> -->
                    <dd class="name"><space uid="vo.sourceInfo.source_user_info.uid">@{uname}</space></dd>
                    <?php if($vo['sourceInfo']['is_del'] == 1): ?>
                    <dd>内容已被删除</dd>
                    <?php else: ?>
                    <dd>{$vo.sourceInfo.source_body|format=true}</dd>
                    <?php endif; ?>
                  </dl>
                  <php>elseif($vo['sourceInfo']['feedtype'] == 'repost'):</php>
                  <p class="hd"><space uid="vo.user_info.uid">{uname}</space>：{$vo.content}//{$source_user_at|parse_html}{$vo.sourceInfo.source_body|format=true}
                  </p>
                  <php>else:</php>
                  <p class="hd"><space uid="vo.user_info.uid">{uname}</space>：
                    <php>if($vo['is_audit']){</php>
                      {$vo.content}
                    <php>}else{</php>
                      内容正在审核
                    <php>}</php>
                  </p>
                  <php>if($vo['hasComment']):</php>
                  <dl class="comment comment-mes">
                    <!-- <dt class="arrow bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt> -->
                    <dd class="name"><space uid="vo.sourceInfo.source_user_info.uid">@{uname}</space></dd>
                    <?php if($vo['sourceInfo']['is_del'] == 1): ?>
                    <dd>内容已被删除</dd>
                    <?php else: ?>
                    <dd>{$vo.sourceInfo.source_body|format=true}</dd>
                    <?php endif; ?>
                  </dl>
                  <php>endif;</php>
                  <php>endif;</php>
                  <p class="info">
                    <php>if($vo['is_audit']){</php>
                      <span class="right">
                      <php>if(CheckPermission('core_normal','comment_del')){</php>
                        <em class="hover">
                          <a event-args="comment_id={$vo.comment_id}" event-node="comment_del" href="javascript:void(0);">{:L('PUBLIC_STREAM_DELETE')}</a>
                          <i class="vline">|</i>
                        </em>
                        <php>}</php>
                        <a href="{$vo.sourceInfo.source_url}">{:L('PUBLIC_VIEW')}</a>
                        <php>if(in_array('comment',$weibo_premission)):</php>
                        <neq name='_GET.type' value='send'>
                        <i class="vline">|</i><a href="javascript:void(0);" onclick="if({$cancomment1}){ui.reply(<php>echo $vo['comment_id'];</php>);}else{ui.error('没有权限');}">{:L('PUBLIC_STREAM_REPLY')}</a>
                        </neq>
                        <php>endif;</php>
                      </span>
                      <span class="date">{$vo.ctime|friendlyDate}</span>&nbsp;
                      <span>{$vo.client_type}</span>
                      <php>if($i<=$unread_comment_count){</php>
                        <img src="__THEME__/image/icon_new.png" />
                      <php>}</php>
                    <php>}</php>
                  </p>
                </dd>
              </dl>
              </volist>
              <else />
              <div class="note">{:L('PUBLIC_COMMENTS_ISNOT')}</div>
              </neq>
              <div id='page' class='page'>{$list.html}</div>
            </div>
            <php>else:</php>
            <!-- 发出的评论 -->
            <div class="feed_lists" id="feed-lists">
              <neq name='list.data' value=''>
              <volist name='list.data' id='vo'>
              <dl class="feed_list"  model-node='comment_list'>
                <dt class="face"><a href="{$vo.user_info.space_url}"><img src="{$vo.user_info.avatar_small}"></a></dt>
                <dd class="content">
                  <?php $source_user_at = '@{uid='.$vo['sourceInfo']['source_user_info']['uid'].'|uname='.$vo['sourceInfo']['source_user_info']['uname'].'}：';?>
                  <php>if($vo['sourceInfo']['feedtype'] == 'post' || $vo['sourceInfo']['feedtype'] == 'weiba_post'):</php>
                  <p class="hd"><space uid="vo.user_info.uid">{uname}</space>：{$vo.content}{$vo.replyInfo|parse_html}</p>
                  <dl class="comment comment-mes">
                    <!-- <dt class="arrow bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt> -->
                    <dd class="name">{$vo.sourceInfo.source_user_info.space_link}</dd>
                    <?php if($vo['sourceInfo']['is_del'] == 1): ?>
                    <dd>内容已被删除</dd>
                    <?php else: ?>
                    <dd>{$vo.sourceInfo.source_body|format=true}</dd>
                    <?php endif; ?>
                  </dl>
                  <php>elseif($vo['sourceInfo']['feedtype'] == 'repost'):</php>
                  <p class="hd"><space uid="vo.user_info.uid">{uname}</space>：{$vo.content}//{$source_user_at|parse_html}{$vo.sourceInfo.source_body|format=true}</p>
                  <php>else:</php>
                  <p class="hd"><space uid="vo.user_info.uid">{uname}</space>：{$vo.content}</p>
                  <php>if($vo['hasComment']):</php>
                  <dl class="comment comment-mes">
                    <!-- <dt class="arrow bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt> -->
                    <dd class="name"><space uid="vo.sourceInfo.source_user_info.uid">@{uname}</space></dd>
                    <?php if($vo['sourceInfo']['is_del'] == 1): ?>
                    <dd>内容已被删除</dd>
                    <?php else: ?>
                    <dd>{$vo.sourceInfo.source_body|format=true}</dd>
                    <?php endif; ?>
                  </dl>
                  <php>endif;</php>
                  <php>endif;</php>
                  <p class="info">
                    <span class="right">
                    <php>if(CheckPermission('core_normal','comment_del')){</php>
                      <em class="hover">
                        <a event-args="comment_id={$vo.comment_id}" event-node="comment_del" href="javascript:void(0);">{:L('PUBLIC_STREAM_DELETE')}</a>
                        <i class="vline">|</i>
                      </em>
                      <php>}</php>
                      <a href="{$vo.sourceInfo.source_url}">{:L('PUBLIC_VIEW')}</a>
                      <neq name='_GET.type' value='send'>
                      <i class="vline">|</i><a href="javascript:void(0);" onclick="if({$cancomment1}){ui.reply(<php>echo $vo['comment_id'];</php>);}else{ui.error('没有权限');}">{:L('PUBLIC_STREAM_REPLY')}</a>
                      </neq>
                    </span>
                    <span class="date">{$vo.ctime|friendlyDate}</span>&nbsp;
                    <span>{$vo.client_type}</span>
                  </p>
                </dd>
              </dl>
              </volist>
              <else />
              <div class="note">{:L('PUBLIC_COMMENTS_ISNOT')}</div>
              </neq>
              <div id='page' class='page'>{$list.html}</div>
            </div>
            <php>endif;</php>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<script type="text/javascript" src="__THEME__/js/module.weibo.js"></script>
<script type="text/javascript">
M.addEventFns({
  img_small:{ //图片显示
    click:function(){
      $(this.parentModel).find('div').each(function(){
        if($(this).attr('rel') == 'small'){
          $(this).hide();
        }else if($(this).attr('rel') == 'big'){
          $(this).show()
        }
      });
    }
  },
  img_big:{
    click:function(){
      $(this.parentModel).find('div').each(function(){
        if($(this).attr('rel') == 'small'){
          $(this).show();
        }else if($(this).attr('rel') == 'big'){
          $(this).hide()
        }
      });
    }
  },
  comment_del:{
    click:function(){
      var attrs = M.getEventArgs(this);
      var pmodel = this.parentModel;
      ui.confirm(this,'{:L('PUBLIC_COMMENT_CONFIRM_TIPS')}',function(msg){
        $(pmodel).fadeOut();
        core.comment.delComment(attrs.comment_id);  
      });
    },
    load:function(){
      core.plugInit('comment');
    }
  }
});

</script>
<include file="__THEME__/public_footer" />