View file sys/inc/news_main.php

File size: 759B
  1. <?
  2. $q=mysql_query("SELECT * FROM `news` WHERE `main_time` > '".time()."' ORDER BY `id` DESC LIMIT 1");
  3. if (mysql_num_rows($q)==1 && !$set['web'])
  4. {
  5. $news = mysql_fetch_assoc($q);
  6. echo "<div class='news'>\n";
  7. echo "<div class='p_t'>\n";
  8. echo "<a href='/news/'>$news[title]</a>\n";
  9. echo "(".vremja($news['time']).")\n";
  10. echo "</div>\n";
  11. echo "<div class='p_m'>\n";
  12. //echo output_text($news['msg'])."<br />\n";
  13. if ($news['link']!=NULL)echo "<a href='".htmlentities($news['link'], ENT_QUOTES, 'UTF-8')."'>Подробности</a><br />\n";
  14. echo "<a href='/news/komm.php?id=$news[id]'>Комментарии</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_news` = '$news[id]'"),0).")<br />\n";
  15. echo "</div>\n";
  16. echo "</div>\n";
  17.  
  18.  
  19. }
  20. ?>