일부 코드 탭 간격 조정

This commit is contained in:
thisgun
2020-10-27 16:34:39 +09:00
parent f1f639070d
commit 2e3f53ed8a
2 changed files with 66 additions and 66 deletions

View File

@ -16,13 +16,13 @@ function get_pretty_url($folder, $no='', $query_string='', $action='')
return $url;
}
// use shortten url
if($config['cf_bbs_rewrite']) {
// use shortten url
if($config['cf_bbs_rewrite']) {
$segments[0] = G5_URL;
if( $folder === 'content' && $no ){ // 내용관리
$segments[1] = $folder;
if( $config['cf_bbs_rewrite'] > 1 ){
@ -36,32 +36,32 @@ function get_pretty_url($folder, $no='', $query_string='', $action='')
} else if(in_array($folder, $boards)) { // 게시판
$segments[1] = $folder;
$segments[1] = $folder;
if($no) {
if($no) {
if( $config['cf_bbs_rewrite'] > 1 ){
$get_write = get_write( $g5['write_prefix'].$folder, $no , true);
$segments[2] = $get_write['wr_seo_title'] ? urlencode($get_write['wr_seo_title']).'/' : urlencode($no);
$get_write = get_write( $g5['write_prefix'].$folder, $no , true);
$segments[2] = $get_write['wr_seo_title'] ? urlencode($get_write['wr_seo_title']).'/' : urlencode($no);
} else {
$segments[2] = urlencode($no);
}
} else if($action) {
} else if($action) {
$segments[2] = urlencode($action);
}
} else {
} else {
$segments[1] = $folder;
if($no) {
$no_array = explode("=", $no);
$no_value = end($no_array);
if($no) {
$no_array = explode("=", $no);
$no_value = end($no_array);
$segments[2] = urlencode($no_value);
}
}
}
}
if($query_string) {
// If the first character of the query string is '&', replace it with '?'.
@ -72,33 +72,33 @@ function get_pretty_url($folder, $no='', $query_string='', $action='')
}
}
} else { // don't use shortten url
if(in_array($folder, $boards)) {
$url = G5_BBS_URL. '/board.php?bo_table='. $folder;
if($no) {
$url .= '&wr_id='. $no;
}
if($query_string) {
} else { // don't use shortten url
if(in_array($folder, $boards)) {
$url = G5_BBS_URL. '/board.php?bo_table='. $folder;
if($no) {
$url .= '&wr_id='. $no;
}
if($query_string) {
if(substr($query_string, 0, 1) !== '&') {
$url .= '&';
}
$url .= $query_string;
}
} else {
$url = G5_BBS_URL. '/'.$folder.'.php';
$url .= $query_string;
}
} else {
$url = G5_BBS_URL. '/'.$folder.'.php';
if($no) {
$url .= ($folder === 'content') ? '?co_id='. $no : '?'. $no;
}
$url .= ($folder === 'content') ? '?co_id='. $no : '?'. $no;
}
if($query_string) {
$url .= ($no ? '?' : '&'). $query_string;
}
}
}
}
$segments[0] = $url;
}
}
return implode('/', $segments).$add_query;
return implode('/', $segments).$add_query;
}
function short_url_clean($string_url, $add_qry=''){
@ -110,7 +110,7 @@ function short_url_clean($string_url, $add_qry=''){
$string_url = str_replace('&', '&', $string_url);
$url=parse_url($string_url);
$page_name = basename($url['path'],".php");
$array_page_names = run_replace('url_clean_page_names', array('board', 'write', 'content'));
if( stripos(preg_replace('/^https?:/i', '', $string_url), preg_replace('/^https?:/i', '', G5_BBS_URL)) === false || ! in_array($page_name, $array_page_names) ){ //게시판이 아니면 리턴
@ -119,19 +119,19 @@ function short_url_clean($string_url, $add_qry=''){
$return_url = '';
parse_str($url['query'], $vars);
/*
/*
// 예) Array ( [scheme] => http [host] => sir.kr [path] => /bbs/board.php [query] => wr_id=1110870&bo_table=cm_free&cpage=1 [fragment] => c_1110946 )
foreach($vars as $k => $v) { $page_name .= "/".$v; }
*/
foreach($vars as $k => $v) { $page_name .= "/".$v; }
*/
if( $page_name === 'write' ){
$vars['action'] = 'write';
$allow_param_keys = array('bo_table'=>'', 'action'=>'');
} else if( $page_name === 'content' ){
$vars['action'] = 'content';
$allow_param_keys = array('action'=>'', 'co_id'=>'');
} else {
$vars['action'] = 'content';
$allow_param_keys = array('action'=>'', 'co_id'=>'');
} else {
$allow_param_keys = array('bo_table'=>'', 'wr_id'=>'');
}
@ -145,7 +145,7 @@ function short_url_clean($string_url, $add_qry=''){
if( $config['cf_bbs_rewrite'] > 1 && $page_name === 'board' && (isset($s['wr_id']) && $s['wr_id']) && (isset($s['bo_table']) && $s['bo_table']) ){
$get_write = get_write( get_write_table_name($s['bo_table']), $s['wr_id'], true);
if( $get_write['wr_seo_title'] ){
unset($s['wr_id']);
$s['wr_seo_title'] = urlencode($get_write['wr_seo_title']).'/';
@ -175,8 +175,8 @@ function short_url_clean($string_url, $add_qry=''){
if( $add_qry ){
$add_param .= $add_param ? '&'.$add_qry : '?'.$add_qry;
}
foreach($s as $k => $v) { $return_url .= '/'.$v; }
foreach($s as $k => $v) { $return_url .= '/'.$v; }
return $host.$return_url.$add_param.$fragment;
}