[Tep-j-general] Re: カテゴリー名を表示させる方法を教えてください

Back to archive index

オンリーワン0nly0ne haf19****@ams*****
2006年 5月 1日 (月) 14:22:16 JST


はまだ様

御忙しい中お教えいただきましてありがとうございます

ご説明が足りず申し訳ございません

> 過去ログを拝見いたしましてはまだ様がご提供されているPHPを
> 使用させていただこうと思ったのですが

>ってのがどれの事なのか、よくわかんないのですが


は、はまだ様の回答内に記載して頂いた
http://lists.sourceforge.jp/mailman/archives/tep-j-general/2004-December/014903.html

を参考にさせていただき、default_tags.phpを作成後default.phpの

<title><?php echo TITLE; ?></title>

 ↓

<?php require(DIR_WS_INCLUDES . 'default_tags.php'); ?>

と書き換えましたが何も変わりませんでした

以前product_info.php を下記のように変更して商品名が出るようにしていたので
それをデフォルトに戻し、はまだ様の提供されているとおりにやってみましたが
だめでした

L21 <title><?php echo TITLE; ?></title>
を下記のように変更します。
<title>
<?php
$product_title_query = tep_db_query("select pd.products_name from " . 
TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where 
p.products_status = '1' and p.products_id = '" . 
(int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id 
and pd.language_id = '" . $languages_id . "'");
$product_title = tep_db_fetch_array($product_title_query);
echo $product_title['products_name'];
?>
</title>


また、default.phpを
<title>
<?php

    $seo_category_query = tep_db_query("select categories_name, 
categories_id from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id 
= '".$current_category_id."' and language_id='" . $languages_id . "'");
    $seo_category = tep_db_fetch_array($seo_category_query);

    $seo_manufacturers_query = tep_db_query("select manufacturers_id, 
manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = 
'".$HTTP_GET_VARS['manufacturers_id']."'");
    $seo_manufacturers = tep_db_fetch_array($seo_manufacturers_query);


 if (isset($cPath_array)) {
       echo $seo_category['categories_name'] . '-' . TITLE ;

   } elseif ($HTTP_GET_VARS['manufacturers_id']) {
       echo $seo_manufacturers['manufacturers_name'] . '-' . TITLE ;

   } else {
       echo TITLE ;
 }

 ?>
</title>

に変更するというので以前作成したosCommerce(アマゾン仕様)のショップで
カテゴリー→サイト名 という風に表示することができたのですが
今回そのように記述してもまったく変わりませんでした

何かやり方が悪いのだと思うのですがどうすればよいのかわかりません

はまださまが今回お教えくださった
> //titleタグを出力
> echo '<title>' . TITLE;
>
> //(適当に)カテゴリを引く
> $sql = "select cd.categories_name from " . TABLE_PRODUCTS_TO_CATEGORIES . 
> " p2c, " . TABLE_CATEGORIES_DESCRIPTION . " cd  where p2c.products_id = '" 
> . (int)$HTTP_GET_VARS['products_id'] . "' and p2c.categories_id = 
> cd.categories_id and cd.language_id ='" .  (int)$languages_id . "' limit 
> 1";
>
> //カテゴリ取得のクエリを投げる
> $categorie_query = tep_db_query($sql);
>
> //カテゴリが取得出来てれば表示
> if ($cat = tep_db_fetch_array($categorie_query)){
>
> 	echo 'ー' . $cat['categories_name'];
>
> }
>
> echo 'ー' . $products_name . '</title>' . "\n";


というのはどのように使えばよいのでしょうか?
初心者で何もわからなくてすみません

お手数をお掛けいたしますが再度お教えいただきますと幸いです
よろしくお願い申し上げます

岡本










Tep-j-general メーリングリストの案内
Back to archive index