Пример #1
0
<?php

$cats = fPost::getCats('videocat');
?>

<article id="post">
    <div class="row videocats mediacats galleries">
        @foreach($cats as $cat)
            <?php 
$item = $cat->cat_lang();
if ($item->name != null && $item->name != '') {
    $videos = fPost::getPostsByCat($cat->id);
    if (isset($videos) && count($videos) > 0) {
        ?>
        <div class="videocat mediacat video ymedia col-sm-4">
            <a href="{{route('cat.view', [$cat->id, $item->slug])}}">
                <div class="framevideo">
                    <?php 
        if (isset($videos) && count($videos) > 0) {
            $firstvideo = $videos[0];
            preg_match('/(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=))([\\w-]{10,12})/', $firstvideo->image, $matches);
            $videoid = $matches[1];
            echo '<img class="img-responsive glimage" alt="Thumbnail" src="' . $cat->image . '" />';
        }
        ?>
                </div>
                <h2 class="title">{{$item->name}}</h2>
            </a>
        </div>
            <?php 
    }
Пример #2
0
<?php

$cats = fPost::getCats('imagecat');
?>
<article id="post">
    <div class="row catimages galleries">
        @foreach($cats as $cat)
            <?php 
$item = $cat->cat_lang();
if ($item->name != null && $item->name != '') {
    $images = fPost::getPostsByCat($cat->id);
    if (count($images) > 0) {
        ?>
        <div class="catimage image ymedia col-sm-3">
            <a href="{{route('cat.view', [$cat->id, $item->slug])}}">

                <img class="img-responsive glimage" src="{{get_image_url($cat->image,"small")}}" alt="image" />

                <h2 class="title">{{$item->name}}</h2>

            </a>
        </div>
            <?php 
    }
}
?>
        @endforeach
    </div>
</article>