<commit_before><div class="container">
  <div class="row">
    
    <div class="col-md-12"> 
      
      <div class="panel">
        <div class="panel-body">     

     <?php foreach($posts as $post) {
      $jamostrou="nao";
       foreach($meusdados as $userlogado) {
                foreach($userlogado->getAmigos() as $amigo) {
                    if($amigo->getId() == $post->getDono()->getId()){
        if($post->getVisibilidade()=="somente amigos" OR $post->getVisibilidade()=="publico" ){
      ?>
      <div class="row">  
            <br>
            <div class="col-md-2 col-sm-3 text-center">
              <a class="story-img" href="#"><img src="/img/postdefault.jpg" style="width:100px;height:100px" class="img-circle"></a>
            </div>
            <div class="col-md-10 col-sm-9">
              <?php if($post->getPhoto()){ ?>
                <a class="story-img" href="#"><img src="/admin/posts/get-photo/id/<?php echo $post->getId(); ?>" style="width:300px;height:260px" class="img-thumbnail"></a>
              <?php } ?>
              <h3><?php echo $post->getTitulo(); ?></h3>
              <div class="row">
                <div class="col-xs-9">
                  <p><?php echo $post->getPostComp(); ?></p>
                  <ul class="list-inline"><li><i>Ultima Edição:</i> <?php echo $post->getDataPost(); ?></li><li><a href="/admin/exibirpost/index/id/<?php echo $post->getId(); ?>"><i class="glyphicon glyphicon-comment"></i> <?php echo count($post->getComentarios()); ?> <i class="glyphicon glyphicon-thumbs-up"></i> <?php echo count($post->getCurtiram()); ?> <i class="glyphicon glyphicon-thumbs-down"></i> <?php echo count($post->getNaocurtiram()); ?> </a></li></ul>
                  <ul>Postado por: <a href="/admin/exibirperfil/index/id/<?php echo $post->getDono()->getId(); ?>"><?php echo $post->getDono()->getNome() ?></a></ul>
                  </div>
                <div class="col-xs-3"></div>
              </div>
              <br><br>
            </div>
          </div>
          <hr>

    <?php 
           $jamostrou="sim";
           }//fim do if visibilidade 
          }//fim do if verificar se é amigos
        }//fim fo if userlogado->getAmigos
      }//fim do if visibilidade


       if($post->getVisibilidade()=="publico" && $jamostrou=="nao" && $post->getDono()->getId()!=$this->session()->offsetGet('user')->getId() ){
      ?>
      <div class="row">    
            <br>
            <div class="col-md-2 col-sm-3 text-center">
              <a class="story-img" href="#"><img src="/img/postdefault.jpg" style="width:100px;height:100px" class="img-circle"></a>
            </div>
            <div class="col-md-10 col-sm-9">
              <?php if($post->getPhoto()){ ?>
                <a class="story-img" href="#"><img src="/admin/posts/get-photo/id/<?php echo $post->getId(); ?>" style="width:300px;height:260px" class="img-thumbnail"></a>
              <?php } ?>
              <h3><?php echo $post->getTitulo(); ?></h3>
              <div class="row">
                <div class="col-xs-9">
                  <p><?php echo $post->getPostComp(); ?></p>
                  <ul class="list-inline"><li><i>Ultima Edição:</i> <?php echo $post->getDataPost(); ?></li><li><a href="/admin/exibirpost/index/id/<?php echo $post->getId(); ?>"><i class="glyphicon glyphicon-comment"></i> <?php echo count($post->getComentarios()); ?> <i class="glyphicon glyphicon-thumbs-up"></i> <?php echo count($post->getCurtiram()); ?> <i class="glyphicon glyphicon-thumbs-down"></i> <?php echo count($post->getNaocurtiram()); ?> </a></li></ul>
                  </div>
                <div class="col-xs-3"></div>
              </div>
              <br><br>
            </div>
          </div>
          <hr>

    <?php 
           }//fim do if visibilidade publico
    }//fim do foreach posts 
    ?>       
          
        </div>
      </div>
                                      
    </div><!--/col-12-->
  </div>
</div>
</hr>
<br><br>

<?php 

$flag="nada";// padrao, se nao for pessoa logada ou se nao tiver curtido/nao curtido

