<?php
/**
 * @var $galleryId
 */
?>
<?php
/** @var $photo GalleryPhoto */
$photo = GalleryPhoto::model()->with('i18n')->find(
    array(
        'condition' => 'gallery_id = :gal_id',
        'order' => 'rand()',
        'params' => array(
            ':gal_id' => $galleryId,
        )
    ));
if ($photo !== null):
    ?>
<p class="section-title"><?php echo Yii::t('site', 'Фотолента');?></p>
<div class="photofeed-box">
    <div class="photofeed-image">
        <?php
        $link = $photo->i18n->link;
        if (empty($link)) $link = '/ru/news/categories/about';
        echo CHtml::link(CHtml::image($photo->getUrl('gallery'), $photo->i18n->name), $link);?>
    </div>
</div>
<?php endif; ?>