/** * Устанавливает meta данные страницы title, description, keywords. * @param string|bool $title заголовок страницы. * @return void. */ function mgSEO($data) { MG::seoMeta($data); }
public static function printNews($arg) { $aUri = URL::getSections(); $result = $arg['result']; if ($aUri[1] == 'news' && empty($aUri[2])) { MG::titlePage('Новости'); $listNews = self::getListNews(MG::getOption('countPrintRowsNews')); $result = ' <div class="page-content"> <ul class="breadcrumbs bor-b"> <li><a href="' . SITE . '" class="home">Главная</a></li> <span> / </span> <li>Новости</li> </ul><!-- !ul.breadcrumbs --> <h1 class="title-page">Новости</h1>'; if (!empty($listNews['listNews'])) { foreach ($listNews['listNews'] as $news) { $result .= ' <div class="news-blocks-main"> <div class="title-news-main"> <a href="news/' . $news['url'] . '">' . ucfirst($news['title']) . '</a> </div> <div class="white-box bor-b clearfix"> <img src="' . SITE . '/uploads/news/' . $news['image_url'] . '" alt="' . $news['title'] . '" title="' . $news['title'] . '"> ' . mb_substr(strip_tags(PM::stripShortcodes($news['description'])), 0, 140, 'utf-8') . ' </div><!-- !div.white-box --> </div><!-- !div.news-blocks-main --> '; } $result .= "{$listNews['pagination']}"; } else { $result .= '<div class="white-box bor-b">Новости не найдены</div><!-- !div.page-content-box -->'; } $result .= '</div><!-- !div.page-content -->'; } else { if (URL::isSection('news')) { $news = self::getNewsByUrl(URL::getLastSection()); if (empty($news)) { MG::redirect('/404.html'); } MG::titlePage($news['title']); MG::seoMeta($news); $body = MG::inlineEditor('mpl_news', 'description', $news['id'], $news['description']); $result = ' <div class="page-content"> <ul class="breadcrumbs bor-b"> <li><a href="' . SITE . '" class="home">Главная</a></li> <span> / </span> <li><a href="' . SITE . '/news' . '">Новости</a></li> <span> / </span> <li>' . $news['title'] . '</li> </ul><!-- !ul.breadcrumbs --> <h1 class="title-page">' . $news['title'] . '</h1> <div class="white-box bor-b"> ' . $body . ' </div><!-- !div.page-content-box --> <div class="clearfix static-comments-btn"> <div class="left"> <p>Комментарии:</p> </div> <div class="right"> <a href="#" class="add-cmt jq-add-cmt-static-page">Добавить комментарий</a> </div> </div><!-- !div.clearfix --> [comments] </div><!-- !div.page-content -->'; } } return $result; }