$v){ $qf = "SELECT * FROM photos WHERE ID_ALBUM = '".$v['ID_ALBUM']."' ORDER BY IS_PRINCIPALE DESC LIMIT 0,1"; $rf = rs::rec2arr($qf); $path = str_replace('', 's192-c', $rf['PATH_PHOTO']); if(!empty($v['D_ALBUM'])){ $key = $v['D_ALBUM']; if(array_key_exists($v['D_ALBUM'],$aM)) $key = $v['D_ALBUM'].'ph'.$v['ID_ALBUM']; } else{ $add++; $key = $d_base -> add_days_db($add); } $aM[$key]['a'] = ''.$rf['TITLE_PHOTO'].''; $aM[$key]['title'] = $v['TITLE_ALBUM']; } # CARICAMENTO NEWS $qn = "SELECT * FROM news WHERE IS_NEW = '1' AND IS_HOME = '1' AND lang = '$giulp_lang'"; $rn = rs::inMatrix($qn); foreach($rn as $k => $v){ //GiulP ID_NEW diventa ID__NEW $qf = "SELECT files.*, news_files.IS_PRINCIPALE FROM news_files Left Join files ON news_files.ID_FILE = files.ID_FILE WHERE news_files.ID__NEW = '".$v['ID_NEW']."' ORDER BY news_files.IS_PRINCIPALE DESC LIMIT 0,1 "; //$qf = "SELECT * FROM news_ WHERE ID_ALBUM = '".$v['ID_ALBUM']."' ORDER BY IS_PRINCIPALE DESC LIMIT 0,1"; $rf = rs::rec2arr($qf); $path = ABS_PATH.IMG_ALB_SQR.$rf['PATH']; if(!empty($v['D_NEW'])){ $key = $v['D_NEW']; if(array_key_exists($v['D_NEW'],$aM)) $key = $v['D_NEW'].'nw'.$v['ID_NEW']; } else{ $add++; $key = $d_base -> add_days_db($add); } $aM[$key]['a'] = ''.$rf['TITLE'].''; if(!empty($v['ID_NEWSTYPE'])){ $qn = "SELECT * FROM newstypes WHERE ID_NEWSTYPE = '".$v['ID_NEWSTYPE']."'"; $rn = rs::rec2arr($qn); $path = ABS_PATH.IMG_LAYOUT.$rn['IMG_PATH']; $aM[$key]['a'] = ''.$rf['TITLE'].''; } $aM[$key]['title'] = $v['TITLE_NEW']; } //print_r($aM); krsort($aM); $i = 0; $html['albums'] = ''; foreach($aM as $k => $v){ if($i >= 6) break; // echo $k.BR; $css = $i%2 == 0 ? 'polaroid_left' : 'polaroid_right'; $html['albums'] .= '
'.$v['a'].'
'.$v['title'].'
'; $i++; } include HEAD; print '
'.$html['albums'].'
'; include FOOTER; ?>