From 082f0c43eec5c233ae6052d33680ee00fdc01736 Mon Sep 17 00:00:00 2001 From: thisgun Date: Fri, 12 Oct 2018 17:57:34 +0900 Subject: [PATCH] =?UTF-8?q?seo=5Ftitle=20=EC=A0=80=EC=9E=A5=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/content.php | 4 ++++ lib/uri.lib.php | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/bbs/content.php b/bbs/content.php index 818d52799..e4c264ec4 100644 --- a/bbs/content.php +++ b/bbs/content.php @@ -13,6 +13,10 @@ if($co_seo_title){ $co = get_content_db($co_id); } +if( ! (isset($co['co_seo_title']) && $co['co_seo_title']) && $co['co_id'] ){ + seo_title_update($g5['content_table'], $co['co_id'], 'content'); +} + if (G5_IS_MOBILE) { include_once(G5_MOBILE_PATH.'/content.php'); return; diff --git a/lib/uri.lib.php b/lib/uri.lib.php index cb45212d9..44de67572 100644 --- a/lib/uri.lib.php +++ b/lib/uri.lib.php @@ -257,6 +257,30 @@ function exist_seo_title_recursive($type, $seo_title, $write_table, $sql_id=0){ return exist_seo_title_recursive($type, $seo_title, $write_table, $sql_id); } +function seo_title_update($write_table, $wr_id, $type='bbs'){ + + global $g5; + + if( $type === 'bbs' ){ + $sql = "select wr_seo_title FROM {$write_table} WHERE wr_seo_title = '".sql_real_escape_string($seo_title)."' AND wr_id <> '$sql_id' limit 1"; + + $row = sql_fetch($sql); + + echo $sql; + + $exists_title = $row['wr_seo_title']; + + } else if ( $type === 'content' ){ + + $sql = "select co_seo_title FROM {$write_table} WHERE co_seo_title = '".sql_real_escape_string($seo_title)."' AND co_id <> '$sql_id' limit 1"; + $row = sql_fetch($sql); + + $exists_title = $row['co_seo_title']; + + } + +} + function get_nginx_conf_rules($return_string=false){ $get_path_url = parse_url( G5_URL );