if($post->getDono()->getId()==$this->session()->offsetGet('user')->getId()){
    ?>
      <div class="row">    
            <br>
            <div class="col-md-2 col-sm-3 text-center">
              <a class="story-img" href="#"><img src="/img/postdefault.jpg" style="width:100px;height:100px" class="img-circle"></a> 
            </div>
            <div class="col-md-10 col-sm-9">
              <?php if($post->getPhoto()){ ?>
                <a class="story-img" href="#"><img src="/admin/posts/get-photo/id/<?php echo $post->getId(); ?>" style="width:300px;height:260px" class="img-thumbnail"></a>
              <?php } ?>
              <h3><?php echo $post->getTitulo(); ?></h3>
              <div class="row">
                <div class="col-xs-9">
                  <p><?php echo $post->getPostComp(); ?></p>
                  <ul class="list-inline"><li><i>Ultima Edição:</i> <?php echo $post->getDataPost(); ?></li><li><a href="/admin/exibirpost/index/id/<?php echo $post->getId(); ?>"><i class="glyphicon glyphicon-comment"></i> <?php echo count($post->getComentarios()); ?> <i class="glyphicon glyphicon-thumbs-up"></i> <?php echo count($post->getCurtiram()); ?> <i class="glyphicon glyphicon-thumbs-down"></i> <?php echo count($post->getNaocurtiram()); ?> </a></li></ul>
                  </div>
                <div class="col-xs-3"></div>
              </div>
              <br><br>
            </div>
          </div>
          <hr>
    <?php
  $flag="postDoUserLogado";
}// fim do if verifica se é meu post

//começo verifica se ja curtiu ou se ja nao curtiu o post
  foreach($post->getCurtiram() as $curtiu) { 
        if($curtiu->getId()==$this->session()->offsetGet('user')->getId()){
          $flag="jaCurtiu";
        }
  } 
 
  foreach($post->getNaocurtiram() as $naoCurtiu) {
        if($naoCurtiu->getId()==$this->session()->offsetGet('user')->getId()){
          $flag="jaNaoCurtiu";
        } 
  } 
//fim verifica se ja curtiu ou se ja nao curtiu o post  

if($flag=="postDoUserLogado"){ ?>
  <div class="col-md-12"> 
    <div class="well">
        <h4>Esse é seu post</h4>                 
    </div>
</div>
<?php
} /*fim do if flag postDoUserLogado*/ 

if($post->getVisibilidade()=="somente eu"){ ?>
  <div class="col-md-12"> 
    <div class="well">
        <h4>Somente o dono do Post pode ve-lo</h4>                 
    </div>
</div>
<?php
} /*fim do if flag postDoUserLogado*/

