/**
  * 新着情報を取得する
  *
  * @return array $arrNews 取得結果を配列で返す
  */
 public function lfGetNews()
 {
     $objNews = new SC_Helper_News_Ex();
     $arrNews = $objNews->getList();
     $objDb = new SC_Helper_DB_Ex();
     $arrInfo = $objDb->sfGetBasisData();
     // RSS用に変換
     foreach (array_keys($arrNews) as $key) {
         $netUrlHttpUrl = new Net_URL(HTTP_URL);
         $row =& $arrNews[$key];
         $row['shop_name'] = $arrInfo['shop_name'];
         $row['email'] = $arrInfo['email04'];
         // 日付
         $row['news_date'] = date('r', strtotime($row['news_date']));
         // 新着情報URL
         if (SC_Utils_Ex::isBlank($row['news_url'])) {
             $row['news_url'] = HTTP_URL;
         } elseif ($row['news_url'][0] == '/') {
             // 変換(絶対パス→URL)
             $netUrl = new Net_URL($row['news_url']);
             $netUrl->protocol = $netUrlHttpUrl->protocol;
             $netUrl->user = $netUrlHttpUrl->user;
             $netUrl->pass = $netUrlHttpUrl->pass;
             $netUrl->host = $netUrlHttpUrl->host;
             $netUrl->port = $netUrlHttpUrl->port;
             $row['news_url'] = $netUrl->getUrl();
         }
     }
     return $arrNews;
 }
Ejemplo n.º 2
0
 /**
  * 登録処理を実行.
  *
  * @param  integer  $news_id
  * @param  array    $sqlval
  * @param  SC_Helper_News_Ex   $objNews
  * @return multiple
  */
 public function doRegist($news_id, $sqlval, SC_Helper_News_Ex $objNews)
 {
     $sqlval['news_id'] = $news_id;
     $sqlval['creator_id'] = $_SESSION['member_id'];
     $sqlval['link_method'] = $this->checkLinkMethod($sqlval['link_method']);
     $sqlval['news_date'] = $this->getRegistDate($sqlval);
     unset($sqlval['year'], $sqlval['month'], $sqlval['day']);
     return $objNews->saveNews($sqlval);
 }
 /**
  * 新着情報1件分をJSON形式で取得する
  * (news_idを指定)
  *
  * @param  array  $arrData フォーム入力値
  * @return String $json 新着情報1件分のJSONを返す
  */
 public function lfGetNewsDetailForJson($arrData)
 {
     $arrNewsList = SC_Helper_News_Ex::getNews($arrData['news_id']);
     $json = SC_Utils_Ex::jsonEncode($arrNewsList);
     //JSON形式
     return $json;
 }