Example #1
0
         $result = get_topmonth($start, $display);
         break;
     case 'topweek':
         $result = get_topweek($start, $display);
         break;
     case 'eSport':
         $result = get_news_type($type, $start, $display);
         break;
     case 'news':
         $result = get_news_type($type, $start, $display);
         break;
     case 'review':
         $result = get_news_type($type, $start, $display);
         break;
     default:
         $result = get_news_type($type, $start, $display);
         break;
 }
 $posts = array();
 // create array to save data
 $title = $type;
 if (mysqli_num_rows($result) > 0) {
     while ($news = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
         $record = mysqli_num_rows($result);
         $posts = array('news_id' => $news['news_id'], 'banner' => $news['banner'], 'day' => $news['day'], 'month' => $news['month'], 'title' => $news['title'], 'post_by' => $news['name'], 'type_name' => $news['type_name'], 'count' => $news['count'], 'content' => $news['content']);
         ?>
         <div class="blog-to">
             <div class="blog-top">
                 <div class="blog-left">
                     <b><?php 
         echo $posts['day'];
Example #2
0
 public function team()
 {
     $product_list = get_news_type(11, 1, 'type_id,type_name,keywords');
     #团队风采
     $news = M('news');
     $news_where['status'] = array('eq', 1);
     $news_where['is_del'] = array('eq', '0');
     foreach ($product_list as $key => $list) {
         $news_where['type_id'] = array('eq', $list['type_id']);
         $count = $news->where($news_where)->count();
         if ($count < 1) {
             unset($product_list[$key]);
         } else {
             $icon = get_news($list['type_id'], 1, 'icon');
             $product_list[$key]['images'] = C('NEWIMGURL') . $icon[0]['icon'];
             $product_list[$key]['count'] = $count;
         }
     }
     $this->assign("product_list", $product_list);
     $this->assign("seo_title", '团队风采');
     $this->display('product');
 }