url 관련 코드 수정

This commit is contained in:
thisgun
2018-10-24 11:05:48 +09:00
parent 7f22566ecd
commit eca24d196e
2 changed files with 29 additions and 2 deletions
+13
View File
@@ -4,6 +4,7 @@ if (!defined('_GNUBOARD_')) exit;
Class G5_object_store {
public $writes = array();
public $contents = array();
public $etcs = array();
function get($type, $key, $group ='default') {
@@ -14,6 +15,9 @@ Class G5_object_store {
case 'content' :
$datas = $this->contents;
break;
default :
$datas = $this->etcs;
break;
}
if( $this->exists($type, $key, $group) ){
@@ -37,6 +41,9 @@ Class G5_object_store {
case 'content':
$datas = $this->contents;
break;
default :
$datas = $this->etcs;
break;
}
return isset($datas[$group]) && ( isset($datas[$group][$key]) || array_key_exists($key, $datas[$group]) );
@@ -53,6 +60,9 @@ Class G5_object_store {
case 'content':
$this->contents[$group][$key] = $data;
break;
default :
$datas = $this->etcs[$group][$key] = $data;
break;
}
}
@@ -65,6 +75,9 @@ Class G5_object_store {
case 'content':
$datas = $this->contents;
break;
default :
$datas = $this->etcs;
break;
}
if ( ! $this->exists('bbs', $key, $group) )
+16 -2
View File
@@ -13,6 +13,10 @@ function get_pretty_url($folder, $no='', $query_string='', $action='')
$segments = array();
$url = $add_query = '';
if( $url = apply_replace('get_pretty_url', $url, $folder, $no, $query_string, $action) ){
return $url;
}
// use shortten url
if($config['cf_bbs_rewrite']) {
@@ -286,7 +290,7 @@ function seo_title_update($db_table, $pk_id, $type='bbs'){
function get_nginx_conf_rules($return_string=false){
$get_path_url = parse_url( G5_URL );
$get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'].'/' : '/';
@@ -294,6 +298,11 @@ function get_nginx_conf_rules($return_string=false){
$rules[] = '#### '.G5_VERSION.' url rules BOF #####';
$rules[] = 'if (!-e $request_filename){';
if( $add_rules = apply_replace('add_nginx_conf_rules', '', $get_path_url, $base_path, $return_string) ){
$rules[] = $add_rules;
}
$rules[] = "rewrite ^{$base_path}content/([0-9a-zA-Z_]+)$ {$base_path}bbs/content.php?co_id=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}content/([^/]+)/$ {$base_path}bbs/content.php?co_seo_title=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}rss/([0-9a-zA-Z_]+)$ {$base_path}bbs/rss.php?bo_table=$1 break;";
@@ -309,7 +318,7 @@ function get_nginx_conf_rules($return_string=false){
function get_mod_rewrite_rules($return_string=false){
$get_path_url = parse_url( G5_URL );
$get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'].'/' : '/';
@@ -321,6 +330,11 @@ function get_mod_rewrite_rules($return_string=false){
$rules[] = 'RewriteBase '.$base_path;
$rules[] = 'RewriteCond %{REQUEST_FILENAME} !-f';
$rules[] = 'RewriteCond %{REQUEST_FILENAME} !-d';
if( $add_rules = apply_replace('add_mod_rewrite_rules', '', $get_path_url, $base_path, $return_string) ){
$rules[] = $add_rules;
}
$rules[] = 'RewriteRule ^content/([0-9a-zA-Z_]+)$ '.G5_BBS_DIR.'/content.php?co_id=$1&rewrite=1 [L]';
$rules[] = 'RewriteRule ^content/([^/]+)/$ '.G5_BBS_DIR.'/content.php?co_seo_title=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^rss/([0-9a-zA-Z_]+)$ '.G5_BBS_DIR.'/rss.php?bo_table=$1 [L]';