require('php/functii.inc'); require('php/auth.inc'); $idnr=0; if (!empty($_GET['idnr'])) { $query = "SELECT issue,vol_nr,nr,t_issues.id as id1 FROM t_issues WHERE id='".$_GET['idnr']."'"; $idnr = $_GET['idnr']; } else { $query = "SELECT t_issues.id as id1,issue,vol_nr,nr FROM t_issues JOIN t_config ON t_issues.id=t_config.valoare WHERE t_config.cheie='nrcrt'"; } $result = mysql_query($query); if (!$result) { die(mysql_error()); } else { $row = mysql_fetch_array($result, MYSQL_ASSOC); $nr_crt=$row['issue']; $id_nrcrt=$row['id1']; $vol_nr=$row['vol_nr']; $nr=$row['nr']; } list($idc,$idsc,$idsc2,$rcol_main,$rcol_1,$rcol_2,$titlu_pag)=get_section1_data($_GET['id']); /* ---------- LISTA PRINCIPALA ----------------------*/ $query = "SELECT titlu,subtitlu,t_articol.id as id1,t_subcategorii.subcategorie as subcat, (SELECT subcat_lvl2 FROM t_subcat_lvl2 WHERE id = t_articol.id_subcat_lvl2) as subcat2,url,has_photo FROM t_articol LEFT JOIN t_subcategorii ON id_subcat = t_subcategorii.id WHERE id_issue='".$id_nrcrt."' AND (priority='1' OR priority='2')"; if ($idsc2>0) { $query = $query." AND t_articol.id_subcat_lvl2='".$idsc2."'"; } else { if ($idsc>0) { $query = $query." AND t_articol.id_subcat='".$idsc."'"; } else { $query = $query." AND t_articol.id_cat='".$idc."'"; } } $lista_princ = mysql_query($query); if (!$lista_princ) die(mysql_error()); /* ---------- LISTA 10 ----------------------*/ $query = "SELECT titlu,id FROM t_articol WHERE priority ='3' AND id_issue='".$id_nrcrt."'"; if ($idsc2>0) { $query = $query." AND id_subcat_lvl2='".$idsc2."'"; } else { if ($idsc>0) { $query = $query." AND id_subcat='".$idsc."'"; } else { $query = $query." AND id_cat='".$idc."'"; } } /* $query = $query." ORDER BY RAND() LIMIT 10"; */ $query = $query." ORDER BY RAND()"; $lista10 = mysql_query($query); /* ---------- LISTA 10 ----------------------*/ $query = "SELECT titlu,id FROM t_articol WHERE id_issue<>'".$id_nrcrt."' AND id_issue NOT IN (SELECT id FROM t_issues WHERE activ ='2')"; if ($idsc2>0) { $query = $query." AND id_subcat_lvl2='".$idsc2."'"; } else { if ($idsc>0) { $query = $query." AND id_subcat='".$idsc."'"; } else { $query = $query." AND id_cat='".$idc."'"; } } $query = $query." ORDER BY RAND() LIMIT 10"; $lista10_2 = mysql_query($query); ?>