<?php
  ///////////////////////////////////////////////////
  //2007 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

  $lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0,2);
  if(is_file ("lang/".$lang.".php")) include "lang/".$lang.".php";
     else include "lang/ru.php";

  $title=$titlepage=$TEXT['global-news'];

  require_once "config.php";
  require_once "utils/top_news.php";

  if(strlen($_GET['news_id'])>250) puterror($TEXT['error-news']);
  $_GET['news_id'] = rep($_GET['news_id']);
?>
<table class="table" border="0" cellpadding="5" cellspacing="1" width="85%">
<?php
  $query1 = "SELECT tbl_news.*,
  YEAR(tbl_news.data) AS news_year,
  MONTH(tbl_news.data) AS news_month,
  DAY(tbl_news.data) AS news_day,
  TIME(tbl_news.data) AS news_hour,
  tbl_organizaciya.organizaciya
  FROM tbl_news 
  JOIN tbl_organizaciya ON tbl_news.org_id=tbl_organizaciya.org_id 
  WHERE tbl_news.new_id = '".$_GET['news_id']."'";
  $result = mysql_query($query1);
    if(!$result) puterror($TEXT['error-tbl17']);
       if (mysql_num_rows($result)>0);
       {
       $news = mysql_fetch_array($result,MYSQL_ASSOC);
        {
         if($news['organizaciya'] == "-") $organizaciya = $TEXT['news-org1'];
          else $organizaciya = $TEXT['news-org2'].$news['organizaciya'].$TEXT['news-org3'];

	   $dat1=$news['news_day'];
	   $dat2=$news['news_month'];
	   $dat3=$news['news_year'];
       $dat4 = $news['news_hour'];
       $org_name = $organizaciya." ".$dat1." ".$month[$dat2]." ".$dat3." ".$TEXT['year']." ".$dat4;

           echo "<tr><td class='news2'>".$news['header']."</td></tr>";

           $news['news'] = str_replace(":smile:","<img alt='картинка' src='img/smile.png' align=middle border=0>",$news['news']);
           $news['news'] = str_replace(":tongue:","<img alt='картинка' src='img/tongue.png' align=middle border=0>",$news['news']);
           $news['news'] = str_replace(":wink:","<img alt='картинка' src='img/wink.png' align=middle border=0>",$news['news']);
           $news['news'] = str_replace(":wassat:","<img alt='картинка' src='img/wassat.png' align=middle border=0>",$news['news']);
           $news['news'] = str_replace(":sad:","<img alt='картинка' src='img/sad.png' align=middle border=0>",$news['news']);
           $news['news'] = str_replace(":crying:","<img alt='картинка' src='img/crying.png' align=middle border=0>",$news['news']);
           $news['news'] = str_replace(":angry:","<img alt='картинка' src='img/angry.png' align=middle border=0>",$news['news']);
           $news['news'] = str_replace("  ","&nbsp;&nbsp;",$news['news']);
           $news['news'] = rep_back($news['news']);

           if(trim($news['picture']) !="") $pic = " <img alt='картинка' src='personal/".$news['picture']."' align='left' >"; else $pic = "";
            echo "<tr><td class='newsbody'><a href='personal/".$news['picture_big']."' target=_blank >".$pic."</a>&nbsp; ".nl2br($news['news'])."<br />&nbsp;<a href=".$news['url']." target=_blank>".$news['url_text']."</a></td></tr>";
            echo "<tr><td class='newspodp'>$org_name</td></tr>";
           }
       }
?>
</table>
<?php
  require_once "utils/bottom.php";
?>