示例#1
0
 static function info($config, $item, $num = 1)
 {
     $news_info = '';
     //
     if ($num == 1) {
         if ($config['news_content_info_pos'] != 'disabled') {
             $class = 'nspInfo1 t' . $config['news_content_info_pos'] . ' f' . $config['news_content_info_float'];
         }
     } else {
         if ($config['news_content_info2_pos'] != 'disabled') {
             $class = 'nspInfo2 t' . $config['news_content_info2_pos'] . ' f' . $config['news_content_info2_float'];
         }
     }
     //
     if ($config['news_content_info_pos'] != 'disabled' && $num == 1 || $config['news_content_info2_pos'] != 'disabled' && $num == 2) {
         $news_info = '<div class="nspInfo ' . $class . '"> ' . $config['info' . ($num == 2 ? '2' : '') . '_format'] . ' </div>';
         $info_category = $config['category_link'] == 1 ? '<a href="' . NSP_GK5_com_hikashop_View::categoryLink($item, $config) . '" >' . $item['cat_name'] . '</a>' : $news_catname;
         //
         $info_date = JHTML::_('date', $item['date'], $config['date_format']);
         //
         if (!isset($item['comments']) || $item['comments'] == 0) {
             $comments_amount = JText::_('MOD_NEWS_PRO_GK5_NO_COMMENTS');
         } else {
             $comments_amount = JText::_('MOD_NEWS_PRO_GK5_COMMENTS') . ' (' . (isset($item['comments']) ? $item['comments'] : '0') . ')';
         }
         $info_comments = '<a class="nspComments" href="' . NSP_GK5_com_hikashop_View::itemLink($item, $config) . '#product-tabs">' . $comments_amount . '</a>';
         // Replace the following phrases:
         // %COMMENTS %DATE %CATEGORY %MANUFACTURER %STORE
         $news_info = str_replace('%DATE', $info_date, $news_info);
         $news_info = str_replace('%CATEGORY', $info_category, $news_info);
         $news_info = str_replace('%COMMENTS', $info_comments, $news_info);
         $news_info = str_replace('%STORE', NSP_GK5_com_hikashop_View::store($config, $item), $news_info);
     } else {
         return '';
     }
     //
     return $news_info;
 }