URL 타이틀 지정 코드 수정

This commit is contained in:
thisgun
2018-10-24 13:53:44 +09:00
parent eca24d196e
commit cf566e3512
2 changed files with 7 additions and 7 deletions
+4 -2
View File
@@ -86,7 +86,7 @@ while ($row = sql_fetch_array($result)) {
if( !$row ){
sql_query("ALTER TABLE `{$write_table}`
ADD `wr_seo_title` varchar(255) NOT NULL DEFAULT '' AFTER `wr_content`,
ADD `wr_seo_title` varchar(200) NOT NULL DEFAULT '' AFTER `wr_content`,
ADD INDEX `wr_seo_title` (`wr_seo_title`);
", false);
@@ -100,7 +100,7 @@ $row = sql_fetch($sql);
if( !$row ){
sql_query("ALTER TABLE `{$g5['content_table']}`
ADD `co_seo_title` varchar(255) NOT NULL DEFAULT '' AFTER `co_content`,
ADD `co_seo_title` varchar(200) NOT NULL DEFAULT '' AFTER `co_content`,
ADD INDEX `co_seo_title` (`co_seo_title`);
", false);
@@ -125,6 +125,8 @@ while ($row = sql_fetch_array($result)) {
}
$is_check = apply_replace('admin_dbupgrade', $is_check);
$db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다.<br>현재 DB 업그레이드가 완료된 상태입니다.';
?>
+3 -5
View File
@@ -221,8 +221,6 @@ function exist_seo_url($type, $seo_title, $write_table, $sql_id=0){
$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'];
@@ -234,7 +232,7 @@ function exist_seo_url($type, $seo_title, $write_table, $sql_id=0){
$exists_title = $row['co_seo_title'];
} else {
return $seo_title;
return apply_replace('exist_check_seo_title', $seo_title, $type, $write_table, $sql_id);
}
if ($exists_title)
@@ -246,7 +244,7 @@ function exist_seo_url($type, $seo_title, $write_table, $sql_id=0){
function exist_seo_title_recursive($type, $seo_title, $write_table, $sql_id=0){
static $count = 0;
$seo_title_add = ($count > 0) ? utf8_strcut($seo_title, 255 - ($count+1), '')."-$count" : $seo_title;
$seo_title_add = ($count > 0) ? utf8_strcut($seo_title, 200 - ($count+1), '')."-$count" : $seo_title;
if( ! exist_seo_url($type, $seo_title_add, $write_table, $sql_id) ){
return $seo_title_add;
@@ -254,7 +252,7 @@ function exist_seo_title_recursive($type, $seo_title, $write_table, $sql_id=0){
$count++;
if( $count > 253 ){
if( $count > 198 ){
return $seo_title_add;
}