view.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. $this->title = 'Tilda проекты на сайте';
  3. $this->params['breadcrumbs'][] = ['label' => 'Tilda', 'url' => ['index'] ];
  4. $this->params['breadcrumbs'][] = 'Загруженные проекты';
  5. ?>
  6. <div class="row">
  7. <?
  8. $curcat = $api->local->getProjectFullDir();
  9. $ucat = $api->local->getProjectDir();
  10. $cat = yii\helpers\FileHelper::findDirectories($curcat, ['recursive'=>false]);
  11. foreach( $cat as $url){
  12. $inx = $url.'/'.'index.html';
  13. if( file_exists( $inx ) ){
  14. if( $f = basename( @readlink( $url.'/'.'index.html') ) ){
  15. $fm = str_replace( '.html', '.php', $f );
  16. //echo $fm."<br>";
  17. if( file_exists( $url.'/meta/'.$fm ) ){
  18. $r = include($url.'/meta/'.$fm);
  19. $dname = basename($url);
  20. if( $r['img'] == '' || !file_exists($url.'/img/'.$r['img']) ){
  21. $txt = file_get_contents($url.'/'.'index.html');
  22. preg_match('|og\:image.*content="([^"]*)"|i',$txt, $a);
  23. $imga=$a[1];
  24. // print_a( $a );
  25. }else{
  26. $imga='/'.$ucat.''.$dname.'/img/'.$r['img'];
  27. }
  28. ?>
  29. <div class="col-md-12 col-lg-6 col-xl-4">
  30. <div class="card mb-2 bg-gradient-dark">
  31. <img class="card-img-top" src="<?=$imga?>" alt="img" style="aspect-ratio:16/9; object-fit: cover;" >
  32. <div class="card-img-overlay d-flex flex-column justify-content-end" style="background: linear-gradient(#00000026, #000000c4);">
  33. <h5 class="card-title text-primary text-white"><?=$r['title']?></h5>
  34. <p class="card-text text-white pb-2 pt-1"><?=$r['descr']?></p>
  35. <a href="https://www.amic.ru/<?=$ucat.$dname?>/" class="text-white" target="_blank">Открыть проект <i class="fas fa-arrow-circle-right"></i></a>
  36. <div><strong><i class="fas fa-pencil-alt mr-1"></i> Сылка для копирования</strong>
  37. <p class="tag tag-danger bg-gradient-warning px-2" style="opacity: 0.7;">https://www.amic.ru/<?=$ucat.$dname?>/</p>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <?
  43. }
  44. }
  45. }
  46. }
  47. ?>
  48. </div>