".$ret[$i]['val']."\n"; } else { $html['search'][$i]['option'] = "\n"; } } /* ------------------------------------------------------------ ページ ------------------------------------------------------------ */ function ViewPage($Mode, $BrowseNode="", $Keyword="") { global $html, $Page, $HTURL; $html['ItemPageNext'] = ""; $html['ItemPagePrev'] = ""; if ($BrowseNode) { if ($Page < $html['ItemTotalPages']) { $PageNext = $Page + 1; if ($HTURL) { $html['ItemPageNext'] = SITEURL."list/".$Mode."/".$PageNext."/".$BrowseNode."/"; } else { $html['ItemPageNext'] = SITEURL."?m=list&mode=".$Mode."&p=".$PageNext."&node=".$BrowseNode; } } if ($Page > 1 && $Page <= $html['ItemTotalPages']) { $PagePrev = $Page - 1; if ($HTURL) { $html['ItemPagePrev'] = SITEURL."list/".$Mode."/".$PagePrev."/".$BrowseNode."/"; } else { $html['ItemPagePrev'] = SITEURL."?m=list&mode=".$Mode."&p=".$PagePrev."&node=".$BrowseNode; } } } else { $Keyword = mb_eregi_replace('/','%2F',$Keyword); if ($Page < $html['ItemTotalPages']) { $PageNext = $Page + 1; if ($HTURL) { $html['ItemPageNext'] = SITEURL."search/".$Mode."/".$PageNext."/".urlencode($Keyword)."/"; } else { $html['ItemPageNext'] = SITEURL."?m=search&mode=".$Mode."&p=".$PageNext."&SearchKeyword=".urlencode($Keyword); } } if ($Page > 1 && $Page <= $html['ItemTotalPages']) { $PagePrev = $Page - 1; if ($HTURL) { $html['ItemPagePrev'] = SITEURL."search/".$Mode."/".$PagePrev."/".urlencode($Keyword)."/"; } else { $html['ItemPagePrev'] = SITEURL."?m=search&mode=".$Mode."&p=".$PagePrev."&SearchKeyword=".urlencode($Keyword); } } } } /*---------------------------------------------------------- コンテンツ表示 ----------------------------------------------------------*/ switch ($ContentsMode) { case "asin": // Asin $Asin = $_REQUEST['asin']; $html = array_merge_recursive($html, Amazon_Query_Asin($Asin, $AmazonMode)); $cat_name = Amazon_MenuName($AmazonMode); $html['pagetitle'] = $html['Asin']['Title']." - ".$cat_name." - ".SITETITLE; break; case "search": // 検索 if ($_GET['SearchKeyword']) { $SearchKeyword = urldecode($_GET['SearchKeyword']); } elseif ($_POST['SearchKeyword']) { $SearchKeyword = $_POST['SearchKeyword']; } else { $SearchKeyword = ""; } if ($SearchKeyword && get_magic_quotes_gpc()) { $SearchKeyword = stripslashes($SearchKeyword); } $html = array_merge_recursive($html, Amazon_Query_ItemSearch($SearchKeyword, $AmazonMode, $Page)); ViewPage($AmazonMode, "", $SearchKeyword); $html['ItemKeyword'] = $SearchKeyword; $html['SearchKeyword'] = $SearchKeyword; $cat_name = Amazon_MenuName($AmazonMode); $html['pagetitle'] = $html['ItemKeyword']." - ".$cat_name." - ".SITETITLE; break; case "list": // 一覧 $html = array_merge_recursive($html, Amazon_Query_BrowseNode($AmazonBrowseNode, $AmazonMode, $Page)); ViewPage($AmazonMode, $AmazonBrowseNode); $html['ItemKeyword'] = Amazon_MenuName($AmazonBrowseNode,$AmazonMode); $cat_name = Amazon_MenuName($AmazonMode); $html['pagetitle'] = $html['ItemKeyword']." - ".$cat_name." - ".SITETITLE; break; default: if (count($TopItemAsin) > 0) { while (list($key,$val) = each($TopItemAsin)) { $Tophtml['topasin'][] = Amazon_Query_Asin($key, $val); } $html = array_merge_recursive($html, $Tophtml); } if (count($TopItemIndex) > 0) { list($key,$val) = each($TopItemIndex); if ($key) { $html = array_merge_recursive($html, Amazon_Query_ItemSearch($key, $val)); ViewPage($val, "", $key); $html['ItemKeyword'] = $key; } else { $ret = Amazon_MenuList($val); $html = array_merge_recursive($html, Amazon_Query_BrowseNode($ret[0]['key'], $val)); ViewPage($val, $ret[0]['key']); $html['ItemKeyword'] = Amazon_MenuName($val); } } $html['pagetitle'] = SITETITLE; } $html['footercontents'] = ""; if ($MobileFLG) { $html = array_to_kana($html); } HtmlTemplate::t_include($TemplateFile, $html); ?>