Пересохранил шаблон, он выдал: Parse error: syntax error, unexpected T_ENDIF in /bitrix/templates/50_test/header.php on line 138
Хотя код и не трогал, какие могут быть догадки!?
Хотя код и не трогал, какие могут быть догадки!?
| Код |
|---|
<?
include($_SERVER["DOCUMENT_ROOT"]."/bitrix/templates/.default/lang/ru/content.php");
include($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/functions.php");
//Если это home.php или корень сайта
if( !preg_match('/home.php$/', $_SERVER['SCRIPT_NAME']) ):
//Если это корневая страница статей - находим первый заполненный пункт меню и редиректим на него
$temp = str_replace("http://".$_SERVER["SERVER_NAME "], "", $_SERVER["REQUEST_URI"]);
$temp = substr($temp, 1, strpos($temp, "/", 1)-1);
if( $_REQUEST['SECTION_ID'] == "" && $temp == "articles")
{
$temp = open_first(6, "", true);
//echo "!".$temp."!";
header('Location: http://***/articles/?SECTION_ID='.$temp['SECTION_ID']."&ELEMENT_ID=".$temp['ELEMENT_ID']);
exit;
}
elseif( $_REQUEST['SECTION_ID'] != "" && $_REQUEST['ELEMENT_ID'] == "" && $temp == "articles")
{
$s_id = $_REQUEST['SECTION_ID'];
$res = CIBlockSection::GetByID($s_id);
if($ar_result = $res->GetNext())
{
if( trim($ar_result['DESCRIPTION']) == "" && GetUserField ("IBLOCK_6_SECTION", $s_id, "UF_MATERIAL") == "")
{
$temp = open_first(6, $s_id, true);
header('Location: http://***/articles/?SECTION_ID='.$temp['SECTION_ID']."&ELEMENT_ID=".$temp['ELEMENT_ID']."&SUBSECTION_ID=".$temp['SUBSECTION_ID']."&IBLOCK_ID=".$temp['IBLOCK_ID']);
exit;
}
}
}
endif; //home.php
?>
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?= LANG_CHARSET;?>">
<META NAME="ROBOTS" content="ALL">
<?$APPLICATION->ShowMeta("keywords")?>
<?$APPLICATION->ShowMeta("description")?>
<title>50-летие Зеленограда - <?$APPLICATION->ShowTitle()?></title>
<?$APPLICATION->ShowCSS();?>
<? $APPLICATION->ShowPanel(); ?>
<script type="text/javascript" src="/bitrix/templates/50_winter/timeline/swfobject.js"></script>
<script src="/bitrix/templates/.default/set/start.js"></script>
<script src="/bitrix/templates/.default/set/menu.js"></script>
<script>
function Init()
{}
</script>
</head>
<body>
<script>Start();</script>
<div id="container"> <? if ($APPLICATION->GetCurPage() == "/index.php"){
if ( date("m")==1 || date("m")==2 || date("m")==3 ||date("m")==12 )
{ echo " <div id=\"winter_header\"><div><div><div>"; }
else
{ echo " <div id=\"header\"><div><div><div>"; }
}else{
echo " <div id=\"insheader\"><a href=\"".SITE_DIR."\"><!--<img src=\"/bitrix/templates/50_winter/images/spacer.gif\" width=\"200\" height=\"50\" align=\"left\" style='float: left;'>--></a><div><div><span style='float: right'><a href=\"".SITE_DIR."\"><img src=\"/bitrix/templates/50_winter/images/spacer.gif\" width=\"140\" height=\"124\"></a></span><div>";
}
/*?>
<span id="date">До юбилея <strong>
<?
$days = round((mktime(0, 0, 0, 3, 3, 2008) - time())/86400) + 1;
echo $days;
if ($days%10 == 0) {echo "</strong> дня</span>";}
if ($days%10 == 1) {echo "</strong> день</span>";}
if (($days%10 >= 2) and ($days%10 <= 4 )) {echo "</strong> дня</span>";}
//if (($days%10 >= 0) and ($days%10 <= 9 )) {echo "</strong> дней</span>";}
*/?>
<ul id="langmenu">
<li><span><img height="9" width="18" alt="Русская версия" src="/bitrix/templates/50_winter/images/langmenu-ru-img.gif" />RUS</span></li>
<li><a href="/eng/"><img height="9" width="18" alt="English Version" src="/bitrix/templates/50_winter/images/langmenu-en-img.gif" />ENG</a></li>
</ul>
<? ?>
<table cellspacing="0" cellpadding="0" id="mainmenu">
<tbody>
<tr> <td>
<ul>
<li><a href="/about/">О проекте</a></li>
<li><a href="/about/participants.php">Участники проекта</a></li>
<!--<li class="mmlast"><a href="/world/" >в мире</a></li>-->
<li class="mmlast"><a href="/event/index.php">Лента событий</a></li>
<li><a href="/foto/index.php">Фотоархив</a></li>
<li><a href="/video/index.php">Видеоархив</a></li>
<li class="mmlast"><a href="/resources">Интернет-ресурсы</a></li>
</ul>
</td> <td id="searchlink"><a href="/search/">Поиск</a></td> </tr>
</tbody>
</table>
</div>
<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/templates/.default/include/flash.php"); ?> <?
$SECTION_ID = "";
$SUB_SECTION_ID = "";
$SECTION_NAME = "";
if( $_REQUEST["SECTION_ID"] != "" ):
//Извлекаем раздел статей и проверяем на активность
$arFilter = Array('IBLOCK_ID'=>6, 'GLOBAL_ACTIVE'=>'Y', 'ID'=>$_REQUEST["SECTION_ID"]);
$db_list = CIBlockSection::GetList(Array($by=>$order), $arFilter, true);
if($ar_result = $db_list->GetNext())
{
$SECTION_ID = $_REQUEST["SECTION_ID"];
//echo "<pre>"; print_r($ar_result); echo "</pre>";
if ( $ar_result["DEPTH_LEVEL"] == 2 )
{ $SUB_SECTION_ID = $SECTION_ID; }
elseif ( $ar_result["DEPTH_LEVEL"] == 3 )
{ $SECTION_ID = $ar_result["IBLOCK_SECTION_ID"]; $SUB_SECTION_ID = $SECTION_ID; }
$SECTION_NAME = $ar_result["NAME"];
}
endif;
?> <?
//if ($APPLICATION->GetCurPage() != "/index.php"){
?> <?
endif;
?> <?
//}
?>
<table cellspacing="0" cellpadding="0" border="1" width="100%" style="border: 1px solid rgb(255, 255, 255);">
<tbody>
<tr> <td style="border: 0px solid rgb(197, 197, 197);">
<div style="padding-right: 8px;">
<div style="padding-left: 20px;">
<h3>Главное меню</h3>
</div>
<?$APPLICATION->IncludeComponent(
"bitrix:catalog.section.list",
"catalog_tree",
Array(
"IBLOCK_TYPE" => "articles",
"IBLOCK_ID" => "6",
"SECTION_ID" => "",
"SECTION_CODE" => "",
"COUNT_ELEMENTS" => "N",
"TOP_DEPTH" => "2",
"SECTION_URL" => "/articles/?SECTION_ID=#SECTION_ID#",
"CACHE_TYPE" => "A",
"CACHE_TIME" => "900",
"DISPLAY_PANEL" => "N",
"ADD_SECTIONS_CHAIN" => "N"
)
);?> </div>
</td> <td __bx_php_before="#APP0#" style="border-style: solid; border-color: rgb(197, 197, 197); border-width: 0px 0px 0px 1px;">
<div style="padding-right: 0px; margin-top: 35px;"> <?$APPLICATION->IncludeComponent(
"bitrix:catalog.section.list",
"simple_list",
Array(
"IBLOCK_TYPE" => "articles",
"IBLOCK_ID" => "6",
"SECTION_ID" => $SUB_SECTION_ID,
"SECTION_URL" => "/articles/?SECTION_ID=#SECTION_ID#",
"COUNT_ELEMENTS" => "N",
"TOP_DEPTH" => "1",
"DISPLAY_PANEL" => "N",
"ADD_SECTIONS_CHAIN" => "N",
"CACHE_TYPE" => "N",
"CACHE_TIME" => "3600"
)
);?> </div>
</td> <td width="100%" style="border-width: 0px; padding-left: 25px;"> <? if ($APPLICATION->GetCurPage() != "/index.php" && $APPLICATION->GetCurPage() != "/test/home.php"): ?>
<div id="listchoose"> <? if ($APPLICATION->GetCurPage() == "/index.php"){ echo 'align="center"';} ?> >
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tbody>
<tr><td><? if ($APPLICATION->GetCurPage() == "/index.php"){ echo 'align="center"';} ?>> <nobr>
<h1 style="margin-bottom: 10px;"><?$APPLICATION->ShowTitle()?></h1>
</nobr> </td><td nowrap="" align="right" width="100%"> <?
if ($APPLICATION->GetCurPage() == "/event/index.php")
{ $url = $APPLICATION->GetCurPageParam("", array("")); }
else
{ $url = "/event/index.php"; }
if ($APPLICATION->GetCurDir() == "/event/"){
?> <? echo $url; ?> <?
}
?> </td></tr>
</tbody>
</table>
</div>
<? endif; ?>
<br />
<br />
<div id="content"> |