read("http://www.oki-diving.com/feed/shops/limit:1"); $arg['shops_count'] = $xml->paging['count']; //ショップ数の取得ここまで //--------------------------------------------------------------------------- //ショップ一覧の取得ここから $xml = $reader->read("http://www.oki-diving.com/feed/shops/limit:{$limit}"); $shops = array(); foreach ($xml->shop as $shop) { $shop->shops_info['shops_comment'] = truncate(strip_tags(h_decode($shop->shops_info['shops_comment']))); $shops[] = array( 'shop' => $shop, 'shops_info' => $shop->shops_info, 'area' => $shop->area, 'area_group' => $shop->area_group, 'appeals' => $shop->appeals, ); } $arg['shops'] = $shops; //ショップ一覧の取得ここまで //--------------------------------------------------------------------------- //スタイルの取得ここから $xml = $reader->read('http://www.oki-diving.com/feed/appeals'); $appeals = array(); foreach ($xml->appeal as $appeal) { $appeals[] = $appeal; } $arg['appeals'] = $appeals; //スタイルの取得ここまで //--------------------------------------------------------------------------- //エリアグループの取得ここから $xml = $reader->read('http://www.oki-diving.com/feed/area_groups'); $area_groups = array(); foreach ($xml->area_group as $area_group) { $area_groups[] = $area_group; } $arg['area_groups'] = $area_groups; //エリアグループの取得ここまで //--------------------------------------------------------------------------- //エリアの取得ここから $xml = $reader->read('http://www.oki-diving.com/feed/areas'); $areas = array(); foreach ($xml->area as $area) { $areas[] = $area; } $arg['areas'] = $areas; //エリアの取得ここまで //--------------------------------------------------------------------------- //ショップランキングの取得ここから $xml = $reader->read("http://www.oki-diving.com/feed/shops/ranking:{$ranking}"); $shops_ranking = array(); $rank = 1; foreach ($xml->shop as $shop) { $shop['shops_name'] = convert($shop['shops_name']); $shop['shops_name'] = mb_substr($shop['shops_name'],0,10,'UTF-8') . (mb_strlen($shop['shops_name'],'UTF-8')>10?'...':''); $shop['shops_added_date'] = ereg_replace(' .*','',$shop['shops_added_date']); $shop['shops_added_date'] = str_replace('-','/',$shop['shops_added_date']); $shop->area['area_name'] = convert($shop->area['area_name']); $shops_ranking[] = array( 'rank' => $rank, 'shop' => $shop, 'shops_info' => $shop->shops_info, 'area' => $shop->area, 'appeals' => $shop->appeals, ); $rank++; } $arg['shops_ranking'] = $shops_ranking; //ショップランキングの取得ここまで //--------------------------------------------------------------------------- HtmlTemplate::t_include("./tmpl/index.html",$arg);