<?

function dispNews(){

  $str = '<div id="main_body"><div id="all_side">';
  $str .= '<div id="newsbox">';
  $str .= '<ul>' . dispNewsRows() . '</ul>';
  $str .= '</div></div>';
  $str .= '<div class="clr">&nbsp;</div>';
  $str .= '</div>';
  echo $str;
}

function dispNewsRows(){

  $str = '';

  if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] )
    $result = getLastNews(2);
  else if ($_SESSION["user_right"] >= $GLOBALS["GUEST"] )
    $result = getLastNews(1);
  else
    $result = getLastNews(0);

  if (mysql_num_rows($result)){
    while ($news = mysql_fetch_array($result)) {
      // DISP NEWS TITLE BY TENDU
      $str .= dispWhenTendu($news["news_tendu"]);

      $str .= '<li><h2><strong>'.$news["news_title"].'</strong>';

      // DISP NEWS CONTENT BY TENDU
      $str .= dispWhenTendu($news["news_tendu"]);


      $str .= '<span class="news_date"> - '.$news["news_date"].'</span></h2>
                        <p class="news_text">'.$news["news_comment"].'</p>
                        <p class="news_separator"><br /><img alt="" src="images/corner_20.png" /><br /></p>
                    </li>';
    }
  }
  return ($str);
}

?>
