Exemplo n.º 1
0
                        <img class="nspImage" alt="<?php 
echo $latestNews->title;
?>
" src="<?php 
echo $latestNews->imagePreview;
?>
">
                    </div>
                    <h4 class="nspHeader">
                        <?php 
echo ($titleLen = ConfigurationHelper::getValue('i.titleWords')) ? StringHelper::truncateWords($latestNews->title, $titleLen) : $latestNews->title;
?>
                    </h4>
                </a>
                <?php 
echo Html::tag('div', ($textLen = ConfigurationHelper::getValue('i.textWords')) ? StringHelper::truncateWords($latestNews->getTextPreview(0, ''), $textLen) : $latestNews->getTextPreview(0, ''), ['class' => 'nspText textPreview', 'lang' => 'ru']);
?>
            </div>
        </div>
    </div>
    <div id="gkToptop3" class="gkCol gkColRight">
        <?php 
echo \frontend\widgets\LastNewsWidget::widget();
?>
    </div>
</div>
<div id="gkTop2" class="gkMain gkWrap">
    <div class="box nsp grey dotted">
        <div>
            <h3 class="header">
                <span>Новости дня</span>
Exemplo n.º 2
0
<?php

use frontend\helpers\ConfigurationHelper;
use frontend\models\News;
?>
<div class="box nsp blue sidebar">
    <div>
        <h3 class="header">
            <span>Популярное</span>
        </h3>
        <div class="content">
            <div class="nspMain popular-list">
                <div class="nspArts">
                    <div class="nspArtScroll1">
                        <div class="nspArtScroll2">
                            <div class="nspArtPage">
                                <?php 
foreach (News::getPopular(ConfigurationHelper::getValue('popularLength')) as $popularNews) {
    echo $this->render('_popular_news_item', ['news' => $popularNews]);
}
?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
Exemplo n.º 3
0
            <div id="gkFooterWrap">
                <div id="gkCopyrights">
                    <div id="gkFooterNav">
                        <ul class="menu">
                            <?php 
foreach (Menu::findByAlias('nizhnee-menyu')->items as $menuItem) {
    echo Html::tag('li', Html::a($menuItem->name, $menuItem->link));
}
?>
                        </ul>
                    </div>
                    <div>
                        Конфликты и законы © 2008-<?php 
echo date('Y');
?>
.<br>
                        <p style="line-height: 13px;"><?php 
echo \frontend\helpers\ConfigurationHelper::getValue('btmText');
?>
</p>
                    </div>
                </div>
            </div>
        </div>
    <?php 
$this->endBody();
?>
    </body>
</html>
<?php 
$this->endPage();
Exemplo n.º 4
0
 public function actionYandexRss()
 {
     if (\Yii::$app->request->url != '/yandex.xml') {
         \Yii::$app->response->redirect('/yandex.xml', 301);
     }
     \Yii::$app->response->format = \yii\web\Response::FORMAT_RAW;
     \Yii::$app->response->headers->add('Content-Type', 'text/xml; charset=utf-8');
     $generator = new SitemapGenerator(['namespaces' => ['xmlns:yandex' => 'http://news.yandex.ru', 'xmlns:media' => 'http://search.yahoo.com/mrss', 'version' => '2.0']]);
     $channelData = ['title' => 'Конфликты и законы', 'link' => 'http://k-z.com.ua/', 'description' => 'Всеукраинский юридический online журнал конфликтных правовых ситуаций', 'yandex:logo' => 'http://k-z.com.ua/images/logo1.png', 'yandex:logo type="square"' => 'http://k-z.com.ua/images/logo_square.jpg'];
     $preparedNews = [];
     $newsQuery = News::find()->where(['in', 'categoryID', yii\helpers\Json::decode(ConfigurationHelper::getValue('ya.exportCats'))])->with('category')->limit(20)->orderBy('publishDate DESC');
     foreach ($newsQuery->each() as $news) {
         $preparedNews[] = ['title' => $news->title, 'link' => yii\helpers\Url::to($news->fullLink, true), 'description' => $news->getTextPreview(0, ''), 'category' => $news->category->title, 'pubDate' => gmdate(DATE_RFC822, $news->publishDate), 'yandex:full-text' => $news->getFullText('')];
     }
     return $generator->createYandex($channelData, $preparedNews);
 }
Exemplo n.º 5
0
if ($seoText = ConfigurationHelper::getValue('i.seoText')) {
    $this->registerJs('$(".seo-text-container-hidden").on(\'click\', function(){ $(this).removeClass(\'seo-text-container-hidden\').addClass(\'seo-text-container\'); })');
    ?>
                        <div class="seo-text-container-hidden"><div class="seo-text"><h1>Online-журнал "Конфликты и законы"</h1><?php 
    echo $seoText;
    ?>
</div></div>
                        <?php 
}
?>
                        <div>
                            Конфликты и законы © 2008-<?php 
echo date('Y');
?>
.<br>
                            <p style="line-height: 13px;"><?php 
echo ConfigurationHelper::getValue('btmText');
?>
</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    <?php 
$this->endBody();
?>
    </body>
</html>
<?php 
$this->endPage();