Forums: osCommerce カスタマイズ (Thread #5485)

レビュー文字に半角英数字でレイアウトが崩れる (2004-07-03 12:25 by Anonymous #10076)

レビューに長い半角文字列 aaaaaaaや、アアアア を書かれるレイアウトが崩れます。
やってみてください。
------------------------------------
防止案として「半角文字を全角に置き換える」で対処しました。
注意) 日本語環境のみです。
*)右側(column_right)だけでも、対処しておくといいと思います。
 下記の catalog/includes/boxes/reviews.php だけでも
*)レビュー機能なんていらん! と言う方は、
 http://lists.sourceforge.jp/mailman/archives/tep-j-general/2003-December/001485.html

■catalog/includes/boxes/reviews.php
line 36: $review = htmlspecialchars($review['reviews_text']);
line 37: $review = tep_break_string($review, 15, '-<br>');
line36と37の間に 下記を追加
$review = mb_convert_kana($review,'AKHVRNS');

で、こうなる。
line 36: $review = htmlspecialchars($review['reviews_text']);
line 37: $review = mb_convert_kana($review,'AKHVRNS');
line 38: $review = tep_break_string($review, 15, '-<br>');

■catalog/product_reviews_info.php
line 91:
<td class="main"><br><?php echo nl2br($reviews_text); ?></td>
 を
<td class="main"><br><?php echo nl2br(mb_convert_kana($reviews_text,'AKHVRNS')); ?></td>

■catalog/includes/modules/reviews.php
line 26: の途中に含まれる下記
. $reviews_array[$i]['review'] .
 を
. mb_convert_kana($reviews_array[$i]['review'],'AKHVRNS') .

Reply to #10076×

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