<?php
        //$thisLink = "/arbour";
        
       
        $table="groups";
        $query = "SELECT * FROM `{$table}`  ORDER BY  RAND() DESC LIMIT 3 ";
        //$accessEdit = (isset($user['id']) ? admin :: getAccess($user,  array('a'=>3,'m_chat'=>1)) : '' );

        $q = DB :: $pdo -> query("{$query}");

        $i = 0;
        $in = 0;
        echo '<div class="app-block">';
        echo'<div class="list _center" style="text-decoration:none;"><b>Популярные группы</b> <i class="fa fa-chevron-down"></i></div>';

         while($r = $q -> fetch()) {
            $dataUser = ($r['id_user'] == $user['id'] ? $user : profile :: getUser($r['id_user'],"*",false) );
            
              ?>
           
          <div class="list _l-padd-n">
            <div class="_l-padd">

                                    <div class="_oh">
            <div class="list-flex">
           <div class="post-l post-l emotion-show" data-emotions="">
				 	<?= group :: Avatar($r,0)?>			</div>
				
                    
              <div class="post-c">
                    <div class="_name">
                    <a href="/groups?group=<?=$r['id']?>"> <?=group :: getName($r)?></a>                    </div>
                
           
          
                     <span class="_gray _font-m">
                         
                                         	
                         
                         
                         
                         
                         
                         
                         
                         
                         
                         
                         
                         
                         
                         
                         
                        </span>            
                     	  						
  			участников: <?=$r['subject']?><br>
  				  				              <span class="_gray _font-m"> <b><?=$r['opis']?> </b>
                   </span>
                                </div>
            </div>
            </div>
                   
            </div>
                                 
                
                        </div>
            
            
            
            
            
            

            
        
            
            
            <?php
        }
        
        echo'</div>';