<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/
// set application wide parameters
// this query set is for NewsDesk
$boxHeading = BOX_HEADING_NEWSDESK_LATEST;
$corner_left = 'rounded';
$corner_right = 'rounded';
$box_base_name = 'newsdesk_latest'; // for easy unique box template setup (added BTSv1.2)
$boxContent_attributes = ' align="center"';

$box_id = $box_base_name . 'Box';  // for CSS styling paulm (editted BTSv1.2)

if ( 'DISPLAY_LATEST_NEWS_BOX' ) {

 $latest_news_var_query = tep_db_query('select p.newsdesk_id, pd.language_id, pd.newsdesk_article_name, pd.newsdesk_article_description, pd.newsdesk_article_shorttext, pd.newsdesk_article_url, pd.newsdesk_article_url_name,  p.newsdesk_image, p.newsdesk_date_added, p.newsdesk_last_modified, p.newsdesk_date_available, p.newsdesk_status  from ' . TABLE_NEWSDESK . ' p, ' . TABLE_NEWSDESK_DESCRIPTION . ' pd WHERE pd.newsdesk_id = p.newsdesk_id and p.newsdesk_date_available <= now() and pd.language_id = "' . $languages_id . '" and newsdesk_status = 1 ORDER BY newsdesk_date_added DESC LIMIT ' . LATEST_DISPLAY_NEWSDESK_NEWS);

 if ((int)tep_db_num_rows($latest_news_var_query) > 0) {

  $boxContent = '<div class="box_kont">';
  while ($latest_news = tep_db_fetch_array($latest_news_var_query))  {
    $boxContent .= '<div class="box_list"><a class="boxLink" href="' . tep_href_link(FILENAME_NEWSDESK_INFO, 'newsdesk_id=' . $latest_news['newsdesk_id']) . '">' . osc_trunc_string($latest_news['newsdesk_article_name'], 50, 1) . '</a></div>';      
    if (file_exists(DIR_WS_TEMPLATES . 'images/infobox/category_line.gif')) {
        $boxContent .= '<div class="box_line">' . tep_image(DIR_WS_TEMPLATES . 'images/infobox/category_line.gif') . '</div>';
    }
  }
  $boxContent .= '</div>';
  include (bts_select('boxes', $box_base_name)); // BTS 1.5
 }
}
?>
