Merge branch 'g54_theme2' of https://github.com/gnuboard/g5 into g54_theme2

This commit is contained in:
thisgun
2019-01-04 11:55:44 +09:00
400 changed files with 23512 additions and 8373 deletions
+100
View File
@@ -0,0 +1,100 @@
<?php
if (!defined('_GNUBOARD_')) exit;
$is_apache = (stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false);
$is_nginx = (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false);
$is_iis = !$is_apache && (stripos($_SERVER['SERVER_SOFTWARE'], 'microsoft-iis') !== false);
$is_write_file = false;
if ( $is_nginx ){
$is_write_file = false;
} else if ( $is_apache && ((!file_exists(G5_PATH.'/.htaccess') && is_writable($home_path)) || is_writable(G5_PATH.'/.htaccess')) ){
$is_write_file = true;
}
$get_path_url = parse_url( G5_URL );
$base_path = isset($get_path_url['path']) ? $get_path_url['path'].'/' : '/';
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_JS_URL.'/remodal/remodal.css">', 11);
add_stylesheet('<link rel="stylesheet" href="'.G5_JS_URL.'/remodal/remodal-default-theme.css">', 12);
add_javascript('<script src="'.G5_JS_URL.'/remodal/remodal.js"></script>', 10);
?>
<section id="anc_cf_url">
<h2 class="h2_frm">짧은 주소 설정</h2>
<?php echo $pg_anchor ?>
<div class="local_desc02 local_desc">
<p>
게시판과 컨텐츠 페이지에 짧은 URL 을 사용합니다.
<?php if( ! $is_write_file && check_need_rewrite_rules() ) { // apache인 경우 ?>
<br>짧은 주소 사용시 아래 Apache 설정 코드를 참고하여 설정해 주세요.
<?php } ?>
</p>
</div>
<div class="server_config_views">
<?php if ( $is_apache ){ ?>
<button type="button" data-remodal-target="modal_apache" class="btn btn_03">Apache 설정 코드 보기</button>
<?php } else if ( $is_nginx ) { ?>
<button type="button" data-remodal-target="modal_nginx" class="btn btn_03">Nginx 설정 코드 보기</button>
<?php } ?>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>짧은주소 설정</caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<?php
$short_url_arrs = array(
'0'=>array('label'=>'사용안함', 'url'=>G5_URL.'/board.php?bo_table=free&wr_id=123'),
'1'=>array('label'=>'숫자', 'url'=>G5_URL.'/free/123'),
'2'=>array('label'=>'글 이름', 'url'=>G5_URL.'/free/안녕하세요/'),
);
foreach($short_url_arrs as $k=>$v){
$checked = ((int) $config['cf_bbs_rewrite'] === (int) $k) ? 'checked' : '';
?>
<tr>
<td><input name="cf_bbs_rewrite" id="cf_bbs_rewrite_<?php echo $k; ?>" type="radio" value="<?php echo $k; ?>" <?php echo $checked;?> ><label for="cf_bbs_rewrite_<?php echo $k; ?>" class="rules_label"><?php echo $v['label']; ?></label></td>
<td><?php echo $v['url']; ?></td>
</tr>
<?php } //end foreach ?>
</tbody>
</table>
</div>
<div class="server_rewrite_info">
<div class="is_rewrite remodal" data-remodal-id="modal_apache" role="dialog" aria-labelledby="modalApache" aria-describedby="modal1Desc">
<button type="button" class="connect-close" data-remodal-action="close">
<i class="fa fa-close"></i>
<span class="txt">닫기</span>
</button>
<h4 class="copy_title">.htaccess 파일에 적용할 코드입니다.
<?php if( ! $is_write_file ) { ?>
<br>자동으로 .htaccess 파일을 수정 할수 있는 권한이 없습니다.<br>.htaccess 파일이 없다면 생성 후에, 아래 코드가 없으면 코드를 복사하여 붙여넣기 해 주세요.
<?php } ?>
</h4>
<textarea readonly="readonly" rows="10"><?php echo get_mod_rewrite_rules(true); ?></textarea>
</div>
<div class="is_rewrite remodal" data-remodal-id="modal_nginx" role="dialog" aria-labelledby="modalNginx" aria-describedby="modal2Desc">
<button type="button" class="connect-close" data-remodal-action="close">
<i class="fa fa-close"></i>
<span class="txt">닫기</span>
</button>
<h4 class="copy_title">아래 코드를 복사하여 nginx 설정 파일에 적용해 주세요.</h4>
<textarea readonly="readonly" rows="10"><?php echo get_nginx_conf_rules(true); ?></textarea>
</div>
</div>
</section>
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
if (!defined('_GNUBOARD_')) exit;
$begin_time = get_microtime();
$g5_debug['php']['begin_time'] = $begin_time = get_microtime();
$files = glob(G5_ADMIN_PATH.'/css/admin_extend_*');
if (is_array($files)) {
@@ -101,7 +101,7 @@ function imageview(id, w, h)
<h1><?php echo $config['cf_title'] ?></h1>
<div id="hd_top">
<button type="button" id="btn_gnb" class="btn_gnb_close <?php echo $adm_menu_cookie['btn_gnb'];?>">메뉴</button>
<div id="logo"><a href="<?php echo G5_ADMIN_URL ?>"><img src="<?php echo G5_ADMIN_URL ?>/img/logo.png" alt="<?php echo $config['cf_title'] ?> 관리자"></a></div>
<div id="logo"><a href="<?php echo correct_goto_url(G5_ADMIN_URL); ?>"><img src="<?php echo G5_ADMIN_URL ?>/img/logo.png" alt="<?php echo $config['cf_title'] ?> 관리자"></a></div>
<div id="tnb">
<ul>
+1 -1
View File
@@ -448,7 +448,7 @@ function admin_check_xss_params($params){
// 접근 권한 검사
if (!$member['mb_id'])
{
alert('로그인 하십시오.', G5_BBS_URL.'/login.php?url=' . urlencode(G5_ADMIN_URL));
alert('로그인 하십시오.', G5_BBS_URL.'/login.php?url=' . urlencode(correct_goto_url(G5_ADMIN_URL)));
}
else if ($is_admin != 'super')
{
+2 -2
View File
@@ -185,7 +185,7 @@ $pg_anchor = '<ul class="anchor">
<?php if ($w == '') { ?>
영문자, 숫자, _ 만 가능 (공백없이 20자 이내)
<?php } else { ?>
<a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $board['bo_table'] ?>" class="btn_frmline">게시판 바로가기</a>
<a href="<?php echo get_pretty_url($board['bo_table']) ?>" class="btn_frmline">게시판 바로가기</a>
<a href="./board_list.php?<?php echo $qstr;?>" class="btn_frmline">목록으로</a>
<?php } ?>
</td>
@@ -1261,7 +1261,7 @@ $pg_anchor = '<ul class="anchor">
<div class="btn_fixed_top">
<?php if( $bo_table && $w ){ ?>
<a href="./board_copy.php?bo_table=<?php echo $board['bo_table']; ?>" id="board_copy" target="win_board_copy" class=" btn_02 btn">게시판복사</a>
<a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $board['bo_table']; ?>" class=" btn_02 btn">게시판 바로가기</a>
<a href="<?php echo get_pretty_url($board['bo_table']); ?>" class=" btn_02 btn">게시판 바로가기</a>
<a href="./board_thumbnail_delete.php?bo_table=<?php echo $board['bo_table'].'&amp;'.$qstr;?>" onclick="return delete_confirm2('게시판 썸네일 파일을 삭제하시겠습니까?');" class="btn_02 btn">게시판 썸네일 삭제</a>
<?php } ?>
<input type="submit" value="확인" class="btn_submi btn btn_01" accesskey="s">
+4
View File
@@ -189,6 +189,8 @@ if ($w == '') {
// 게시판 테이블 생성
$file = file('./sql_write.sql');
$file = get_db_create_replace($file);
$sql = implode($file, "\n");
$create_table = $g5['write_prefix'] . $bo_table;
@@ -441,5 +443,7 @@ delete_cache_latest($bo_table);
if(function_exists('get_admin_captcha_by'))
get_admin_captcha_by('remove');
start_event('admin_board_form_update', $bo_table, $w);
goto_url("./board_form.php?w=u&bo_table={$bo_table}&amp;{$qstr}");
?>
+1 -1
View File
@@ -131,7 +131,7 @@ $colspan = 15;
</td>
<td>
<input type="hidden" name="board_table[<?php echo $i ?>]" value="<?php echo $row['bo_table'] ?>">
<a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $row['bo_table'] ?>"><?php echo $row['bo_table'] ?></a>
<a href="<?php echo get_pretty_url($row['bo_table']) ?>"><?php echo $row['bo_table'] ?></a>
</td>
<td>
<label for="bo_skin_<?php echo $i; ?>" class="sound_only">스킨</label>
+1 -1
View File
@@ -127,7 +127,7 @@ $colspan = 10;
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo $row['gr_subject'] ?> 그룹</label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td class="td_left"><a href="<?php echo G5_BBS_URL ?>/group.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo $row['gr_id'] ?></a></td>
<td class="td_left"><a href="<?php echo get_pretty_url(G5_GROUP_DIR, $row['gr_id']); ?>"><?php echo $row['gr_id'] ?></a></td>
<td class="td_input">
<label for="gr_subject_<?php echo $i; ?>" class="sound_only">그룹제목</label>
<input type="text" name="gr_subject[<?php echo $i ?>]" value="<?php echo get_text($row['gr_subject']) ?>" id="gr_subject_<?php echo $i ?>" class="tbl_input">
+1 -1
View File
@@ -85,7 +85,7 @@ $colspan = 4;
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo $row['gr_subject'] ?> 그룹</label>
<input type="checkbox" name="chk[]" value="<?php echo $row['gm_id'] ?>" id="chk_<?php echo $i ?>">
</td>
<td class="td_grid"><a href="<?php echo G5_BBS_URL; ?>/group.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo $row['gr_id'] ?></a></td>
<td class="td_grid"><a href="<?php echo get_pretty_url(G5_GROUP_DIR, $row['gr_id']); ?>"><?php echo $row['gr_id'] ?></a></td>
<td class="td_category"><?php echo $row['gr_subject'] ?></td>
<td class="td_datetime"><?php echo $row['gm_datetime'] ?></td>
</tr>
+1 -1
View File
@@ -3,7 +3,7 @@ $sub_menu = "100510";
include_once('./_common.php');
if(!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE))
alert('사용할 수 없는 기능입니다.', G5_ADMIN_URL);
alert('사용할 수 없는 기능입니다.', correct_goto_url(G5_ADMIN_URL));
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
+1 -1
View File
@@ -3,7 +3,7 @@ $sub_menu = "100520";
include_once('./_common.php');
if(!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE))
alert('사용할 수 없는 기능입니다.', G5_ADMIN_URL);
alert('사용할 수 없는 기능입니다.', correct_goto_url(G5_ADMIN_URL));
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
+22
View File
@@ -253,6 +253,24 @@ if(!sql_query(" DESC {$g5['social_profile_table']} ", false)) {
) ", true);
}
// 짧은 URL 주소를 사용 여부 필드 추가
if (!isset($config['cf_bbs_rewrite'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}`
ADD `cf_bbs_rewrite` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_link_target` ", true);
}
// 읽지 않은 메모 수 칼럼 추가
if(!isset($member['mb_memo_cnt'])) {
sql_query(" ALTER TABLE `{$g5['member_table']}`
ADD `mb_memo_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_call`", true);
}
// 스크랩 읽은 수 추가
if(!isset($member['mb_scrap_cnt'])) {
sql_query(" ALTER TABLE `{$g5['member_table']}`
ADD `mb_scrap_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_cnt`", true);
}
if(!$config['cf_faq_skin']) $config['cf_faq_skin'] = "basic";
if(!$config['cf_mobile_faq_skin']) $config['cf_mobile_faq_skin'] = "basic";
@@ -264,6 +282,7 @@ $pg_anchor = '<ul class="anchor">
<li><a href="#anc_cf_board">게시판기본</a></li>
<li><a href="#anc_cf_join">회원가입</a></li>
<li><a href="#anc_cf_cert">본인확인</a></li>
<li><a href="#anc_cf_url">짧은주소</a></li>
<li><a href="#anc_cf_mail">기본메일환경</a></li>
<li><a href="#anc_cf_article_mail">글작성메일</a></li>
<li><a href="#anc_cf_join_mail">가입메일</a></li>
@@ -881,6 +900,9 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
</div>
</section>
<?php
include_once('_rewrite_config_form.php');
?>
<section id="anc_cf_mail">
<h2 class="h2_frm">기본 메일 환경 설정</h2>
+9
View File
@@ -61,6 +61,7 @@ $sql = " update {$g5['config_table']}
cf_add_meta = '{$_POST['cf_add_meta']}',
cf_syndi_token = '{$_POST['cf_syndi_token']}',
cf_syndi_except = '{$_POST['cf_syndi_except']}',
cf_bbs_rewrite = '{$_POST['cf_bbs_rewrite']}',
cf_member_skin = '{$_POST['cf_member_skin']}',
cf_use_homepage = '{$_POST['cf_use_homepage']}',
cf_req_homepage = '{$_POST['cf_req_homepage']}',
@@ -179,5 +180,13 @@ sql_query($sql);
//sql_query(" OPTIMIZE TABLE `$g5[config_table]` ");
if( isset($_POST['cf_bbs_rewrite']) ){
g5_delete_all_cache();
}
start_event('admin_config_form_update');
update_rewrite_rules();
goto_url('./config_form.php', false);
?>
+1 -1
View File
@@ -77,7 +77,7 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
<td>
<?php echo help('20자 이내의 영문자, 숫자, _ 만 가능합니다.'); ?>
<input type="text" value="<?php echo $co['co_id']; ?>" name="co_id" id ="co_id" required <?php echo $readonly; ?> class="required <?php echo $readonly; ?> frm_input" size="20" maxlength="20">
<?php if ($w == 'u') { ?><a href="<?php echo G5_BBS_URL; ?>/content.php?co_id=<?php echo $co_id; ?>" class="btn_frmline">내용확인</a><?php } ?>
<?php if ($w == 'u') { ?><a href="<?php echo get_pretty_url('content', $co_id); ?>" class="btn_frmline">내용확인</a><?php } ?>
</td>
</tr>
<tr>
+5
View File
@@ -70,6 +70,8 @@ if( $co_include_tail && ! is_include_path_check($co_include_tail, 1) ){
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
}
$co_seo_title = exist_seo_title_recursive('content', generate_seo_title($co_subject), $g5['content_table'], $co_id);
$sql_common = " co_include_head = '$co_include_head',
co_include_tail = '$co_include_tail',
co_html = '$co_html',
@@ -77,6 +79,7 @@ $sql_common = " co_include_head = '$co_include_head',
co_subject = '$co_subject',
co_content = '$co_content',
co_mobile_content = '$co_mobile_content',
co_seo_title = '$co_seo_title',
co_skin = '$co_skin',
co_mobile_skin = '$co_mobile_skin' ";
@@ -110,6 +113,8 @@ else if ($w == "d")
if(function_exists('get_admin_captcha_by'))
get_admin_captcha_by('remove');
g5_delete_cache_by_prefix('content-'.$co_id.'-');
if ($w == "" || $w == "u")
{
if ($_FILES['co_himg']['name'])
+1 -1
View File
@@ -77,7 +77,7 @@ $result = sql_query($sql);
<td class="td_left"><?php echo htmlspecialchars2($row['co_subject']); ?></td>
<td class="td_mng td_mng_l">
<a href="./contentform.php?w=u&amp;co_id=<?php echo $row['co_id']; ?>" class="btn btn_03"><span class="sound_only"><?php echo htmlspecialchars2($row['co_subject']); ?> </span>수정</a>
<a href="<?php echo G5_BBS_URL; ?>/content.php?co_id=<?php echo $row['co_id']; ?>" class="btn btn_02"><span class="sound_only"><?php echo htmlspecialchars2($row['co_subject']); ?> </span> 보기</a>
<a href="<?php echo get_pretty_url('content', $row['co_id']); ?>" class="btn btn_02"><span class="sound_only"><?php echo htmlspecialchars2($row['co_subject']); ?> </span> 보기</a>
<a href="./contentformupdate.php?w=d&amp;co_id=<?php echo $row['co_id']; ?>" onclick="return delete_confirm(this);" class="btn btn_02"><span class="sound_only"><?php echo htmlspecialchars2($row['co_subject']); ?> </span>삭제</a>
</td>
</tr>
+12 -1
View File
@@ -27,6 +27,7 @@ a:link, a:visited {color:#000;text-decoration:none}
h2{font-size: 1.083em;font-weight: bold;margin:10px 0}
#wrapper {min-height:480px}
/* 레이아웃 */
#hd h1 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#hd_top{position:fixed;top:0;left:0;width:100%;height:50px;background:#3f51b5;z-index:1000}
@@ -512,8 +513,18 @@ td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
/* 환경설정 */
.cf_cert_hide {display:none}
.server_config_views {margin-bottom:10px}
.rules_label {margin-left:5px;vertical-align:middle}
.is_rewrite .connect-close {position:absolute;top:10px;right:10px;margin:0;padding:0;width:30px;height:30px;border:0;background:transparent;color:#383838;cursor:pointer;font-size:15px}
.is_rewrite .connect-close:hover {color:#ff5191}
.is_rewrite .connect-close .fa {margin:0 0 0 1px}
.is_rewrite .connect-close .txt {position:absolute;line-height:0;font-size:0;overflow:hidden}
.is_rewrite textarea{width:99%}
.is_rewrite .copy_title{margin-top:25px;margin-bottom:10px;font-weight:bold;text-align:left}
/* 관리권한설정 */
#add_admin fieldset {margin-top:20px}
#add_admin fieldset {margin-top:20px;overflow:auto;padding:2px 6px;line-height:1.4;resize:vertical}
/* 메일 테스트 */
+75
View File
@@ -74,6 +74,81 @@ if( isset($g5['social_profile_table']) && !sql_query(" DESC {$g5['social_profile
$is_check = true;
}
// 게시판 짧은 주소
$sql = " select bo_table from {$g5['board_table']} ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
$write_table = $g5['write_prefix'] . $row['bo_table']; // 게시판 테이블 전체이름
$sql = " SHOW COLUMNS FROM {$write_table} LIKE 'wr_seo_title' ";
$row = sql_fetch($sql);
if( !$row ){
sql_query("ALTER TABLE `{$write_table}`
ADD `wr_seo_title` varchar(200) NOT NULL DEFAULT '' AFTER `wr_content`,
ADD INDEX `wr_seo_title` (`wr_seo_title`);
", false);
$is_check = true;
}
}
// 내용 관리 짧은 주소
$sql = " SHOW COLUMNS FROM `{$g5['content_table']}` LIKE 'co_seo_title' ";
$row = sql_fetch($sql);
if( !$row ){
sql_query("ALTER TABLE `{$g5['content_table']}`
ADD `co_seo_title` varchar(200) NOT NULL DEFAULT '' AFTER `co_content`,
ADD INDEX `co_seo_title` (`co_seo_title`);
", false);
$is_check = true;
}
$sql = "select * from {$g5['content_table']} limit 100 ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
if( ! $row['co_seo_title']){
$co_seo_title = exist_seo_title_recursive('content', generate_seo_title($row['co_subject']), $g5['content_table'], $row['co_id']);
$sql = " update {$g5['content_table']}
set co_seo_title = '$co_seo_title'
where co_id = '{$row['co_id']}' ";
sql_query($sql);
}
}
// 메모 테이블
$sql = " SHOW COLUMNS FROM `{$g5['memo_table']}` LIKE 'me_send_id' ";
$row = sql_fetch($sql);
if( !$row ){
sql_query("ALTER TABLE `{$g5['memo_table']}`
ADD `me_send_id` INT(11) NOT NULL DEFAULT '0',
ADD `me_type` ENUM('send','recv') NOT NULL DEFAULT 'recv',
ADD `me_send_ip` VARCHAR(100) NOT NULL DEFAULT '',
CHANGE COLUMN `me_id` `me_id` INT(11) NOT NULL AUTO_INCREMENT;
", false);
$is_check = true;
}
// 읽지 않은 메모 수 칼럼
if(!isset($member['mb_memo_cnt'])) {
sql_query(" ALTER TABLE `{$g5['member_table']}`
ADD `mb_memo_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_call`", true);
$is_check = true;
}
$is_check = apply_replace('admin_dbupgrade', $is_check);
$db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다.<br>현재 DB 업그레이드가 완료된 상태입니다.';
?>
+3 -3
View File
@@ -212,8 +212,8 @@ $colspan = 5;
<tr>
<td class="td_category"><a href="<?php echo G5_BBS_URL ?>/new.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo cut_str($row['gr_subject'],10) ?></a></td>
<td class="td_category"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $row['bo_table'] ?>"><?php echo cut_str($row['bo_subject'],20) ?></a></td>
<td><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $row['bo_table'] ?>&amp;wr_id=<?php echo $row2['wr_id'] ?><?php echo $comment_link ?>"><?php echo $comment ?><?php echo conv_subject($row2['wr_subject'], 100) ?></a></td>
<td class="td_category"><a href="<?php echo get_pretty_url($row['bo_table']) ?>"><?php echo cut_str($row['bo_subject'],20) ?></a></td>
<td><a href="<?php echo get_pretty_url($row['bo_table'], $row2['wr_id']); ?><?php echo $comment_link ?>"><?php echo $comment ?><?php echo conv_subject($row2['wr_subject'], 100) ?></a></td>
<td class="td_mbname"><div><?php echo $name ?></div></td>
<td class="td_datetime"><?php echo $datetime ?></td>
</tr>
@@ -283,7 +283,7 @@ $colspan = 7;
$link1 = $link2 = "";
if (!preg_match("/^\@/", $row['po_rel_table']) && $row['po_rel_table'])
{
$link1 = '<a href="'.G5_BBS_URL.'/board.php?bo_table='.$row['po_rel_table'].'&amp;wr_id='.$row['po_rel_id'].'" target="_blank">';
$link1 = '<a href="'.get_pretty_url($row['po_rel_table'], $row['po_rel_id']).'" target="_blank">';
$link2 = '</a>';
}
?>
+4 -4
View File
@@ -240,9 +240,9 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<input type="file" name="mb_icon" id="mb_icon">
<?php
$mb_dir = substr($mb['mb_id'],0,2);
$icon_file = G5_DATA_PATH.'/member/'.$mb_dir.'/'.$mb['mb_id'].'.gif';
$icon_file = G5_DATA_PATH.'/member/'.$mb_dir.'/'.get_mb_icon_name($mb['mb_id']).'.gif';
if (file_exists($icon_file)) {
$icon_url = G5_DATA_URL.'/member/'.$mb_dir.'/'.$mb['mb_id'].'.gif';
$icon_url = str_replace(G5_DATA_PATH, G5_DATA_URL, $icon_file);
echo '<img src="'.$icon_url.'" alt="">';
echo '<input type="checkbox" id="del_mb_icon" name="del_mb_icon" value="1">삭제';
}
@@ -256,9 +256,9 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<input type="file" name="mb_img" id="mb_img">
<?php
$mb_dir = substr($mb['mb_id'],0,2);
$icon_file = G5_DATA_PATH.'/member_image/'.$mb_dir.'/'.$mb['mb_id'].'.gif';
$icon_file = G5_DATA_PATH.'/member_image/'.$mb_dir.'/'.get_mb_icon_name($mb['mb_id']).'.gif';
if (file_exists($icon_file)) {
$icon_url = G5_DATA_URL.'/member_image/'.$mb_dir.'/'.$mb['mb_id'].'.gif';
$icon_url = str_replace(G5_DATA_PATH, G5_DATA_URL, $icon_file);
echo '<img src="'.$icon_url.'" alt="">';
echo '<input type="checkbox" id="del_mb_img" name="del_mb_img" value="1">삭제';
}
+4 -2
View File
@@ -116,13 +116,13 @@ else if ($w == 'u')
alert('이미 존재하는 이메일입니다.\\nID : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']);
$mb_dir = substr($mb_id,0,2);
$mb_icon_img = get_mb_icon_name($mb_id).'.gif';
// 회원 아이콘 삭제
if ($del_mb_icon)
@unlink(G5_DATA_PATH.'/member/'.$mb_dir.'/'.$mb_id.'.gif');
@unlink(G5_DATA_PATH.'/member/'.$mb_dir.'/'.$mb_icon_img);
$image_regex = "/(\.(gif|jpe?g|png))$/i";
$mb_icon_img = $mb_id.'.gif';
// 아이콘 업로드
if (isset($_FILES['mb_icon']) && is_uploaded_file($_FILES['mb_icon']['tmp_name'])) {
@@ -228,5 +228,7 @@ else if ($w == 'u')
else
alert('제대로 된 값이 넘어오지 않았습니다.');
start_event('admin_member_form_update', $w, $mb_id);
goto_url('./member_form.php?'.$qstr.'&amp;w=u&amp;mb_id='.$mb_id, false);
?>
+6 -2
View File
@@ -12,6 +12,8 @@ auth_check($auth[$sub_menu], 'w');
check_admin_token();
$mb_datas = array();
if ($_POST['act_button'] == "선택수정") {
for ($i=0; $i<count($_POST['chk']); $i++)
@@ -19,7 +21,7 @@ if ($_POST['act_button'] == "선택수정") {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$mb = get_member($_POST['mb_id'][$k]);
$mb_datas[] = $mb = get_member($_POST['mb_id'][$k]);
if (!$mb['mb_id']) {
$msg .= $mb['mb_id'].' : 회원자료가 존재하지 않습니다.\\n';
@@ -53,7 +55,7 @@ if ($_POST['act_button'] == "선택수정") {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$mb = get_member($_POST['mb_id'][$k]);
$mb_datas[] = $mb = get_member($_POST['mb_id'][$k]);
if (!$mb['mb_id']) {
$msg .= $mb['mb_id'].' : 회원자료가 존재하지 않습니다.\\n';
@@ -74,5 +76,7 @@ if ($msg)
//echo '<script> alert("'.$msg.'"); </script>';
alert($msg);
start_event('admin_member_list_update', $_POST['act_button'], $mb_datas);
goto_url('./member_list.php?'.$qstr);
?>
+3 -3
View File
@@ -52,13 +52,13 @@ if($sql) {
<?php }
switch($type) {
case 'group':
$link = G5_BBS_URL.'/group.php?gr_id='.$row['id'];
$link = get_pretty_url(G5_GROUP_DIR, $row['id']);
break;
case 'board':
$link = G5_BBS_URL.'/board.php?bo_table='.$row['id'];
$link = get_pretty_url($row['id']);
break;
case 'content':
$link = G5_BBS_URL.'/content.php?co_id='.$row['id'];
$link = get_pretty_url(G5_CONTENT_DIR, $row['id']);
break;
default:
$link = '';
+1 -1
View File
@@ -131,7 +131,7 @@ else
$link1 = $link2 = '';
if (!preg_match("/^\@/", $row['po_rel_table']) && $row['po_rel_table']) {
$link1 = '<a href="'.G5_BBS_URL.'/board.php?bo_table='.$row['po_rel_table'].'&amp;wr_id='.$row['po_rel_id'].'" target="_blank">';
$link1 = '<a href="'.get_pretty_url($row['po_rel_table'], $row['po_rel_id']).'" target="_blank">';
$link2 = '</a>';
}
+2
View File
@@ -10,6 +10,7 @@ CREATE TABLE `__TABLE_NAME__` (
`wr_option` set('html1','html2','secret','mail') NOT NULL,
`wr_subject` varchar(255) NOT NULL,
`wr_content` text NOT NULL,
`wr_seo_title` varchar(255) NOT NULL DEFAULT '',
`wr_link1` text NOT NULL,
`wr_link2` text NOT NULL,
`wr_link1_hit` int(11) NOT NULL DEFAULT '0',
@@ -39,6 +40,7 @@ CREATE TABLE `__TABLE_NAME__` (
`wr_9` varchar(255) NOT NULL,
`wr_10` varchar(255) NOT NULL,
PRIMARY KEY (`wr_id`),
KEY `wr_seo_title` (`wr_seo_title`),
KEY `wr_num_reply_parent` (`wr_num`,`wr_reply`,`wr_parent`),
KEY `wr_is_comment` (`wr_is_comment`,`wr_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+8 -8
View File
@@ -8,7 +8,7 @@ if (!$board['bo_table']) {
check_device($board['bo_device']);
if (isset($write['wr_is_comment']) && $write['wr_is_comment']) {
goto_url('./board.php?bo_table='.$bo_table.'&amp;wr_id='.$write['wr_parent'].'#c_'.$wr_id);
goto_url(get_pretty_url($bo_table, $write['wr_parent'], '#c_'.$wr_id));
}
if (!$bo_table) {
@@ -23,14 +23,14 @@ if (isset($wr_id) && $wr_id) {
// 글이 없을 경우 해당 게시판 목록으로 이동
if (!$write['wr_id']) {
$msg = '글이 존재하지 않습니다.\\n\\n글이 삭제되었거나 이동된 경우입니다.';
alert($msg, './board.php?bo_table='.$bo_table);
alert($msg, get_pretty_url($bo_table));
}
// 그룹접근 사용
if (isset($group['gr_use_access']) && $group['gr_use_access']) {
if ($is_guest) {
$msg = "비회원은 이 게시판에 접근할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.";
alert($msg, './login.php?wr_id='.$wr_id.$qstr.'&amp;url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr));
alert($msg, './login.php?wr_id='.$wr_id.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id, $qstr)));
}
// 그룹관리자 이상이라면 통과
@@ -51,14 +51,14 @@ if (isset($wr_id) && $wr_id) {
if ($is_member)
alert('글을 읽을 권한이 없습니다.', G5_URL);
else
alert('글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&amp;url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr));
alert('글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id, $qstr)));
}
// 본인확인을 사용한다면
if ($config['cf_cert_use'] && !$is_admin) {
// 인증된 회원만 가능
if ($board['bo_use_cert'] != '' && $is_guest) {
alert('이 게시판은 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&amp;url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr));
alert('이 게시판은 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id, $qstr)));
}
if ($board['bo_use_cert'] == 'cert' && !$member['mb_certify']) {
@@ -108,7 +108,7 @@ if (isset($wr_id) && $wr_id) {
// 이 게시물이 저장된 게시물이 아니면서 관리자가 아니라면
//if ("$bo_table|$write['wr_num']" != get_session("ss_secret"))
if (!get_session($ss_name))
goto_url('./password.php?w=s&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
goto_url(G5_BBS_URL.'/password.php?w=s&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
}
set_session($ss_name, TRUE);
@@ -151,7 +151,7 @@ if (isset($wr_id) && $wr_id) {
if ($config['cf_cert_use'] && !$is_admin) {
// 인증된 회원만 가능
if ($board['bo_use_cert'] != '' && $is_guest) {
alert('이 게시판은 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&amp;url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr));
alert('이 게시판은 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id, $qstr)));
}
if ($board['bo_use_cert'] == 'cert' && !$member['mb_certify']) {
@@ -189,7 +189,7 @@ $ip = "";
$is_ip_view = $board['bo_use_ip_view'];
if ($is_admin) {
$is_ip_view = true;
if (array_key_exists('wr_ip', $write)) {
if ($write && array_key_exists('wr_ip', $write)) {
$ip = $write['wr_ip'];
}
} else {
+12 -3
View File
@@ -8,14 +8,23 @@ if( !isset($g5['content_table']) ){
die('<meta charset="utf-8">관리자 모드에서 게시판관리->내용 관리를 먼저 확인해 주세요.');
}
// 내용
if($co_seo_title){
$co = get_content_by_field($g5['content_table'], 'content', 'co_seo_title', $co_seo_title);
$co_id = $co['co_id'];
} else {
$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;
}
// 내용
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql);
if (!$co['co_id'])
alert('등록된 내용이 없습니다.');
+4 -2
View File
@@ -30,7 +30,7 @@ else if ($is_admin == 'group') { // 그룹관리자
alert('자신의 글이 아니므로 삭제할 수 없습니다.');
} else {
if ($write['mb_id'])
alert('로그인 후 삭제하세요.', './login.php?url='.urlencode('./board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
alert('로그인 후 삭제하세요.', './login.php?url='.urlencode(get_pretty_url($bo_table, $wr_id)));
else if (!check_password($wr_password, $write['wr_password']))
alert('비밀번호가 틀리므로 삭제할 수 없습니다.');
}
@@ -134,5 +134,7 @@ if ($count_write > 0 || $count_comment > 0)
delete_cache_latest($bo_table);
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;page='.$page.$qstr);
start_event('bbs_delete', $write, $board);
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;page='.$page.$qstr));
?>
+3 -1
View File
@@ -156,5 +156,7 @@ if ($count_write > 0 || $count_comment > 0)
delete_cache_latest($bo_table);
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;page='.$page.$qstr);
start_event('bbs_delete_all', $tmp_array, $board);
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;page='.$page.$qstr));
?>
+2
View File
@@ -86,5 +86,7 @@ sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$bo_table}'
delete_cache_latest($bo_table);
start_event('bbs_delete_comment', $comment_id, $board);
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$write['wr_parent'].'&amp;page='.$page. $qstr);
?>
+2 -2
View File
@@ -15,7 +15,7 @@ if (!get_session('ss_view_'.$bo_table.'_'.$wr_id))
// 다운로드 차감일 때 비회원은 다운로드 불가
if($board['bo_download_point'] < 0 && $is_guest)
alert('다운로드 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&amp;'.$qstr.'&amp;url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
alert('다운로드 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&amp;'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id)));
$sql = " select bf_source, bf_file from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' ";
$file = sql_fetch($sql);
@@ -38,7 +38,7 @@ if ($member['mb_level'] < $board['bo_download_level']) {
if ($member['mb_id'])
alert($alert_msg);
else
alert($alert_msg.'\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&amp;'.$qstr.'&amp;url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
alert($alert_msg.'\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&amp;'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id)));
}
$filepath = G5_DATA_PATH.'/file/'.$bo_table.'/'.$file['bf_file'];
+2
View File
@@ -8,6 +8,8 @@ if (!$config['cf_email_use'])
if (!$is_member && $config['cf_formmail_is_member'])
alert_close('회원만 이용하실 수 있습니다.');
$mb_id = isset($mb_id) ? get_search_string($mb_id) : '';
if ($is_member && !$member['mb_open'] && $is_admin != "super" && $member['mb_id'] != $mb_id)
alert_close('자신의 정보를 공개하지 않으면 다른분에게 메일을 보낼 수 없습니다.\\n\\n정보공개 설정은 회원정보수정에서 하실 수 있습니다.');
+2 -2
View File
@@ -90,7 +90,7 @@ if($_POST['js'] == "on") {
if (!$is_member)
{
$href = './login.php?'.$qstr.'&amp;url='.urlencode('./board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
$href = './login.php?'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id));
alert('회원만 가능합니다.', $href);
}
@@ -144,7 +144,7 @@ if($_POST['js'] == "on") {
else
$status = '비추천';
$href = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$href = get_pretty_url($bo_table, $wr_id);
alert("이 글을 $status 하셨습니다.", '', false);
}
+10 -8
View File
@@ -6,7 +6,7 @@ $is_category = false;
$category_option = '';
if ($board['bo_use_category']) {
$is_category = true;
$category_href = G5_BBS_URL.'/board.php?bo_table='.$bo_table;
$category_href = get_pretty_url($bo_table);
$category_option .= '<li><a href="'.$category_href.'"';
if ($sca=='')
@@ -17,7 +17,7 @@ if ($board['bo_use_category']) {
for ($i=0; $i<count($categories); $i++) {
$category = trim($categories[$i]);
if ($category=='') continue;
$category_option .= '<li><a href="'.($category_href."&amp;sca=".urlencode($category)).'"';
$category_option .= '<li><a href="'.(get_pretty_url($bo_table,'','sca='.urlencode($category))).'"';
$category_msg = '';
if ($category==$sca) { // 현재 선택된 카테고리라면
$category_option .= ' id="bo_cate_on"';
@@ -200,13 +200,15 @@ if($page_rows > 0) {
}
}
$write_pages = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, './board.php?bo_table='.$bo_table.$qstr.'&amp;page=');
g5_latest_cache_data($board['bo_table'], $list);
$write_pages = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, get_pretty_url($bo_table, '', $qstr.'&amp;page='));
$list_href = '';
$prev_part_href = '';
$next_part_href = '';
if ($is_search_bbs) {
$list_href = './board.php?bo_table='.$bo_table;
$list_href = get_pretty_url($bo_table);
$patterns = array('#&amp;page=[0-9]*#', '#&amp;spt=[0-9\-]*#');
@@ -214,14 +216,14 @@ if ($is_search_bbs) {
$prev_spt = $spt - $config['cf_search_part'];
if (isset($min_spt) && $prev_spt >= $min_spt) {
$qstr1 = preg_replace($patterns, '', $qstr);
$prev_part_href = './board.php?bo_table='.$bo_table.$qstr1.'&amp;spt='.$prev_spt.'&amp;page=1';
$prev_part_href = get_pretty_url($bo_table,0,$qstr1.'&amp;spt='.$prev_spt.'&amp;page=1');
$write_pages = page_insertbefore($write_pages, '<a href="'.$prev_part_href.'" class="pg_page pg_prev">이전검색</a>');
}
$next_spt = $spt + $config['cf_search_part'];
if ($next_spt < 0) {
$qstr1 = preg_replace($patterns, '', $qstr);
$next_part_href = './board.php?bo_table='.$bo_table.$qstr1.'&amp;spt='.$next_spt.'&amp;page=1';
$next_part_href = get_pretty_url($bo_table,0,$qstr1.'&amp;spt='.$next_spt.'&amp;page=1');
$write_pages = page_insertafter($write_pages, '<a href="'.$next_part_href.'" class="pg_page pg_end">다음검색</a>');
}
}
@@ -229,7 +231,7 @@ if ($is_search_bbs) {
$write_href = '';
if ($member['mb_level'] >= $board['bo_write_level']) {
$write_href = './write.php?bo_table='.$bo_table;
$write_href = short_url_clean(G5_BBS_URL.'/write.php?bo_table='.$bo_table);
}
$nobr_begin = $nobr_end = "";
@@ -241,7 +243,7 @@ if (preg_match("/gecko|firefox/i", $_SERVER['HTTP_USER_AGENT'])) {
// RSS 보기 사용에 체크가 되어 있어야 RSS 보기 가능 061106
$rss_href = '';
if ($board['bo_use_rss_view']) {
$rss_href = './rss.php?bo_table='.$bo_table;
$rss_href = G5_BBS_URL.'/rss.php?bo_table='.$bo_table;
}
$stx = get_text(stripslashes($stx));
+2
View File
@@ -31,5 +31,7 @@ if (!file_exists($login_file))
include_once($member_skin_path.'/login.skin.php');
start_event('member_login_tail', $login_url, $login_action_url, $member_skin_path, $url);
include_once('./_tail.sub.php');
?>
+6 -1
View File
@@ -29,7 +29,10 @@ if(function_exists('social_is_login_check')){
// 가입된 회원이 아니다. 비밀번호가 틀리다. 라는 메세지를 따로 보여주지 않는 이유는
// 회원아이디를 입력해 보고 맞으면 또 비밀번호를 입력해보는 경우를 방지하기 위해서입니다.
// 불법사용자의 경우 회원아이디가 틀린지, 비밀번호가 틀린지를 알기까지는 많은 시간이 소요되기 때문입니다.
if (!$is_social_password_check && (!$mb['mb_id'] || !check_password($mb_password, $mb['mb_password'])) ) {
if (!$is_social_password_check && (!$mb['mb_id'] || !login_password_check($mb, $mb_password, $mb['mb_password'])) ) {
start_event('password_is_wrong', 'login', $mb);
alert('가입된 회원아이디가 아니거나 비밀번호가 틀립니다.\\n비밀번호는 대소문자를 구분합니다.');
}
@@ -118,5 +121,7 @@ if(function_exists('social_login_success_after')){
social_login_session_clear(1);
}
start_event('member_login_check', $mb, $link);
goto_url($link);
?>
+3 -1
View File
@@ -29,10 +29,12 @@ if ($url) {
$link = $url;
} else if ($bo_table) {
$link = G5_BBS_URL.'/board.php?bo_table='.$bo_table;
$link = get_pretty_url($bo_table);
} else {
$link = G5_URL;
}
start_event('member_logout', $link);
goto_url($link);
?>
+8 -3
View File
@@ -18,12 +18,15 @@ else if ($kind == 'send')
else
alert(''.$kind .'값을 넘겨주세요.');
$sql = " select count(*) as cnt from {$g5['memo_table']} where me_{$kind}_mb_id = '{$member['mb_id']}' ";
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
start_event('memo_list', $kind, $unkind, $page);
$sql = " select count(*) as cnt from {$g5['memo_table']} where me_{$kind}_mb_id = '{$member['mb_id']}' and me_type = '$kind' ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$total_page = ceil($total_count / $config['cf_page_rows']); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ((int) $page - 1) * $config['cf_page_rows']; // 시작 열을 구함
if ($kind == 'recv')
@@ -44,8 +47,9 @@ $list = array();
$sql = " select a.*, b.mb_id, b.mb_nick, b.mb_email, b.mb_homepage
from {$g5['memo_table']} a
left join {$g5['member_table']} b on (a.me_{$unkind}_mb_id = b.mb_id)
where a.me_{$kind}_mb_id = '{$member['mb_id']}'
where a.me_{$kind}_mb_id = '{$member['mb_id']}' and a.me_type = '$kind'
order by a.me_id desc limit $from_record, {$config['cf_page_rows']} ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
@@ -67,6 +71,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$send_datetime = substr($row['me_send_datetime'],2,14);
$list[$i]['mb_id'] = $mb_id;
$list[$i]['name'] = $name;
$list[$i]['send_datetime'] = $send_datetime;
$list[$i]['read_datetime'] = $read_datetime;
+9 -4
View File
@@ -15,6 +15,11 @@ $me_id = (int)$_REQUEST['me_id'];
$sql = " select * from {$g5['memo_table']} where me_id = '{$me_id}' ";
$row = sql_fetch($sql);
$sql = " delete from {$g5['memo_table']}
where me_id = '{$me_id}'
and (me_recv_mb_id = '{$member['mb_id']}' or me_send_mb_id = '{$member['mb_id']}') ";
sql_query($sql);
if (!$row['me_read_datetime'][0]) // 메모 받기전이면
{
$sql = " update {$g5['member_table']}
@@ -22,12 +27,12 @@ if (!$row['me_read_datetime'][0]) // 메모 받기전이면
where mb_id = '{$row['me_recv_mb_id']}'
and mb_memo_call = '{$row['me_send_mb_id']}' ";
sql_query($sql);
$sql = " update `{$g5['member_table']}` set mb_memo_cnt = '".get_memo_not_read($member['mb_id'])."' where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
}
$sql = " delete from {$g5['memo_table']}
where me_id = '{$me_id}'
and (me_recv_mb_id = '{$member['mb_id']}' or me_send_mb_id = '{$member['mb_id']}') ";
sql_query($sql);
start_event('memo_delete', $me_id, $row);
goto_url('./memo.php?kind='.$kind);
?>
+34 -6
View File
@@ -13,7 +13,10 @@ $recv_list = explode(',', trim($_POST['me_recv_mb_id']));
$str_nick_list = '';
$msg = '';
$error_list = array();
$member_list = array();
$member_list = array('id'=>array(), 'nick'=>array());
start_event('memo_form_update_before', $recv_list);
for ($i=0; $i<count($recv_list); $i++) {
$row = sql_fetch(" select mb_id, mb_nick, mb_open, mb_leave_date, mb_intercept_date from {$g5['member_table']} where mb_id = '{$recv_list[$i]}' ");
if ($row) {
@@ -41,6 +44,10 @@ $error_msg = implode(",", $error_list);
if ($error_msg && !$is_admin)
alert("회원아이디 '{$error_msg}' 은(는) 존재(또는 정보공개)하지 않는 회원아이디 이거나 탈퇴, 접근차단된 회원아이디 입니다.\\n쪽지를 발송하지 않았습니다.");
if (! count($member_list['id'])){
alert('해당 회원이 존재하지 않습니다.');
}
if (!$is_admin) {
if (count($member_list['id'])) {
$point = (int)$config['cf_memo_send_point'] * count($member_list['id']);
@@ -59,12 +66,21 @@ for ($i=0; $i<count($member_list['id']); $i++) {
$recv_mb_id = $member_list['id'][$i];
$recv_mb_nick = get_text($member_list['nick'][$i]);
// 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_id, me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo ) values ( '$me_id', '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$_POST['me_memo']}' ) ";
// 받는 회원 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_type, me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$_POST['me_memo']}' , 'recv', '{$_SERVER['REMOTE_ADDR']}' ) ";
sql_query($sql);
if( $me_id = sql_insert_id() ){
// 보내는 회원 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_send_id, me_type , me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$_POST['me_memo']}', '$me_id', 'send', '{$_SERVER['REMOTE_ADDR']}' ) ";
sql_query($sql);
}
// 실시간 쪽지 알림 기능
$sql = " update {$g5['member_table']} set mb_memo_call = '{$member['mb_id']}' where mb_id = '$recv_mb_id' ";
$sql = " update {$g5['member_table']} set mb_memo_call = '{$member['mb_id']}', mb_memo_cnt = '".get_memo_not_read($recv_mb_id)."' where mb_id = '$recv_mb_id' ";
sql_query($sql);
if (!$is_admin) {
@@ -73,9 +89,21 @@ for ($i=0; $i<count($member_list['id']); $i++) {
}
if ($member_list) {
$redirect_url = G5_HTTP_BBS_URL."/memo.php?kind=send";
$str_nick_list = implode(',', $member_list['nick']);
alert($str_nick_list." 님께 쪽지를 전달하였습니다.", G5_HTTP_BBS_URL."/memo.php?kind=send", false);
start_event('memo_form_update_after', $member_list, $str_nick_list, $redirect_url);
alert($str_nick_list." 님께 쪽지를 전달하였습니다.", $redirect_url, false);
} else {
alert("회원아이디 오류 같습니다.", G5_HTTP_BBS_URL."/memo_form.php", false);
$redirect_url = G5_HTTP_BBS_URL."/memo_form.php";
start_event('memo_form_update_failed', $member_list, $redirect_url);
exit;
alert("회원아이디 오류 같습니다.", $redirect_url, false);
}
?>
+20 -20
View File
@@ -13,10 +13,13 @@ if ($kind == 'recv')
$sql = " update {$g5['memo_table']}
set me_read_datetime = '".G5_TIME_YMDHIS."'
where me_id = '$me_id'
where (me_id = '$me_id' or me_send_id = '$me_id' )
and me_recv_mb_id = '{$member['mb_id']}'
and me_read_datetime = '0000-00-00 00:00:00' ";
sql_query($sql);
$sql = " update `{$g5['member_table']}` set mb_memo_cnt = '".get_memo_not_read($member['mb_id'])."' where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
}
else if ($kind == 'send')
{
@@ -37,31 +40,28 @@ $sql = " select * from {$g5['memo_table']}
$memo = sql_fetch($sql);
// 이전 쪽지
$sql = " select * from {$g5['memo_table']}
where me_id > '{$me_id}'
and me_{$kind}_mb_id = '{$member['mb_id']}'
order by me_id asc
limit 1 ";
$prev = sql_fetch($sql);
if ($prev['me_id'])
$prev_link = './memo_view.php?kind='.$kind.'&amp;me_id='.$prev['me_id'];
else
//$prev_link = 'javascript:alert(\'쪽지의 처음입니다.\');';
$prev_link = '';
$sql = " select me.*, a.rownum from `{$g5['memo_table']}` as me inner join ( select me_id , (@rownum:=@rownum+1) as rownum from `{$g5['memo_table']}` as memo, (select @rownum:=0) tmp where me_{$kind}_mb_id = '{$member['mb_id']}' and memo.me_type = '$kind' order by me_id desc ) as a on a.me_id = me.me_id where me.me_id < '$me_id' and me.me_{$kind}_mb_id = '{$member['mb_id']}' and me.me_type = '$kind' order by me.me_id desc limit 1 ";
$prev = sql_fetch($sql);
if ($prev['me_id']) {
$prev_link = './memo_view.php?kind='.$kind.'&amp;me_id='.$prev['me_id'];
$prev['page'] = ceil( (int)$prev['rownum'] / $config['cf_page_rows']); // 이동할 페이지 계산
if( (int)$prev['page'] > 0 ) $prev_link .= "&amp;page=".$prev['page'];
} else {
$prev_link = '';
}
// 다음 쪽지
$sql = " select * from {$g5[memo_table]}
where me_id < '{$me_id}'
and me_{$kind}_mb_id = '{$member[mb_id]}'
order by me_id desc
limit 1 ";
$sql = " select me.*, a.rownum from `{$g5['memo_table']}` as me inner join ( select me_id , (@rownum:=@rownum+1) as rownum from `{$g5['memo_table']}` as memo, (select @rownum:=0) tmp where me_{$kind}_mb_id = '{$member['mb_id']}' and memo.me_type = '$kind' order by me_id asc ) as a on a.me_id = me.me_id where me.me_id > '$me_id' and me.me_{$kind}_mb_id = '{$member['mb_id']}' and me.me_type = '$kind' order by me.me_id asc limit 1 ";
$next = sql_fetch($sql);
if ($next['me_id'])
if ($next['me_id']) {
$next_link = './memo_view.php?kind='.$kind.'&amp;me_id='.$next['me_id'];
else
//$next_link = 'javascript:alert(\'쪽지의 마지막입니다.\');';
$next['page'] = ceil( (int)$next['rownum'] / $config['cf_page_rows']); // 이동할 페이지 계산
if( (int)$next['page'] > 0 ) $next_link .= "&amp;page=".$next['page'];
} else {
$next_link = '';
}
$mb = get_member($memo['me_'.$unkind.'_mb_id']);
+1
View File
@@ -156,5 +156,6 @@ function fboardmoveall_submit(f)
</script>
<?php
start_event('move_html_footer');
include_once(G5_PATH.'/tail.sub.php');
?>
+3 -1
View File
@@ -207,9 +207,11 @@ if ($sw == 'move')
}
$msg = '해당 게시물을 선택한 게시판으로 '.$act.' 하였습니다.';
$opener_href = './board.php?bo_table='.$bo_table.'&amp;page='.$page.'&amp;'.$qstr;
$opener_href = get_pretty_url($bo_table,'','&amp;page='.$page.'&amp;'.$qstr);
$opener_href1 = str_replace('&amp;', '&', $opener_href);
start_event('bbs_move_update', $bo_table, $chk_bo_table, $wr_id_list, $opener_href);
echo <<<HEREDOC
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script>
+2 -2
View File
@@ -99,7 +99,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i]['bo_table'] = $row['bo_table'];
$list[$i]['name'] = $name;
$list[$i]['comment'] = $comment;
$list[$i]['href'] = './board.php?bo_table='.$row['bo_table'].'&amp;wr_id='.$row2['wr_id'].$comment_link;
$list[$i]['href'] = get_pretty_url($row['bo_table'], $row2['wr_id'], $comment_link);
$list[$i]['datetime'] = $datetime;
$list[$i]['datetime2'] = $datetime2;
@@ -113,4 +113,4 @@ $write_pages = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['c
include_once($new_skin_path.'/new.skin.php');
include_once('./_tail.php');
?>
?>
+2
View File
@@ -143,5 +143,7 @@ foreach ($save_bo_table as $key=>$value) {
delete_cache_latest($value);
}
start_event('bbs_new_delete', $chk_bn_id, $save_bo_table);
goto_url("new.php?sfl=$sfl&stx=$stx&page=$page");
?>
+7 -7
View File
@@ -6,35 +6,35 @@ $g5['title'] = '비밀번호 입력';
switch ($w) {
case 'u' :
$action = G5_HTTP_BBS_URL.'/write.php';
$return_url = G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$return_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
break;
case 'd' :
set_session('ss_delete_token', $token = uniqid(time()));
$action = https_url(G5_BBS_DIR).'/delete.php?token='.$token;
$return_url = G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$return_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
break;
case 'x' :
set_session('ss_delete_comment_'.$comment_id.'_token', $token = uniqid(time()));
$action = https_url(G5_BBS_DIR).'/delete_comment.php?token='.$token;
$row = sql_fetch(" select wr_parent from $write_table where wr_id = '$comment_id' ");
$return_url = G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$row['wr_parent'];
$return_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$row['wr_parent']);
break;
case 's' :
// 비밀번호 창에서 로그인 하는 경우 관리자 또는 자신의 글이면 바로 글보기로 감
if ($is_admin || ($member['mb_id'] == $write['mb_id'] && $write['mb_id']))
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
else {
$action = https_url(G5_BBS_DIR).'/password_check.php';
$return_url = G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table;
$return_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table);
}
break;
case 'sc' :
// 비밀번호 창에서 로그인 하는 경우 관리자 또는 자신의 글이면 바로 글보기로 감
if ($is_admin || ($member['mb_id'] == $write['mb_id'] && $write['mb_id']))
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
else {
$action = https_url(G5_BBS_DIR).'/password_check.php';
$return_url = G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$return_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
}
break;
default :
+18 -2
View File
@@ -6,8 +6,16 @@ if ($w == 's') {
$wr = get_write($write_table, $wr_id);
if (!check_password($wr_password, $wr['wr_password']))
if( !$wr['wr_password'] && $wr['mb_id'] ){
if ( $mb = get_member($wr['mb_id']) ){
$wr['wr_password'] = $mb['mb_password'];
}
}
if (!check_password($wr_password, $wr['wr_password'])) {
start_event('password_is_wrong', 'bbs', $wr);
alert('비밀번호가 틀립니다.');
}
// 세션에 아래 정보를 저장. 하위번호는 비밀번호없이 보아야 하기 때문임.
//$ss_name = 'ss_secret.'_'.$bo_table.'_'.$wr_id';
@@ -20,8 +28,16 @@ if ($w == 's') {
$wr = get_write($write_table, $wr_id);
if (!check_password($wr_password, $wr['wr_password']))
if( !$wr['wr_password'] && $wr['mb_id'] ){
if ( $mb = get_member($wr['mb_id']) ){
$wr['wr_password'] = $mb['mb_password'];
}
}
if (!check_password($wr_password, $wr['wr_password'])){
start_event('password_is_wrong', 'bbs', $wr);
alert('비밀번호가 틀립니다.');
}
// 세션에 아래 정보를 저장. 하위번호는 비밀번호없이 보아야 하기 때문임.
$ss_name = 'ss_secret_comment_'.$bo_table.'_'.$wr['wr_id'];
+3
View File
@@ -7,7 +7,10 @@ if (!$member['mb_id'])
if (!$member['mb_open'] && $is_admin != 'super' && $member['mb_id'] != $mb_id)
alert_close('자신의 정보를 공개하지 않으면 다른분의 정보를 조회할 수 없습니다.\\n\\n정보공개 설정은 회원정보수정에서 하실 수 있습니다.');
$mb_id = isset($mb_id) ? $mb_id : '';
$mb = get_member($mb_id);
if (!$mb['mb_id'])
alert_close('회원정보가 존재하지 않습니다.\\n\\n탈퇴하였을 수 있습니다.');
+2
View File
@@ -317,6 +317,8 @@ if($w == '' || $w == 'a' || $w == 'r') {
sql_query($sql);
}
start_event('qawrite_update', $qa_id, $write, $w, $qaconfig);
// SMS 알림
if($config['cf_sms_use'] == 'icode' && $qaconfig['qa_use_sms']) {
if($config['cf_sms_type'] == 'LMS') {
+10 -8
View File
@@ -76,12 +76,14 @@ if ($w == "") {
if ($_POST['mb_password']) {
// 수정된 정보를 업데이트후 되돌아 온것이라면 비밀번호가 암호화 된채로 넘어온것임
if ($_POST['is_update'])
if ($_POST['is_update']) {
$tmp_password = $_POST['mb_password'];
else
$tmp_password = get_encrypt_string($_POST['mb_password']);
$pass_check = ($member['mb_password'] === $tmp_password);
} else {
$pass_check = check_password($_POST['mb_password'], $member['mb_password']);
}
if ($member['mb_password'] != $tmp_password)
if (!$pass_check)
alert('비밀번호가 틀립니다.');
}
@@ -117,12 +119,12 @@ if ($w == "") {
include_once('./_head.php');
// 회원아이콘 경로
$mb_icon_path = G5_DATA_PATH.'/member/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif';
$mb_icon_url = G5_DATA_URL.'/member/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif';
$mb_icon_path = G5_DATA_PATH.'/member/'.substr($member['mb_id'],0,2).'/'.get_mb_icon_name($member['mb_id']).'.gif';
$mb_icon_url = G5_DATA_URL.'/member/'.substr($member['mb_id'],0,2).'/'.get_mb_icon_name($member['mb_id']).'.gif';
// 회원이미지 경로
$mb_img_path = G5_DATA_PATH.'/member_image/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif';
$mb_img_url = G5_DATA_URL.'/member_image/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif';
$mb_img_path = G5_DATA_PATH.'/member_image/'.substr($member['mb_id'],0,2).'/'.get_mb_icon_name($member['mb_id']).'.gif';
$mb_img_url = G5_DATA_URL.'/member_image/'.substr($member['mb_id'],0,2).'/'.get_mb_icon_name($member['mb_id']).'.gif';
$register_action_url = G5_HTTPS_BBS_URL.'/register_form_update.php';
$req_nick = !isset($member['mb_nick_date']) || (isset($member['mb_nick_date']) && $member['mb_nick_date'] <= date("Y-m-d", G5_SERVER_TIME - ($config['cf_nick_modify'] * 86400)));
+21 -3
View File
@@ -74,6 +74,8 @@ $mb_addr2 = clean_xss_tags($mb_addr2);
$mb_addr3 = clean_xss_tags($mb_addr3);
$mb_addr_jibeon = preg_match("/^(N|R)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : '';
start_event('register_form_update_before', $mb_id, $w);
if ($w == '' || $w == 'u') {
if ($msg = empty_mb_id($mb_id)) alert($msg, "", true, true); // alert($msg, $url, $error, $post);
@@ -146,6 +148,8 @@ if ($w == '' || $w == 'u') {
$old_email = $member['mb_email'];
}
start_event('register_form_update_valid', $w, $mb_id, $mb_nick, $mb_email);
if ($msg = exist_mb_nick($mb_nick, $mb_id)) alert($msg, "", true, true);
if ($msg = exist_mb_email($mb_email, $mb_id)) alert($msg, "", true, true);
}
@@ -265,9 +269,13 @@ if ($w == '') {
include_once ('./register_form_update_mail1.php');
$content = ob_get_contents();
ob_end_clean();
$content = apply_replace('register_form_update_mail_mb_content', $content, $mb_id);
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb_email, $subject, $content, 1);
start_event('register_form_update_send_mb_mail', $config['cf_admin_email_name'], $config['cf_admin_email'], $mb_email, $subject, $content);
// 메일인증을 사용하는 경우 가입메일에 인증 url이 있으므로 인증메일을 다시 발송되지 않도록 함
if($config['cf_use_email_certify'])
$old_email = $mb_email;
@@ -275,14 +283,18 @@ if ($w == '') {
// 최고관리자님께 메일 발송
if ($config['cf_email_mb_super_admin']) {
$subject = '['.$config['cf_title'].'] '.$mb_nick .' 님께서 회원으로 가입하셨습니다.';
$subject = apply_replace('register_form_update_mail_admin_subject', '['.$config['cf_title'].'] '.$mb_nick .' 님께서 회원으로 가입하셨습니다.', $mb_id, $mb_nick);
ob_start();
include_once ('./register_form_update_mail2.php');
$content = ob_get_contents();
ob_end_clean();
$content = apply_replace('register_form_update_mail_admin_content', $content, $mb_id);
mailer($mb_nick, $mb_email, $config['cf_admin_email'], $subject, $content, 1);
start_event('register_form_update_send_admin_mail', $mb_nick, $mb_email, $config['cf_admin_email'], $subject, $content);
}
// 메일인증 사용하지 않는 경우에만 로그인
@@ -356,7 +368,7 @@ $mb_dir = G5_DATA_PATH.'/member/'.substr($mb_id,0,2);
// 아이콘 삭제
if (isset($_POST['del_mb_icon'])) {
@unlink($mb_dir.'/'.$mb_id.'.gif');
@unlink($mb_dir.'/'.get_mb_icon_name($mb_id).'.gif');
}
$msg = "";
@@ -364,7 +376,7 @@ $msg = "";
// 아이콘 업로드
$mb_icon = '';
$image_regex = "/(\.(gif|jpe?g|png))$/i";
$mb_icon_img = $mb_id.'.gif';
$mb_icon_img = get_mb_icon_name($mb_id).'.gif';
if (isset($_FILES['mb_icon']) && is_uploaded_file($_FILES['mb_icon']['tmp_name'])) {
if (preg_match($image_regex, $_FILES['mb_icon']['name'])) {
@@ -484,8 +496,12 @@ if ($config['cf_use_email_certify'] && $old_email != $mb_email) {
include_once ('./register_form_update_mail3.php');
$content = ob_get_contents();
ob_end_clean();
$content = apply_replace('register_form_update_mail_certify_content', $content, $mb_id);
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb_email, $subject, $content, 1);
start_event('register_form_update_send_certify_mail', $config['cf_admin_email_name'], $config['cf_admin_email'], $mb_email, $subject, $content);
}
@@ -501,6 +517,8 @@ unset($_SESSION['ss_cert_adult']);
if ($msg)
echo '<script>alert(\''.$msg.'\');</script>';
start_event('register_form_update_after', $mb_id, $w);
if ($w == '') {
goto_url(G5_HTTP_BBS_URL.'/register_result.php');
} else if ($w == 'u') {
+4 -4
View File
@@ -47,8 +47,8 @@ echo '<?xml version="1.0" encoding="utf-8" ?>'."\n";
?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title><?php echo specialchars_replace($config['cf_title'].' &gt; '.$subj1.' &gt; '.$subj2) ?></title>
<link><?php echo specialchars_replace(G5_BBS_URL.'/board.php?bo_table='.$bo_table) ?></link>
<title><?php echo specialchars_replace($config['cf_title'].' &gt; '.$subj1.' &gt; '.$subj2); ?></title>
<link><?php echo specialchars_replace(get_pretty_url($bo_table)); ?></link>
<description>테스트 버전 0.2 (2004-04-26)</description>
<language>ko</language>
@@ -69,8 +69,8 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
?>
<item>
<title><?php echo specialchars_replace($row['wr_subject']) ?></title>
<link><?php echo specialchars_replace(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$row['wr_id']) ?></link>
<title><?php echo specialchars_replace($row['wr_subject']); ?></title>
<link><?php echo specialchars_replace(get_pretty_url($bo_table, $wr_id)); ?></link>
<description><![CDATA[<?php echo $file ?><?php echo conv_content($row['wr_content'], $html) ?>]]></description>
<dc:creator><?php echo specialchars_replace($row['wr_name']) ?></dc:creator>
<?php
+2 -2
View File
@@ -47,8 +47,8 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
$row3['wr_subject'] = '[글 없음]';
$list[$i]['num'] = $num;
$list[$i]['opener_href'] = './board.php?bo_table='.$row['bo_table'];
$list[$i]['opener_href_wr_id'] = './board.php?bo_table='.$row['bo_table'].'&amp;wr_id='.$row['wr_id'];
$list[$i]['opener_href'] = get_pretty_url($row['bo_table']);
$list[$i]['opener_href_wr_id'] = get_pretty_url($row['bo_table'], $row['wr_id']);
$list[$i]['bo_subject'] = $row2['bo_subject'];
$list[$i]['subject'] = $subject;
$list[$i]['del_href'] = './scrap_delete.php?ms_id='.$row['ms_id'].'&amp;page='.$page;
+3
View File
@@ -7,5 +7,8 @@ if (!$is_member)
$sql = " delete from {$g5['scrap_table']} where mb_id = '{$member['mb_id']}' and ms_id = '$ms_id' ";
sql_query($sql);
$sql = " update `{$g5['member_table']}` set mb_scrap_cnt = '".get_scrap_totals($member['mb_id'])."' where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
goto_url('./scrap.php?page='.$page);
?>
+5 -2
View File
@@ -4,7 +4,7 @@ include_once('./_common.php');
include_once(G5_PATH.'/head.sub.php');
if ($is_guest) {
$href = './login.php?'.$qstr.'&amp;url='.urlencode('./board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
$href = './login.php?'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id));
$href2 = str_replace('&amp;', '&', $href);
echo <<<HEREDOC
<script>
@@ -38,6 +38,9 @@ $sql = " select count(*) as cnt from {$g5['scrap_table']}
and wr_id = '$wr_id' ";
$row = sql_fetch($sql);
if ($row['cnt']) {
$back_url = get_pretty_url($bo_table, $wr_id);
echo <<<HEREDOC
<script>
if (confirm('이미 스크랩하신 글 입니다.\\n\\n지금 스크랩을 확인하시겠습니까?'))
@@ -48,7 +51,7 @@ if ($row['cnt']) {
<noscript>
<p>이미 스크랩하신 글 입니다.</p>
<a href="./scrap.php">스크랩 확인하기</a>
<a href="./board.php?bo_table={$bo_table}&amp;wr_id=$wr_id">돌아가기</a>
<a href="{$back_url}">돌아가기</a>
</noscript>
HEREDOC;
exit;
+5 -2
View File
@@ -5,7 +5,7 @@ include_once(G5_PATH.'/head.sub.php');
if (!$is_member)
{
$href = './login.php?'.$qstr.'&amp;url='.urlencode('./board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id);
$href = './login.php?'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id));
echo '<script> alert(\'회원만 접근 가능합니다.\'); top.location.href = \''.str_replace('&amp;', '&', $href).'\'; </script>';
exit;
}
@@ -31,7 +31,7 @@ if ($row['cnt'])
<noscript>
<p>이미 스크랩하신 글 입니다.</p>
<a href="./scrap.php">스크랩 확인하기</a>
<a href="./board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'">돌아가기</a>
<a href="'.get_pretty_url($bo_table, $wr_id).'">돌아가기</a>
</noscript>';
exit;
}
@@ -101,6 +101,9 @@ if ($wr_content && ($member['mb_level'] >= $board['bo_comment_level']))
$sql = " insert into {$g5['scrap_table']} ( mb_id, bo_table, wr_id, ms_datetime ) values ( '{$member['mb_id']}', '$bo_table', '$wr_id', '".G5_TIME_YMDHIS."' ) ";
sql_query($sql);
$sql = " update `{$g5['member_table']}` set mb_scrap_cnt = '".get_scrap_totals($member['mb_id'])."' where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
delete_cache_latest($bo_table);
echo <<<HEREDOC
+1 -1
View File
@@ -172,7 +172,7 @@ if ($stx) {
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 검색어까지 링크되면 게시판 부하가 일어남
$list[$idx][$i] = $row;
$list[$idx][$i]['href'] = './board.php?bo_table='.$search_table[$idx].'&amp;wr_id='.$row['wr_parent'];
$list[$idx][$i]['href'] = get_pretty_url($search_table[$idx], $row['wr_parent']);
if ($row['wr_is_comment'])
{
+20 -18
View File
@@ -13,11 +13,11 @@ $sql_search = "";
if ($sca || $stx || $stx === '0') {
// where 문을 얻음
$sql_search = get_sql_search($sca, $sfl, $stx, $sop);
$search_href = './board.php?bo_table='.$bo_table.'&amp;page='.$page.$qstr;
$list_href = './board.php?bo_table='.$bo_table;
$search_href = get_pretty_url($bo_table,'','&amp;page='.$page.$qstr);
$list_href = get_pretty_url($bo_table);
} else {
$search_href = '';
$list_href = './board.php?bo_table='.$bo_table.'&amp;page='.$page;
$list_href = get_pretty_url($bo_table,'',$qstr);
}
if (!$board['bo_use_list_view']) {
@@ -47,7 +47,7 @@ if (!$board['bo_use_list_view']) {
$prev_href = '';
if (isset($prev['wr_id']) && $prev['wr_id']) {
$prev_wr_subject = get_text(cut_str($prev['wr_subject'], 255));
$prev_href = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$prev['wr_id'].$qstr;
$prev_href = get_pretty_url($bo_table, $prev['wr_id'], $qstr);
$prev_wr_date = $prev['wr_datetime'];
}
@@ -55,38 +55,40 @@ if (isset($prev['wr_id']) && $prev['wr_id']) {
$next_href = '';
if (isset($next['wr_id']) && $next['wr_id']) {
$next_wr_subject = get_text(cut_str($next['wr_subject'], 255));
$next_href = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$next['wr_id'].$qstr;
$next_href = get_pretty_url($bo_table, $next['wr_id'], $qstr);
$next_wr_date = $next['wr_datetime'];
}
// 쓰기 링크
$write_href = '';
if ($member['mb_level'] >= $board['bo_write_level'])
$write_href = './write.php?bo_table='.$bo_table;
if ($member['mb_level'] >= $board['bo_write_level']) {
$write_href = short_url_clean(G5_BBS_URL.'/write.php?bo_table='.$bo_table);
}
// 답변 링크
$reply_href = '';
if ($member['mb_level'] >= $board['bo_reply_level'])
$reply_href = './write.php?w=r&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr;
if ($member['mb_level'] >= $board['bo_reply_level']) {
$reply_href = short_url_clean(G5_BBS_URL.'/write.php?w=r&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
}
// 수정, 삭제 링크
$update_href = $delete_href = '';
// 로그인중이고 자신의 글이라면 또는 관리자라면 비밀번호를 묻지 않고 바로 수정, 삭제 가능
if (($member['mb_id'] && ($member['mb_id'] === $write['mb_id'])) || $is_admin) {
$update_href = './write.php?w=u&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$update_href = short_url_clean(G5_BBS_URL.'/write.php?w=u&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr);
set_session('ss_delete_token', $token = uniqid(time()));
$delete_href ='./delete.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;token='.$token.'&amp;page='.$page.urldecode($qstr);
$delete_href = G5_BBS_URL.'/delete.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;token='.$token.'&amp;page='.$page.urldecode($qstr);
}
else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
$update_href = './password.php?w=u&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$delete_href = './password.php?w=d&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$update_href = G5_BBS_URL.'/password.php?w=u&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$delete_href = G5_BBS_URL.'/password.php?w=d&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
}
// 최고, 그룹관리자라면 글 복사, 이동 가능
$copy_href = $move_href = '';
if ($write['wr_reply'] == '' && ($is_admin == 'super' || $is_admin == 'group')) {
$copy_href = './move.php?sw=copy&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$move_href = './move.php?sw=move&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$copy_href = G5_BBS_URL.'/move.php?sw=copy&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
$move_href = G5_BBS_URL.'/move.php?sw=move&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
}
$scrap_href = '';
@@ -94,15 +96,15 @@ $good_href = '';
$nogood_href = '';
if ($is_member) {
// 스크랩 링크
$scrap_href = './scrap_popin.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$scrap_href = G5_BBS_URL.'/scrap_popin.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
// 추천 링크
if ($board['bo_use_good'])
$good_href = './good.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;good=good';
$good_href = G5_BBS_URL.'/good.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;good=good';
// 비추천 링크
if ($board['bo_use_nogood'])
$nogood_href = './good.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;good=nogood';
$nogood_href = G5_BBS_URL.'/good.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;good=nogood';
}
$view = get_view($write, $board, $board_skin_path);
+3 -3
View File
@@ -48,7 +48,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$ss_name = 'ss_secret_comment_'.$bo_table.'_'.$list[$i]['wr_id'];
if(!get_session($ss_name))
$list[$i]['content'] = '<a href="./password.php?w=sc&amp;bo_table='.$bo_table.'&amp;wr_id='.$list[$i]['wr_id'].$qstr.'" class="s_cmt">댓글내용 확인</a>';
$list[$i]['content'] = '<a href="'.G5_BBS_URL.'/password.php?w=sc&amp;bo_table='.$bo_table.'&amp;wr_id='.$list[$i]['wr_id'].$qstr.'" class="s_cmt">댓글내용 확인</a>';
else {
$list[$i]['content'] = conv_content($row['wr_content'], 0, 'wr_content');
$list[$i]['content'] = search_font($stx, $list[$i]['content']);
@@ -74,7 +74,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
if ($row['mb_id'] === $member['mb_id'] || $is_admin)
{
set_session('ss_delete_comment_'.$row['wr_id'].'_token', $token = uniqid(time()));
$list[$i]['del_link'] = './delete_comment.php?bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;token='.$token.'&amp;page='.$page.$qstr;
$list[$i]['del_link'] = G5_BBS_URL.'/delete_comment.php?bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;token='.$token.'&amp;page='.$page.$qstr;
$list[$i]['is_edit'] = true;
$list[$i]['is_del'] = true;
}
@@ -82,7 +82,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
else
{
if (!$row['mb_id']) {
$list[$i]['del_link'] = './password.php?w=x&amp;bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;page='.$page.$qstr;
$list[$i]['del_link'] = G5_BBS_URL.'/password.php?w=x&amp;bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;page='.$page.$qstr;
$list[$i]['is_del'] = true;
}
}
+2
View File
@@ -31,6 +31,8 @@ if ($w == 'u' || $w == 'r') {
}
}
start_event('bbs_write', $board, $wr_id, $w);
if ($w == '') {
if ($wr_id) {
alert('글쓰기에는 \$wr_id 값을 사용하지 않습니다.', G5_BBS_URL.'/board.php?bo_table='.$bo_table);
+10 -4
View File
@@ -54,18 +54,20 @@ if (empty($wr['wr_id']))
// 이 옵션을 사용 안 함으로 설정할 경우 어떤 스크립트도 실행 되지 않습니다.
//if (!trim($_POST["wr_content"])) die ("내용을 입력하여 주십시오.");
$post_wr_password = '';
if ($is_member)
{
$mb_id = $member['mb_id'];
// 4.00.13 - 실명 사용일때 댓글에 닉네임으로 입력되던 오류를 수정
$wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick']));
$wr_password = $member['mb_password'];
$wr_password = '';
$wr_email = addslashes($member['mb_email']);
$wr_homepage = addslashes(clean_xss_tags($member['mb_homepage']));
}
else
{
$mb_id = '';
$post_wr_password = $wr_password;
$wr_password = get_encrypt_string($wr_password);
}
@@ -205,7 +207,7 @@ if ($w == 'c') // 댓글 입력
$subject = '['.$config['cf_title'].'] '.$board['bo_subject'].' 게시판에 '.$str.'글이 올라왔습니다.';
// 4.00.15 - 메일로 보내는 댓글의 바로가기 링크 수정
$link_url = G5_BBS_URL."/board.php?bo_table=".$bo_table."&amp;wr_id=".$wr_id."&amp;".$qstr."#c_".$comment_id;
$link_url = get_pretty_url($bo_table, $wr_id, $qstr."#c_".$comment_id);
include_once(G5_LIB_PATH.'/mailer.lib.php');
@@ -289,7 +291,7 @@ else if ($w == 'cu') // 댓글 수정
if ($member['mb_id'] !== $comment['mb_id'])
alert('자신의 글이 아니므로 수정할 수 없습니다.');
} else {
if($comment['wr_password'] != $wr_password)
if( !($comment['mb_id'] === '' && $comment['wr_password'] && check_password($post_wr_password, $comment['wr_password'])) )
alert('댓글을 수정할 권한이 없습니다.');
}
@@ -337,5 +339,9 @@ else if ($w == 'cu') // 댓글 수정
delete_cache_latest($bo_table);
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr['wr_parent'].'&amp;'.$qstr.'&amp;#c_'.$comment_id);
$redirect_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr['wr_parent'].'&amp;'.$qstr.'&amp;#c_'.$comment_id);
start_event('comment_update_after', $board, $wr_id, $w, $qstr, $redirect_url);
goto_url($redirect_url);
?>
+2 -2
View File
@@ -22,7 +22,7 @@ if ($_POST['facebook_checked']) {
if ($user) {
try {
$link = G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr['wr_parent'].'&#c_'.$comment_id;
$link = get_pretty_url($bo_table, $wr['wr_parent'], '&#c_'.$comment_id);
$attachment = array(
'message' => stripslashes($wr_content),
'name' => $wr_subject,
@@ -53,7 +53,7 @@ if ($_POST['twitter_checked']) {
include_once(G5_SNS_PATH."/twitter/twitterconfig.php");
if ( !(empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) ) {
$comment_url = G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr['wr_parent'].'&#c_'.$comment_id;
$comment_url = get_pretty_url($bo_table, $wr['wr_parent'], '&#c_'.$comment_id);
$post = googl_short_url($comment_url).' '.$wr_content;
$post = utf8_strcut($post, 140);
+22 -7
View File
@@ -127,6 +127,8 @@ for ($i=1; $i<=10; $i++) {
@include_once($board_skin_path.'/write_update.head.skin.php');
start_event('write_update_before', $board, $wr_id, $w, $qstr);
if ($w == '' || $w == 'u') {
// 외부에서 글을 등록할 수 있는 버그가 존재하므로 공지는 관리자만 등록이 가능해야 함
@@ -211,12 +213,14 @@ if ($w == '' || $w == 'r') {
if (!isset($_POST['wr_subject']) || !trim($_POST['wr_subject']))
alert('제목을 입력하여 주십시오.');
$wr_seo_title = exist_seo_title_recursive('bbs', generate_seo_title($wr_subject), $write_table, $wr_id);
if ($w == '' || $w == 'r') {
if ($member['mb_id']) {
$mb_id = $member['mb_id'];
$wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick']));
$wr_password = $member['mb_password'];
$wr_password = '';
$wr_email = addslashes($member['mb_email']);
$wr_homepage = addslashes(clean_xss_tags($member['mb_homepage']));
} else {
@@ -251,6 +255,7 @@ if ($w == '' || $w == 'r') {
wr_option = '$html,$secret,$mail',
wr_subject = '$wr_subject',
wr_content = '$wr_content',
wr_seo_title = '$wr_seo_title',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_link1_hit = 0,
@@ -304,10 +309,10 @@ if ($w == '' || $w == 'r') {
}
} else if ($w == 'u') {
if (get_session('ss_bo_table') != $_POST['bo_table'] || get_session('ss_wr_id') != $_POST['wr_id']) {
alert('올바른 방법으로 수정하여 주십시오.', G5_BBS_URL.'/board.php?bo_table='.$bo_table);
alert('올바른 방법으로 수정하여 주십시오.', get_pretty_url($bo_table));
}
$return_url = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;
$return_url = get_pretty_url($bo_table, $wr_id);
if ($is_admin == 'super') // 최고관리자 통과
;
@@ -372,6 +377,7 @@ if ($w == '' || $w == 'r') {
wr_option = '{$html},{$secret},{$mail}',
wr_subject = '{$wr_subject}',
wr_content = '{$wr_content}',
wr_seo_title = '$wr_seo_title',
wr_link1 = '{$wr_link1}',
wr_link2 = '{$wr_link2}',
mb_id = '{$mb_id}',
@@ -546,6 +552,8 @@ for ($i=0; $i<count($_FILES['bf_file']['name']); $i++) {
// 올라간 파일의 퍼미션을 변경합니다.
chmod($dest_file, G5_FILE_PERMISSION);
$dest_file = apply_replace('write_update_upload_file', $dest_file, $board, $wr_id, $w);
}
}
@@ -603,6 +611,8 @@ for ($i=0; $i<count($upload); $i++)
bf_type = '{$upload[$i]['image']['2']}',
bf_datetime = '".G5_TIME_YMDHIS."' ";
sql_query($sql);
start_event('write_update_file_insert', $bo_table, $wr_id, $upload[$i], $w);
}
}
@@ -655,7 +665,7 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai
$subject = '['.$config['cf_title'].'] '.$board['bo_subject'].' 게시판에 '.$str.'글이 올라왔습니다.';
$link_url = G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;'.$qstr;
$link_url = get_pretty_url($bo_table, $wr_id, $qstr);
include_once(G5_LIB_PATH.'/mailer.lib.php');
@@ -686,7 +696,8 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai
// 중복된 메일 주소는 제거
$unique_email = array_unique($array_email);
$unique_email = array_values($unique_email);
$unique_email = apply_replace('write_update_mail_list', array_values($unique_email), $board, $wr_id);
for ($i=0; $i<count($unique_email); $i++) {
mailer($wr_name, $wr_email, $unique_email[$i], $subject, $content, 1);
}
@@ -698,8 +709,12 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai
delete_cache_latest($bo_table);
$redirect_url = apply_replace('write_update_move_url', short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr), $board, $wr_id, $w, $qstr, $file_upload_msg);
start_event('write_update_after', $board, $wr_id, $w, $qstr, $redirect_url);
if ($file_upload_msg)
alert($file_upload_msg, G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
alert($file_upload_msg, $redirect_url);
else
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
goto_url($redirect_url);
?>
+23 -8
View File
@@ -122,7 +122,14 @@ $member = array();
$board = array();
$group = array();
$g5 = array();
$g5_debug = array('php'=>array(),'sql'=>array());
include_once(G5_LIB_PATH.'/hook.lib.php'); // hook 함수 파일
include_once(G5_LIB_PATH.'/get_data.lib.php'); // 데이타 가져오는 함수 모음
include_once(G5_LIB_PATH.'/uri.lib.php'); // URL 함수 파일
include_once(G5_LIB_PATH.'/cache.lib.php');
$g5_object = new G5_object_store();
//==============================================================================
// 공통
@@ -138,7 +145,7 @@ if (file_exists($dbconfig_file)) {
// mysql connect resource $g5 배열에 저장 - 명랑폐인님 제안
$g5['connect_db'] = $connect_db;
sql_set_charset('utf8', $connect_db);
sql_set_charset(G5_DB_CHARSET, $connect_db);
if(defined('G5_MYSQL_SET_MODE') && G5_MYSQL_SET_MODE) sql_query("SET SESSION sql_mode = ''");
if (defined('G5_TIMEZONE')) sql_query(" set time_zone = '".G5_TIMEZONE."'");
} else {
@@ -212,7 +219,7 @@ ini_set("session.cookie_domain", G5_COOKIE_DOMAIN);
//------------------------------------------------------------------------------
// 기본환경설정
// 기본적으로 사용하는 필드만 얻은 후 상황에 따라 필드를 추가로 얻음
$config = sql_fetch(" select * from {$g5['config_table']} ");
$config = get_config();
define('G5_HTTP_BBS_URL', https_url(G5_BBS_DIR, false));
define('G5_HTTPS_BBS_URL', https_url(G5_BBS_DIR, true));
@@ -402,19 +409,25 @@ if ($_SESSION['ss_mb_id']) { // 로그인중이라면
$write = array();
$write_table = "";
if ($bo_table) {
$board = sql_fetch(" select * from {$g5['board_table']} where bo_table = '$bo_table' ");
$board = get_board_db($bo_table);
if ($board['bo_table']) {
set_cookie("ck_bo_table", $board['bo_table'], 86400 * 1);
$gr_id = $board['gr_id'];
$write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$comment_table = $g5['write_prefix'] . $bo_table . $g5['comment_suffix']; // 코멘트 테이블 전체이름
if (isset($wr_id) && $wr_id)
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
if (isset($wr_id) && $wr_id) {
$write = get_write($write_table, $wr_id);
} else if (isset($wr_seo_title) && $wr_seo_title) {
$write = get_content_by_field($write_table, 'bbs', 'wr_seo_title', $wr_seo_title);
if( isset($write['wr_id']) ){
$wr_id = $write['wr_id'];
}
}
}
}
if ($gr_id) {
$group = sql_fetch(" select * from {$g5['group_table']} where gr_id = '$gr_id' ");
$group = get_group($gr_id);
}
@@ -637,5 +650,7 @@ header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
start_event('common_header');
$html_process = new html_process();
?>
?>
+20 -1
View File
@@ -29,6 +29,16 @@ if (PHP_VERSION >= '5.1.0') {
define('G5_DOMAIN', '');
define('G5_HTTPS_DOMAIN', '');
//디버깅 상수
define('G5_DEBUG', true);
// Set Databse table default engine is Databse default_storage_engine, If you want to use MyISAM or InnoDB, change to MyISAM or InnoDB.
define('G5_DB_ENGINE', '');
// Set Databse table default Charset
// utf8, utf8mb4 등 지정 가능 기본값은 utf8
define('G5_DB_CHARSET', 'utf8');
/*
www.sir.kr 과 sir.kr 도메인은 서로 다른 도메인으로 인식합니다. 쿠키를 공유하려면 .sir.kr 과 같이 입력하세요.
이곳에 입력이 없다면 www 붙은 도메인과 그렇지 않은 도메인은 쿠키를 공유하지 않으므로 로그인이 풀릴 수 있습니다.
@@ -60,6 +70,9 @@ define('G5_PHPMAILER_DIR', 'PHPMailer');
define('G5_SESSION_DIR', 'session');
define('G5_THEME_DIR', 'theme');
define('G5_GROUP_DIR', 'group');
define('G5_CONTENT_DIR', 'content');
// URL 은 브라우저상에서의 경로 (도메인으로 부터의)
if (G5_DOMAIN) {
define('G5_URL', G5_DOMAIN);
@@ -147,6 +160,9 @@ define('G5_HANGUL', 16); // 한글
define('G5_SPACE', 32); // 공백
define('G5_SPECIAL', 64); // 특수문자
// SEO TITLE 문단 길이
define('G5_SEO_TITEL_WORD_CUT', 8); // SEO TITLE 문단 길이
// 퍼미션
define('G5_DIR_PERMISSION', 0755); // 디렉토리 생성시 퍼미션
define('G5_FILE_PERMISSION', 0644); // 파일 생성시 퍼미션
@@ -166,7 +182,10 @@ define('G5_SMTP_PORT', '25');
// 암호화 함수 지정
// 사이트 운영 중 설정을 변경하면 로그인이 안되는 등의 문제가 발생합니다.
define('G5_STRING_ENCRYPT_FUNCTION', 'sql_password');
// 5.4 버전 이전에는 sql_password 이 사용됨, 5.4 버전부터 기본이 create_hash 로 변경
//define('G5_STRING_ENCRYPT_FUNCTION', 'sql_password');
define('G5_STRING_ENCRYPT_FUNCTION', 'create_hash');
define('G5_MYSQL_PASSWORD_LENGTH', 41); // mysql password length 41, old_password 의 경우에는 16
// SQL 에러를 표시할 것인지 지정
// 에러를 표시하려면 TRUE 로 변경
+21
View File
@@ -0,0 +1,21 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
put_event('tail_sub', 'show_debug_bar');
function show_debug_bar() {
global $g5, $g5_debug, $is_admin;
if( ! get_permission_debug_show() ) return;
if ( !($is_admin === 'super' && !is_mobile() ) ){
return;
}
$memory_usage = function_exists( 'memory_get_peak_usage' ) ? memory_get_peak_usage() : memory_get_usage();
$php_run_time = get_microtime()-$g5_debug['php']['begin_time'];
include_once( G5_PLUGIN_PATH.'/debugbar/debugbar.php' );
}
?>
+59
View File
@@ -0,0 +1,59 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
put_event('member_login_check', 'g54_userlogin_after', 10, 2);
put_event('memo_list', 'g54_user_memo_insert', 10, 3);
// 5.3 버전에서
function g54_userlogin_after($mb, $link){
global $g5;
if(isset($mb['mb_id']) && $mb['mb_id']){
$mb_img_paths = array(G5_DATA_PATH.'/member/'.substr($mb['mb_id'], 0, 2).'/', G5_DATA_PATH.'/member_image/'.substr($mb['mb_id'], 0, 2).'/');
$mb_id = $mb['mb_id'];
foreach( $mb_img_paths as $path ){
$before_file = $path.$mb_id.'.gif';
$after_file = $path.get_mb_icon_name($mb_id).'.gif';
// 회원 아이콘 또는 프로필 파일 이름을 변경
if( ($before_file !== $after_file) && file_exists($before_file) && ! file_exists($after_file) ){
@rename($before_file, $after_file);
}
}
}
}
function g54_user_memo_insert($kind, $unkind, $page=1){
global $g5, $is_member, $member;
if( ! $is_member || $kind !== 'send' ) return;
$sql = " select count(*) as cnt from {$g5['memo_table']} where me_send_mb_id = '{$member['mb_id']}' and me_type = 'recv' and me_send_ip = '' ";
$row = sql_fetch($sql);
if ( !$row['cnt'] ) return;
$sql = " select count(*) as cnt from {$g5['memo_table']} where me_send_mb_id = '{$member['mb_id']}' and me_type = 'send' ";
$row2 = sql_fetch($sql);
if( $row['cnt'] && ! $row2['cnt'] ){
$sql = " select * from {$g5['memo_table']} where me_send_mb_id = '{$member['mb_id']}' and me_type = 'recv' ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
$sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_read_datetime, me_memo, me_send_id, me_type ) values ( '".addslashes($row['me_recv_mb_id'])."', '".addslashes($row['me_send_mb_id'])."', '".addslashes($row['me_send_datetime'])."', '".addslashes($row['me_read_datetime'])."', '".addslashes($row['me_memo'])."', '".$row['me_id']."', 'send' ) ";
sql_query($sql);
}
$sql = " update {$g5['memo_table']} set me_send_ip = '{$_SERVER['REMOTE_ADDR']}' where me_send_mb_id = '{$member['mb_id']}' and me_type = 'recv' and me_send_ip = '' ";
sql_query($sql);
}
}
?>
+4 -4
View File
@@ -38,8 +38,8 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
<li><a href="<?php echo G5_BBS_URL ?>/member_confirm.php?url=<?php echo G5_BBS_URL ?>/register_form.php"><i class="fa fa-cog" aria-hidden="true"></i> 정보수정</a></li>
<li><a href="<?php echo G5_BBS_URL ?>/logout.php"><i class="fa fa-sign-out" aria-hidden="true"></i> 로그아웃</a></li>
<?php if ($is_admin) { ?>
<li class="tnb_admin"><a href="<?php echo G5_ADMIN_URL ?>"><b><i class="fa fa-user-circle" aria-hidden="true"></i> 관리자</b></a></li>
<?php } ?>
<li class="tnb_admin"><a href="<?php echo correct_goto_url(G5_ADMIN_URL); ?>"><b><i class="fa fa-user-circle" aria-hidden="true"></i> 관리자</b></a></li>
<?php } ?>
<?php } else { ?>
<li><a href="<?php echo G5_BBS_URL ?>/register.php"><i class="fa fa-user-plus" aria-hidden="true"></i> 회원가입</a></li>
<li><a href="<?php echo G5_BBS_URL ?>/login.php"><b><i class="fa fa-sign-in" aria-hidden="true"></i> 로그인</b></a></li>
@@ -165,7 +165,7 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
} //end foreach $row
if ($i == 0) { ?>
<li class="gnb_empty">메뉴 준비 중입니다.<?php if ($is_admin) { ?> <a href="<?php echo G5_ADMIN_URL; ?>/menu_list.php">관리자모드 &gt; 환경설정 &gt; 메뉴설정</a>에서 설정하실 수 있습니다.<?php } ?></li>
<li class="gnb_empty">메뉴 준비 중입니다.<?php if ($is_admin) { ?> <a href="<?php echo correct_goto_url(G5_ADMIN_URL); ?>/menu_list.php">관리자모드 &gt; 환경설정 &gt; 메뉴설정</a>에서 설정하실 수 있습니다.<?php } ?></li>
<?php } ?>
</ul>
<div id="gnb_all">
@@ -198,7 +198,7 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
} //end foreach $row
if ($i == 0) { ?>
<li class="gnb_empty">메뉴 준비 중입니다.<?php if ($is_admin) { ?> <br><a href="<?php echo G5_ADMIN_URL; ?>/menu_list.php">관리자모드 &gt; 환경설정 &gt; 메뉴설정</a>에서 설정하실 수 있습니다.<?php } ?></li>
<li class="gnb_empty">메뉴 준비 중입니다.<?php if ($is_admin) { ?> <br><a href="<?php echo correct_goto_url(G5_ADMIN_URL); ?>/menu_list.php">관리자모드 &gt; 환경설정 &gt; 메뉴설정</a>에서 설정하실 수 있습니다.<?php } ?></li>
<?php } ?>
</ul>
<button type="button" class="gnb_close_btn"><i class="fa fa-times" aria-hidden="true"></i></button>
+1 -1
View File
@@ -8,7 +8,7 @@ if(!defined('G5_IS_ADMIN') && defined('G5_THEME_PATH') && is_file(G5_THEME_PATH.
return;
}
$begin_time = get_microtime();
$g5_debug['php']['begin_time'] = $begin_time = get_microtime();
if (!isset($g5['title'])) {
$g5['title'] = $config['cf_title'];
+3
View File
@@ -4,6 +4,9 @@ include_once('../lib/json.lib.php');
include_once('../lib/common.lib.php'); // 공통 라이브러리
include_once('./install.function.php'); // 인스톨 과정 함수 모음
include_once('../lib/hook.lib.php'); // hook 함수 파일
include_once('../lib/get_data.lib.php'); // 데이타 가져오는 함수 모음
$data_path = '../'.G5_DATA_DIR;
// 파일이 존재한다면 설치할 수 없다.
+43 -32
View File
@@ -186,10 +186,10 @@ CREATE TABLE IF NOT EXISTS `g5_board_new` (
DROP TABLE IF EXISTS `g5_config`;
CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_title` varchar(255) NOT NULL DEFAULT '',
`cf_theme` varchar(255) NOT NULL DEFAULT '',
`cf_admin` varchar(255) NOT NULL DEFAULT '',
`cf_admin_email` varchar(255) NOT NULL DEFAULT '',
`cf_admin_email_name` varchar(255) NOT NULL DEFAULT '',
`cf_theme` varchar(100) NOT NULL DEFAULT '',
`cf_admin` varchar(100) NOT NULL DEFAULT '',
`cf_admin_email` varchar(100) NOT NULL DEFAULT '',
`cf_admin_email_name` varchar(100) NOT NULL DEFAULT '',
`cf_add_script` text NOT NULL,
`cf_use_point` tinyint(4) NOT NULL DEFAULT '0',
`cf_point_term` int(11) NOT NULL DEFAULT '0',
@@ -198,25 +198,26 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_login_point` int(11) NOT NULL DEFAULT '0',
`cf_cut_name` tinyint(4) NOT NULL DEFAULT '0',
`cf_nick_modify` int(11) NOT NULL DEFAULT '0',
`cf_new_skin` varchar(255) NOT NULL DEFAULT '',
`cf_new_skin` varchar(50) NOT NULL DEFAULT '',
`cf_new_rows` int(11) NOT NULL DEFAULT '0',
`cf_search_skin` varchar(255) NOT NULL DEFAULT '',
`cf_connect_skin` varchar(255) NOT NULL DEFAULT '',
`cf_faq_skin` varchar(255) NOT NULL DEFAULT '',
`cf_search_skin` varchar(50) NOT NULL DEFAULT '',
`cf_connect_skin` varchar(50) NOT NULL DEFAULT '',
`cf_faq_skin` varchar(50) NOT NULL DEFAULT '',
`cf_read_point` int(11) NOT NULL DEFAULT '0',
`cf_write_point` int(11) NOT NULL DEFAULT '0',
`cf_comment_point` int(11) NOT NULL DEFAULT '0',
`cf_download_point` int(11) NOT NULL DEFAULT '0',
`cf_write_pages` int(11) NOT NULL DEFAULT '0',
`cf_mobile_pages` int(11) NOT NULL DEFAULT '0',
`cf_link_target` varchar(255) NOT NULL DEFAULT '',
`cf_link_target` varchar(50) NOT NULL DEFAULT '',
`cf_bbs_rewrite` tinyint(4) NOT NULL DEFAULT '0',
`cf_delay_sec` int(11) NOT NULL DEFAULT '0',
`cf_filter` text NOT NULL,
`cf_possible_ip` text NOT NULL,
`cf_intercept_ip` text NOT NULL,
`cf_analytics` text NOT NULL,
`cf_add_meta` text NOT NULL,
`cf_member_skin` varchar(255) NOT NULL DEFAULT '',
`cf_member_skin` varchar(50) NOT NULL DEFAULT '',
`cf_use_homepage` tinyint(4) NOT NULL DEFAULT '0',
`cf_req_homepage` tinyint(4) NOT NULL DEFAULT '0',
`cf_use_tel` tinyint(4) NOT NULL DEFAULT '0',
@@ -272,44 +273,44 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_privacy` text NOT NULL,
`cf_open_modify` int(11) NOT NULL DEFAULT '0',
`cf_memo_send_point` int(11) NOT NULL DEFAULT '0',
`cf_mobile_new_skin` varchar(255) NOT NULL DEFAULT '',
`cf_mobile_search_skin` varchar(255) NOT NULL DEFAULT '',
`cf_mobile_connect_skin` varchar(255) NOT NULL DEFAULT '',
`cf_mobile_faq_skin` varchar(255) NOT NULL DEFAULT '',
`cf_mobile_member_skin` varchar(255) NOT NULL DEFAULT '',
`cf_mobile_new_skin` varchar(50) NOT NULL DEFAULT '',
`cf_mobile_search_skin` varchar(50) NOT NULL DEFAULT '',
`cf_mobile_connect_skin` varchar(50) NOT NULL DEFAULT '',
`cf_mobile_faq_skin` varchar(50) NOT NULL DEFAULT '',
`cf_mobile_member_skin` varchar(50) NOT NULL DEFAULT '',
`cf_captcha_mp3` varchar(255) NOT NULL DEFAULT '',
`cf_editor` varchar(255) NOT NULL DEFAULT '',
`cf_editor` varchar(50) NOT NULL DEFAULT '',
`cf_cert_use` tinyint(4) NOT NULL DEFAULT '0',
`cf_cert_ipin` varchar(255) NOT NULL DEFAULT '',
`cf_cert_hp` varchar(255) NOT NULL DEFAULT '',
`cf_cert_kcb_cd` varchar(255) NOT NULL DEFAULT '',
`cf_cert_kcp_cd` varchar(255) NOT NULL DEFAULT '',
`cf_lg_mid` varchar(255) NOT NULL DEFAULT '',
`cf_lg_mert_key` varchar(255) NOT NULL DEFAULT '',
`cf_lg_mid` varchar(100) NOT NULL DEFAULT '',
`cf_lg_mert_key` varchar(100) NOT NULL DEFAULT '',
`cf_cert_limit` int(11) NOT NULL DEFAULT '0',
`cf_cert_req` tinyint(4) NOT NULL DEFAULT '0',
`cf_sms_use` varchar(255) NOT NULL DEFAULT '',
`cf_sms_type` varchar(10) NOT NULL DEFAULT '',
`cf_icode_id` varchar(255) NOT NULL DEFAULT '',
`cf_icode_pw` varchar(255) NOT NULL DEFAULT '',
`cf_icode_server_ip` varchar(255) NOT NULL DEFAULT '',
`cf_icode_server_port` varchar(255) NOT NULL DEFAULT '',
`cf_googl_shorturl_apikey` varchar(255) NOT NULL DEFAULT '',
`cf_icode_server_ip` varchar(50) NOT NULL DEFAULT '',
`cf_icode_server_port` varchar(50) NOT NULL DEFAULT '',
`cf_googl_shorturl_apikey` varchar(50) NOT NULL DEFAULT '',
`cf_social_login_use` tinyint(4) NOT NULL DEFAULT '0',
`cf_social_servicelist` varchar(255) NOT NULL DEFAULT '',
`cf_payco_clientid` varchar(100) NOT NULL DEFAULT '',
`cf_payco_secret` varchar(100) NOT NULL DEFAULT '',
`cf_facebook_appid` varchar(255) NOT NULL,
`cf_facebook_secret` varchar(255) NOT NULL,
`cf_twitter_key` varchar(255) NOT NULL,
`cf_twitter_secret` varchar(255) NOT NULL,
`cf_facebook_appid` varchar(100) NOT NULL,
`cf_facebook_secret` varchar(100) NOT NULL,
`cf_twitter_key` varchar(100) NOT NULL,
`cf_twitter_secret` varchar(100) NOT NULL,
`cf_google_clientid` varchar(100) NOT NULL DEFAULT '',
`cf_google_secret` varchar(100) NOT NULL DEFAULT '',
`cf_naver_clientid` varchar(100) NOT NULL DEFAULT '',
`cf_naver_secret` varchar(100) NOT NULL DEFAULT '',
`cf_kakao_rest_key` varchar(100) NOT NULL DEFAULT '',
`cf_kakao_client_secret` varchar(100) NOT NULL DEFAULT '',
`cf_kakao_js_apikey` varchar(255) NOT NULL,
`cf_kakao_js_apikey` varchar(100) NOT NULL,
`cf_captcha` varchar(100) NOT NULL DEFAULT '',
`cf_recaptcha_site_key` varchar(100) NOT NULL DEFAULT '',
`cf_recaptcha_secret_key` varchar(100) NOT NULL DEFAULT '',
@@ -416,7 +417,7 @@ CREATE TABLE IF NOT EXISTS `g5_group_member` (
DROP TABLE IF EXISTS `g5_login`;
CREATE TABLE IF NOT EXISTS `g5_login` (
`lo_ip` varchar(255) NOT NULL default '',
`lo_ip` varchar(100) NOT NULL default '',
`mb_id` varchar(20) NOT NULL default '',
`lo_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`lo_location` text NOT NULL,
@@ -490,6 +491,8 @@ CREATE TABLE IF NOT EXISTS `g5_member` (
`mb_open_date` date NOT NULL default '0000-00-00',
`mb_profile` text NOT NULL,
`mb_memo_call` varchar(255) NOT NULL default '',
`mb_memo_cnt` int(11) NOT NULL DEFAULT '0',
`mb_scrap_cnt` int(11) NOT NULL default '0',
`mb_1` varchar(255) NOT NULL default '',
`mb_2` varchar(255) NOT NULL default '',
`mb_3` varchar(255) NOT NULL default '',
@@ -514,12 +517,15 @@ CREATE TABLE IF NOT EXISTS `g5_member` (
DROP TABLE IF EXISTS `g5_memo`;
CREATE TABLE IF NOT EXISTS `g5_memo` (
`me_id` int(11) NOT NULL default '0',
`me_id` INT(11) NOT NULL AUTO_INCREMENT,
`me_recv_mb_id` varchar(20) NOT NULL default '',
`me_send_mb_id` varchar(20) NOT NULL default '',
`me_send_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`me_read_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`me_memo` text NOT NULL,
`me_send_id` INT(11) NOT NULL DEFAULT '0',
`me_type` ENUM('send','recv') NOT NULL DEFAULT 'recv',
`me_send_ip` VARCHAR(100) NOT NULL DEFAULT '',
PRIMARY KEY (`me_id`),
KEY `me_recv_mb_id` (`me_recv_mb_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -543,7 +549,7 @@ CREATE TABLE IF NOT EXISTS `g5_point` (
`po_mb_point` int(11) NOT NULL default '0',
`po_rel_table` varchar(20) NOT NULL default '',
`po_rel_id` varchar(20) NOT NULL default '',
`po_rel_action` varchar(255) NOT NULL default '',
`po_rel_action` varchar(100) NOT NULL default '',
PRIMARY KEY (`po_id`),
KEY `index1` (`mb_id`,`po_rel_table`,`po_rel_id`,`po_rel_action`),
KEY `index2` (`po_expire_date`)
@@ -645,11 +651,14 @@ CREATE TABLE IF NOT EXISTS `g5_scrap` (
DROP TABLE IF EXISTS `g5_visit`;
CREATE TABLE IF NOT EXISTS `g5_visit` (
`vi_id` int(11) NOT NULL default '0',
`vi_ip` varchar(255) NOT NULL default '',
`vi_ip` varchar(100) NOT NULL default '',
`vi_date` date NOT NULL default '0000-00-00',
`vi_time` time NOT NULL default '00:00:00',
`vi_referer` text NOT NULL,
`vi_agent` varchar(255) NOT NULL default '',
`vi_agent` varchar(200) NOT NULL default '',
`vi_browser` varchar(255) NOT NULL DEFAULT '',
`vi_os` varchar(255) NOT NULL DEFAULT '',
`vi_device` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`vi_id`),
UNIQUE KEY `index1` (`vi_ip`,`vi_date`),
KEY `index2` (`vi_date`)
@@ -798,6 +807,7 @@ CREATE TABLE IF NOT EXISTS `g5_content` (
`co_html` tinyint(4) NOT NULL DEFAULT '0',
`co_subject` varchar(255) NOT NULL DEFAULT '',
`co_content` longtext NOT NULL,
`co_seo_title` varchar(255) NOT NULL DEFAULT '',
`co_mobile_content` longtext NOT NULL,
`co_skin` varchar(255) NOT NULL DEFAULT '',
`co_mobile_skin` varchar(255) NOT NULL DEFAULT '',
@@ -805,7 +815,8 @@ CREATE TABLE IF NOT EXISTS `g5_content` (
`co_hit` int(11) NOT NULL DEFAULT '0',
`co_include_head` varchar(255) NOT NULL,
`co_include_tail` varchar(255) NOT NULL,
PRIMARY KEY (`co_id`)
PRIMARY KEY (`co_id`),
KEY `co_seo_title` (`co_seo_title`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
+13 -3
View File
@@ -13,6 +13,11 @@ include_once ('../config.php');
include_once ('../lib/common.lib.php');
include_once('./install.function.php'); // 인스톨 과정 함수 모음
include_once('../lib/hook.lib.php'); // hook 함수 파일
include_once('../lib/get_data.lib.php');
include_once('../lib/uri.lib.php'); // URL 함수 파일
include_once('../lib/cache.lib.php');
$title = G5_VERSION." 설치 완료 3/3";
include_once ('./install.inc.php');
@@ -57,7 +62,7 @@ if (!$select_db) {
}
$mysql_set_mode = 'false';
sql_set_charset('utf8', $dblink);
sql_set_charset(G5_DB_CHARSET, $dblink);
$result = sql_query(" SELECT @@sql_mode as mode ", true, $dblink);
$row = sql_fetch_array($result);
if($row['mode']) {
@@ -82,7 +87,10 @@ $file = preg_replace('/`g5_([^`]+`)/', '`'.$table_prefix.'$1', $file);
$f = explode(';', $file);
for ($i=0; $i<count($f); $i++) {
if (trim($f[$i]) == '') continue;
sql_query($f[$i], true, $dblink);
$sql = get_db_create_replace($f[$i]);
sql_query($sql, true, $dblink);
}
// 테이블 생성 ------------------------------------
?>
@@ -176,7 +184,7 @@ sql_query($sql, true, $dblink);
// 관리자 회원가입
$sql = " insert into `{$table_prefix}member`
set mb_id = '$admin_id',
mb_password = PASSWORD('$admin_pass'),
mb_password = '".get_encrypt_string($admin_pass)."',
mb_name = '$admin_name',
mb_nick = '$admin_name',
mb_email = '$admin_email',
@@ -279,6 +287,8 @@ for ($i=0; $i<count($tmp_bo_table); $i++)
// 게시판 테이블 생성
$file = file("../adm/sql_write.sql");
$file = get_db_create_replace($file);
$sql = implode($file, "\n");
$create_table = $table_prefix.'write_' . $tmp_bo_table[$i];
+5
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+186
View File
@@ -0,0 +1,186 @@
/**
* Owl Carousel v2.3.4
* Copyright 2013-2018 David Deutsch
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
*/
/*
* Owl Carousel - Core
*/
.owl-carousel {
display: none;
width: 100%;
-webkit-tap-highlight-color: transparent;
/* position relative and z-index fix webkit rendering fonts issue */
position: relative;
z-index: 1; }
.owl-carousel .owl-stage {
position: relative;
-ms-touch-action: pan-Y;
touch-action: manipulation;
-moz-backface-visibility: hidden;
/* fix firefox animation glitch */ }
.owl-carousel .owl-stage:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0; }
.owl-carousel .owl-stage-outer {
position: relative;
overflow: hidden;
/* fix for flashing background */
-webkit-transform: translate3d(0px, 0px, 0px); }
.owl-carousel .owl-wrapper,
.owl-carousel .owl-item {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0); }
.owl-carousel .owl-item {
position: relative;
min-height: 1px;
float: left;
-webkit-backface-visibility: hidden;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none; }
.owl-carousel .owl-item img {
display: block;
width: 100%; }
.owl-carousel .owl-nav.disabled,
.owl-carousel .owl-dots.disabled {
display: none; }
.owl-carousel .owl-nav .owl-prev,
.owl-carousel .owl-nav .owl-next,
.owl-carousel .owl-dot {
cursor: pointer;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.owl-carousel .owl-nav button.owl-prev,
.owl-carousel .owl-nav button.owl-next,
.owl-carousel button.owl-dot {
background: none;
color: inherit;
border: none;
padding: 0 !important;
font: inherit; }
.owl-carousel.owl-loaded {
display: block; }
.owl-carousel.owl-loading {
opacity: 0;
display: block; }
.owl-carousel.owl-hidden {
opacity: 0; }
.owl-carousel.owl-refresh .owl-item {
visibility: hidden; }
.owl-carousel.owl-drag .owl-item {
-ms-touch-action: pan-y;
touch-action: pan-y;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.owl-carousel.owl-grab {
cursor: move;
cursor: grab; }
.owl-carousel.owl-rtl {
direction: rtl; }
.owl-carousel.owl-rtl .owl-item {
float: right; }
/* No Js */
.no-js .owl-carousel {
display: block; }
/*
* Owl Carousel - Animate Plugin
*/
.owl-carousel .animated {
animation-duration: 1000ms;
animation-fill-mode: both; }
.owl-carousel .owl-animated-in {
z-index: 0; }
.owl-carousel .owl-animated-out {
z-index: 1; }
.owl-carousel .fadeOut {
animation-name: fadeOut; }
@keyframes fadeOut {
0% {
opacity: 1; }
100% {
opacity: 0; } }
/*
* Owl Carousel - Auto Height Plugin
*/
.owl-height {
transition: height 500ms ease-in-out; }
/*
* Owl Carousel - Lazy Load Plugin
*/
.owl-carousel .owl-item {
/**
This is introduced due to a bug in IE11 where lazy loading combined with autoheight plugin causes a wrong
calculation of the height of the owl-item that breaks page layouts
*/ }
.owl-carousel .owl-item .owl-lazy {
opacity: 0;
transition: opacity 400ms ease; }
.owl-carousel .owl-item .owl-lazy[src^=""], .owl-carousel .owl-item .owl-lazy:not([src]) {
max-height: 0; }
.owl-carousel .owl-item img.owl-lazy {
transform-style: preserve-3d; }
/*
* Owl Carousel - Video Plugin
*/
.owl-carousel .owl-video-wrapper {
position: relative;
height: 100%;
background: #000; }
.owl-carousel .owl-video-play-icon {
position: absolute;
height: 80px;
width: 80px;
left: 50%;
top: 50%;
margin-left: -40px;
margin-top: -40px;
background: url("owl.video.play.png") no-repeat;
cursor: pointer;
z-index: 1;
-webkit-backface-visibility: hidden;
transition: transform 100ms ease; }
.owl-carousel .owl-video-play-icon:hover {
-ms-transform: scale(1.3, 1.3);
transform: scale(1.3, 1.3); }
.owl-carousel .owl-video-playing .owl-video-tn,
.owl-carousel .owl-video-playing .owl-video-play-icon {
display: none; }
.owl-carousel .owl-video-tn {
opacity: 0;
height: 100%;
background-position: center center;
background-repeat: no-repeat;
background-size: contain;
transition: opacity 400ms ease; }
.owl-carousel .owl-video-frame {
position: relative;
z-index: 1;
height: 100%;
width: 100%; }
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
/**
* Owl Carousel v2.3.4
* Copyright 2013-2018 David Deutsch
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
*/
.owl-carousel,.owl-carousel .owl-item{-webkit-tap-highlight-color:transparent;position:relative}.owl-carousel{display:none;width:100%;z-index:1}.owl-carousel .owl-stage{position:relative;-ms-touch-action:pan-Y;touch-action:manipulation;-moz-backface-visibility:hidden}.owl-carousel .owl-stage:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.owl-carousel .owl-stage-outer{position:relative;overflow:hidden;-webkit-transform:translate3d(0,0,0)}.owl-carousel .owl-item,.owl-carousel .owl-wrapper{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0)}.owl-carousel .owl-item{min-height:1px;float:left;-webkit-backface-visibility:hidden;-webkit-touch-callout:none}.owl-carousel .owl-item img{display:block;width:100%}.owl-carousel .owl-dots.disabled,.owl-carousel .owl-nav.disabled{display:none}.no-js .owl-carousel,.owl-carousel.owl-loaded{display:block}.owl-carousel .owl-dot,.owl-carousel .owl-nav .owl-next,.owl-carousel .owl-nav .owl-prev{cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel .owl-nav button.owl-next,.owl-carousel .owl-nav button.owl-prev,.owl-carousel button.owl-dot{background:0 0;color:inherit;border:none;padding:0!important;font:inherit}.owl-carousel.owl-loading{opacity:0;display:block}.owl-carousel.owl-hidden{opacity:0}.owl-carousel.owl-refresh .owl-item{visibility:hidden}.owl-carousel.owl-drag .owl-item{-ms-touch-action:pan-y;touch-action:pan-y;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel.owl-grab{cursor:move;cursor:grab}.owl-carousel.owl-rtl{direction:rtl}.owl-carousel.owl-rtl .owl-item{float:right}.owl-carousel .animated{animation-duration:1s;animation-fill-mode:both}.owl-carousel .owl-animated-in{z-index:0}.owl-carousel .owl-animated-out{z-index:1}.owl-carousel .fadeOut{animation-name:fadeOut}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.owl-height{transition:height .5s ease-in-out}.owl-carousel .owl-item .owl-lazy{opacity:0;transition:opacity .4s ease}.owl-carousel .owl-item .owl-lazy:not([src]),.owl-carousel .owl-item .owl-lazy[src^=""]{max-height:0}.owl-carousel .owl-item img.owl-lazy{transform-style:preserve-3d}.owl-carousel .owl-video-wrapper{position:relative;height:100%;background:#000}.owl-carousel .owl-video-play-icon{position:absolute;height:80px;width:80px;left:50%;top:50%;margin-left:-40px;margin-top:-40px;background:url(owl.video.play.png) no-repeat;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;transition:transform .1s ease}.owl-carousel .owl-video-play-icon:hover{-ms-transform:scale(1.3,1.3);transform:scale(1.3,1.3)}.owl-carousel .owl-video-playing .owl-video-play-icon,.owl-carousel .owl-video-playing .owl-video-tn{display:none}.owl-carousel .owl-video-tn{opacity:0;height:100%;background-position:center center;background-repeat:no-repeat;background-size:contain;transition:opacity .4s ease}.owl-carousel .owl-video-frame{position:relative;z-index:1;height:100%;width:100%}
File diff suppressed because one or more lines are too long
+187
View File
@@ -0,0 +1,187 @@
<?php
if (!defined('_GNUBOARD_')) exit;
class FileCache
{
/**
* The root cache directory.
* @var string
*/
protected $_cache_path = '/tmp/cache';
/** @var string */
protected $file_extension = '';
/**
* Creates a FileCache object
*
* @param array $options
*/
public function __construct($options = array())
{
$available_options = array('_cache_path', 'file_extension');
foreach ($available_options as $name) {
if (isset($options[$name])) {
$this->$name = $options[$name];
}
}
}
/**
* Fetches an entry from the cache.
*
* @param string $id
*/
public function get($id)
{
$data = $this->_get($id);
return is_array($data) ? $data['data'] : FALSE;
}
protected function get_cache_file_path($id){
$id = str_replace(DIRECTORY_SEPARATOR, '/', $id);
$add_separator = '';
$add_file_extension = '';
if( strpos('/', $id) !== 0 ){
$add_separator = '/';
}
$ext = pathinfo($id, PATHINFO_EXTENSION);
if( !(isset($ext['extension']) && $ext['extension']) ){
$add_file_extension = $this->file_extension;
}
return $this->_cache_path.$add_separator.$id.$add_file_extension;
}
protected function _get($id)
{
$cache_file_path = $this->get_cache_file_path($id);
if ( ! is_file($cache_file_path) )
{
return FALSE;
}
$data = unserialize(file_get_contents( $cache_file_path ));
if ($data['ttl'] > 0 && time() > $data['time'] + $data['ttl'])
{
unlink( $cache_file_path );
return FALSE;
}
return $data;
}
public function write_file($path, $data, $mode = 'wb')
{
if ( ! $fp = @fopen($path, $mode))
{
return FALSE;
}
flock($fp, LOCK_EX);
for ($result = $written = 0, $length = strlen($data); $written < $length; $written += $result)
{
if (($result = fwrite($fp, substr($data, $written))) === FALSE)
{
break;
}
}
flock($fp, LOCK_UN);
fclose($fp);
return is_int($result);
}
/**
* Deletes a cache entry.
*
* @param string $id
*
* @return bool
*/
public function delete($id)
{
$cache_file_path = $this->get_cache_file_path($id);
return file_exists($cache_file_path) ? unlink($cache_file_path) : FALSE;
}
/**
* Puts data into the cache.
*
* @param string $id
* @param mixed $data
* @param int $lifetime
*
* @return bool
*/
public function save($id, $data, $ttl = 60, $raw = FALSE)
{
$cache_file_path = $this->get_cache_file_path($id);
$contents = array(
'time' => time(),
'ttl' => $ttl,
'data' => $data
);
if ($this->write_file($cache_file_path, serialize($contents)))
{
chmod($cache_file_path, G5_FILE_PERMISSION);
return TRUE;
}
return FALSE;
}
/**
* Fetches a base directory to store the cache data
*
* @return string
*/
protected function getCacheDirectory()
{
return $this->_cache_path;
}
/**
* Encodes some data to a string so it can be written to disk
*
* @param mixed $data
* @param int $ttl
* @return string
*/
public function encode($data, $ttl)
{
$expire = null;
if ($ttl !== null) {
$expire = time() + $ttl;
}
return serialize(array($data, $expire));
}
/**
* Decodes a string encoded by {@see encode()}
*
* Must returns a tuple (data, expire). Expire
* can be null to signal no expiration.
*
* @param string $data
* @return array (data, expire)
*/
public function decode($data)
{
return unserialize($data);
}
}
?>
+327
View File
@@ -0,0 +1,327 @@
<?php
if (!defined('_GNUBOARD_')) exit;
/**
* Library for handling hooks.
*
* @author Josantonius <hello@josantonius.com>
* @copyright 2017 (c) Josantonius - PHP-Hook
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
* @link https://github.com/Josantonius/PHP-Hook
* @since 1.0.0
*/
/**
* Hook handler.
*
* @since 1.0.0
*/
class Hook
{
/**
* Instance id.
*
* @since 1.0.5
*
* @var int
*/
protected static $id = '0';
/**
* Callbacks.
*
* @since 1.0.3
*
* @var array
*/
protected $callbacks = array();
/**
* Number of actions executed.
*
* @since 1.0.3
*
* @var array
*/
protected $actions = array('count' => 0);
/**
* Current action hook.
*
* @since 1.0.3
*
* @var string|false
*/
protected static $current = false;
/**
* Method to use the singleton pattern and just create an instance.
*
* @since 1.0.0
*
* @var string
*/
protected $singleton = 'getInstance';
/**
* Instances.
*
* @since 1.0.0
*
* @var array
*/
private static $instances = array();
/**
* Get instance.
*
* @since 1.0.0
*
* @param int $id
*
* @return object → instance
*/
// 이부분 수정
/*
public static function getInstance($id = '0')
{
self::$id = $id;
if (isset(self::$instances[self::$id])) {
return self::$instances[self::$id];
}
return self::$instances[self::$id] = new self;
}
*/
public static function getInstance($id = '0')
{
self::$id = $id;
if (isset(self::$instances[self::$id])) {
return self::$instances[self::$id];
}
$calledClass = get_called_class();
return self::$instances[self::$id] = new $calledClass;
}
/**
* Attach custom function to action hook.
*
* @since 1.0.3
*
* @param string $tag → action hook name
* @param callable $func → function to attach to action hook
* @param int $priority → order in which the action is executed
* @param int $args → number of arguments accepted
*
* @return bool
*/
public static function addAction($tag, $func, $priority = 8, $args = 0)
{
$that = self::getInstance(self::$id);
$that->callbacks[$tag][$priority][] = array(
'function' => $func,
'arguments' => $args,
);
return true;
}
/**
* Add actions hooks from array.
*
* @since 1.0.3
*
* @param array $actions
*
* @return bool
*/
public static function addActions($actions)
{
foreach ($actions as $arguments) {
call_user_func_array(array(__CLASS__, 'addAction'), $arguments);
}
return true;
}
/**
* Run all hooks attached to the hook.
*
* By default it will look for getInstance method to use singleton
* pattern and create a single instance of the class. If it does not
* exist it will create a new object.
*
* @see setSingletonName() for change the method name.
*
* @since 1.0.3
*
* @param string $tag → action hook name
* @param mixed $args → optional arguments
* @param bool $remove → delete hook after executing actions
*
* @return returns the output of the last action or false
*/
public static function doAction($tag, $args = array(), $remove = true)
{
$that = self::getInstance(self::$id);
self::$current = $tag;
$that->actions['count']++;
if (! array_key_exists($tag, $that->actions)) {
$that->actions[$tag] = 0;
}
$that->actions[$tag]++;
$actions = $that->getActions($tag, $remove);
//asort($actions);
// 이 부분 수정 priority 로 정렬 하려면 ksort를 써야함
ksort($actions);
foreach ($actions as $priority) {
foreach ($priority as $action) {
$action = $that->runAction($action, $args);
}
}
self::$current = false;
return (isset($action)) ? $action : false;
}
/**
* Set method name for use singleton pattern.
*
* @since 1.0.0
*
* @param string $method → singleton method name
*/
public static function setSingletonName($method)
{
$that = self::getInstance(self::$id);
$that->singleton = $method;
}
/**
* Returns the current action hook.
*
* @since 1.0.3
*
* @return string|false → current action hook
*/
public static function current()
{
return self::$current;
}
/**
* Check if there is a certain action hook.
*
* @since 1.0.7
*
* @param string $tag → action hook name
*
* @return bool
*/
public static function isAction($tag)
{
$that = self::getInstance(self::$id);
return isset($that->callbacks[$tag]);
}
/**
* Run action hook.
*
* @since 1.0.3
*
* @param string $action → action hook
* @param int $args → arguments
*
* @return callable|false → returns the calling function
*/
protected function runAction($action, $args)
{
$function = $action['function'];
$argsNumber = $action['arguments'];
$class = (isset($function[0])) ? $function[0] : false;
$method = (isset($function[1])) ? $function[1] : false;
$args = $this->getArguments($argsNumber, $args);
if (! ($class && $method) && function_exists($function)) {
return call_user_func($function, $args);
} elseif ($obj = call_user_func(array($class, $this->singleton))) {
if ($obj !== false) {
return call_user_func_array(array($obj, $method), $args);
}
} elseif (class_exists($class)) {
$instance = new $class;
return call_user_func_array(array($instance, $method), $args);
}
return null;
}
/**
* Get actions for hook
*
* @since 1.0.3
*
* @param string $tag → action hook name
* @param bool $remove → delete hook after executing actions
*
* @return object|false → returns the calling function
*/
protected function getActions($tag, $remove)
{
if (isset($this->callbacks[$tag])) {
$actions = $this->callbacks[$tag];
if ($remove) {
unset($this->callbacks[$tag]);
}
}
return (isset($actions)) ? $actions : array();
}
/**
* Get arguments for action.
*
* @since 1.0.3
*
* @param int $argsNumber → arguments number
* @param mixed $arguments → arguments
*
* @return array → arguments
*/
protected function getArguments($argsNumber, $arguments)
{
if ($argsNumber == 1 && is_string($arguments)) {
return array($arguments);
} elseif ($argsNumber === count($arguments)) {
return $arguments;
}
for ($i = 0; $i < $argsNumber; $i++) {
if (array_key_exists($i, $arguments)) {
$args[] = $arguments[$i];
continue;
}
return $args;
}
return array();
}
}
?>
+161
View File
@@ -0,0 +1,161 @@
<?php
if (!defined('_GNUBOARD_')) exit;
Class GML_Hook extends Hook {
protected $filters = array('count' => 0);
protected $callback_filters = array();
protected static $current_filter = false;
protected function runAction($action, $args)
{
$function = $action['function'];
$argsNumber = $action['arguments'];
$class = (is_array($function) && isset($function[0])) ? $function[0] : false;
$method = (is_array($function) && isset($function[1])) ? $function[1] : false;
$args = $this->getArguments($argsNumber, $args);
if (! ($class && $method) && function_exists($function)) {
return call_user_func_array($function, $args);
} elseif ($obj = call_user_func(array($class, $this->singleton))) {
if ($obj !== false) {
return call_user_func_array(array($obj, $method), $args);
}
} elseif (class_exists($class)) {
$instance = new $class;
return call_user_func_array(array($instance, $method), $args);
}
}
protected function getFilters($tag, $remove)
{
if (isset($this->callback_filters[$tag])) {
$filters = $this->callback_filters[$tag];
if ($remove) {
unset($this->callback_filters[$tag]);
}
}
return (isset($filters)) ? $filters : array();
}
public static function get_properties($type, $is_callback=false){
$that = self::getInstance(self::$id);
if( $type === 'event' ){
return $is_callback ? $that->callbacks : $that->actions;
}
return $is_callback ? $that->callback_filters : $that->filters;
}
public static function addFilter($tag, $func, $priority = 8, $args = 0)
{
$that = self::getInstance(self::$id);
$that->callback_filters[$tag][$priority][] = array(
'function' => $func,
'arguments' => $args,
);
return true;
}
public static function apply_filters($tag, $args = array(), $remove = true)
{
$that = self::getInstance(self::$id);
self::$current_filter = $tag;
$that->filters['count']++;
if (! array_key_exists($tag, $that->filters)) {
$that->filters[$tag] = 0;
}
$that->filters[$tag]++;
$filters = $that->getFilters($tag, $remove);
ksort($filters);
$value = $args[0];
foreach ($filters as $priority) {
foreach ($priority as $filter) {
$replace = $that->runAction($filter, $args);
if( ! is_null($replace) ) {
$value = $replace;
}
}
}
self::$current_filter = false;
return $value;
}
protected function getArguments($argsNumber, $arguments)
{
if ($argsNumber == 1 && is_string($arguments)) {
return array($arguments);
} elseif ($argsNumber === count($arguments)) {
return $arguments;
}
$args = array();
for ($i = 0; $i < $argsNumber; $i++) {
if (is_array($arguments) && array_key_exists($i, $arguments)) {
$args[] = $arguments[$i];
}
}
return $args;
}
public static function remove_filter($tag, $func, $priority)
{
$that = self::getInstance(self::$id);
$is_remove = false;
if (isset($that->callback_filters[$tag]) && isset($that->callback_filters[$tag][$priority]) ) {
$found_key = array_search($func, array_column($that->callback_filters[$tag][$priority], 'function'));
if( $found_key !== false ){
unset($that->callback_filters[$tag][$priority][$found_key]);
}
}
return $is_remove;
}
public static function remove_action($tag, $func, $priority)
{
$that = self::getInstance(self::$id);
$is_remove = false;
if (isset($that->callbacks[$tag]) && isset($that->callbacks[$tag][$priority]) ) {
$found_key = array_search($func, array_column($that->callbacks[$tag][$priority], 'function'));
if( $found_key !== false ){
unset($that->callbacks[$tag][$priority][$found_key]);
}
}
return $is_remove;
}
}
// end Hook Class
?>
+92
View File
@@ -0,0 +1,92 @@
<?php
if (!defined('_GNUBOARD_')) exit;
Class G5_object_store {
public $writes = array();
public $contents = array();
public $etcs = array();
function get($type, $key, $group ='default') {
switch ($type) {
case 'bbs':
$datas = $this->writes;
break;
case 'content' :
$datas = $this->contents;
break;
default :
$datas = $this->etcs;
break;
}
if( $this->exists($type, $key, $group) ){
if ( is_object($datas[$group][$key]) )
return clone $datas[$group][$key];
else
return $datas[$group][$key];
}
return false;
}
function exists($type, $key, $group = 'default' ) {
$return_data = '';
switch ($type) {
case 'bbs':
$datas = $this->writes;
break;
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]) );
}
function set($type, $key, $data=array(), $group='default') {
if ( is_object( $data ) )
$data = clone $data;
switch ($type) {
case 'bbs':
$this->writes[$group][$key] = $data;
break;
case 'content':
$this->contents[$group][$key] = $data;
break;
default :
$datas = $this->etcs[$group][$key] = $data;
break;
}
}
function delete($key, $group='default') {
switch ($type) {
case 'bbs':
$datas = $this->writes;
break;
case 'content':
$datas = $this->contents;
break;
default :
$datas = $this->etcs;
break;
}
if ( ! $this->exists('bbs', $key, $group) )
return false;
unset( $datas[$group][$key] );
return true;
}
} //end Class
?>
+167
View File
@@ -0,0 +1,167 @@
<?php
if (!defined('_GNUBOARD_')) exit;
class G5_URI {
public $basename;
public $parts;
public $slashes;
public static function getInstance()
{ //싱글톤
static $instance = null;
if (null === $instance) {
$instance = new self();
}
return $instance;
}
public function parseURL() {
/* grab URL query string and script name */
$uri = $_SERVER['REQUEST_URI'];
$script = $_SERVER['SCRIPT_NAME'];
/* get extension */
$ext = end( explode(".",$script) );
/* if extension is found in URL, eliminate it */
if(strstr($uri,".")) {
$arr_uri = explode('.', $uri);
/* get last part */
$last = end($arr_uri);
if($last == $ext){
array_pop($arr_uri);
$uri = implode('.', $arr_uri);
}
}
/* pick the name without extension */
$basename = basename ($script, '.'.$ext);
/* slicing query string */
$temp = explode('/',$uri);
$key = array_search($basename,$temp);
$parts = array_slice ($temp, $key+1);
$this->basename = $basename;
$this->parts = $parts;
}
public function setRelative($relativevar) {
/* count the number of slash
to define relative path */
$numslash = count($this->parts);
$slashes="";
for($i=0;$i<$numslash;$i++){
$slashes .= "../";
}
$this->slashes = $slashes;
/* make relative path variable available for webpage */
//eval("\$GLOBALS['$relativevar'] = '$slashes';");
$links = array();
$links[$relativevar] = $slashes;
return $links;
}
public function getParts() {
/* return array of sliced query string */
return $this->parts;
}
public function setParts() {
/* pair off query string variable and query string value */
$numargs = func_num_args();
$arg_list = func_get_args();
$urlparts = $this->getParts();
$links = array();
for ($i = 0; $i < $numargs; $i++) {
/* make them available for webpage */
//eval ("\$GLOBALS['".$arg_list[$i] ."']= '$urlparts[$i]';");
$links[$arg_list[$i]] = $urlparts[$i];
}
return $links;
}
public function makeClean($string_url) {
/* convert normal URL query string to clean URL */
$url=parse_url($string_url);
$strurl = basename($url['path'],".php");
$qstring = parse_str($url['query'],$vars);
while(list($k,$v) = each($vars)) $strurl .= "/".$v;
return $strurl;
}
public function url_clean($string_url, $add_qry='') {
global $config, $g5;
$string_url = str_replace('&amp;', '&', $string_url);
$url=parse_url($string_url);
$page_name = basename($url['path'],".php");
$array_page_names = apply_replace('url_clean_page_names', array('board', 'write'));
if( strpos($string_url, G5_BBS_URL) === false || ! in_array($page_name, $array_page_names) ){ //게시판이 아니면 리턴
return $string_url;
}
$return_url = '';
$qstring = 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 )
//while(list($k,$v) = each($vars)) $page_name .= "/".$v;
if( $page_name === 'write' ){
$vars['action'] = 'write';
$allow_param_keys = array('bo_table'=>'', 'action'=>'');
} else {
$allow_param_keys = array('bo_table'=>'', 'wr_id'=>'');
}
$s = array();
foreach( $allow_param_keys as $key=>$v ){
if( !isset($vars[$key]) || empty($vars[$key]) ) continue;
$add = '';
$s[$key] = $vars[$key];
}
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'] = $get_write['wr_seo_title'].'/';
}
}
$fragment = isset($url['fragment']) ? '#'.$url['fragment'] : '';
$host = G5_URL;
if( isset($url['host']) ){
$array_file_paths = apply_replace('url_clean_page_paths', array('/'.G5_BBS_DIR.'/board.php', '/'.G5_BBS_DIR.'/write.php'));
$str_path = isset($url['path']) ? $url['path'] : '';
$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 'https://' : 'http://';
$host = $http.$url['host'].str_replace($array_file_paths, '', $str_path);
}
$add_param = '';
if( $result = array_diff_key($vars, $allow_param_keys ) ){
$add_param = '?'.http_build_query($result,'','&amp;');
}
if( $add_qry ){
$add_param .= $add_param ? '&amp;'.$add_qry : '?'.$add_qry;
}
while(list($k,$v) = each($s)) $return_url .= '/'.$v;
return $host.$return_url.$add_param.$fragment;
}
}
?>
+94
View File
@@ -0,0 +1,94 @@
<?php
if (!defined('_GNUBOARD_')) exit;
include_once(dirname(__FILE__) .'/Cache/FileCache.class.php');
function get_cachemanage_instance(){
static $instance = null;
if( ! (defined('G5_USE_CACHE') && G5_USE_CACHE) ) return $instance;
if( $instance === null ){
$options = array(
'_cache_path'=> G5_DATA_PATH.'/cache',
'file_extension'=>'.php',
);
$instance = new FileCache($options);
}
return $instance;
}
function g5_cache_secret_key(){
static $str = '';
if( $str ) return $str;
$str = substr(md5($_SERVER['SERVER_SOFTWARE'].$_SERVER['DOCUMENT_ROOT']), 0, 6);
return $str;
}
function g5_latest_cache_data($bo_table, $cache_list=array(), $find_wr_id=0){
static $cache = array();
if( $bo_table && $cache_list && ! isset($cache[$bo_table]) ){
foreach( (array) $cache_list as $wr ){
if( empty($wr) || ! isset($wr['wr_id']) ) continue;
$cache[$bo_table][$wr['wr_id']] = $wr;
}
}
if( $find_wr_id && isset($cache[$bo_table][$find_wr_id]) ){
return $cache[$bo_table][$find_wr_id];
}
}
function g5_set_cache($key, $save_data, $ttl = null){
if( $cache = get_cachemanage_instance() ){
$cache->save($key, $save_data, $ttl);
}
}
function g5_get_cache($key){
if( $cache = get_cachemanage_instance() ){
return $cache->get($key);
}
return false;
}
function g5_delete_cache($key){
if( $cache = get_cachemanage_instance() ){
return $cache->delete($key);
}
return false;
}
function g5_delete_all_cache(){
$board_tables = get_board_names();
foreach( $board_tables as $board_table ){
delete_cache_latest($board_table);
}
start_event('adm_cache_delete', $board_tables);
}
function g5_delete_cache_by_prefix($key){
$files = glob(G5_DATA_PATH.'/cache/'.$key.'*');
foreach( (array) $files as $filename){
if(empty($filename)) continue;
unlink($filename);
}
return ($files) ? true : false;
}
?>
+195 -50
View File
@@ -1,6 +1,8 @@
<?php
if (!defined('_GNUBOARD_')) exit;
include_once(dirname(__FILE__) .'/pbkdf2.compat.php');
/*************************************************************************
**
** 일반 함수 모음
@@ -152,6 +154,8 @@ function alert($msg='', $url='', $error=true, $post=false)
{
global $g5, $config, $member;
global $is_admin;
start_event('alert', $msg, $url, $error, $post);
$msg = $msg ? strip_tags($msg, '<br>') : '올바른 방법으로 이용해 주십시오.';
@@ -169,6 +173,8 @@ function alert_close($msg, $error=true)
{
global $g5;
start_event('alert_close', $msg, $error);
$msg = strip_tags($msg, '<br>');
$header = '';
@@ -245,7 +251,7 @@ function url_auto_link($str)
$str = preg_replace("/\t_gt_\t/", "&gt;", $str);
*/
return $str;
return apply_replace('url_auto_link', $str);
}
@@ -335,11 +341,13 @@ function get_dirsize($dir)
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
function get_list($write_row, $board, $skin_url, $subject_len=40)
{
global $g5, $config;
global $g5, $config, $g5_object;
global $qstr, $page;
//$t = get_microtime();
$g5_object->set('bbs', $write_row['wr_id'], $write_row, $board['bo_table']);
// 배열전체를 복사
$list = $write_row;
unset($write_row);
@@ -352,6 +360,10 @@ function get_list($write_row, $board, $skin_url, $subject_len=40)
else
$list['subject'] = conv_subject($list['wr_subject'], $board['bo_subject_len'], '…');
if( ! (isset($list['wr_seo_title']) && $list['wr_seo_title']) && $list['wr_id'] ){
seo_title_update(get_write_table_name($board['bo_table']), $list['wr_id'], 'bbs');
}
// 목록에서 내용 미리보기 사용한 게시판만 내용을 변환함 (속도 향상) : kkal3(커피)님께서 알려주셨습니다.
if ($board['bo_use_list_content'])
{
@@ -405,9 +417,9 @@ function get_list($write_row, $board, $skin_url, $subject_len=40)
$list['icon_link'] = '<i class="fa fa-link" aria-hidden="true"></i> ';
// 분류명 링크
$list['ca_name_href'] = G5_BBS_URL.'/board.php?bo_table='.$board['bo_table'].'&amp;sca='.urlencode($list['ca_name']);
$list['ca_name_href'] = get_pretty_url($board['bo_table'], '', 'sca='.urlencode($list['ca_name']));
$list['href'] = G5_BBS_URL.'/board.php?bo_table='.$board['bo_table'].'&amp;wr_id='.$list['wr_id'].$qstr;
$list['href'] = get_pretty_url($board['bo_table'], $list['wr_id'], $qstr);
$list['comment_href'] = $list['href'];
$list['icon_new'] = '';
@@ -682,13 +694,24 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op
return $str;
}
// 게시판 테이블에서 하나의 행을 읽음
function get_write($write_table, $wr_id)
function get_write($write_table, $wr_id, $is_cache=false)
{
return sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
}
global $g5, $g5_object;
$wr_bo_table = preg_replace('/^'.preg_quote($g5['write_prefix']).'/i', '', $write_table);
$write = $g5_object->get('bbs', $wr_id, $wr_bo_table);
if( !$write ){
$sql = " select * from {$write_table} where wr_id = '{$wr_id}' ";
$write = sql_fetch($sql);
$g5_object->set('bbs', $wr_id, $write, $wr_bo_table);
}
return $write;
}
// 게시판의 다음글 번호를 얻는다.
function get_next_num($table)
@@ -702,22 +725,47 @@ function get_next_num($table)
// 그룹 설정 테이블에서 하나의 행을 읽음
function get_group($gr_id)
function get_group($gr_id, $is_cache=false)
{
global $g5;
return sql_fetch(" select * from {$g5['group_table']} where gr_id = '$gr_id' ");
static $cache = array();
$gr_id = preg_replace('/[^a-z0-9_]/i', '', $gr_id);
$key = md5($gr_id);
if( $is_cache && isset($cache[$key]) ){
return $cache[$key];
}
$sql = " select * from {$g5['group_table']} where gr_id = '$gr_id' ";
$cache[$key] = apply_replace('get_group', sql_fetch($sql), $gr_id, $is_cache);
return $cache[$key];
}
// 회원 정보를 얻는다.
function get_member($mb_id, $fields='*')
function get_member($mb_id, $fields='*', $is_cache=false)
{
global $g5;
$mb_id = preg_replace("/[^0-9a-z_]+/i", "", $mb_id);
return sql_fetch(" select $fields from {$g5['member_table']} where mb_id = TRIM('$mb_id') ");
static $cache = array();
$key = md5($fields);
if( $is_cache && isset($cache[$mb_id]) && isset($cache[$mb_id][$key]) ){
return $cache[$mb_id][$key];
}
$sql = " select $fields from {$g5['member_table']} where mb_id = TRIM('$mb_id') ";
$cache[$mb_id][$key] = apply_replace('get_member', sql_fetch($sql), $mb_id, $fields, $is_cache);
return $cache[$mb_id][$key];
}
@@ -796,12 +844,19 @@ function is_admin($mb_id)
{
global $config, $group, $board;
if (!$mb_id) return;
if (!$mb_id) return '';
if ($config['cf_admin'] == $mb_id) return 'super';
if (isset($group['gr_admin']) && ($group['gr_admin'] == $mb_id)) return 'group';
if (isset($board['bo_admin']) && ($board['bo_admin'] == $mb_id)) return 'board';
return '';
$is_authority = '';
if ($config['cf_admin'] == $mb_id){
$is_authority = 'super';
} else if (isset($group['gr_admin']) && ($group['gr_admin'] == $mb_id)){
$is_authority = 'group';
} else if (isset($board['bo_admin']) && ($board['bo_admin'] == $mb_id)){
$is_authority = 'board';
}
return apply_replace('is_admin', $is_authority, $mb_id);
}
@@ -1215,8 +1270,7 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
global $g5;
global $bo_table, $sca, $is_admin, $member;
$email_enc = new str_encrypt();
$email = $email_enc->encrypt($email);
$email = get_string_encrypt($email);
$homepage = set_http(clean_xss_tags($homepage));
$name = get_text($name, 0, true);
@@ -1224,18 +1278,20 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
$homepage = get_text($homepage);
$tmp_name = "";
$en_mb_id = $mb_id;
if ($mb_id) {
//$tmp_name = "<a href=\"".G5_BBS_URL."/profile.php?mb_id=".$mb_id."\" class=\"sv_member\" title=\"$name 자기소개\" rel="nofollow" target=\"_blank\" onclick=\"return false;\">$name</a>";
$tmp_name = '<a href="'.G5_BBS_URL.'/profile.php?mb_id='.$mb_id.'" class="sv_member" title="'.$name.' 자기소개" target="_blank" rel="nofollow" onclick="return false;">';
if ($config['cf_use_member_icon']) {
$mb_dir = substr($mb_id,0,2);
$icon_file = G5_DATA_PATH.'/member/'.$mb_dir.'/'.$mb_id.'.gif';
$icon_file = G5_DATA_PATH.'/member/'.$mb_dir.'/'.get_mb_icon_name($mb_id).'.gif';
if (file_exists($icon_file)) {
$width = $config['cf_member_icon_width'];
$height = $config['cf_member_icon_height'];
$icon_file_url = G5_DATA_URL.'/member/'.$mb_dir.'/'.$mb_id.'.gif';
$icon_file_url = G5_DATA_URL.'/member/'.$mb_dir.'/'.get_mb_icon_name($mb_id).'.gif';
$tmp_name .= '<span class="profile_img"><img src="'.$icon_file_url.'" width="'.$width.'" height="'.$height.'" alt=""></span>';
if ($config['cf_use_member_icon'] == 2) // 회원아이콘+이름
@@ -1259,7 +1315,7 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
if(!$bo_table)
return $name;
$tmp_name = '<a href="'.G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;sca='.$sca.'&amp;sfl=wr_name,1&amp;stx='.$name.'" title="'.$name.' 이름으로 검색" class="sv_guest" rel="nofollow" onclick="return false;">'.$name.'</a>';
$tmp_name = '<a href="'.get_pretty_url($bo_table, '', 'sca='.$sca.'&amp;sfl=wr_name,1&amp;stx='.$name).'" title="'.$name.' 이름으로 검색" class="sv_guest" rel="nofollow" onclick="return false;">'.$name.'</a>';
$title_mb_id = '[비회원]';
}
@@ -1276,10 +1332,11 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
if($mb_id)
$str2 .= "<a href=\"".G5_BBS_URL."/profile.php?mb_id=".$mb_id."\" onclick=\"win_profile(this.href); return false;\">자기소개</a>\n";
if($bo_table) {
if($mb_id)
$str2 .= "<a href=\"".G5_BBS_URL."/board.php?bo_table=".$bo_table."&amp;sca=".$sca."&amp;sfl=mb_id,1&amp;stx=".$mb_id."\">아이디로 검색</a>\n";
else
$str2 .= "<a href=\"".G5_BBS_URL."/board.php?bo_table=".$bo_table."&amp;sca=".$sca."&amp;sfl=wr_name,1&amp;stx=".$name."\">이름으로 검색</a>\n";
if($mb_id) {
$str2 .= "<a href=\"".get_pretty_url($bo_table, '', "sca=".$sca."&amp;sfl=mb_id,1&amp;stx=".$en_mb_id)."\">아이디로 검색</a>\n";
} else {
$str2 .= "<a href=\"".get_pretty_url($bo_table, '', "sca=".$sca."&amp;sfl=wr_name,1&amp;stx=".$name)."\">이름으로 검색</a>\n";
}
}
if($mb_id)
$str2 .= "<a href=\"".G5_BBS_URL."/new.php?mb_id=".$mb_id."\" class=\"link_new_page\" onclick=\"check_goto_new(this.href, event);\">전체게시물</a>\n";
@@ -1479,12 +1536,21 @@ function sql_set_charset($charset, $link=null)
mysql_query(" set names {$charset} ", $link);
}
function sql_data_seek($result, $offset=0)
{
if ( ! $result ) return;
if(function_exists('mysqli_set_charset') && G5_MYSQLI_USE)
mysqli_data_seek($result, $offset);
else
mysql_data_seek($result, $offset);
}
// mysqli_query 와 mysqli_error 를 한꺼번에 처리
// mysql connect resource 지정 - 명랑폐인님 제안
function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null)
{
global $g5;
global $g5, $g5_debug;
if(!$link)
$link = $g5['connect_db'];
@@ -1497,6 +1563,10 @@ function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null)
// `information_schema` DB로의 접근을 허락하지 않습니다.
$sql = preg_replace("#^select.*from.*where.*`?information_schema`?.*#i", "select 1", $sql);
$is_debug = get_permission_debug_show();
$start_time = $is_debug ? get_microtime() : 0;
if(function_exists('mysqli_query') && G5_MYSQLI_USE) {
if ($error) {
$result = @mysqli_query($link, $sql) or die("<p>$sql<p>" . mysqli_errno($link) . " : " . mysqli_error($link) . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
@@ -1511,6 +1581,15 @@ function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null)
}
}
if($result && $is_debug) {
// 여기에 실행한 sql문을 화면에 표시하는 로직 넣기
$g5_debug['sql'][] = array(
'sql' => $sql,
'start_time' => $start_time,
'end_time' => get_microtime(),
);
}
return $result;
}
@@ -1996,6 +2075,16 @@ function is_utf8($str)
// 출처 : https://www.google.co.kr/search?q=utf8_strcut&aq=f&oq=utf8_strcut&aqs=chrome.0.57j0l3.826j0&sourceid=chrome&ie=UTF-8
function utf8_strcut( $str, $size, $suffix='...' )
{
if( function_exists('mb_strlen') && function_exists('mb_substr') ){
if(mb_strlen($str)<=$size) {
return $str;
} else {
$str = mb_substr($str, 0, $size, 'utf-8');
$str .= $suffix;
}
} else {
$substr = substr( $str, 0, $size * 2 );
$multi_size = preg_match_all( '/[\x80-\xff]/', $substr, $multi_chars );
@@ -2007,8 +2096,9 @@ function utf8_strcut( $str, $size, $suffix='...' )
$str = preg_replace( '/(([\x80-\xff]{3})*?)([\x80-\xff]{0,2})$/', '$1', $str );
$str .= $suffix;
}
}
return $str;
return $str;
}
@@ -2167,11 +2257,7 @@ function delete_cache_latest($bo_table)
return;
}
$files = glob(G5_DATA_PATH.'/cache/latest-'.$bo_table.'-*');
if (is_array($files)) {
foreach ($files as $filename)
unlink($filename);
}
g5_delete_cache_by_prefix('latest-'.$bo_table.'-');
}
// 게시판 첨부파일 썸네일 삭제
@@ -2455,6 +2541,8 @@ class html_process {
}
array_multisort($order, SORT_ASC, $index, SORT_ASC, $links);
$links = apply_replace('html_process_css_files', $links);
foreach($links as $link) {
if(!trim($link[1]))
@@ -2481,6 +2569,8 @@ class html_process {
}
array_multisort($order, SORT_ASC, $index, SORT_ASC, $scripts);
$scripts = apply_replace('html_process_script_files', $scripts);
foreach($scripts as $js) {
if(!trim($js[1]))
@@ -2509,6 +2599,17 @@ class html_process {
if($javascript)
$nl = "\n";
$buffer = preg_replace('#(</head>[^<]*<body[^>]*>)#', "$javascript{$nl}$1", $buffer);
$meta_tag = apply_replace('html_process_add_meta', '');
if( $meta_tag ){
/*
</title>content<body>
전에 메타태그가 위치 하도록 하게 한다.
*/
$nl = "\n";
$buffer = preg_replace('#(<title[^>]*>.*?</title>)#', "$meta_tag{$nl}$1", $buffer);
}
return $buffer;
}
@@ -2680,10 +2781,16 @@ function get_qa_config($fld='*')
{
global $g5;
$sql = " select $fld from {$g5['qa_config_table']} ";
$row = sql_fetch($sql);
static $cache = array();
return $row;
if( $is_cache && !empty($cache) ){
return $cache;
}
$sql = " select * from {$g5['qa_config_table']} ";
$cache = apply_replace('get_qa_config', sql_fetch($sql));
return $cache;
}
// get_sock 함수 대체
@@ -3041,11 +3148,43 @@ function get_encrypt_string($str)
// 비밀번호 비교
function check_password($pass, $hash)
{
if(defined('G5_STRING_ENCRYPT_FUNCTION') && G5_STRING_ENCRYPT_FUNCTION === 'create_hash') {
return validate_password($pass, $hash);
}
$password = get_encrypt_string($pass);
return ($password === $hash);
}
// 로그인 패스워드 체크
function login_password_check($mb, $pass, $hash)
{
global $g5;
$mb_id = isset($mb['mb_id']) ? $mb['mb_id'] : '';
if(!$mb_id)
return false;
if(G5_STRING_ENCRYPT_FUNCTION === 'create_hash' && strlen($hash) === G5_MYSQL_PASSWORD_LENGTH) {
if( sql_password($pass) === $hash ){
if( ! isset($mb['mb_password2']) ){
$sql = "ALTER TABLE `{$g5['member_table']}` ADD `mb_password2` varchar(255) NOT NULL default '' AFTER `mb_password`";
sql_query($sql);
}
$new_password = create_hash($pass);
$sql = " update {$g5['member_table']} set mb_password = '$new_password', mb_password2 = '$hash' where mb_id = '$mb_id' ";
sql_query($sql);
return true;
}
}
return check_password($pass, $hash);
}
// 동일한 host url 인지
function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false)
{
@@ -3194,22 +3333,19 @@ function clean_query_string($query, $amp=true)
return $str;
}
function get_device_change_url()
{
function get_params_merge_url($params){
$p = @parse_url(G5_URL);
$href = $p['scheme'].'://'.$p['host'];
if(isset($p['port']) && $p['port'])
$href .= ':'.$p['port'];
$href .= $_SERVER['SCRIPT_NAME'];
if( $tmp = explode('?', $_SERVER['REQUEST_URI']) ){
if( isset($tmp[0]) && $tmp[0] )
$href .= $tmp[0];
}
$q = array();
$device = 'device='.(G5_IS_MOBILE ? 'pc' : 'mobile');
if($_SERVER['QUERY_STRING']) {
foreach($_GET as $key=>$val) {
if($key == 'device')
continue;
$key = strip_tags($key);
$val = strip_tags($val);
@@ -3218,16 +3354,25 @@ function get_device_change_url()
}
}
if(!empty($q)) {
$query = http_build_query($q, '', '&amp;');
$href .= '?'.$query.'&amp;'.$device;
} else {
$href .= '?'.$device;
if( is_array($params) ){
$q = array_merge($q, $params);
}
$query = http_build_query($q, '', '&amp;');
$href .= '?'.$query;
return $href;
}
function get_device_change_url()
{
$q = array();
$device = (G5_IS_MOBILE ? 'pc' : 'mobile');
$q['device'] = $device;
return get_params_merge_url($q);
}
// 스킨 path
function get_skin_path($dir, $skin)
{
@@ -3372,7 +3517,7 @@ function get_member_profile_img($mb_id='', $width='', $height='', $alt='profile_
if( isset($member_cache[$mb_id]) ){
$src = $member_cache[$mb_id];
} else {
$member_img = G5_DATA_PATH.'/member_image/'.substr($mb_id,0,2).'/'.$mb_id.'.gif';
$member_img = G5_DATA_PATH.'/member_image/'.substr($mb_id,0,2).'/'.get_mb_icon_name($mb_id).'.gif';
if (is_file($member_img)) {
$member_cache[$mb_id] = $src = str_replace(G5_DATA_PATH, G5_DATA_URL, $member_img);
}
+393
View File
@@ -0,0 +1,393 @@
<?php
if (!defined('_GNUBOARD_')) exit;
function get_config($is_cache=false){
global $g5;
static $cache = array();
$cache = apply_replace('get_config_cache', $cache, $is_cache);
if( $is_cache && !empty($cache) ){
return $cache;
}
$sql = " select * from {$g5['config_table']} ";
$cache = apply_replace('get_config', sql_fetch($sql));
return $cache;
}
function get_content_db($co_id, $is_cache=false){
global $g5, $g5_object;
static $cache = array();
$type = 'content';
$co_id = preg_replace('/[^a-z0-9_]/i', '', $co_id);
$co = $g5_object->get($type, $co_id, $type);
if( !$co ){
$cache_file_name = "{$type}-{$co_id}-".g5_cache_secret_key();
$co = g5_get_cache($cache_file_name, 10800);
if( $co === false ){
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql);
g5_set_cache($cache_file_name, $co, 10800);
}
$g5_object->set($type, $co_id, $co, $type);
}
return $co;
}
function get_board_names(){
global $g5;
static $boards = array();
if( ! $boards ){
$sql = " select bo_table from {$g5['board_table']} ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
$boards[] = $row['bo_table'];
}
}
return $boards;
}
function get_board_db($bo_table, $is_cache=false){
global $g5;
static $cache = array();
$cache = apply_replace('get_board_db_cache', $cache, $bo_table, $is_cache);
$key = md5($bo_table);
$bo_table = preg_replace('/[^a-z0-9_]/i', '', $bo_table);
if( $is_cache && isset($cache[$key]) ){
return $cache[$key];
}
if( !($cache[$key] = apply_replace('get_board_db', array(), $bo_table)) ){
$sql = " select * from {$g5['board_table']} where bo_table = '$bo_table' ";
$cache[$key] = sql_fetch($sql);
}
return $cache[$key];
}
// 게시판 테이블에서 하나의 행을 읽음
function get_content_by_field($write_table, $type='bbs', $where_field='', $where_value='', $is_cache=false)
{
global $g5, $g5_object;
if( $type === 'content' ){
$check_array = array('co_id', 'co_html', 'co_subject', 'co_content', 'co_seo_title', 'co_mobile_content', 'co_skin', 'co_mobile_skin', 'co_tag_filter_use', 'co_hit', 'co_include_head', 'co_include_tail');
} else {
$check_array = array('wr_id', 'wr_num', 'wr_reply', 'wr_parent', 'wr_is_comment', 'ca_name', 'wr_option', 'wr_subject', 'wr_content', 'wr_seo_title', 'wr_link1', 'wr_link2', 'wr_hit', 'wr_good', 'wr_nogood', 'mb_id', 'wr_name', 'wr_email', 'wr_homepage', 'wr_datetime', 'wr_ip', 'wr_1', 'wr_2', 'wr_3', 'wr_4', 'wr_5', 'wr_6', 'wr_7', 'wr_8', 'wr_9', 'wr_10');
}
if( ! in_array($where_field, $check_array) ){
return '';
}
$where_value = strip_tags($where_value);
$key = md5($write_table.'|'.$where_field.'|'.$where_value);
if( $is_cache && isset($cache[$key]) ){
return $cache[$key];
}
$sql = " select * from {$write_table} where $where_field = '".sql_real_escape_string($where_value)."' ";
$cache[$key] = sql_fetch($sql);
if( $type === 'content' ){
$g5_object->set($type, $cache[$key]['co_id'], $cache[$key], 'content');
} else {
$wr_bo_table = preg_replace('/^'.preg_quote($g5['write_prefix']).'/i', '', $write_table);
$g5_object->set($type, $cache[$key]['wr_id'], $cache[$key], $wr_bo_table);
}
return $cache[$key];
}
// 게시판 첨부파일 테이블에서 하나의 행을 읽음
function get_board_file_db($bo_table, $wr_id, $fields='*', $add_where='', $is_cache=false)
{
global $g5;
static $cache = array();
$wr_id = (int) $wr_id;
$key = md5($bo_table.'|'.$wr_id.$fields.$add_where);
if( $is_cache && isset($cache[$key]) ){
return $cache[$key];
}
$sql = " select $fields from {$g5['board_file_table']}
where bo_table = '$bo_table' and wr_id = '$wr_id' $add_where order by bf_no limit 0, 1 ";
$cache[$key] = sql_fetch($sql);
return $cache[$key];
}
function get_poll_db($po_id, $is_cache=false){
global $g5;
static $cache = array();
$po_id = (int) $po_id;
$key = md5($po_id);
if( $is_cache && isset($cache[$key]) ){
return $cache[$key];
}
$sql = " select * from {$g5['poll_table']} where po_id = '{$po_id}' ";
$cache[$key] = sql_fetch($sql);
return $cache[$key];
}
function get_point_db($po_id, $is_cache=false){
global $g5;
static $cache = array();
$po_id = (int) $po_id;
$key = md5($po_id);
if( $is_cache && isset($cache[$key]) ){
return $cache[$key];
}
$sql = " select * from {$g5['point_table']} where po_id = '{$po_id}' ";
$cache[$key] = sql_fetch($sql);
return $cache[$key];
}
function get_mail_content_db($ma_id, $is_cache=false){
global $g5;
static $cache = array();
$ma_id = (int) $ma_id;
$key = md5($ma_id);
if( $is_cache && isset($cache[$key]) ){
return $cache[$key];
}
$sql = " select * from {$g5['mail_table']} where ma_id = '{$ma_id}' ";
$cache[$key] = sql_fetch($sql);
return $cache[$key];
}
function get_qacontent_db($qa_id, $is_cache=false){
global $g5;
static $cache = array();
$qa_id = (int) $qa_id;
$key = md5($qa_id);
if( $is_cache && isset($cache[$key]) ){
return $cache[$key];
}
$sql = " select * from {$g5['qa_content_table']} where qa_id = '{$qa_id}' ";
$cache[$key] = sql_fetch($sql);
return $cache[$key];
}
function get_thumbnail_find_cache($bo_table, $wr_id, $wr_key){
global $g5;
if( $cache_content = g5_latest_cache_data($bo_table, array(), $wr_id) ){
if( $wr_key === 'content' ){
return $cache_content;
} else if ( $wr_key === 'file' && isset($cache_content['first_file_thumb']) ){
return $cache_content['first_file_thumb'];
}
}
if( $wr_key === 'content' ){
$write_table = $g5['write_prefix'].$bo_table;
return get_write($write_table, $wr_id, true);
}
return get_board_file_db($bo_table, $wr_id, 'bf_file, bf_content', "and bf_type between '1' and '3'", true);
}
function get_write_table_name($bo_table){
global $g5;
return $g5['write_prefix'].preg_replace('/[^a-z0-9_]/i', '', $bo_table);
}
function get_db_charset($charset){
$add_charset = $charset;
if ( 'utf8mb4' === $charset ) {
$add_charset .= ' COLLATE utf8mb4_unicode_ci';
}
return apply_replace('get_db_charset', $add_charset, $charset);
}
function get_db_create_replace($sql_str){
if( in_array(strtolower(G5_DB_ENGINE), array('innodb', 'myisam')) ){
$sql_str = preg_replace('/ENGINE=MyISAM/', 'ENGINE='.G5_DB_ENGINE, $sql_str);
} else {
$sql_str = preg_replace('/ENGINE=MyISAM/', '', $sql_str);
}
if( G5_DB_CHARSET !== 'utf8' ){
$sql_str = preg_replace('/CHARSET=utf8/', 'CHARACTER SET '.get_db_charset(G5_DB_CHARSET), $sql_str);
}
return $sql_str;
}
function get_class_encrypt(){
static $cache;
if( $cache && is_object($obj) ){
return $cache;
}
$cache = apply_replace('get_class_encrypt', new str_encrypt());
return $cache;
}
function get_string_encrypt($str){
$new = get_class_encrypt();
$encrypt_str = $new->encrypt($str);
return $encrypt_str;
}
function get_string_decrypt($str){
$new = get_class_encrypt();
$decrypt_str = $new->decrypt($str);
return $decrypt_str;
}
function get_permission_debug_show(){
global $member;
$bool = false;
if ( defined('G5_DEBUG') && G5_DEBUG ){
$bool = true;
}
return apply_replace('get_permission_debug_show', $bool, $member);
}
function get_check_mod_rewrite(){
if( function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules()) )
$mod_rewrite = 1;
elseif( isset($_SERVER['IIS_UrlRewriteModule']) )
$mod_rewrite = 1;
else
$mod_rewrite = 0;
return $mod_rewrite;
}
function get_mb_icon_name($mb_id){
if( $icon_name = apply_replace('get_mb_icon_name', '', $mb_id) ){
return $icon_name;
}
return $mb_id;
}
// 생성되면 안되는 게시판명
function get_bo_table_banned_word(){
$folders = array();
foreach(glob(G5_PATH.'/*', GLOB_ONLYDIR) as $dir) {
$folders[] = basename($dir);
}
return apply_replace('get_bo_table_banned_word', $folders);
}
function get_board_sfl_select_options($sfl){
global $is_admin;
$str = '';
$str .= '<option value="wr_subject" '.get_selected($sfl, 'wr_subject', true).'>제목</option>';
$str .= '<option value="wr_content" '.get_selected($sfl, 'wr_content').'>내용</option>';
$str .= '<option value="wr_subject||wr_content" '.get_selected($sfl, 'wr_subject||wr_content').'>제목+내용</option>';
if ( $is_admin ){
$str .= '<option value="mb_id,1" '.get_selected($sfl, 'mb_id,1').'>회원아이디</option>';
$str .= '<option value="mb_id,0" '.get_selected($sfl, 'mb_id,0').'>회원아이디(코)</option>';
}
$str .= '<option value="wr_name,1" '.get_selected($sfl, 'wr_name,1').'>글쓴이</option>';
$str .= '<option value="wr_name,0" '.get_selected($sfl, 'wr_name,0').'>글쓴이(코)</option>';
return apply_replace('get_board_sfl_select_options', $str, $sfl);
}
// 읽지 않은 메모 갯수 반환
function get_memo_not_read($mb_id, $add_where='')
{
global $g5;
$sql = " SELECT count(*) as cnt FROM {$g5['memo_table']} WHERE me_recv_mb_id = '$mb_id' and me_type= 'recv' and me_read_datetime like '0%' $add_where ";
$row = sql_fetch($sql, false);
return $row['cnt'];
}
function get_scrap_totals($mb_id=''){
global $g5;
$add_where = $mb_id ? " and mb_id = '$mb_id' " : '';
$sql = " select count(*) as cnt from {$g5['scrap_table']} where 1=1 $add_where";
$row = sql_fetch($sql, false);
return $row['cnt'];
}
?>
+134
View File
@@ -0,0 +1,134 @@
<?php
if (!defined('_GNUBOARD_')) exit;
define('G5_HOOK_DEFAULT_PRIORITY', 8);
if (!function_exists('get_called_class')) {
function get_called_class() {
$bt = debug_backtrace();
$lines = file($bt[1]['file']);
preg_match(
'/([a-zA-Z0-9\_]+)::'.$bt[1]['function'].'/',
$lines[$bt[1]['line']-1],
$matches
);
return $matches[1];
}
}
include_once(dirname(__FILE__) .'/Hook/hook.class.php');
include_once(dirname(__FILE__) .'/Hook/hook.extends.class.php');
function get_hook_class(){
if( class_exists('GML_Hook') ){
return GML_Hook::getInstance();
}
return null;
}
function put_event($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=0){
if( $hook = get_hook_class() ){
$hook->addAction($tag, $func, $priority, $args);
}
}
function start_event($tag, $arg = ''){
if( $hook = get_hook_class() ){
$args = array();
if (
is_array($arg)
&&
isset($arg[0])
&&
is_object($arg[0])
&&
1 == count($arg)
) {
$args[] =& $arg[0];
} else {
$args[] = $arg;
}
$numArgs = func_num_args();
for ($a = 2; $a < $numArgs; $a++) {
$args[] = func_get_arg($a);
}
$hook->doAction($tag, $args, false);
}
}
function put_replace($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=0){
if( $hook = get_hook_class() ){
return $hook->addFilter($tag, $func, $priority, $args);
}
return null;
}
function apply_replace($tag, $arg = ''){
if( $hook = get_hook_class() ){
$args = array();
if (
is_array($arg)
&&
isset($arg[0])
&&
is_object($arg[0])
&&
1 == count($arg)
) {
$args[] =& $arg[0];
} else {
$args[] = $arg;
}
$numArgs = func_num_args();
for ($a = 2; $a < $numArgs; $a++) {
$args[] = func_get_arg($a);
}
return $hook->apply_filters($tag, $args, false);
}
return null;
}
function delete_event($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY){
if( $hook = get_hook_class() ){
return $hook->remove_action($tag, $func, $priority);
}
return null;
}
function delete_replace($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY){
if( $hook = get_hook_class() ){
return $hook->remove_filter($tag, $func, $priority);
}
return null;
}
function get_hook_datas($type='', $is_callback=''){
if( $hook = get_hook_class() ){
return $hook->get_properties($type, $is_callback);
}
return null;
}
?>
+38 -41
View File
@@ -30,46 +30,27 @@ function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=
}
}
$cache_fwrite = false;
$caches = null;
if(G5_USE_CACHE) {
$cache_file = G5_DATA_PATH."/cache/latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}-serial.php";
if(!file_exists($cache_file)) {
$cache_fwrite = true;
} else {
if($cache_time > 0) {
$filetime = filemtime($cache_file);
if($filetime && $filetime < (G5_SERVER_TIME - 3600 * $cache_time)) {
@unlink($cache_file);
$cache_fwrite = true;
}
}
if(!$cache_fwrite) {
try{
$file_contents = file_get_contents($cache_file);
$file_ex = explode("\n\n", $file_contents);
$caches = unserialize(base64_decode($file_ex[1]));
$list = (is_array($caches) && isset($caches['list'])) ? $caches['list'] : array();
$bo_subject = (is_array($caches) && isset($caches['bo_subject'])) ? $caches['bo_subject'] : '';
} catch(Exception $e){
$cache_fwrite = true;
$list = array();
}
}
}
$cache_file_name = "latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}-".g5_cache_secret_key();
$caches = g5_get_cache($cache_file_name);
$cache_list = isset($caches['list']) ? $caches['list'] : array();
g5_latest_cache_data($bo_table, $cache_list);
}
if(!G5_USE_CACHE || $cache_fwrite) {
if( $caches === false ){
$list = array();
$sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
$board = sql_fetch($sql);
$board = get_board_db($bo_table, true);
$bo_subject = get_text($board['bo_subject']);
$board['bo_use_sideview'] = 0; // not use sideview
$tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 order by wr_num limit 0, {$rows} ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
try {
@@ -82,22 +63,38 @@ function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=
$row['file'] = array('count'=>0);
}
$list[$i] = get_list($row, $board, $latest_skin_url, $subject_len);
}
if($cache_fwrite) {
$handle = fopen($cache_file, 'w');
$list[$i]['first_file_thumb'] = (isset($row['wr_file']) && $row['wr_file']) ? get_board_file_db($bo_table, $row['wr_id'], 'bf_file, bf_content', "and bf_type between '1' and '3'", true) : array('bf_file'=>'', 'bf_content'=>'');
$list[$i]['bo_table'] = $bo_table;
// 썸네일 추가
if($options) {
$options_arr = explode(',', $options);
$thumb_width = $options_arr[0];
$thumb_height = $options_arr[1];
$thumb = get_list_thumbnail($bo_table, $row['wr_id'], $thumb_width, $thumb_height, false, true);
// 이미지 썸네일
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$thumb_width.'" height="'.$thumb_height.'">';
$list[$i]['img_thumbnail'] = '<a href="'.$list[$i]['href'].'" class="lt_img">'.$img_content.'</a>';
// } else {
// $img_content = '<img src="'. G5_IMG_URL.'/no_img.png'.'" alt="'.$thumb['alt'].'" width="'.$thumb_width.'" height="'.$thumb_height.'" class="no_img">';
}
}
}
g5_latest_cache_data($bo_table, $list);
if(G5_USE_CACHE) {
$caches = array(
'list' => $list,
'bo_subject' => sql_escape_string($bo_subject),
);
$cache_content = "<?php if (!defined('_GNUBOARD_')) exit; ?>\n\n";
$cache_content .= base64_encode(serialize($caches)); //serialize
);
fwrite($handle, $cache_content);
fclose($handle);
@chmod($cache_file, 0640);
g5_set_cache($cache_file_name, $caches, 3600 * $cache_time);
}
} else {
$list = $cache_list;
$bo_subject = (is_array($caches) && isset($caches['bo_subject'])) ? $caches['bo_subject'] : '';
}
ob_start();
+8 -5
View File
@@ -36,10 +36,13 @@ function outlogin($skin_dir='basic')
// 읽지 않은 쪽지가 있다면
if ($is_member) {
$sql = " select count(*) as cnt from {$g5['memo_table']} where me_recv_mb_id = '{$member['mb_id']}' and me_read_datetime = '0000-00-00 00:00:00' ";
$row = sql_fetch($sql);
$memo_not_read = $row['cnt'];
if( isset($member['mb_memo_cnt']) ){
$memo_not_read = $member['mb_memo_cnt'];
} else {
$memo_not_read = get_memo_not_read($member['mb_id']);
}
$mb_scrap_cnt = isset($member['mb_scrap_cnt']) ? (int) $member['mb_scrap_cnt'] : '';
$is_auth = false;
$sql = " select count(*) as cnt from {$g5['auth_table']} where mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
@@ -49,7 +52,7 @@ function outlogin($skin_dir='basic')
$outlogin_url = login_url($urlencode);
$outlogin_action_url = G5_HTTPS_BBS_URL.'/login_check.php';
ob_start();
if ($is_member)
include_once ($outlogin_skin_path.'/outlogin.skin.2.php');
+221
View File
@@ -0,0 +1,221 @@
<?php
if (!defined('_GNUBOARD_')) exit;
/*
* Password Hashing with PBKDF2 (http://crackstation.net/hashing-security.htm).
* Copyright (c) 2013, Taylor Hornby
* All rights reserved.
*
* Modified to Work with Older Versions of PHP
* Copyright (c) 2014, Kijin Sung
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
// These constants may be changed without breaking existing hashes.
define('PBKDF2_COMPAT_HASH_ALGORITHM', 'SHA256');
define('PBKDF2_COMPAT_ITERATIONS', 12000);
define('PBKDF2_COMPAT_SALT_BYTES', 24);
define('PBKDF2_COMPAT_HASH_BYTES', 24);
// Calculates a hash from the given password.
function create_hash($password, $force_compat = false)
{
// Generate the salt.
if (function_exists('mcrypt_create_iv')) {
$salt = base64_encode(mcrypt_create_iv(PBKDF2_COMPAT_SALT_BYTES, MCRYPT_DEV_URANDOM));
} elseif (@file_exists('/dev/urandom') && $fp = @fopen('/dev/urandom', 'r')) {
$salt = base64_encode(fread($fp, PBKDF2_COMPAT_SALT_BYTES));
} else {
$salt = '';
for ($i = 0; $i < PBKDF2_COMPAT_SALT_BYTES; $i += 2) {
$salt .= pack('S', mt_rand(0, 65535));
}
$salt = base64_encode(substr($salt, 0, PBKDF2_COMPAT_SALT_BYTES));
}
// Determine the best supported algorithm and iteration count.
$algo = strtolower(PBKDF2_COMPAT_HASH_ALGORITHM);
$iterations = PBKDF2_COMPAT_ITERATIONS;
if ($force_compat || !function_exists('hash_algos') || !in_array($algo, hash_algos())) {
$algo = false; // This flag will be detected by pbkdf2_default()
$iterations = round($iterations / 5); // PHP 4 is very slow. Don't cause too much server load.
}
// Return format: algorithm:iterations:salt:hash
$pbkdf2 = pbkdf2_default($algo, $password, $salt, $iterations, PBKDF2_COMPAT_HASH_BYTES);
$prefix = $algo ? $algo : 'sha1';
return $prefix . ':' . $iterations . ':' . $salt . ':' . base64_encode($pbkdf2);
}
// Checks whether a password matches a previously calculated hash
function validate_password($password, $hash)
{
// Split the hash into 4 parts.
$params = explode(':', $hash);
if (count($params) < 4) return false;
// Recalculate the hash and compare it with the original.
$pbkdf2 = base64_decode($params[3]);
$pbkdf2_check = pbkdf2_default($params[0], $password, $params[2], (int)$params[1], strlen($pbkdf2));
return slow_equals($pbkdf2, $pbkdf2_check);
}
// Checks whether a hash needs upgrading.
function needs_upgrade($hash)
{
// Get the current algorithm and iteration count.
$params = explode(':', $hash);
if (count($params) < 4) return true;
$algo = $params[0];
$iterations = (int)$params[1];
// Compare the current hash with the best supported options.
if (!function_exists('hash_algos') || !in_array($algo, hash_algos())) {
return false;
} elseif ($algo === strtolower(PBKDF2_COMPAT_HASH_ALGORITHM) && $iterations >= PBKDF2_COMPAT_ITERATIONS) {
return false;
} else {
return true;
}
}
// Compares two strings $a and $b in length-constant time.
function slow_equals($a, $b)
{
$diff = strlen($a) ^ strlen($b);
for($i = 0; $i < strlen($a) && $i < strlen($b); $i++) {
$diff |= ord($a[$i]) ^ ord($b[$i]);
}
return $diff === 0;
}
// PBKDF2 key derivation function as defined by RSA's PKCS #5: https://www.ietf.org/rfc/rfc2898.txt
// Test vectors can be found here: https://www.ietf.org/rfc/rfc6070.txt
// This implementation of PBKDF2 was originally created by https://defuse.ca
// With improvements by http://www.variations-of-shadow.com
function pbkdf2_default($algo, $password, $salt, $count, $key_length)
{
// Sanity check.
if ($count <= 0 || $key_length <= 0) {
trigger_error('PBKDF2 ERROR: Invalid parameters.', E_USER_ERROR);
}
// Check if we should use the fallback function.
if (!$algo) return pbkdf2_fallback($password, $salt, $count, $key_length);
// Check if the selected algorithm is available.
$algo = strtolower($algo);
if (!function_exists('hash_algos') || !in_array($algo, hash_algos())) {
if ($algo === 'sha1') {
return pbkdf2_fallback($password, $salt, $count, $key_length);
} else {
trigger_error('PBKDF2 ERROR: Hash algorithm not supported.', E_USER_ERROR);
}
}
// Use built-in function if available.
if (function_exists('hash_pbkdf2')) {
return hash_pbkdf2($algo, $password, $salt, $count, $key_length, true);
}
// Count the blocks.
$hash_length = strlen(hash($algo, '', true));
$block_count = ceil($key_length / $hash_length);
// Hash it!
$output = '';
for ($i = 1; $i <= $block_count; $i++) {
$last = $salt . pack('N', $i); // $i encoded as 4 bytes, big endian.
$last = $xorsum = hash_hmac($algo, $last, $password, true); // first iteration.
for ($j = 1; $j < $count; $j++) { // The other $count - 1 iterations.
$xorsum ^= ($last = hash_hmac($algo, $last, $password, true));
}
$output .= $xorsum;
}
// Truncate and return.
return substr($output, 0, $key_length);
}
// Fallback function using sha1() and a pure-PHP implementation of HMAC.
// The result is identical to the default function when used with SHA-1.
// But it is approximately 1.6x slower than the hash_hmac() function of PHP 5.1.2+,
// And approximately 2.3x slower than the hash_pbkdf2() function of PHP 5.5+.
function pbkdf2_fallback($password, $salt, $count, $key_length)
{
// Count the blocks.
$hash_length = 20;
$block_count = ceil($key_length / $hash_length);
// Prepare the HMAC key and padding.
if (strlen($password) > 64) {
$password = str_pad(sha1($password, true), 64, chr(0));
} else {
$password = str_pad($password, 64, chr(0));
}
$opad = str_repeat(chr(0x5C), 64) ^ $password;
$ipad = str_repeat(chr(0x36), 64) ^ $password;
// Hash it!
$output = '';
for ($i = 1; $i <= $block_count; $i++) {
$last = $salt . pack('N', $i);
$xorsum = $last = pack('H*', sha1($opad . pack('H*', sha1($ipad . $last))));
for ($j = 1; $j < $count; $j++) {
$last = pack('H*', sha1($opad . pack('H*', sha1($ipad . $last))));
$xorsum ^= $last;
}
$output .= $xorsum;
}
// Truncate and return.
return substr($output, 0, $key_length);
}
+6 -11
View File
@@ -10,22 +10,17 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
$filename = $alt = "";
$edt = false;
$sql = " select bf_file, bf_content from {$g5['board_file_table']}
where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_type between '1' and '3' order by bf_no limit 0, 1 ";
$row = sql_fetch($sql);
$row = get_thumbnail_find_cache($bo_table, $wr_id, 'file');
if($row['bf_file']) {
$filename = $row['bf_file'];
$filepath = G5_DATA_PATH.'/file/'.$bo_table;
$alt = get_text($row['bf_content']);
} else {
$write_table = $g5['write_prefix'].$bo_table;
$sql = " select wr_content from $write_table where wr_id = '$wr_id' ";
$write = sql_fetch($sql);
$matches = get_editor_image($write['wr_content'], false);
$write = get_thumbnail_find_cache($bo_table, $wr_id, 'content');
$edt = true;
if(isset($matches[1]) && is_array($matches[1])){
if( $matches = get_editor_image($write['wr_content'], false) ){
for($i=0; $i<count($matches[1]); $i++)
{
// 이미지 path 구함
@@ -50,8 +45,8 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
break;
}
}
}
} //end for
} //end if
}
if(!$filename)
+415
View File
@@ -0,0 +1,415 @@
<?php
if (!defined('_GNUBOARD_')) exit;
include_once(dirname(__FILE__) .'/URI/uri.class.php');
include_once(dirname(__FILE__) .'/URI/obj.class.php');
// 짧은 주소 형식으로 만들어서 가져온다.
function get_pretty_url($folder, $no='', $query_string='', $action='')
{
global $g5, $config;
$boards = get_board_names();
$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']) {
$segments[0] = G5_URL;
if( $folder === 'content' && $no ){ // 내용관리
$segments[1] = $folder;
if( $config['cf_bbs_rewrite'] > 1 ){
$get_content = get_content_db( $no , true);
$segments[2] = $get_content['co_seo_title'] ? urlencode($get_content['co_seo_title']).'/' : urlencode($no);
} else {
$segments[2] = urlencode($no);
}
} else if(in_array($folder, $boards)) { // 게시판
$segments[1] = $folder;
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);
} else {
$segments[2] = urlencode($no);
}
} else if($action) {
$segments[2] = urlencode($action);
}
} else {
$segments[1] = $folder;
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 '?'.
if(substr($query_string, 0, 1) == '&') {
$add_query = preg_replace("/\&amp;/", "?", $query_string, 1);
} else {
$add_query = '?'. $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 .= '&amp;wr_id='. $no;
}
if($query_string) {
$url .= '&amp;'. $query_string;
}
} else {
$url = G5_BBS_URL. '/'.$folder.'.php';
if($no) {
$url .= '?'. $no;
}
if($query_string) {
$url .= ($no ? '?' : '&amp;'). $query_string;
}
}
$segments[0] = $url;
}
return implode('/', $segments).$add_query;
}
function short_url_clean($string_url, $add_qry=''){
global $config, $g5;
if( isset($config['cf_bbs_rewrite']) && $config['cf_bbs_rewrite'] ){
$string_url = str_replace('&amp;', '&', $string_url);
$url=parse_url($string_url);
$page_name = basename($url['path'],".php");
$array_page_names = apply_replace('url_clean_page_names', array('board', 'write'));
if( strpos($string_url, G5_BBS_URL) === false || ! in_array($page_name, $array_page_names) ){ //게시판이 아니면 리턴
return $string_url;
}
$return_url = '';
$qstring = 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 )
//while(list($k,$v) = each($vars)) $page_name .= "/".$v;
if( $page_name === 'write' ){
$vars['action'] = 'write';
$allow_param_keys = array('bo_table'=>'', 'action'=>'');
} else {
$allow_param_keys = array('bo_table'=>'', 'wr_id'=>'');
}
$s = array();
foreach( $allow_param_keys as $key=>$v ){
if( !isset($vars[$key]) || empty($vars[$key]) ) continue;
$add = '';
$s[$key] = $vars[$key];
}
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'] = $get_write['wr_seo_title'].'/';
}
}
$fragment = isset($url['fragment']) ? '#'.$url['fragment'] : '';
$host = G5_URL;
if( isset($url['host']) ){
$array_file_paths = apply_replace('url_clean_page_paths', array('/'.G5_BBS_DIR.'/board.php', '/'.G5_BBS_DIR.'/write.php'));
$str_path = isset($url['path']) ? $url['path'] : '';
$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 'https://' : 'http://';
$host = $http.$url['host'].str_replace($array_file_paths, '', $str_path);
}
$add_param = '';
if( $result = array_diff_key($vars, $allow_param_keys ) ){
$add_param = '?'.http_build_query($result,'','&amp;');
}
if( $add_qry ){
$add_param .= $add_param ? '&amp;'.$add_qry : '?'.$add_qry;
}
while(list($k,$v) = each($s)) $return_url .= '/'.$v;
return $host.$return_url.$add_param.$fragment;
}
return $string_url;
}
function correct_goto_url($url){
return $url.'/';
}
function generate_seo_title($string, $wordLimit=G5_SEO_TITEL_WORD_CUT){
$separator = '-';
if($wordLimit != 0){
$wordArr = explode(' ', $string);
$string = implode(' ', array_slice($wordArr, 0, $wordLimit));
}
$quoteSeparator = preg_quote($separator, '#');
$trans = array(
'&.+?;' => '',
'[^\w\d _-]' => '',
'\s+' => $separator,
'('.$quoteSeparator.')+'=> $separator
);
$string = strip_tags($string);
if( function_exists('mb_convert_encoding') ){
$string = mb_convert_encoding($string, 'UTF-8', 'UTF-8');
}
foreach ($trans as $key => $val){
$string = preg_replace('#'.$key.'#iu', $val, $string);
}
$string = strtolower($string);
return trim(trim($string, $separator));
}
function exist_seo_url($type, $seo_title, $write_table, $sql_id=0){
global $g5;
$exists_title = '';
$sql_id = preg_replace('/[^a-z0-9_]/i', '', $sql_id);
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);
$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'];
} else {
return apply_replace('exist_check_seo_title', $seo_title, $type, $write_table, $sql_id);
}
if ($exists_title)
return 'is_exists';
else
return '';
}
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, 200 - ($count+1), '')."-$count" : $seo_title;
if( ! exist_seo_url($type, $seo_title_add, $write_table, $sql_id) ){
return $seo_title_add;
}
$count++;
if( $count > 198 ){
return $seo_title_add;
}
return exist_seo_title_recursive($type, $seo_title, $write_table, $sql_id);
}
function seo_title_update($db_table, $pk_id, $type='bbs'){
global $g5;
$pk_id = (int) $pk_id;
if( $type === 'bbs' ){
$write = get_write($db_table, $pk_id, true);
if( ! $write['wr_seo_title'] && $co['wr_subject'] ){
$wr_seo_title = exist_seo_title_recursive('bbs', generate_seo_title($write['wr_subject']), $db_table, $pk_id);
$sql = " update `{$db_table}` set wr_seo_title = '{$wr_seo_title}' where wr_id = '{$pk_id}' ";
sql_query($sql);
}
} else if ( $type === 'content' ){
$co = get_content_db($pk_id, true);
if( ! $co['co_seo_title'] && $co['co_subject'] ){
$co_seo_title = exist_seo_title_recursive('content', generate_seo_title($co['co_subject']), $db_table, $pk_id);
$sql = " update `{$db_table}` set co_seo_title = '{$co_seo_title}' where co_id = '{$pk_id}' ";
sql_query($sql);
}
}
}
function get_nginx_conf_rules($return_string=false){
$get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'].'/' : '/';
$rules = array();
$rules[] = '#### '.G5_VERSION.' nginx rules BEGIN #####';
$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;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)$ {$base_path}bbs/board.php?bo_table=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)/write$ {$base_path}bbs/write.php?bo_table=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)/([^/]+)/$ {$base_path}bbs/board.php?bo_table=$1&wr_seo_title=$2&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)/([0-9]+)$ {$base_path}bbs/board.php?bo_table=$1&wr_id=$2&rewrite=1 break;";
$rules[] = '}';
$rules[] = '#### '.G5_VERSION.' nginx rules END #####';
return $return_string ? implode("\n", $rules) : $rules;
}
function get_mod_rewrite_rules($return_string=false){
$get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'].'/' : '/';
$rules = array();
$rules[] = '#### '.G5_VERSION.' rewrite BEGIN #####';
$rules[] = '<IfModule mod_rewrite.c>';
$rules[] = 'RewriteEngine On';
$rules[] = 'RewriteBase '.$base_path;
$rules[] = 'RewriteCond %{REQUEST_FILENAME} -f [OR]';
$rules[] = 'RewriteCond %{REQUEST_FILENAME} -d';
$rules[] = 'RewriteRule ^ - [L]';
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]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)$ '.G5_BBS_DIR.'/board.php?bo_table=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)/([^/]+)/$ '.G5_BBS_DIR.'/board.php?bo_table=$1&wr_seo_title=$2&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)/write$ '.G5_BBS_DIR.'/write.php?bo_table=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)/([0-9]+)$ '.G5_BBS_DIR.'/board.php?bo_table=$1&wr_id=$2&rewrite=1 [QSA,L]';
$rules[] = '</IfModule>';
$rules[] = '#### '.G5_VERSION.' rewrite END #####';
return $return_string ? implode("\n", $rules) : $rules;
}
function check_need_rewrite_rules(){
$is_apache = (stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false);
if($is_apache){
$save_path = G5_PATH.'/.htaccess';
if( !file_exists($save_path) ){
return true;
}
$rules = get_mod_rewrite_rules();
$bof_str = $rules[0];
$eof_str = end($rules);
$code = file_get_contents($save_path);
if( strpos($code, $bof_str) === false || strpos($code, $eof_str) === false ){
return true;
}
}
return false;
}
function update_rewrite_rules(){
$is_apache = (stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false);
if($is_apache){
$save_path = G5_PATH.'/.htaccess';
if( (!file_exists($save_path) && is_writable(G5_PATH)) || is_writable($save_path) ){
$rules = get_mod_rewrite_rules();
$bof_str = $rules[0];
$eof_str = end($rules);
if( file_exists($save_path) ){
$code = file_get_contents($save_path);
if( $code && strpos($code, $bof_str) !== false && strpos($code, $eof_str) !== false ){
return true;
}
}
$fp = fopen($save_path, "ab");
flock( $fp, LOCK_EX );
$rewrite_str = implode("\n", $rules);
fwrite( $fp, "\n" );
fwrite( $fp, $rewrite_str );
fwrite( $fp, "\n" );
flock( $fp, LOCK_UN );
fclose($fp);
return true;
}
}
return false;
}
?>
-3
View File
@@ -1,9 +1,6 @@
<?php
include_once('./_common.php');
// 내용
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql);
if (!$co['co_id'])
alert('등록된 내용이 없습니다.');
+1 -7
View File
@@ -136,13 +136,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<input type="hidden" name="sop" value="and">
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl">
<option value="wr_subject"<?php echo get_selected($sfl, 'wr_subject', true); ?>>제목</option>
<option value="wr_content"<?php echo get_selected($sfl, 'wr_content'); ?>>내용</option>
<option value="wr_subject||wr_content"<?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>>제목+내용</option>
<option value="mb_id,1"<?php echo get_selected($sfl, 'mb_id,1'); ?>>회원아이디</option>
<option value="mb_id,0"<?php echo get_selected($sfl, 'mb_id,0'); ?>>회원아이디(코)</option>
<option value="wr_name,1"<?php echo get_selected($sfl, 'wr_name,1'); ?>>글쓴이</option>
<option value="wr_name,0"<?php echo get_selected($sfl, 'wr_name,0'); ?>>글쓴이(코)</option>
<?php echo get_board_sfl_select_options($sfl); ?>
</select>
<input name="stx" value="<?php echo stripslashes($stx) ?>" placeholder="검색어(필수)" required id="stx" class="sch_input" size="15" maxlength="20">
<button type="submit" value="검색" class="sch_btn"><i class="fa fa-search" aria-hidden="true"></i> <span class="sound_only">검색</span></button>
+1 -1
View File
@@ -154,7 +154,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</div>
<div class="btn_top top write_div">
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel">취소</a>
<a href="<?php echo get_pretty_url($bo_table); ?>" class="btn_cancel">취소</a>
<input type="submit" value="작성완료" id="btn_submit" class="btn_submit" accesskey="s">
</div>
</form>
+1 -7
View File
@@ -162,13 +162,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<input type="hidden" name="sop" value="and">
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl">
<option value="wr_subject"<?php echo get_selected($sfl, 'wr_subject', true); ?>>제목</option>
<option value="wr_content"<?php echo get_selected($sfl, 'wr_content'); ?>>내용</option>
<option value="wr_subject||wr_content"<?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>>제목+내용</option>
<option value="mb_id,1"<?php echo get_selected($sfl, 'mb_id,1'); ?>>회원아이디</option>
<option value="mb_id,0"<?php echo get_selected($sfl, 'mb_id,0'); ?>>회원아이디(코)</option>
<option value="wr_name,1"<?php echo get_selected($sfl, 'wr_name,1'); ?>>글쓴이</option>
<option value="wr_name,0"<?php echo get_selected($sfl, 'wr_name,0'); ?>>글쓴이(코)</option>
<?php echo get_board_sfl_select_options($sfl); ?>
</select>
<input name="stx" value="<?php echo stripslashes($stx) ?>" placeholder="검색어(필수)" required id="stx" class="sch_input" size="15" maxlength="20">
<button type="submit" value="검색" class="sch_btn"><i class="fa fa-search" aria-hidden="true"></i> <span class="sound_only">검색</span></button>
+1 -1
View File
@@ -154,7 +154,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</div>
<div class="btn_top top write_div">
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel">취소</a>
<a href="<?php echo get_pretty_url($bo_table); ?>" class="btn_cancel">취소</a>
<input type="submit" value="작성완료" id="btn_submit" class="btn_submit" accesskey="s">
</div>
</form>
+2 -2
View File
@@ -13,14 +13,14 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<li><a href="./memo.php?kind=send">보낸쪽지</a></li>
<li><a href="./memo_form.php" class="selected">쪽지쓰기</a></li>
</ul>
<form name="fmemoform" action="./memo_form_update.php" onsubmit="return fmemoform_submit(this);" method="post" autocomplete="off">
<form name="fmemoform" action="<?php echo $memo_action_url; ?>" onsubmit="return fmemoform_submit(this);" method="post" autocomplete="off">
<div class="form_01">
<h2 class="sound_only">쪽지쓰기</h2>
<ul>
<li>
<label for="me_recv_mb_id" class="sound_only">받는 회원아이디<strong>필수</strong></label>
<input type="text" name="me_recv_mb_id" value="<?php echo $me_recv_mb_id ?>" id="me_recv_mb_id" required class="frm_input required" placeholder="받는 회원아이디">
<input type="text" name="me_recv_mb_id" value="<?php echo $me_recv_mb_id; ?>" id="me_recv_mb_id" required class="frm_input full_input required" size="47" placeholder="받는 회원아이디">
<span class="frm_info">여러 회원에게 보낼때는 컴마(,)로 구분하세요.</span>
<?php if ($config['cf_memo_send_point']) { ?>
<br ><span class="frm_info">쪽지 보낼때 회원당 <?php echo number_format($config['cf_memo_send_point']); ?>점의 포인트를 차감합니다.</span>
+1 -1
View File
@@ -43,7 +43,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
</article>
<div class="win_btn">
<?php if ($kind == 'recv') { ?><a href="./memo_form.php?me_recv_mb_id=<?php echo $mb['mb_id'] ?>&amp;me_id=<?php echo $memo['me_id'] ?>" class="btn_submit">답장</a><?php } ?>
<?php if ($kind == 'recv') { ?><a href="./memo_form.php?me_recv_mb_id=<?php echo $mb['mb_id'] ?>&amp;me_id=<?php echo $memo['me_id'] ?>" class="btn_submit">답장</a><?php } ?>
<?php if($prev_link) { ?>
<a href="<?php echo $prev_link ?>" class="btn_b03 btn">이전쪽지</a>
<?php } ?>
@@ -18,7 +18,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$outlogin_skin_url.'/style.css">'
</div>
<div id="ol_after_btn">
<?php if ($is_admin == 'super' || $is_auth) { ?><a href="<?php echo G5_ADMIN_URL ?>" class="btn_admin">관리자</a><?php } ?>
<?php if ($is_admin == 'super' || $is_auth) { ?><a href="<?php echo correct_goto_url(G5_ADMIN_URL); ?>" class="btn_admin">관리자</a><?php } ?>
<a href="<?php echo G5_BBS_URL ?>/logout.php" id="ol_after_logout">로그아웃</a>
</div>
+71 -74
View File
@@ -1,14 +1,14 @@
@charset "utf-8";
.social_info_guide{background:#f3f3f3;border:1px solid #ddd;margin:0 10px 10px;padding:10px 15px;line-height:1.5em}
.bg-warning{margin:0 10px 10px;padding:10px 15px;line-height:1.5em}
.bg-warning1{background:#f7dfe4;border:1px solid #eac3cb}
.bg-warning2{background:#deeabf;border:1px solid #bde498}
.bg-warning3{background:#fff8dc;border:1px solid #f1e4b2}
.social_info_guide {background:#f3f3f3;border:1px solid #ddd;margin:0 10px 10px;padding:10px 15px;line-height:1.5em}
.bg-warning {margin:0 10px 10px;padding:10px 15px;line-height:1.5em}
.bg-warning1 {background:#f7dfe4;border:1px solid #eac3cb}
.bg-warning2 {background:#deeabf;border:1px solid #bde498}
.bg-warning3 {background:#fff8dc;border:1px solid #f1e4b2}
/* SNS LOGIN */
.login-sns{padding-bottom:10px;margin-top:5px;;clear:both;}
.login-sns h3{padding-top:10px;text-align:center;color:#b2b2b2;;margin-top:15px;font-weight:normal}
.login-sns {padding-bottom:10px;margin-top:5px;clear:both}
.login-sns h3 {padding-top:10px;text-align:center;color:#b2b2b2;margin-top:15px;font-weight:normal}
.sns-wrap {margin:10px 0 0;text-align:center}
.sns-icon {display:inline-block;vertical-align:middle;text-decoration:none}
.sns-icon:hover {text-decoration:none}
@@ -25,19 +25,19 @@
.reg-form .sns-icon .txt i {font-style:normal}
.sns-wrap-reg .sns-naver {border-color:#18a400;background:#2db400}
.sns-wrap-reg .sns-naver .ico {background-position:-29px 0; }
.sns-wrap-reg .sns-naver .ico {background-position:-29px 0}
.sns-wrap-reg .sns-google {border-color:#ca2c19;background:#dd5443}
.sns-wrap-reg .sns-google .ico {background-position:-58px 0}
.sns-wrap-reg .sns-facebook {border-color:#2e5393;background:#3a5897}
.sns-wrap-reg .sns-facebook .ico {background-position:0 0 }
.sns-wrap-reg .sns-facebook .ico {background-position:0 0}
.sns-wrap-reg .sns-icon {border-color:#dcdcdc}
.sns-wrap-reg .sns-icon-not {border-color:#8b8b8b}
.sns-wrap-reg .sns-naver{border-color:#18a400}
.sns-wrap-reg .sns-naver .ico {background-position:-29px 0; }
.sns-wrap-reg .sns-naver {border-color:#18a400}
.sns-wrap-reg .sns-naver .ico {background-position:-29px 0}
.sns-wrap-reg .sns-google .ico {background-position:-58px 0}
.sns-wrap-reg .sns-google {border-color:#ca2c19}
.sns-wrap-reg .sns-facebook .ico {background-position:0 0 }
.sns-wrap-reg .sns-facebook .ico {background-position:0 0}
.sns-wrap-reg .sns-facebook {border-color:#2e5393}
.sns-wrap-reg .sns-kakao .ico {background-position:-87px 0}
.sns-wrap-reg .sns-twitter {border-color:#488FC9}
@@ -47,7 +47,7 @@
.sns-wrap-reg .sns-kakao {border-color:#f2df00}
/* SNS by COLOR */
.sns-wrap-over .sns-naver{background:url('./img/sns_naver_s.png') no-repeat}
.sns-wrap-over .sns-naver {background:url('./img/sns_naver_s.png') no-repeat}
.sns-wrap-over .sns-google {background:url('./img/sns_gp_s.png') no-repeat}
.sns-wrap-over .sns-facebook {background:url('./img/sns_fb_s.png') no-repeat}
.sns-wrap-over .sns-twitter {background:url('./img/sns_twitter_s.png') no-repeat}
@@ -57,99 +57,96 @@
/* 아웃로그인 */
#sns_outlogin {clear:both;}
#sns_outlogin {clear:both}
#sns_outlogin .sns-icon {overflow:hidden;margin:0 1px}
#sns_outlogin .sns-icon .txt {position:absolute;line-height:0;font-size:0;vertical-align:middle;overflow:hidden}
#sns_outlogin .sns-icon .ico {width:30px;height:30px}
/*로그인 */
#sns_login{border:0;margin-top:15px;padding:0; border-top:1px solid #edeaea}
#sns_login h3{padding: 0;font-weight:bold;color:#888;text-align:center}
#sns_login .sns-icon{display:block;height:40px;line-height:40px;width:100%;margin:0 0 5px;padding-left:40px;text-align:left;color:#fff;border-radius:2px}
#sns_login .sns-naver{background-color:#1fc800;background-position:5px 5px;border-bottom:1px solid #1ea505}
#sns_login .sns-kakao{background-color:#ffeb00;background-position:5px 5px;border-bottom:1px solid #e2c10a}
#sns_login {border:0;margin-top:15px;padding:0; border-top:1px solid #edeaea}
#sns_login h3 {padding:0;font-weight:bold;color:#888;text-align:center}
#sns_login .sns-icon {display:block;height:40px;line-height:40px;width:100%;margin:0 0 5px;padding-left:40px;text-align:left;color:#fff;border-radius:2px}
#sns_login .sns-naver {background-color:#1fc800;background-position:5px 5px;border-bottom:1px solid #1ea505}
#sns_login .sns-kakao {background-color:#ffeb00;background-position:5px 5px;border-bottom:1px solid #e2c10a}
#sns_login .sns-kakao {color:#3c1e1e}
#sns_login .sns-facebook{background-color:#3b579d;background-position:5px 5px;border-bottom:1px solid #28458f}
#sns_login .sns-google{background-color:#db4a3a;background-position:5px 5px;border-bottom:1px solid #c03121}
#sns_login .sns-twitter{background-color:#1ea1f2;background-position:5px 5px;border-bottom:1px solid #1e82c0}
#sns_login .sns-payco{background-color:#df0b00;background-position:5px 5px;border-bottom:1px solid #9d0800}
#sns_login .txt{text-align:left;padding-left:10px;border-left:1px solid rgba(0,0,0,0.1);display:block;font-weight:bold}
#sns_login .sns-facebook {background-color:#3b579d;background-position:5px 5px;border-bottom:1px solid #28458f}
#sns_login .sns-google {background-color:#db4a3a;background-position:5px 5px;border-bottom:1px solid #c03121}
#sns_login .sns-twitter {background-color:#1ea1f2;background-position:5px 5px;border-bottom:1px solid #1e82c0}
#sns_login .sns-payco {background-color:#df0b00;background-position:5px 5px;border-bottom:1px solid #9d0800}
#sns_login .txt {text-align:left;padding-left:10px;border-left:1px solid rgba(0,0,0,0.1);display:block;font-weight:bold}
/*회원가입 */
#sns_register{margin:0 0 10px;padding:0;text-align:center;background:#fff;border: 1px solid #dbdbdb;
-webkit-box-shadow: 2px 2px 3px 0px rgba(0,0,0,0.2);
-moz-box-shadow: 2px 2px 3px 0px rgba(0,0,0,0.2);
box-shadow: 2px 2px 3px 0px rgba(0,0,0,0.2);}
#sns_register h2{font-size: 1.167em;text-align: left;padding: 15px 20px;border-bottom: 1px solid #dbdbdb;}
#sns_register {margin:0 0 10px;padding:0;text-align:center;background:#fff;border:1px solid #dbdbdb}
#sns_register h2 {font-size:1.167em;text-align:left;padding:15px 20px;border-bottom:1px solid #dbdbdb}
#sns_register .sns-wrap:after {display:block;visibility:hidden;clear:both;content:""}
#sns_register .sns-wrap{display:inline-block;padding:20px;vertical-align:top;margin:0}
#sns_register .sns-icon{display:inline-block;height:40px;line-height:40px;width:100%;margin:0 0 5px;padding-left:40px;text-align:left;color:#fff;border-radius:2px;float:left}
#sns_register .sns-icon:nth-child(3n+1){clear:both}
#sns_register .sns-naver{background-color:#1fc800;background-position:5px 5px;border-bottom:1px solid #1ea505}
#sns_register .sns-kakao{background-color:#ffeb00;background-position:5px 5px;border-bottom:1px solid #e2c10a}
#sns_register .sns-wrap {display:inline-block;padding:20px;vertical-align:top;margin:0}
#sns_register .sns-icon {display:inline-block;height:40px;line-height:40px;width:100%;margin:0 0 5px;padding-left:40px;text-align:left;color:#fff;border-radius:2px;float:left}
#sns_register .sns-icon:nth-child(3n+1) {clear:both}
#sns_register .sns-naver {background-color:#1fc800;background-position:5px 5px;border-bottom:1px solid #1ea505}
#sns_register .sns-kakao {background-color:#ffeb00;background-position:5px 5px;border-bottom:1px solid #e2c10a}
#sns_register .sns-kakao {color:#3c1e1e}
#sns_register .sns-facebook{background-color:#3b579d;background-position:5px 5px;border-bottom:1px solid #28458f}
#sns_register .sns-google{background-color:#db4a3a;background-position:5px 5px;border-bottom:1px solid #c03121}
#sns_register .sns-twitter{background-color:#1ea1f2;background-position:5px 5px;border-bottom:1px solid #1e82c0}
#sns_register .sns-payco{background-color:#df0b00;background-position:5px 5px;border-bottom:1px solid #9d0800}
#sns_register .txt{text-align:;padding-left:10px;border-left:1px solid rgba(0,0,0,0.1);display:block;font-weight:bold}
#sns_register .sns-facebook {background-color:#3b579d;background-position:5px 5px;border-bottom:1px solid #28458f}
#sns_register .sns-google {background-color:#db4a3a;background-position:5px 5px;border-bottom:1px solid #c03121}
#sns_register .sns-twitter {background-color:#1ea1f2;background-position:5px 5px;border-bottom:1px solid #1e82c0}
#sns_register .sns-payco {background-color:#df0b00;background-position:5px 5px;border-bottom:1px solid #9d0800}
#sns_register .txt {display:block;padding-left:10px;border-left:1px solid rgba(0,0,0,0.1);font-weight:bold}
/* LOGIN LOADING */
.social-login-loading{width:100%;height:auto;text-align:center}
.social-login-loading p{display:inline-block;margin-top:10px;padding:40px 0 0;line-height:30px}
.social-login-loading {width:100%;height:auto;text-align:center}
.social-login-loading p {display:inline-block;margin-top:10px;padding:40px 0 0;line-height:30px}
/*기존 계정에 연결하기*/
/* Styles for Accordion */
.mbskin .toggle{position:relative;display:block;border:1px solid #c6cacc;margin-top:-1px;background-color: #fcfcfc;margin:0 0 5px}
.mbskin .toggle .toggle-title{padding:13px 15px;line-height:20px}
.mbskin .toggle .title-name{display:block}
.mbskin .toggle .toggle-inner{padding:15px;line-height:1.5em;display:none;background:#fff;border-top:1px solid #e2e2e2;}
.mbskin .toggle .toggle-inner div{max-width:100%}
.mbskin .right_i{position:absolute;font-size:0.92em;top:10px;right:10px;padding:0 10px 0 0;border-radius:3px;display:inline-block;z-index: 2;background: #3497d9;color: #fff;border-bottom-color: #1977b5;}
.mbskin .toggle .toggle-title .right_i i{background:url("./img/plus_minus.png") 0 -24px no-repeat;width:20px;height:24px;display:inline-block;vertical-align:middle}
.mbskin .toggle .toggle-title.active .right_i i{background:url("./img/plus_minus.png") 0 0 no-repeat}
.mbskin .all_agree{position:relative;display:block;;margin-bottom:6px;background:#d9d9d9;border-radius:3px;border-top:0;padding:13px 15px;line-height:20px}
.mbskin .toggle {position:relative;display:block;border:1px solid #c6cacc;margin-top:-1px;background-color:#fcfcfc;margin:0 0 5px}
.mbskin .toggle .toggle-title {padding:13px 15px;line-height:20px}
.mbskin .toggle .title-name {display:block}
.mbskin .toggle .toggle-inner {padding:15px;line-height:1.5em;display:none;background:#fff;border-top:1px solid #e2e2e2}
.mbskin .toggle .toggle-inner div {max-width:100%}
.mbskin .right_i {position:absolute;font-size:0.92em;top:10px;right:10px;padding:0 10px 0 0;border-radius:3px;display:inline-block;z-index:2;background:#3497d9;color:#fff;border-bottom-color:#1977b5}
.mbskin .toggle .toggle-title .right_i i {background:url("./img/plus_minus.png") 0 -24px no-repeat;width:20px;height:24px;display:inline-block;vertical-align:middle}
.mbskin .toggle .toggle-title.active .right_i i {background:url("./img/plus_minus.png") 0 0 no-repeat}
.mbskin .all_agree {position:relative;display:block;margin-bottom:6px;background:#d9d9d9;border-radius:3px;border-top:0;padding:13px 15px;line-height:20px}
#register_member .sns_tbl{background:#fff;;margin:10px 0;border:1px solid #c6cacc;}
.sns_tbl table{border:0}
.sns_tbl caption{ padding: 0 20px;line-height: 45px;font-size: 1.083em;border-bottom: 1px solid #e2e2e2;color:#4162ff;background: #fff;}
.sns_tbl th{width:80px;text-align:right;vertical-align:top;line-height:40px;padding:10px;}
.sns_tbl td{padding:10px;}
.sns_tbl .email_msg{color:#777;margin:5px 0 0}
#register_member .sns_tbl {background:#fff;margin:10px 0;border:1px solid #c6cacc}
.sns_tbl table {border:0}
.sns_tbl caption {padding:0 20px;line-height:45px;font-size:1.083em;border-bottom:1px solid #e2e2e2;color:#4162ff;background:#fff}
.sns_tbl th {width:80px;text-align:right;vertical-align:top;line-height:40px;padding:10px}
.sns_tbl td {padding:10px}
.sns_tbl .email_msg {color:#777;margin:5px 0 0}
.sns_tbl .frm_input {width:100%}
#fregisterform{margin:10px}
#fregisterform .btn_confirm{text-align:center;margin:20px 0}
#fregisterform .btn_confirm .btn_submit{height:45px;;padding:0 30px;font-weight:bold;font-size:1.083em}
#fregisterform .btn_confirm .btn_cancel{line-height:45px;height:45px;padding:0 30px;font-weight:bold;font-size:1.083em}
#sns-link-pnl.remodal{border-radius:5px;max-width:400px;
#fregisterform .btn_confirm {text-align:center;margin:20px 0}
#fregisterform .btn_confirm .btn_submit {height:45px;padding:0 30px;font-weight:bold;font-size:1.083em}
#fregisterform .btn_confirm .btn_cancel {line-height:45px;height:45px;padding:0 30px;font-weight:bold;font-size:1.083em}
#sns-link-pnl.remodal {border-radius:5px;max-width:400px;
-webkit-box-shadow:0 0 10px rgba(0, 0, 0,0.8);
-moz-box-shadow:0 0 10px rgba(0, 0, 0,0.8);
box-shadow:0 0 10px rgba(0, 0, 0,0.8);}
box-shadow:0 0 10px rgba(0, 0, 0,0.8)}
#sns-link-pnl .connect-close {position:absolute;top:10px;right:10px;margin:0;padding:0;width:30px;height:30px;border:0;background:transparent;color:#383838;cursor:pointer;font-size:15px}
#sns-link-pnl .connect-close:hover {color:#ff5191}
#sns-link-pnl .connect-close .fa {margin:0 0 0 1px}
#sns-link-pnl .connect-close .txt {position:absolute;line-height:0;font-size:0;overflow:hidden}
#sns-link-pnl #login_fs{margin:0 auto;width:100%;text-align:left}
#sns-link-pnl #login_fs label{display:block;display: block;font-size: 0.93em;color: #7a7a7a;margin: 5px 0;}
#sns-link-pnl #login_fs .lg_id,#sns-link-pnl #login_fs .lg_pw{width:100%;margin-bottom:5px;}
#sns-link-pnl #login_id,#sns-link-pnl #login_pw{width:100%}
#sns-link-pnl #login_fs .login_submit{width: 100%;height: 44px;font-size:1.167em;margin:10px auto 0;font-weight:bold;cursor:pointer;display:block;}
#sns-link-pnl #login_fs {margin:0 auto;width:100%;text-align:left}
#sns-link-pnl #login_fs label {display:block;display:block;font-size:0.93em;color:#7a7a7a;margin:5px 0}
#sns-link-pnl #login_fs .lg_id, #sns-link-pnl #login_fs .lg_pw {width:100%;margin-bottom:5px}
#sns-link-pnl #login_id, #sns-link-pnl #login_pw {width:100%}
#sns-link-pnl #login_fs .login_submit {width:100%;height:44px;font-size:1.167em;margin:10px auto 0;font-weight:bold;cursor:pointer;display:block}
#sns-link-pnl .connect-fg {height:320px;text-align:left}
#sns-link-pnl .login_fs {margin:0 auto;width:260px}
#sns-link-pnl .connect-fg .connect-desc {margin:0 0 10px;padding:15px;border:1px solid #d6e9c6;background:#dff0d8;color:#3c763d}
#sns-link-pnl .connect-fg .connect-title {margin-top:25px;margin-bottom:10px;font-size:1.667em;font-weight:bold;text-align:center}
.mbskin .member_connect:after {display:block;visibility:hidden;clear:both;content:""}
.mbskin .member_connect{margin-top:1em;border: 2px solid #cacaca;margin:10px;padding:10px;text-align:left}
.mbskin .member_connect .strong{font-weight:bold;margin:0 0 10px;font-size:0.97em}
.mbskin .member_connect button{color: #fff;border:0;padding:7px 13px;border:1px solid #6446e7;font-weight:bold;background: #6f50e7;border-radius:3px;font-size:0.92em}
.mbskin .member_connect button:hover{background:#6446e7}
.mbskin .member_connect {margin-top:1em;border:2px solid #cacaca;margin:10px;padding:10px;text-align:left}
.mbskin .member_connect .strong {font-weight:bold;margin:0 0 10px;font-size:0.97em}
.mbskin .member_connect button {color:#fff;border:0;padding:7px 13px;border:1px solid #6446e7;font-weight:bold;background:#6f50e7;border-radius:3px;font-size:0.92em}
.mbskin .member_connect button:hover {background:#6446e7}
.mbskin .btn_group_trigger{margin:10px;text-align:center}
.mbskin .btn_group_trigger .btn_submit_trigger{display:inline-block;height:45px;line-height:45px;color:#fff;padding:0 30px;font-weight:bold;font-size:1.083em;background:#253dbe}
.mbskin .btn_group_trigger {margin:10px;text-align:center}
.mbskin .btn_group_trigger .btn_submit_trigger {display:inline-block;height:45px;line-height:45px;color:#fff;padding:0 30px;font-weight:bold;font-size:1.083em;background:#253dbe}
.mbskin .member_connect{margin-top:50px}
.mbskin .member_connect {margin-top:50px}

Some files were not shown because too many files have changed in this diff Show More