diff --git a/bbs/current_connect.php b/bbs/current_connect.php index 68c49e0c3..6ea8b5e93 100644 --- a/bbs/current_connect.php +++ b/bbs/current_connect.php @@ -28,7 +28,6 @@ for ($i=0; $row=sql_fetch_array($result); $i++) { echo ''; -$connect_skin_path = $g4['path'].'/skin/connect/'.$config['cf_connect_skin']; include_once($connect_skin_path.'/current_connect.skin.php'); include_once('./_tail.php'); diff --git a/bbs/formmail.php b/bbs/formmail.php index bd64f8e2b..a60774823 100644 --- a/bbs/formmail.php +++ b/bbs/formmail.php @@ -37,7 +37,6 @@ if (!isset($type)) $type_checked[0] = $type_checked[1] = $type_checked[2] = ""; $type_checked[$type] = 'checked'; -$member_skin_path = $g4['path'].'/skin/member/'.$config[cf_member_skin]; include_once($member_skin_path.'/formmail.skin.php'); include_once($g4['path'].'/tail.sub.php'); diff --git a/bbs/login.php b/bbs/login.php index d71bc4533..f21bc5f08 100644 --- a/bbs/login.php +++ b/bbs/login.php @@ -48,8 +48,6 @@ if ($g4['https_url']) else $login_action_url = "{$g4['bbs_url']}/login_check.php"; -$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; - include_once($member_skin_path.'/login.skin.php'); include_once('./_tail.php'); diff --git a/bbs/login_check.php b/bbs/login_check.php index 74bfe7176..03c48b921 100644 --- a/bbs/login_check.php +++ b/bbs/login_check.php @@ -43,7 +43,6 @@ if ($mb['mb_leave_date'] && $mb['mb_leave_date'] <= date("Ymd", $g4['server_time if ($config['cf_use_email_certify'] && !preg_match("/[1-9]/", $mb['mb_email_certify'])) alert('메일인증을 받으셔야 로그인 하실 수 있습니다.\n회원님의 메일주소는 '.$mb['mb_email'].' 입니다.'); -$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; @include_once($member_skin_path.'/login_check.skin.php'); // 회원아이디 세션 생성 diff --git a/bbs/member_confirm.php b/bbs/member_confirm.php index 7a0dffe57..2d2d43c00 100644 --- a/bbs/member_confirm.php +++ b/bbs/member_confirm.php @@ -14,7 +14,6 @@ else $g4['title'] = '회원 패스워드 확인'; include_once('./_head.php'); -$member_skin_path = $g4['path'].'/skin/member/'.$config[cf_member_skin]; include_once($member_skin_path.'/member_confirm.skin.php'); include_once('./_tail.php'); diff --git a/bbs/memo.php b/bbs/memo.php index 0c9951fff..12d81558c 100644 --- a/bbs/memo.php +++ b/bbs/memo.php @@ -76,10 +76,6 @@ for ($i=0; $row=sql_fetch_array($result); $i++) echo ''; -if (G4_IS_MOBILE) - $member_skin_path = $g4['mobile_path'].'/skin/member/'.$config[cf_member_skin]; -else - $member_skin_path = $g4['path'].'/skin/member/'.$config[cf_member_skin]; include_once($member_skin_path.'/memo.skin.php'); include_once($g4['path'].'/tail.sub.php'); diff --git a/bbs/memo_form.php b/bbs/memo_form.php index 58c2ef0a0..a790f49f6 100644 --- a/bbs/memo_form.php +++ b/bbs/memo_form.php @@ -40,10 +40,6 @@ if ($g4['https_url']) else $memo_action_url = "{$g4['url']}/{$g4['bbs']}/memo_form_update.php"; -if (G4_IS_MOBILE) - $member_skin_path = $g4['mobile_path'].'/skin/member/'.$config[cf_member_skin]; -else - $member_skin_path = $g4['path'].'/skin/member/'.$config[cf_member_skin]; include_once($member_skin_path.'/memo_form.skin.php'); include_once($g4['path'].'/tail.sub.php'); diff --git a/bbs/memo_view.php b/bbs/memo_view.php index 6ea1a6c34..e518ae357 100644 --- a/bbs/memo_view.php +++ b/bbs/memo_view.php @@ -63,7 +63,6 @@ $mb = get_member($memo['me_'.$unkind.'_mb_id']); echo ''; -$member_skin_path = $g4['path'].'/skin/member/'.$config[cf_member_skin]; include_once($member_skin_path.'/memo_view.skin.php'); include_once($g4['path'].'/tail.sub.php'); diff --git a/bbs/new.php b/bbs/new.php index c24ba1a25..c743a09c9 100644 --- a/bbs/new.php +++ b/bbs/new.php @@ -105,8 +105,6 @@ for ($i=0; $row=sql_fetch_array($result); $i++) { $write_pages = get_paging($config['cf_write_pages'], $page, $total_page, "?gr_id=$gr_id&view=$view&mb_id=$mb_id&page="); -$new_skin_path = $g4['path'].'/skin/new/'.$config['cf_new_skin']; - echo ''.PHP_EOL; include_once($new_skin_path.'/new.skin.php'); diff --git a/bbs/password.php b/bbs/password.php index e83083cf8..9cc27cf5c 100644 --- a/bbs/password.php +++ b/bbs/password.php @@ -29,8 +29,6 @@ include_once($g4['path'].'/head.sub.php'); if ($board['bo_include_head']) { @include ($board['bo_include_head']); } if ($board['bo_content_head']) { echo stripslashes($board['bo_content_head']); } -$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; - include_once($member_skin_path.'/password.skin.php'); if ($board['bo_content_tail']) { echo stripslashes($board['bo_content_tail']); } diff --git a/bbs/password_lost.php b/bbs/password_lost.php index 2be67f14a..7239b6bc7 100644 --- a/bbs/password_lost.php +++ b/bbs/password_lost.php @@ -14,7 +14,6 @@ if ($g4['https_url']) else $action_url = "{$g4['bbs_url']}/password_lost2.php"; -$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; include_once($member_skin_path.'/password_lost.skin.php'); include_once($g4['path'].'/tail.sub.php'); diff --git a/bbs/poll_result.php b/bbs/poll_result.php index b1f9a1434..c593c301e 100644 --- a/bbs/poll_result.php +++ b/bbs/poll_result.php @@ -84,8 +84,6 @@ include_once($g4['path'].'/head.sub.php'); echo ''; -$skin_dir = isset($_GET['skin_dir']) ? $_GET['skin_dir'] : 'basic'; -$poll_skin_path = $g4['path'].'/skin/poll/'.$skin_dir; if (!file_exists($poll_skin_path.'/poll_result.skin.php')) die('skin error'); include_once ($poll_skin_path.'/poll_result.skin.php'); diff --git a/bbs/profile.php b/bbs/profile.php index 51bb95532..ffe877fba 100644 --- a/bbs/profile.php +++ b/bbs/profile.php @@ -29,7 +29,6 @@ $mb_profile = $mb[mb_profile] ? conv_content($mb[mb_profile],0) : '소개 내용 echo ''; -$member_skin_path = $g4['path'].'/skin/member/'.$config[cf_member_skin]; include_once($member_skin_path.'/profile.skin.php'); include_once($g4['path'].'/tail.sub.php'); diff --git a/bbs/register.php b/bbs/register.php index 20fd67812..aa33b0b31 100644 --- a/bbs/register.php +++ b/bbs/register.php @@ -9,8 +9,6 @@ if ($is_member) { // 세션을 지웁니다. set_session("ss_mb_reg", ""); -$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; - if ($g4['https_url']) { $register_action_url = $g4['https_url'].'/'.$g4['bbs'].'/register_form.php'; } else { diff --git a/bbs/register_form.php b/bbs/register_form.php index 7b3162810..980178e98 100644 --- a/bbs/register_form.php +++ b/bbs/register_form.php @@ -104,7 +104,6 @@ $captcha_html = captcha_html(); // 회원아이콘 경로 $mb_icon = $g4['path'].'/data/member/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif'; -$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; include_once('./_head.php'); diff --git a/bbs/register_result.php b/bbs/register_result.php index 8825ea470..7ecece748 100644 --- a/bbs/register_result.php +++ b/bbs/register_result.php @@ -8,8 +8,6 @@ if (isset($_SESSION['ss_mb_reg'])) if (!$mb['mb_id']) goto_url($g4['path']); -$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; - $g4['title'] = '회원가입이 완료되었습니다.'; include_once('./_head.php'); include_once($member_skin_path.'/register_result.skin.php'); diff --git a/bbs/scrap.php b/bbs/scrap.php index 4fc239807..04614e9f8 100644 --- a/bbs/scrap.php +++ b/bbs/scrap.php @@ -28,8 +28,8 @@ $sql = " select * $sql_order limit $from_record, $rows "; $result = sql_query($sql); -for ($i=0; $row=sql_fetch_array($result); $i++) -{ +for ($i=0; $row=sql_fetch_array($result); $i++) { + $list[$i] = $row; // 순차적인 번호 (순번) @@ -56,7 +56,6 @@ for ($i=0; $row=sql_fetch_array($result); $i++) $list[$i]['del_href'] = './scrap_delete.php?ms_id='.$row['ms_id'].'&page='.$page; } -$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; include_once($member_skin_path.'/scrap.skin.php'); include_once($g4['path'].'/tail.sub.php'); diff --git a/bbs/scrap_popin.php b/bbs/scrap_popin.php index 1fdc816a2..9b04edb85 100644 --- a/bbs/scrap_popin.php +++ b/bbs/scrap_popin.php @@ -3,7 +3,7 @@ include_once('./_common.php'); include_once($g4['path'].'/head.sub.php'); -if (!$is_member) { +if ($is_guest) { $href = './login.php?'.$qstr.'&url='.urlencode('./board.php?bo_table='.$bo_table.'&wr_id='.$wr_id); echo << @@ -53,7 +53,6 @@ HEREDOC; exit; } -$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; include_once($member_skin_path.'/scrap_popin.skin.php'); include_once($g4['path'].'/tail.sub.php'); diff --git a/bbs/search.php b/bbs/search.php index 7c7055f2e..503917719 100644 --- a/bbs/search.php +++ b/bbs/search.php @@ -225,7 +225,6 @@ $group_select .= ''; if (!$sfl) $sfl = 'wr_subject'; if (!$sop) $sop = 'or'; -$search_skin_path = $g4['path'].'/skin/search/'.$config['cf_search_skin']; include_once($search_skin_path.'/search.skin.php'); include_once('./_tail.php'); diff --git a/bbs/zip.php b/bbs/zip.php index 6bd6d9618..28cfd42dd 100644 --- a/bbs/zip.php +++ b/bbs/zip.php @@ -65,7 +65,6 @@ if ($addr1) $g4['title'] = '우편번호 검색'; include_once($g4['path'].'/head.sub.php'); -$member_skin_path = $g4['path'].'/skin/member/'.$config[cf_member_skin]; include_once($member_skin_path.'/zip.skin.php'); include_once($g4['path'].'/tail.sub.php'); diff --git a/common.php b/common.php index 6054c9df2..6b7f4886d 100644 --- a/common.php +++ b/common.php @@ -204,7 +204,7 @@ $g4['url'] = preg_replace("/\/$/", "", $g4['url']); //============================================================================== // 공통 -//============================================================================== +//------------------------------------------------------------------------------ $dirname = dirname(__FILE__).'/'; $dbconfig_file = 'data/dbconfig.php'; if (file_exists($g4['path'].'/'.$dbconfig_file)) { @@ -218,9 +218,9 @@ if (file_exists($g4['path'].'/'.$dbconfig_file)) { exit; } -//------------------------------------------- +//============================================================================== // SESSION 설정 -//------------------------------------------- +//------------------------------------------------------------------------------ ini_set("session.use_trans_sid", 0); // PHPSESSID를 자동으로 넘기지 않음 ini_set("url_rewriter.tags",""); // 링크에 PHPSESSID가 따라다니는것을 무력화함 (해뜰녘님께서 알려주셨습니다.) @@ -230,6 +230,7 @@ if (isset($SESSION_CACHE_LIMITER)) @session_cache_limiter($SESSION_CACHE_LIMITER); else @session_cache_limiter("no-cache, must-revalidate"); +//============================================================================== //============================================================================== @@ -501,14 +502,21 @@ if ($is_admin != 'super') { } } + +//============================================================================== // 스킨경로 -$board_skin_path = ""; -if (isset($board['bo_skin'])) { - if (G4_IS_MOBILE) - $board_skin_path = $g4['mobile_path'].'/skin/board/'.$board['bo_skin']; // 게시판 스킨 경로 - else - $board_skin_path = $g4['path'].'/skin/board/'.$board['bo_skin']; // 게시판 스킨 경로 -} +//------------------------------------------------------------------------------ +$skin_path = skin_path(); +$board_skin_path = $skin_path.'/board/'.$board['bo_skin']; +$member_skin_path = $skin_path.'/member/'.$config['cf_member_skin']; +$new_skin_path = $skin_path.'/new/'.$config['cf_new_skin']; +$search_skin_path = $skin_path.'/search/'.$config['cf_search_skin']; +$connect_skin_path = $skin_path.'/connect/'.$config['cf_connect_skin']; +$poll_skin_path = $skin_path.'/poll/basic'; +if (isset($_GET['skin_dir'])) + $poll_skin_path = $skin_path.'/poll/'.$_GET['skin_dir']; +//============================================================================== + // 방문자수의 접속을 남김 include_once($g4['bbs_path'].'/visit_insert.inc.php'); diff --git a/lib/common.lib.php b/lib/common.lib.php index 1dc61db0f..6cd500cf8 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1627,4 +1627,14 @@ function get_selected($field, $value, $first=false) $selected = ($field=="") ? ' selected="selected"' : ''; return $selected; } + + +function skin_path() +{ + global $g4; + $skin_dir = 'skin'; + $skin_path = $g4['path'].'/'.$skin_dir; + if (G4_IS_MOBILE) $skin_path = $g4['mobile_path'].'/'.$skin_dir; + return $skin_path; +} ?> \ No newline at end of file diff --git a/lib/connect.lib.php b/lib/connect.lib.php index 72a495766..033560dc4 100644 --- a/lib/connect.lib.php +++ b/lib/connect.lib.php @@ -10,10 +10,9 @@ function connect($skin_dir='') $sql = " select sum(IF(mb_id<>'',1,0)) as mb_cnt, count(*) as total_cnt from {$g4['login_table']} where mb_id <> '{$config['cf_admin']}' "; $row = sql_fetch($sql); - if ($skin_dir) - $connect_skin_path = $g4['path'].'/skin/connect/'.$skin_dir; - else - $connect_skin_path = $g4['path'].'/skin/connect/'.$config['cf_connect_skin']; + if (!$skin_dir) + $skin_dir = $config['cf_connect_skin']; + $connect_skin_path = skin_path().'/connect/'.$skin_dir; ob_start(); include_once ($connect_skin_path.'/connect.skin.php'); diff --git a/lib/latest.lib.php b/lib/latest.lib.php index f03bf3184..e312a1d2c 100644 --- a/lib/latest.lib.php +++ b/lib/latest.lib.php @@ -6,10 +6,9 @@ function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $options='') { global $g4; - if ($skin_dir) - $latest_skin_path = $g4['path'].'/skin/latest/'.$skin_dir; - else - $latest_skin_path = $g4['path'].'/skin/latest/basic'; + if (!$skin_dir) + $skin_dir = 'basic'; + $latest_skin_path = skin_path().'/latest/'.$skin_dir; $list = array(); diff --git a/lib/outlogin.lib.php b/lib/outlogin.lib.php index e6ff92be9..784a1763c 100644 --- a/lib/outlogin.lib.php +++ b/lib/outlogin.lib.php @@ -13,7 +13,7 @@ function outlogin($skin_dir='basic') $point = number_format($member['mb_point']); } - $outlogin_skin_path = $g4['path'].'/skin/outlogin/'.$skin_dir; + $outlogin_skin_path = skin_path().'/outlogin/'.$skin_dir; // 읽지 않은 쪽지가 있다면 if ($is_member) { diff --git a/lib/poll.lib.php b/lib/poll.lib.php index d8029f21d..b3a10110d 100644 --- a/lib/poll.lib.php +++ b/lib/poll.lib.php @@ -14,7 +14,7 @@ function poll($skin_dir='basic', $po_id=false) } ob_start(); - $poll_skin_path = $g4['path'].'/skin/poll/'.$skin_dir; + $poll_skin_path = skin_path().'/poll/'.$skin_dir; include_once ($poll_skin_path.'/poll.skin.php'); $content = ob_get_contents(); ob_end_clean(); diff --git a/lib/popular.lib.php b/lib/popular.lib.php index f024632cb..4e1143cf3 100644 --- a/lib/popular.lib.php +++ b/lib/popular.lib.php @@ -26,7 +26,7 @@ function popular($skin_dir='basic', $pop_cnt=7, $date_cnt=3) } ob_start(); - $popular_skin_path = $g4['path'].'/skin/popular/'.$skin_dir; + $popular_skin_path = skin_path().'/popular/'.$skin_dir; include_once ($popular_skin_path.'/popular.skin.php'); $content = ob_get_contents(); ob_end_clean(); diff --git a/lib/visit.lib.php b/lib/visit.lib.php index 6ece28d52..a9222e615 100644 --- a/lib/visit.lib.php +++ b/lib/visit.lib.php @@ -19,7 +19,7 @@ function visit($skin_dir='basic') settype($visit[3], "integer"); ob_start(); - $visit_skin_path = $g4['path'].'/skin/visit/'.$skin_dir; + $visit_skin_path = skin_path().'/visit/'.$skin_dir; include_once ($visit_skin_path.'/visit.skin.php'); $content = ob_get_contents(); ob_end_clean();