\n"; echo $testing; echo "\n"; } if (!isset($_GET['y'])){$year=$dirs[0];} else {$year=$_GET['y'];} echo '
'.$year.'
'; echo '
'; foreach ( $dirs as $dirn ) { if ($dirn!=$year){echo ''.$dirn.'   ';} } echo '
'; $path = $newsdir.$year.'/'; $files = array(); if ($dir1 = @opendir($path)) { while (($file = readdir($dir1)) !== false) {if ($file != "." && $file != "..") {array_push ($files, $file);} } closedir($dir1); } if (count($files)){ rsort ($files); foreach ( $files as $namefile ) {//Перебор новостей echo ''; $file=fopen($path.$namefile,"r"); while (!feof($file)){ $strfile = fgets($file, 4096); if (strstr($strfile, '')){ echo '<td><a class="blue12" href="'.$path.$namefile.'" title="Новости" target="_self">'.substr(trim(strip_tags($strfile)), 36).'</a></td>'; echo '</tr><tr><td valign="top"> </td><td> </td></tr>'; break; } } fclose($file); } } else {echo '<p>Нет данных';} include ("newsbot.htm"); ?>
19-07-2010
'.substr($namefile,11,2).'-'.substr($namefile,9,2).'-'.substr($namefile,5,4).'