Download
Magazine
Develop
Account
Download
Magazine
Develop
Login
Forgot Account/Password
Create Account
Language
Help
Language
Help
×
Login
Login Name
Password
×
Forgot Account/Password
Category:
Software
People
PersonalForge
Magazine
Wiki
Search
OSDN
>
Find Software
>
Internet
>
WWW/HTTP
>
Site Management
>
osCommerce 日本語版
>
Forums
>
osCommerce カスタマイズ
>
タイトル、メタタグ、キーワードを個別に設定する
osCommerce 日本語版
Description
Project Summary
Developer Dashboard
Web Page
Developers
Image Gallery
List of RSS Feeds
Activity
Statistics
History
Downloads
List of Releases
Stats
Source Code
Code Repository list
CVS
View Repository
Ticket
Ticket List
Milestone List
Type List
Component List
List of frequently used tickets/RSS
Submit New Ticket
Documents
Communication
Forums
List of Forums
イベント (20)
osCommerce カスタマイズ (493)
osCommerce FAQ (1365)
osCommerce 一般 (36)
Mailing Lists
list of ML
tep-j-develop
tep-j-general
News
Forums:
osCommerce カスタマイズ
(Thread #5614)
Return to Thread list
RSS
タイトル、メタタグ、キーワードを個別に設定する (2004-07-22 13:15 by
Anonymous
#10294)
Reply
Create ticket
以下をファイル名 title_mata.php としてください
------------------------------------------
<?php
/*****
title_mata.php
下記を参考にしました 著作権は下記のお二人にあります。
http://lists.sourceforge.jp/mailman/archives/tep-j-general/2004-July/002210.html
http://lists.sourceforge.jp/mailman/archives/tep-j-general/2003-August/002806.html
/catalog/includesにtitle_mata.phpを配置し、catalog/product_info.phpヘッダ内の
<title><?php echo TITLE; ?></title>
を 下記と入れ替える
<?php
require(DIR_WS_INCLUDES . 'title_mata.php');
?>
title、metaタグのkeywordとdescriptionの行 を生成します。
******/
$the_product_info_query = tep_db_query("select pd.language_id, p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" . " and p.manufacturers_id = m.manufacturers_id and pd.language_id ='" . (int)$languages_id . "'");
//クエリを投げる
$the_product_info = tep_db_fetch_array($the_product_info_query);
//タイトルを作成
$the_title= $the_product_info['products_name'];
echo ' <title>' . TITLE .' - ' .$the_title . '</title>' . "\n";
//キーワードタグを作成
echo "<meta name=\"keyword\" content=\"" . $the_product_info['manufacturers_name'] ; //先ずメーカー名をキーワードに入れる
//取得した商品名を半角スペース毎に分解して配列に収納
$pieces = explode(" ", $the_product_info['products_name']);
//分解した商品名部品をカンマ区切りで出力
//あまりにも「商品名の空白区切り」で出来る部品が多い場合は、行が冗長になったりスパム扱いされるのを避けるためキーワード個数を制限する必要があるかもしれない
$i = 0;
do {
echo "," . $pieces[$i];
$i++;
} while($pieces[$i] != ""); //部品が無くなるまでループ
echo "\">\n";
//説明タグを作成
echo "<meta name=\"description\" content=\"";
//「説明は100字以内くらい」との事なので、とりあえず150バイトにしてます
//説明内にタグや改行が含まれてると都合悪いので、除去
$description = mb_strcut(ereg_replace("\n|\r|\r\n"," ",strip_tags($the_product_info['products_description'])),0,150);
echo $description;
echo "\">\n";
?>
Reply to #10294
×
Subject
Body
Reply To Message #10294 > 以下をファイル名 title_mata.php としてください > ------------------------------------------ > > <?php > /***** > title_mata.php > 下記を参考にしました 著作権は下記のお二人にあります。 > http://lists.sourceforge.jp/mailman/archives/tep-j-general/2004-July/002210.html > http://lists.sourceforge.jp/mailman/archives/tep-j-general/2003-August/002806.html > > /catalog/includesにtitle_mata.phpを配置し、catalog/product_info.phpヘッダ内の > > <title><?php echo TITLE; ?></title> > を 下記と入れ替える > > <?php > require(DIR_WS_INCLUDES . 'title_mata.php'); > ?> > title、metaタグのkeywordとdescriptionの行 を生成します。 > > ******/ > > $the_product_info_query = tep_db_query("select pd.language_id, p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" . " and p.manufacturers_id = m.manufacturers_id and pd.language_id ='" . (int)$languages_id . "'"); > > //クエリを投げる > $the_product_info = tep_db_fetch_array($the_product_info_query); > > //タイトルを作成 > $the_title= $the_product_info['products_name']; > echo ' <title>' . TITLE .' - ' .$the_title . '</title>' . "\n"; > > //キーワードタグを作成 > echo "<meta name=\"keyword\" content=\"" . $the_product_info['manufacturers_name'] ; //先ずメーカー名をキーワードに入れる > > //取得した商品名を半角スペース毎に分解して配列に収納 > $pieces = explode(" ", $the_product_info['products_name']); > > //分解した商品名部品をカンマ区切りで出力 > //あまりにも「商品名の空白区切り」で出来る部品が多い場合は、行が冗長になったりスパム扱いされるのを避けるためキーワード個数を制限する必要があるかもしれない > > $i = 0; > > do { > echo "," . $pieces[$i]; > $i++; > > } while($pieces[$i] != ""); //部品が無くなるまでループ > > echo "\">\n"; > > //説明タグを作成 > echo "<meta name=\"description\" content=\""; > > //「説明は100字以内くらい」との事なので、とりあえず150バイトにしてます > //説明内にタグや改行が含まれてると都合悪いので、除去 > > $description = mb_strcut(ereg_replace("\n|\r|\r\n"," ",strip_tags($the_product_info['products_description'])),0,150); > > echo $description; > > echo "\">\n"; > > ?>
You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.)
Login
Nickname
Preview
Post
Cancel
RE: タイトル、メタタグ、キーワードを個別に設定する (2004-07-22 13:18 by
Anonymous
#10295)
Reply
Create ticket
title_meta.php にするつもりが
title_mata.php に・・(ToT)
実害はないです。
Reply to
#10294
Reply to #10295
×
Subject
Body
Reply To Message #10295 > title_meta.php にするつもりが > > title_mata.php に・・(ToT) > > 実害はないです。
You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.)
Login
Nickname
Preview
Post
Cancel
RE: タイトル、メタタグ、キーワードを個別に設定する(関連) (2008-02-03 11:22 by
Anonymous
#34852)
Reply
Create ticket
初歩的な質問で恐縮ですが、
トップページのタイトル(当初"osCommerce")を変更したのですが、対処法のご指導をお願いします。
Reply to
#10295
Reply to #34852
×
Subject
Body
Reply To Message #34852 > 初歩的な質問で恐縮ですが、 > > トップページのタイトル(当初"osCommerce")を変更したのですが、対処法のご指導をお願いします。
You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.)
Login
Nickname
Preview
Post
Cancel
RE: タイトル、メタタグ、キーワードを個別に設定する(関連) (2008-02-03 17:48 by
Anonymous
#34856)
Reply
Create ticket
自己レスです。
catalog/includes/laguages/japanese.phpに下記を追加
// page title
define ('TITLE' , 'タイトル名');
にて表示させることができました。
Reply to
#34852
Reply to #34856
×
Subject
Body
Reply To Message #34856 > 自己レスです。 > > catalog/includes/laguages/japanese.phpに下記を追加 > // page title > define ('TITLE' , 'タイトル名'); > にて表示させることができました。
You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.)
Login
Nickname
Preview
Post
Cancel
SEO (2004-09-03 10:51 by
Anonymous
#10868)
Reply
Create ticket
これは、SEO対策になりますね。 (^人^)感謝♪
Reply to
#10294
Reply to #10868
×
Subject
Body
Reply To Message #10868 > これは、SEO対策になりますね。 (^人^)感謝♪
You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.)
Login
Nickname
Preview
Post
Cancel
今は (2004-10-05 15:25 by
Anonymous
#11393)
Reply
Create ticket
>あまりにも「商品名の空白区切り」で出来る部品が
>多い場合は、行が冗長になったりスパム扱いされる
>のを避けるためキーワード個数を制限する必要があ
>るかもしれない
ということなんで、
do {
echo "," . $pieces[$i];
$i++;
} while($pieces[$i] != "" | $i > 10); //部品が無くなるか10単語までループ
↑こう直してます。採用単語数は、まぁ適当に。
Reply to
#10294
Reply to #11393
×
Subject
Body
Reply To Message #11393 > >あまりにも「商品名の空白区切り」で出来る部品が > >多い場合は、行が冗長になったりスパム扱いされる > >のを避けるためキーワード個数を制限する必要があ > >るかもしれない > > ということなんで、 > > do { > echo "," . $pieces[$i]; > $i++; > > } while($pieces[$i] != "" | $i > 10); //部品が無くなるか10単語までループ > > ↑こう直してます。採用単語数は、まぁ適当に。
You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.)
Login
Nickname
Preview
Post
Cancel
RE: (2006-03-27 11:48 by
Anonymous
#20881)
Reply
Create ticket
ありがとうございます
Reply to
#10294
Reply to #20881
×
Subject
Body
Reply To Message #20881 > ありがとうございます
You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.)
Login
Nickname
Preview
Post
Cancel