header("Location: http://www.icenter.ru/");
die;
require 'include/categor.inc' ;
require 'include/common.inc' ;
require './include/templates.inc' ;
require './include/blocks3.inc' ;
//require './include/categoriesi.inc' ;
require 'include/access.inc' ;
require '/home/include/newsroutine3.inc' ;
function verify_access ($id, $lang)
{
connect_to_db_telenews ();
$select_clause = 'SELECT free FROM articles WHERE id=' . $id ;
$select_result = mysql_query ($select_clause) ;
$row = mysql_fetch_array ($select_result) ;
mysql_free_result ($select_result) ;
return ($row['free'] == 'true') ? TRUE : authenticate_user ('News', $lang) ;
}
function message_text ($id, $lang)
{
if ($lang == 'eng')
$suffix = '_eng' ;
else
$suffix = '' ;
$select_clause =
'SELECT title, title_eng, detail, detail_eng, subject' .
' FROM articles WHERE id=' . $id ;
$select_result = mysql_query ($select_clause) ;
$row = mysql_fetch_array ($select_result) ;
mysql_free_result ($select_result) ;
$subject = substr($row['subject'],0,2);
if($subject=='01') {$link.='
Подробнее новость доступна подписчикам продукта "Вестник телекоммуникаций"';}
if($subject=='02') {$link.='
Подробнее новость доступна подписчикам продукта "Безопасность Экспресс"';}
$text_tpl = new tpl ('templates2/message.text.tpl') ;
$text_tdf['title'] = $row['title' . $suffix] ;
$text_tdf['text'] = $row['detail' . $suffix].$link ;
return $text_tpl->instance ($text_tdf) ;
}
function error_page ($lang)
{
return file_read ('templates2/message.err.access.html') ;
}
if (! isset($id)) header('Location: http://www.telenews.ru/lenta.phtml');
//
//
connect_to_db () ;
$tpl = new tpl ('./templates2/template.tpl') ;
$tdf['title'] = 'Новости';
if (verify_access ($id, $lang))
$tdf['content'] = message_text ($id, $lang) ;
else
$tdf['content'] = error_page ($lang) ;
$site_id = 31;
$rubr = '01.';
$rubrics = $rubr."%";
$search="";
$tdf['left-column'] = latest_articles ('rus', 10, $rubrics);
//file_read('./contents/vt-short.html').
//file_read('./contents/be-short.html');
$tdf['right-column'] = Shownews($site_id,$from,5,0,$search);
//file_read('./contents/lenta-short.html').
//file_read('./contents/pan-telecom-short.html').
//file_read('./contents/pan-sec-short.html');
print $tpl->instance ($tdf);
?>