lib('mall'); if ( !isset($cfg['number']) ) $cfg['number'] = 4; if ( !isset($cfg['width']) ) $cfg['width'] = 120; if ( !isset($cfg['height']) ) $cfg['height'] = 200; if ( empty($cfg['category']) ) $categories = array(); else $categories = explode(",", $cfg['category']); if ( ! isset($cfg['price']) ) $cfg['price'] = NULL; if ( ! isset($cfg['recommend']) ) $cfg['recommend'] = NULL; if ( ! isset($cfg['hit']) ) $cfg['hit'] = NULL; $fn = $cfg['order']; switch ( $fn ) { case 'dateTime' : $field = "dateTime_firstwrite"; break; case 'hits' : $field = "hits"; break; case 'recommend' : $field = "recommend"; break; case 'hit' : $field = mall_fieldname("hit"); break; case 'price' : $field = mall_fieldname("price"); break; } $kvs['idx_category_type'] = CATE_MALL; $kvs['idx_category_type cond'] = '='; // $order[$field] = 'DESC'; lib('post'); $rows = searchPost($categories, $kvs, array('toNumber'=>$cfg['number']), $order); $items = convToItems($rows); ?>