0) { // ------------------- вывод конкретной новости ----------------------- $query = "select * from " . $dtbase_pref . "novosti where kogda<=NOW() and kogda='$newsDate' and id=$newsId "; if (strpos($_SERVER['REQUEST_URI'], "news2") == false) $OneRecTemplate = '{NEWS_PODROBNO}'; else $OneRecTemplate = '{KOVER_PODROBNO}'; $FieldPrefix = 'NEWS_'; $result = _mysql_query($query); if ($row = mysqli_fetch_array($result)) { if (isset($row['goods']) && !empty($row['goods'])) { $GlField['NEWSF_goods'] = $row['goods']; } foreach ($row as $key => $value) { $GlField[$FieldPrefix . $key] = $value; } //$GlField[$FieldPrefix.'date'] = intval(substr($row["kogda"],8,2)).' '.$mesicy[intval(substr($row["kogda"],5,2))].' '.substr($row["kogda"],0,4); $GlField[$FieldPrefix . 'date'] = rus_date($row['kogda']); $GlField[$FieldPrefix . 'telo'] = BigImgToPreview($GlField[$FieldPrefix . 'telo']); if ($row['plain_html'] == 0) { $GlField[$FieldPrefix . 'telo'] = nl2br($GlField[$FieldPrefix . 'telo']); } $GlField['NEWS_img'] = ""; if (file_exists('photo/news/1_' . $row['id'] . '.jpg')) { $GlField['NEWS_FIX'] = '

'; $GlField['NEWS_img'] = BigImgToPreview('' . $row['zag'] . ''); } elseif (file_exists('photo/news/1_' . $row['id'] . '.gif')) { $GlField['NEWS_img'] = '' . $row['zag'] . ''; } else { $GlField['NEWS_FIX'] = ''; } if (!empty($row["vurl"])) { $GlField[$FieldPrefix . 'url'] = $row["vurl"]; header('Location: '.$row['vurl']); exit(); } else { $r.=FillTemplate(FillTemplate($OneRecTemplate)); } } else { $r.=FillTemplate('За указанную дату нет запрощенной новости указанного типа.


'); } mysqli_free_result($result); global $ROOT_DELIMITED; @$GlField['NEWS_TITLE'] = strip_tags($GlField[$FieldPrefix . 'zag']) . $ROOT_DELIMITED; $GlField['NAV'].=$GlField['DVIZHOK_NAV_DELIMITED'] . '' . GetQueryValue("select title as value from $dtbase_pref" . "pages where id=$page") . ''; // ------------------- вывод конкретной новости ----------------------- } if (!empty($newsDate)) { // ------------------- вывод новостей за дату кроме текущей новости ----------------------- $query = "select * from " . $dtbase_pref . "novosti where kogda<=NOW() and razdel='$page' and id<>$newsId and kogda='$newsDate' order by id desc"; $OneRecTemplate = '{NEWS_LIST_ONE_REC}'; $FieldPrefix = 'NEWS_'; $result = _mysql_query($query); while ($row = mysqli_fetch_array($result)) { foreach ($row as $key => $value) { $GlField[$FieldPrefix . $key] = $value; } // if(!empty($GlField[$FieldPrefix.'zag'])) $GlField[$FieldPrefix.'zag'] = ''.$GlField[$FieldPrefix.'zag'].'
'; $GlField[$FieldPrefix . 'date'] = rus_date($row['kogda']); $GlField[$FieldPrefix . 'date_digit'] = substr($row["kogda"], 8, 2) . '.' . substr($row["kogda"], 5, 2) . '.' . substr($row["kogda"], 0, 4); if (empty($row["vurl"])) { // взять адрес страницы приплюсовать к нему дату и ид новости $url = ''; $url.=GetPageUrl($row["razdel"]); $url.='/'; $url.=substr($row["kogda"], 0, 10); $url.='/'; $url.=$row["id"]; $url.='.html'; $GlField[$FieldPrefix . 'url'] = $url; } else { $GlField[$FieldPrefix . 'url'] = $row["vurl"]; } $GlField['NEWS_img'] = ""; if (file_exists('photo/news/1_' . $row['id'] . '.jpg')) { $GlField['NEWS_FIX'] = '

'; $GlField['NEWS_img'] = '' . $row['zag'] . ''; } elseif (file_exists('photo/news/1_' . $row['id'] . '.gif')) { $GlField['NEWS_img'] = '' . $row['zag'] . ''; } else { $GlField['NEWS_FIX'] = ''; } //$r.= FillTemplate(FillTemplate($OneRecTemplate)); } mysqli_free_result($result); // ------------------- вывод новостей за дату кроме текущей новости ----------------------- } else { // ------------------- вывод архива новостей ----------------------- // ------------------- с разбивкой по страницам ----------------------- $ret_news = _mysql_query("SELECT value FROM " . $dtbase_pref . "site_constant WHERE name='countNews';"); $f_news = mysqli_fetch_array($ret_news); $countNews = $f_news['value']; $countNewsList = 10; if (isset($_GET['page'])) { $p = intval($_GET['page']); } else { $p = 1; } $limit = ' LIMIT ' . ($p - 1) * $countNewsList . ',' . $countNewsList; $query = "select * from " . $dtbase_pref . "novosti where kogda<=NOW() and razdel='$page' order by kogda desc,id desc $limit"; $OneRecTemplate = '{NEWS_LIST_ONE_REC_1}'; $FieldPrefix = 'NEWS_'; $result = _mysql_query($query); while ($row = mysqli_fetch_array($result)) { foreach ($row as $key => $value) { $GlField[$FieldPrefix . $key] = $value; } $GlField[$FieldPrefix . 'date'] = rus_date($row['kogda']); if (empty($row["vurl"])) { // взять адрес страницы приплюсовать к нему дату и ид новости $url = ''; $url.=GetPageUrl($row["razdel"]); $url.='/'; $url.=substr($row["kogda"], 0, 10); $url.='/'; $url.=$row["id"]; $url.='.html'; $GlField[$FieldPrefix . 'url'] = $url; } else { $GlField[$FieldPrefix . 'url'] = $row["vurl"]; } $GlField['NEWS_img'] = ""; if (file_exists('photo/news/1_' . $row['id'] . '.jpg')) { $GlField['NEWS_FIX'] = '

'; $GlField['NEWS_img'] = '' . $row['zag'] . ''; } elseif (file_exists('photo/news/1_' . $row['id'] . '.gif')) { $GlField['NEWS_img'] = '' . $row['zag'] . ''; } else { $GlField['NEWS_FIX'] = ''; } $r.= FillTemplate(FillTemplate($OneRecTemplate)); } mysqli_free_result($result); $GlField['PHP_LAST_FIRM2'] = ''; $count = getCountRecord($dtbase_pref . 'novosti' . " where razdel='$page' and kogda<=NOW()"); // $GlField['CURRENT_PAGE'] = '{PAGE}'; // $GlField['GO_PAGE']=' {PAGE} '; $GlField['CURRENT_PAGE'] = '{PAGE}'; $GlField['GO_PAGE'] = '{PAGE}'; $rezForPage = $countNewsList; // количество на страницу $rr = ''; // $rr='

'; if ($count > $rezForPage) $rr.=''; $rr.='
записей: '.$count.'
Страница: ' . PageNav1($count, $rezForPage, '', $p) . '
'; $r.=$rr; // ------------------- вывод заданного количества последних новостей ----------------------- } if (empty($r)) $r.= FillTemplate('{404error}'); return $r; } ?> Новости | Строительно-монтажный трест НЛМК
  • Слайд
  • Слайд 2
  • Слайд 3
Ошибка загрузки модуля