<?php
if ($files) {
  $cnt = 0;
  $CARD_THUMB = '117x117';
  $thumbsize = explode('x', $CARD_THUMB);
  foreach ($files as $tmpf) {
    $cnt++;
    if ($tmpf['thumb']) {
      $thumb = APP_URL . '/' . $tmpf['folder'] . $CARD_THUMB . '/' . $tmpf['thumb'];
    } else {
      $thumb = APP_URL . '/assets/images/music.svg';
    }
     $audioname = pathinfo($tmpf['dname'], PATHINFO_EXTENSION) ? $tmpf['dname'] : $tmpf['dname'] . '.' . $tmpf['ext'];
 echo $media;
    echo ' 
     <div class="col-sm-6 col-lg-3 audio_item pb-3 letaudioplay" id="audio_' . $tmpf['id'] . '" data-id="' . $tmpf['id'] . '" data-file="' . APP_URL . '/' . $tmpf['folder'] . $audioname . '">
        <div class="embed-responsive embed-responsive-1by1 audioRadius">
            <div style="'.randGradient().'"  class="embed-responsive-item audio_gb" >
<div class="audio_itemplay">
                    <span class="material-icons playtrigericon">play_arrow</span>
                </div>
                <a href="' . APP_URL . '/tonuri/' . $tmpf['slug'] . $endRoute . '"><div class="audio_item_views"><i class="fa fa-cloud-download" aria-hidden="true"></i> ' . $tmpf['download'] . '+</div></a>
                <div class="audio_item_likes"><i class="fa fa-clock-o" aria-hidden="true"></i> ' . $tmpf['duration'] . '</div>
<br>
<div class="audio_item_category">
                 <a class="text-white" href="' . APP_URL . '/tonuri/' . $tmpf['slug'] . $endRoute . '" class="d-flex list-m"><i class="fa fa-cloud-download" aria-hidden="true"></i> '.substr_replace(  $tmpf['name']  , "", 20).'</a>
                </div>
            </div>
        </div>
    </div> 
    ';
  ?>
 <?
    if ($cnt % ADVT_EACH == 0) {
      echo getAds($AdsPath . '/between_fileslist');
    }
  }
  unset($files);
  unset($thumbsize);
}
