From a9cf96ae08544961117221f390ddafa57ca06d2c Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 18 Jan 2013 17:49:58 +0900 Subject: [PATCH 1/4] =?UTF-8?q?cut=5Fstr=20=ED=95=A8=EC=88=98=20=EA=B8=80?= =?UTF-8?q?=EC=9E=90=EC=88=98=EB=A1=9C=20=EB=AC=B8=EC=9E=90=EC=97=B4=20?= =?UTF-8?q?=EC=9E=90=EB=A5=B4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index af4661cac..abc8c965f 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1066,14 +1066,16 @@ function view_link($view, $number, $attribute) function cut_str($str, $len, $suffix="…") { - if (strlen($str) >= $len) { - $length = floor($len / 3); + $arr_str = preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY); + $str_len = count($arr_str); - $arr_str = array_slice(preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY), 0, $length); - $string = join("", $arr_str); + if ($str_len >= $len) { + $slice_str = array_slice($arr_str, 0, $len); + $str = join("", $slice_str); - return $string . (strlen($str)-strlen($suffix) >= $len ? $suffix : ''); + return $str . ($str_len > $len ? $suffix : ''); } else { + $str = join("", $arr_str); return $str; } } From e1749834ed8716eaf322c9c02fb267d859ebc038 Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 18 Jan 2013 18:04:00 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EB=8C=93=EA=B8=80=20=EC=9E=91=EC=84=B1?= =?UTF-8?q?=EC=8B=9C=20w=20=EA=B0=92=20=EB=84=98=EC=96=B4=EA=B0=80?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skin/board/neo/view_comment.skin.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/skin/board/neo/view_comment.skin.php b/skin/board/neo/view_comment.skin.php index b05f9aa4b..d03f0ef99 100644 --- a/skin/board/neo/view_comment.skin.php +++ b/skin/board/neo/view_comment.skin.php @@ -71,7 +71,10 @@ var char_max = parseInt(); // 최대 - +