From 83fe14288aec5baacd6a0a18b5b9c0b30c5b6651 Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 28 Mar 2014 16:11:41 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=B4=EC=9A=A9=EA=B4=80=EB=A6=AC=20html=5Fp?= =?UTF-8?q?urifier=20=EC=82=AC=EC=9A=A9=20=EC=84=A0=ED=83=9D=ED=95=A0=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EB=8A=94=20=EC=84=A4=EC=A0=95=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/contentform.php | 25 +++++++++++++-- adm/contentformupdate.php | 11 ++++--- bbs/content.php | 7 ++++- install/gnuboard5.sql | 1 + lib/common.lib.php | 6 ++-- mobile/content.php | 64 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 103 insertions(+), 11 deletions(-) create mode 100644 mobile/content.php diff --git a/adm/contentform.php b/adm/contentform.php index 8419ebdeb..de2c6315d 100644 --- a/adm/contentform.php +++ b/adm/contentform.php @@ -6,9 +6,18 @@ include_once(G5_EDITOR_LIB); auth_check($auth[$sub_menu], "w"); // 상단, 하단 파일경로 필드 추가 -$sql = " ALTER TABLE `{$g5['content_table']}` ADD `co_include_head` VARCHAR( 255 ) NOT NULL , - ADD `co_include_tail` VARCHAR( 255 ) NOT NULL "; -sql_query($sql, false); +if(!sql_query(" select co_include_head from {$g5['content_table']} limit 1 ", false)) { + $sql = " ALTER TABLE `{$g5['content_table']}` ADD `co_include_head` VARCHAR( 255 ) NOT NULL , + ADD `co_include_tail` VARCHAR( 255 ) NOT NULL "; + sql_query($sql, false); +} + +// html purifier 사용여부 필드 +if(!sql_query(" select co_tag_filter_use from {$g5['content_table']} limit 1 ", false)) { + sql_query(" ALTER TABLE `{$g5['content_table']}` + ADD `co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `co_content` ", true); + sql_query(" update {$g5['content_table']} set co_tag_filter_use = '1' "); +} $html_title = "내용"; $g5['title'] = $html_title.' 관리'; @@ -60,6 +69,16 @@ include_once (G5_ADMIN_PATH.'/admin.head.php'); 내용 + + + + + + + diff --git a/adm/contentformupdate.php b/adm/contentformupdate.php index a3313bcb1..4f9786ffd 100644 --- a/adm/contentformupdate.php +++ b/adm/contentformupdate.php @@ -16,11 +16,12 @@ else if ($co_himg_del) @unlink(G5_DATA_PATH."/content/{$co_id}_h"); if ($co_timg_del) @unlink(G5_DATA_PATH."/content/{$co_id}_t"); -$sql_common = " co_include_head = '$co_include_head', - co_include_tail = '$co_include_tail', - co_html = '$co_html', - co_subject = '$co_subject', - co_content = '$co_content' "; +$sql_common = " co_include_head = '$co_include_head', + co_include_tail = '$co_include_tail', + co_html = '$co_html', + co_tag_filter_use = '$co_tag_filter_use', + co_subject = '$co_subject', + co_content = '$co_content' "; if ($w == "") { diff --git a/bbs/content.php b/bbs/content.php index 76082013c..a8ba46f2a 100644 --- a/bbs/content.php +++ b/bbs/content.php @@ -6,6 +6,11 @@ if( !isset($g5['content_table']) ){ die('관리자 모드에서 게시판관리->내용 관리를 먼저 확인해 주세요.'); } +if (G5_IS_MOBILE) { + include_once(G5_MOBILE_PATH.'/content.php'); + return; +} + // 내용 $sql = " select * from {$g5['content_table']} where co_id = '$co_id' "; $co = sql_fetch($sql); @@ -19,7 +24,7 @@ if ($co['co_include_head']) else include_once('./_head.php'); -$str = conv_content($co['co_content'], $co['co_html']); +$str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']); // $src 를 $dst 로 변환 unset($src); diff --git a/install/gnuboard5.sql b/install/gnuboard5.sql index bc0f35f17..6df6f7538 100644 --- a/install/gnuboard5.sql +++ b/install/gnuboard5.sql @@ -801,6 +801,7 @@ CREATE TABLE IF NOT EXISTS `g5_content` ( `co_html` tinyint(4) NOT NULL DEFAULT '0', `co_subject` varchar(255) NOT NULL DEFAULT '', `co_content` longtext NOT NULL, + `co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0', `co_hit` int(11) NOT NULL DEFAULT '0', `co_include_head` varchar(255) NOT NULL, `co_include_tail` varchar(255) NOT NULL, diff --git a/lib/common.lib.php b/lib/common.lib.php index e2a52a832..80180937c 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -510,7 +510,7 @@ function conv_subject($subject, $len, $suffix='') } // 내용을 변환 -function conv_content($content, $html) +function conv_content($content, $html, $filter=true) { global $config, $board; @@ -536,7 +536,9 @@ function conv_content($content, $html) } $content = preg_replace($source, $target, $content); - $content = html_purifier($content); + + if($filter) + $content = html_purifier($content); } else // text 이면 { diff --git a/mobile/content.php b/mobile/content.php new file mode 100644 index 000000000..4ca181961 --- /dev/null +++ b/mobile/content.php @@ -0,0 +1,64 @@ + + + +
+
+

+
+ +
+ +
+ +
+ + +