sql_connect(); /* if (empty($section)==true): $qSQL = "SELECT * FROM describe_ru ORDER BY RAND() LIMIT 1"; else: $qSQL = "SELECT * FROM describe_ru WHERE section='$section' ORDER BY RAND() LIMIT 1"; endif; */ $text=""; $qSQL = "SELECT * FROM describe_ru WHERE section<>'celebrity' AND date_pub BETWEEN subdate(now(), interval 50 day) AND now() ORDER BY date_pub DESC LIMIT 10"; $qQResult = mysql_query($qSQL); if (mysql_error()) { print(mysql_error()); } while ($qrow = mysql_fetch_array($qQResult)): $name=$qrow['name'] ; $description=substr($qrow['description'],0,150) ; $serial=$qrow['id']; $section=$qrow['section']; $field=trim($qrow['field']); if ($field=='regular') { $field='list'; } $path=$my->PATH_HTTP_DESCRIBE."/$field/".$qrow['section']."-".$qrow['path'].".html"; $aSQLs = "SELECT * FROM describe_ru_section WHERE nameengl='$section'"; //echo $aSQLs; $aQResults = mysql_query($aSQLs); if (mysql_error()) { print(mysql_error()); } while ($row = mysql_fetch_array($aQResults)): $title_section=$row['name']; endwhile; $random=RAND(0,3); if ($random==0) { $title="факты";}; if ($random==1) { $title="факт";}; if ($random==2) { $title="описание";}; if ($random==2) { $title="";}; if ($random==3) { $title="описания";}; $text.=" \n"; $text.=" $name\n"; $text.=" \n"; $text.=" $path\n"; $text.=" $serial\n"; $text.=" $date\n"; $text.=" \n"; endwhile; //echo $path."
"; $date=date("D, j M Y H:i:s"); $rss ="\n"; $rss.="\n"; $rss.="\n"; $rss.=" Хочу Всё Знать! $title_section\n"; $rss.=" Хочу Всё Знать!, факты, факт, описание, описания\n"; $rss.=" http://www.describe.ru/\n"; $rss.=" $date +0000\n"; $rss.=" $date +0000 \n"; $rss.=" 1800\n"; $rss.=$text; $rss.="\n"; $rss.="\n"; echo $rss; $my->sql_close(); ?>