include('include/common.inc.php');
include('nb_specific/common.inc.php');
include('nb_specific/security.inc.php');
include('modules/list/list.class.php');
include('modules/article/article.class.php');
include('include/filters/transliterate.class.php');
include('include/filters/newlinefilter.class.php');
include('include/library/edatabase.inc.php');
global $lang;
$type = $_GET['mag'];
CheckNumericID();
$id = $_GET['id'];
include('language_redirect.php');
if ($redirect!="")
{
header("location: ".$redirect."rubrics_".$id.".html");
die();
}
$electronic = strpos($type, 'e_') !== false ? true : false;
global $lang;
$lang = GetLanguage();
$id_mag = 0;
$mag_info = array();
EDBConnect();
$type = str_replace("e_","",$type);
$mag_info = GetRecordSet('enotabene.emag_mags', array('*'), "str_id='$type'");
$mag_info = $mag_info[0];
$id_mag = $mag_info['id_mag'];
DBDisconnect();
EDBConnect();
if ($lang == 2)
{
$rubric = GetSQLValue('emag_rubrics', 'title_eng', 'id_rubric='.$id);
$rubrics = GetRecordSet('emag_rubrics', array("title_eng AS title", "id_rubric", "is_active"), "id_mag = '".$id_mag."' ORDER BY order_value ASC, id_rubric ASC");
}
else
{
$rubric = GetSQLValue('emag_rubrics', 'title', 'id_rubric='.$id);
$rubrics = GetRecordSet('emag_rubrics', array("title", "id_rubric", "is_active"), "id_mag = '".$id_mag."' ORDER BY order_value ASC, id_rubric ASC");
}
ShowTopPart();
$side_menu_html = RenderSideMenu($type, -1, 0, 0, $mag_info, $lang, $electronic, $id);
$addSql = 'a.id_rubric = '.$id;
$orderStr = ' ORDER BY a.year DESC, a.month DESC ';
$articles = new CList('enotabene.emag_articles a LEFT JOIN enotabene.emag_rubrics r ON a.id_rubric = r.id_rubric ', 'printed = 0 AND status = 7 AND a.id_mag = '.$id_mag.' AND '.$addSql.$orderStr,
array("a.id_article","a.year","a.month","a.doi", "a.id_rubric", "a.title", "a.authors", "a.annotation", "a.title_eng", "a.annotation_eng", "a.page_start", "a.lang_text",
"a.page_end", "a.printed", "a.free", "a.uploaded", "a.id_mag", "a.authors_eng","a.edn"), 'articles_per_rubric/');
$articles->SetRecordCountInPage(100);
$articles->AddConst('side_menu', $side_menu_html);
$articles->AddHelperQuery("SELECT GROUP_CONCAT(keyword SEPARATOR ', ') AS keywords FROM enotabene.emag_keywords WHERE id_article={id_article}");
$articles->AddHelperQuery("SELECT GROUP_CONCAT(keyword SEPARATOR ', ') AS keywords_eng FROM enotabene.emag_keywords_eng WHERE id_article={id_article}");
$articles->AddHelperQuery("SELECT GROUP_CONCAT(link SEPARATOR '
') AS bibliography FROM enotabene.emag_bibliolinks WHERE id_article={id_article}");
$articles->AddHelperQuery("SELECT GROUP_CONCAT(link SEPARATOR '
') AS bibliography_eng FROM enotabene.emag_bibliolinks_eng WHERE id_article={id_article}");
$articles->AddConst('mag_info', $mag_info);
$articles->AddConst('rubric', $rubric);
$articles->AddConst('lang', $lang);
//$articles->AddFieldFilter('bibliography', new CNewlineFilter());
if ($lang == 2)
$articles->AddFieldFilter('bibliography', new CTransliterateFilter());
$articles->Show();
ShowBottomPart();
?>