if($flag=="nada"){
?>
<!-- likes -->
    <div class="col-md-12"> 
    <div class="well"><commit_msg>ajustado view exibirpost<commit_after><div class="container">
  <div class="row">
    
    <div class="col-md-12"> 
      
      <div class="panel">
        <div class="panel-body">     

     <?php foreach($posts as $post) {
      $jamostrou="nao";
       foreach($meusdados as $userlogado) {
                foreach($userlogado->getAmigos() as $amigo) {
                    if($amigo->getId() == $post->getDono()->getId()){
        if($post->getVisibilidade()=="somente amigos" OR $post->getVisibilidade()=="publico" ){
      ?>
      <div class="row">  
            <br>
            <div class="col-md-2 col-sm-3 text-center">
              <a class="story-img" href="#"><img src="/img/postdefault.jpg" style="width:100px;height:100px" class="img-circle"></a>
            </div>
            <div class="col-md-10 col-sm-9">
              <?php if($post->getPhoto()){ ?>
                <a class="story-img" href="#"><img src="/admin/posts/get-photo/id/<?php echo $post->getId(); ?>" style="width:300px;height:260px" class="img-thumbnail"></a>
              <?php } ?>
              <h3><?php echo $post->getTitulo(); ?></h3>
              <div class="row">
                <div class="col-xs-9">
                  <p><?php echo $post->getPostComp(); ?></p>
                  <ul class="list-inline"><li><i>Ultima Edição:</i> <?php echo $post->getDataPost(); ?></li><li><a href="/admin/exibirpost/index/id/<?php echo $post->getId(); ?>"><i class="glyphicon glyphicon-comment"></i> <?php echo count($post->getComentarios()); ?> <i class="glyphicon glyphicon-thumbs-up"></i> <?php echo count($post->getCurtiram()); ?> <i class="glyphicon glyphicon-thumbs-down"></i> <?php echo count($post->getNaocurtiram()); ?> </a></li></ul>
                  <ul>Postado por: <a href="/admin/exibirperfil/index/id/<?php echo $post->getDono()->getId(); ?>"><?php echo $post->getDono()->getNome() ?></a></ul>
                  </div>
                <div class="col-xs-3"></div>
              </div>
              <br><br>
            </div>
          </div>
          <hr>

    <?php 
           $jamostrou="sim";
           }//fim do if visibilidade 
          }else{$amigo="nao";}//fim do if verificar se é amigos
        }//fim fo if userlogado->getAmigos
      }//fim do if visibilidade


       if($post->getVisibilidade()=="publico" && $jamostrou=="nao" && $post->getDono()->getId()!=$this->session()->offsetGet('user')->getId() ){
      ?>
      <div class="row">    
            <br>
            <div class="col-md-2 col-sm-3 text-center">
              <a class="story-img" href="#"><img src="/img/postdefault.jpg" style="width:100px;height:100px" class="img-circle"></a>
            </div>
            <div class="col-md-10 col-sm-9">
              <?php if($post->getPhoto()){ ?>
                <a class="story-img" href="#"><img src="/admin/posts/get-photo/id/<?php echo $post->getId(); ?>" style="width:300px;height:260px" class="img-thumbnail"></a>
              <?php } ?>
              <h3><?php echo $post->getTitulo(); ?></h3>
              <div class="row">
                <div class="col-xs-9">
                  <p><?php echo $post->getPostComp(); ?></p>
                  <ul class="list-inline"><li><i>Ultima Edição:</i> <?php echo $post->getDataPost(); ?></li><li><a href="/admin/exibirpost/index/id/<?php echo $post->getId(); ?>"><i class="glyphicon glyphicon-comment"></i> <?php echo count($post->getComentarios()); ?> <i class="glyphicon glyphicon-thumbs-up"></i> <?php echo count($post->getCurtiram()); ?> <i class="glyphicon glyphicon-thumbs-down"></i> <?php echo count($post->getNaocurtiram()); ?> </a></li></ul>
                  </div>
                <div class="col-xs-3"></div>
              </div>
              <br><br>
            </div>
          </div>
          <hr>

    <?php 
           }//fim do if visibilidade publico
    }//fim do foreach posts 
    ?>       
          
        </div>
      </div>
                                      
    </div><!--/col-12-->
  </div>
</div>
</hr>
<br><br>

<?php 

$flag="nada";// padrao, se nao for pessoa logada ou se nao tiver curtido/nao curtido

if($post->getDono()->getId()==$this->session()->offsetGet('user')->getId()){
    ?>
      <div class="row">    
            <br>
            <div class="col-md-2 col-sm-3 text-center">
              <a class="story-img" href="#"><img src="/img/postdefault.jpg" style="width:100px;height:100px" class="img-circle"></a> 
            </div>
            <div class="col-md-10 col-sm-9">
              <?php if($post->getPhoto()){ ?>
                <a class="story-img" href="#"><img src="/admin/posts/get-photo/id/<?php echo $post->getId(); ?>" style="width:300px;height:260px" class="img-thumbnail"></a>
              <?php } ?>
              <h3><?php echo $post->getTitulo(); ?></h3>
              <div class="row">
                <div class="col-xs-9">
                  <p><?php echo $post->getPostComp(); ?></p>
                  <ul class="list-inline"><li><i>Ultima Edição:</i> <?php echo $post->getDataPost(); ?></li><li><a href="/admin/exibirpost/index/id/<?php echo $post->getId(); ?>"><i class="glyphicon glyphicon-comment"></i> <?php echo count($post->getComentarios()); ?> <i class="glyphicon glyphicon-thumbs-up"></i> <?php echo count($post->getCurtiram()); ?> <i class="glyphicon glyphicon-thumbs-down"></i> <?php echo count($post->getNaocurtiram()); ?> </a></li></ul>
                  </div>
                <div class="col-xs-3"></div>
              </div>
              <br><br>
            </div>
          </div>
          <hr>
    <?php
  $flag="postDoUserLogado";
}// fim do if verifica se é meu post

//começo verifica se ja curtiu ou se ja nao curtiu o post
  foreach($post->getCurtiram() as $curtiu) { 
        if($curtiu->getId()==$this->session()->offsetGet('user')->getId()){
          $flag="jaCurtiu";
        }
  } 
 
  foreach($post->getNaocurtiram() as $naoCurtiu) {
        if($naoCurtiu->getId()==$this->session()->offsetGet('user')->getId()){
          $flag="jaNaoCurtiu";
        } 
  } 
//fim verifica se ja curtiu ou se ja nao curtiu o post  

if($flag=="postDoUserLogado"){ ?>
  <div class="col-md-12"> 
    <div class="well">
        <h4>Esse é seu post</h4>                 
    </div>
</div>
<?php
} /*fim do if flag postDoUserLogado*/ 

if($post->getVisibilidade()=="somente eu"){ ?>
  <div class="col-md-12"> 
    <div class="well">
        <h4>Somente o dono do Post pode ve-lo</h4>                 
    </div>
</div>
<?php
} /*fim do if flag postDoUserLogado*/

if($post->getVisibilidade()=="somente amigos" && $amigo=="nao"){ ?>
  <div class="col-md-12"> 
    <div class="well">
        <h4>Somente os amigos do usuario podem ver o post</h4>                 
    </div>
</div>
<?php
} /*fim do if flag postDoUserLogado*/

if($flag=="nada"){
?>
<!-- likes -->
    <div class="col-md-12"> 
    <div class="well">
{'fraction_non_alphanumeric': 0.21951762523191096, 'fraction_numerical': 0.011725417439703154, 'mean_word_length': 2.182054309327037, 'pattern_counts': {'":': 0, '<': 406, '<?xml version=': 0, '>': 527, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7050727', 'n_tokens_mistral': 4662, 'n_tokens_neox': 4539, 'n_words': 849}