引数 | 説明 | 省略時 |
1 | ASIN番号 | clearとレビュー作成の場合以外省略不可 |
2 | left,center,right,clear | インラインプラグイン以外right |
3 | image,content,nocontent,subscript,delimage, deltitle,delete,タイトルなど | タイトル自動取得 |
4 | アマゾン以外の写影のURI | 必要ならプラグインによる写影 |
http://images-jp.amazon.com/images/P/B000002G6J.01.MZZZZZZZ.jpg
#amazon(B00005Y6Q2,right,image) #amazon(B00005Y6Q2,right,subscript) #amazon(,clear) |BGCOLOR(white):#amazon(B00005Y6Q2,left,image)|| |foo|BGCOLOR(pink):COLOR(black){bar}|
引数 | 説明 | 省略時 |
1 | ASIN番号または英数字からなるID | 省略不可 |
2 | title,author,manufact,media,pricel,price, avail,content,image,link,lib,lib0 | タイトル自動取得 |
Fatal error: Maximum execution time of 30 seconds exceeded in amazon.inc.php on line 308が頻発しますね。タイムアウト対策をしないと駄目かなぁ? -- upk 2004-05-16 (日) 16:44:37
define('PLUGIN_AMAZON_AID','自分のID');cacheのhtaccessを
Order allow,deny Deny from all # Amazon plugin's Image <FilesMatch "^ASIN.*\.jpg$"> Allow from all </FilesMatch>
と両方試してみました。画像はOKとなりました。でも文字化けが解決しません。amazonにリンクもされてはいますが・・・・。 -- tyura3san 2005-02-07 (月) 04:04:47
大 LZZZZZZZ.jpg 中 MZZZZZZZ.jpg 小 TZZZZZZZ.jpg サムネイル THUMBZZZ.jpgのようになってるので、プラグインから選べるようにしたいです。-- almaz 2005-10-09 (日) 15:03:48
amazonプラグインは http://www.amazon.co.jp/exec/obidos/ASIN/000000000/xxx amazonで作成したリンクは http://rcm-jp.amazon.co.jp/e/cm?t=xxxとなりアフェリエイトID(上記xxx部)の使い方が異なるのですが、これは等価なのでしょうか。 pukiwikiもアフェリエイトも初心者です。よろしくお願いします。-- summer-初心者 2006-10-07 (土) 06:57:54
23bでは第三引数はimage,content,contentc,nocontent,nocontentc,subscript,subscriptcのみ機能する状態になっているはずです。 -- 萬Q 2009-07-22 (水) 21:17:20
amazon.inc.php 184-185行目 ・修正前 $div .= "<tr><td class='amazon_td'><a href='" . AMAZON_SHOP . $check->asin; $div .= "/" . AMAZON_AID . "'>" . $item . "</a></td></tr></table></div>"; ・修正後 $div .= '<tr><td class="amazon_td"><a href="' . AMAZON_SHOP; $div .= '$check->asin/' . AMAZON_AID . '">$item</a></td></tr></table></div>';非常に恐縮なのですが、試していただいてもよろしいでしょうか?
asin/xxxxxxxx-22>
$div .= '<tr><td class="amazon_td"><a href="' . AMAZON_SHOP; $div .= $check->asin . '/' . AMAZON_AID . '">' . $item . '</a></td></tr></table></div>';
また、当プラグイン改善のためにご尽力いただきありがとうございました! -- 萬Q 2009-08-07 (金) 00:50:27
plugin/amazon.inc.php | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/plugin/amazon.inc.php b/plugin/amazon.inc.php index 03a7c05..fb8eb17 100644 --- a/plugin/amazon.inc.php +++ b/plugin/amazon.inc.php @@ -114,6 +114,10 @@ EOD; $div .= "<input type='hidden' name='SubscriptionId' value='" . AWS_SUBSCRIPTION_ID . "'>"; } else $div .= "<div class='amazon_sub' style='text-align:$align'>"; + + $div .= '<a href="' . AMAZON_SHOP . $check->asin. '/' + . AMAZON_AID . '">' . $info->items['title'] . '</a><br />'; + $div .= $info->items['author'] . "<br />"; $div .= $info->items['manufact'] . "<br />"; if($info->items['lprice'] != '') @@ -129,7 +133,7 @@ EOD; if($info->items['asaved'] != '') { $div .= "<b>" . mb_convert_encoding("OFF", SOURCE_ENCODING, DISPLAY_ENCODING) . ":</b><span style='color: #990000;'> " . $info->items['asaved']; - $div .= "(" . $info->items['psaved'] . mb_convert_encoding("%", SOURCE_ENCODING, DISPLAY_ENCODING) . ")</b></div>"; + $div .= "(" . $info->items['psaved'] . mb_convert_encoding("%", SOURCE_ENCODING, DISPLAY_ENCODING) . ")</span></b></div>"; } $div .= "<div class='amazon_avail' style='text-align:$align'>"; if($info->items['avail'] != '')
// デフォルトの表示形式 define('AMAZON_PLUGIN_DEFAULT_ITEM_TYPE', 'content'); // デフォルトの整列形式 define('AMAZON_PLUGIN_DEFAULT_ALIGN', 'left');ソースはgithubにアップしてあります。 →http://github.com/toooooooby/pukiwiki-amazon-plugin/tree/my_amazon 以下、パッチ
plugin/amazon.inc.php | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/plugin/amazon.inc.php b/plugin/amazon.inc.php index fb8eb17..c2c2d64 100644 --- a/plugin/amazon.inc.php +++ b/plugin/amazon.inc.php @@ -21,6 +21,10 @@ define('AMAZON_CARGO','./image/remote-buy-jp.gif'); define('PLUGIN_AMAZON_IMAGE_SIZE', 'MediumImage'); // 表示エンコード utf-8, sjis, euc-jp, jis, ascii define('DISPLAY_ENCODING', 'euc-jp'); +// デフォルトの表示形式 +define('AMAZON_PLUGIN_DEFAULT_ITEM_TYPE', ''); +// デフォルトの整列形式 +define('AMAZON_PLUGIN_DEFAULT_ALIGN', 'right'); ///////////////////////////////////////////////// 変更してはならない箇所 define('AMAZON_SHOP','http://www.amazon.co.jp/exec/obidos/ASIN/'); @@ -76,10 +80,13 @@ EOD; $align = strtolower(trim($aryargs[1])); if ($align == 'clear') return '<div style="clear:both"></div>'; // 改行挿入 - if ($align == '') $align = 'right'; + if ($align == '') $align = AMAZON_PLUGIN_DEFAULT_ALIGN; if (preg_match("/^(right|left|center)$/", $align) == false) return false; $item = htmlspecialchars(trim($aryargs[2])); // for XSS + if ($item == '') { + $item = AMAZON_PLUGIN_DEFAULT_ITEM_TYPE; + } $check = new amazon_check_asin(htmlspecialchars($aryargs[0])); // for XSS if ($check->is_asin)
plugin/amazon.inc.php | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugin/amazon.inc.php b/plugin/amazon.inc.php index a6f85a9..0761381 100644 --- a/plugin/amazon.inc.php +++ b/plugin/amazon.inc.php @@ -124,9 +124,13 @@ EOD; $div .= '<a href="' . AMAZON_SHOP . $check->asin. '/' . AMAZON_AID . '">' . $info->items['title'] . '</a><br />'; - - $div .= $info->items['author'] . "<br />"; - $div .= $info->items['manufact'] . "<br />"; + + if($info->items['author'] != '') { + $div .= $info->items['author'] . "<br />"; + } + if($info->items['manufact'] != '') { + $div .= $info->items['manufact'] . "<br />"; + } if($info->items['lprice'] != '') { $div .= "<b>" . mb_convert_encoding("サイケヘイチウハ", SOURCE_ENCODING, DISPLAY_ENCODING) . ":</b><s> " . $info->items['lprice'];ソースまるごとはgithubにアップしてあります。 →http://github.com/toooooooby/pukiwiki-amazon-plugin/tree/my_amazon
plugin/amazon.inc.php | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/amazon.inc.php b/plugin/amazon.inc.php index a8a3fae..67962af 100644 --- a/plugin/amazon.inc.php +++ b/plugin/amazon.inc.php @@ -144,7 +144,7 @@ EOD; if($info->items['asaved'] != '') { $div .= "<b>" . mb_convert_encoding("OFF", SOURCE_ENCODING, DISPLAY_ENCODING) . ":</b><span style='color: #990000;'> " . $info->items['asaved']; - $div .= "(" . $info->items['psaved'] . mb_convert_encoding("%", SOURCE_ENCODING, DISPLAY_ENCODING) . ")</span></b></div>"; + $div .= "(" . $info->items['psaved'] . mb_convert_encoding("%", SOURCE_ENCODING, DISPLAY_ENCODING) . ")</span></b>"; } $div .= "<div class='amazon_avail' style='text-align:$align'>"; if($info->items['avail'] != '') @@ -157,8 +157,8 @@ EOD; $div .= "<b>" . mb_convert_encoding("在庫状態", SOURCE_ENCODING, DISPLAY_ENCODING) . ":</b> " . mb_convert_encoding("現在在庫がありません", SOURCE_ENCODING, DISPLAY_ENCODING) . "</div>"; if ($iscargo) $div .= "<br /></form>"; } + $div .= "</div>"; if ($item == 'content') $div .= "<br />" . $info->items['content'] . '<div style="clear:both"></div>'; } else {例によってgithubに(ry