Example #1
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== TRUE) {
    die;
}
CModule::IncludeModule("iblock");
$ARTICLE_ID = (int) $arParams['ARTICLE_ID'];
$objArticle = new Article($ARTICLE_ID);
$article = $objArticle->getItem();
$arResult["ARTICLE"] = $article[$ARTICLE_ID];
$this->IncludeComponentTemplate();
$APPLICATION->SetTitle(html_entity_decode($arResult["ARTICLE"]['NAME']));
$APPLICATION->SetPageProperty("description", "Статья: " . $arResult["ARTICLE"]['PREVIEW_TEXT']);
Example #2
0
<?
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php");
?>

<?
if (empty($_GET['URL'])) {
    $Article = new Article(intval($_GET['ARTICLE_ID']));
    $article_contant=$Article->getItem();




    $url = formUrl($article_contant[$_GET['ARTICLE_ID']]['ID'], $article_contant[$_GET['ARTICLE_ID']]['NAME']);

    header('HTTP/1.1 301 Moved Permanently');
    header("Location: /article/{$article_contant[$_GET['ARTICLE_ID']]['SECTION']['CODE']}/{$url}/");
    die();

}
?>

<?$APPLICATION->IncludeComponent("mytb:article", "", array(
    "ARTICLE_ID" => $_GET['ARTICLE_ID']
), false);?>


<? require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php"); ?>