sql_connect(); //$my->set_count_prod(); $my->set_meta('cat'); $my->page_size=10; empty($l) ? $l=0 : $l=(int)$l; empty($r) ? $r=0 : $r=(int)$r; empty($page) ? $page=0 : $page=(int)$page; empty($page) ? $page=0 : $page=(int)$page; empty($id) ? $news_id=0 : $news_id=(int)$id; empty($r_n) ? $r_n='' : $r_n='Y'; empty($b_id) ? $b_id=0 : $b_id=(int)$b_id; empty($basket_file) ? $basket_file='' : $basket_file=str_replace('\\','',$basket_file); //echo $basket_file; $id=0; //if(empty($year)) $year=(int)date('Y'); if($news_id>0){ $my->sql_query="select date, head,anons from ".$my->sql_tbl."news where id=$news_id"; $my->sql_execute(); if($row=mysql_fetch_array($my->sql_res)){ $my->Title.=' / '.str_replace('\\','',$row['head']); //$my->Keywords=''.str_replace('\\','',$row['keywords']); $my->Description=''.str_replace('\\','',$row['anons']); $dd=explode('-',$row['date']); $year=$dd[0]; if(empty($mounth)) $mounth=$dd[1]; } }/*else{*/ if(empty($mounth)) $mounth='all'; empty($year) ? $year=date('Y') : $year=(int)$year; if(empty($mounth)) $mounth=date('m'); if($mounth!='all'){ $mounth=(int)$mounth; if($mounth>12) exit; $data_start=$year.'-'.($mounth<10 ? '0'.$mounth : $mounth).'-01 00:00:00'; $data_end=$year.'-'.($mounth<10 ? '0'.$mounth : $mounth).'-31 23:59:59'; } else{ $data_start=$year.'-01-01 00:00:00'; $data_end=$year.'-12-31 23:59:59'; } /*$my->Title.=' / '.(empty($nstatus) ? 'Новости' : $my->show_tema_name($nstatus)); $my->Keywords=' '.(empty($nstatus) ? 'Новости' : $my->show_tema_name($nstatus)); $my->Description=''.(empty($nstatus) ? 'Новости' : $my->show_tema_name($nstatus)); //}*/ include($my->PATH_INC."top.php"); ?> "; echo "

Архив новостей


"; $my->sql_query="SELECT DISTINCT Year(date) AS yd FROM ".$my->sql_tbl."news WHERE Year(date)<=".date("Y")." and Year(date)!= '00' ORDER BY date DESC"; $res=$my->sql_execute(); while($rows = mysql_fetch_array($res)) { if($year==$rows["yd"]) echo "".$rows["yd"]."
"; else echo ""; $my->sql_query="SELECT DISTINCT DATE_FORMAT(date,'%m') AS md FROM ".$my->sql_tbl."news WHERE ".($rows["yd"]==date('Y') ? "date between '".date('Y')."-01-01 00:00:00' and '".date('Y')."-".date('m')."-31 23:59:00'" : "Year(date)='".$rows["yd"]."'")." ORDER BY date"; $my->sql_execute(); while($rows2 = mysql_fetch_array($my->sql_res)){ if($mounth==$rows2["md"] && $year==$rows["yd"]) echo "
  • ".$my->mounth_in_ru($rows2["md"]).'
    '; else echo "
  • ".$my->mounth_in_ru($rows2["md"])."
    "; } echo '
    '; } echo "
  • "; ?>

    Новости скутеростроения :)

    '.$my->show_newsn_cont($news_id,$r_n,$mounth,$year,$page); else{ $news_row=$my->show_newsn($page,$data_start,$data_end,$mounth,$year); if($news_row['num_pages']>1){ $str='
    Страницы: '; for($i=0;$i<$news_row['num_pages'];$i++){ $j=$i+1; if($news_row['page']==$i) $str.="$j / "; else $str.=''.$j.' / '; if(fmod($i+1,16)==0) $str.='
    '; } $str.='
      '; } echo $str.$news_row['text'].$str; } $str.='
    ' ?>
    новости геологии
    PATH_INC."bottom.php");?>