diff --git a/adm/_common.php b/adm/_common.php
index 074ed3b51..316c629c3 100644
--- a/adm/_common.php
+++ b/adm/_common.php
@@ -6,4 +6,6 @@ include_once(G5_ADMIN_PATH.'/admin.lib.php');
if( isset($token) ){
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);
}
+
+run_event('admin_common');
?>
\ No newline at end of file
diff --git a/adm/_rewrite_config_form.php b/adm/_rewrite_config_form.php
new file mode 100644
index 000000000..3f2f8f0f3
--- /dev/null
+++ b/adm/_rewrite_config_form.php
@@ -0,0 +1,120 @@
+', 11);
+add_stylesheet('', 12);
+add_javascript('', 10);
+?>
+
+
짧은 주소 설정
+
+
+
+ 게시판과 컨텐츠 페이지에 짧은 URL 을 사용합니다. 설정 관련 메뉴얼 보기
+
+
+ Apache 서버인 경우 rewrite_module 이 비활성화 되어 있으면 짧은 주소를 사용할수 없습니다.
+
+ 짧은 주소 사용시 아래 Apache 설정 코드를 참고하여 설정해 주세요.
+
+
+
.htaccess 파일에 적용할 코드입니다.
+
+ Apache 서버인 경우 rewrite_module 이 비활성화 되어 있으면 짧은 주소를 사용할수 없습니다.
+
+ 자동으로 .htaccess 파일을 수정 할수 있는 권한이 없습니다. .htaccess 파일이 없다면 생성 후에, 아래 코드가 없으면 코드를 복사하여 붙여넣기 해 주세요.
+
+ 정상적으로 적용된 상태입니다.
+
+
+
+
+
+
+
+
+
아래 코드를 복사하여 nginx 설정 파일에 적용해 주세요.
+
+
+
+
+
\ No newline at end of file
diff --git a/adm/admin.head.php b/adm/admin.head.php
index 9c35b557c..1ed34b228 100644
--- a/adm/admin.head.php
+++ b/adm/admin.head.php
@@ -1,7 +1,7 @@
-
+
diff --git a/adm/admin.lib.php b/adm/admin.lib.php
index 3c99546d9..31f765e45 100644
--- a/adm/admin.lib.php
+++ b/adm/admin.lib.php
@@ -486,10 +486,41 @@ function admin_check_xss_params($params){
return;
}
+function admin_menu_find_by($call, $search_key){
+ global $menu;
+
+ static $cache_menu = array();
+
+ if( empty($cache_menu) ){
+ foreach( $menu as $k1=>$arr1 ){
+
+ if (empty($arr1) ) continue;
+ foreach( $arr1 as $k2=>$arr2 ){
+ if (empty($arr2) ) continue;
+
+ $menu_key = isset($arr2[3]) ? $arr2[3] : '';
+ if (empty($menu_key) ) continue;
+
+ $cache_menu[$menu_key] = array(
+ 'sub_menu'=>$arr2[0],
+ 'title'=>$arr2[1],
+ 'link'=>$arr2[2],
+ );
+ }
+ }
+ }
+
+ if( isset($cache_menu[$call]) && isset($cache_menu[$call][$search_key]) ){
+ return$cache_menu[$call][$search_key];
+ }
+
+ return '';
+}
+
// 접근 권한 검사
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')
{
@@ -541,6 +572,11 @@ foreach($menu_files as $file){
}
@ksort($amenu);
+$amenu = run_replace('admin_amenu', $amenu);
+if( isset($menu) && $menu ){
+ $menu = run_replace('admin_menu', $menu);
+}
+
$arr_query = array();
if (isset($sst)) $arr_query[] = 'sst='.$sst;
if (isset($sod)) $arr_query[] = 'sod='.$sod;
diff --git a/adm/board_copy.php b/adm/board_copy.php
index 92b006256..291a225ac 100644
--- a/adm/board_copy.php
+++ b/adm/board_copy.php
@@ -58,6 +58,19 @@ include_once(G5_PATH.'/head.sub.php');
-
diff --git a/adm/member_form_update.php b/adm/member_form_update.php
index c6791d254..a0c87eb9d 100644
--- a/adm/member_form_update.php
+++ b/adm/member_form_update.php
@@ -143,13 +143,13 @@ else
if( $w == '' || $w == 'u' ){
$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'])) {
@@ -236,5 +236,7 @@ if( $w == '' || $w == 'u' ){
}
}
+run_event('admin_member_form_update', $w, $mb_id);
+
goto_url('./member_form.php?'.$qstr.'&w=u&mb_id='.$mb_id, false);
?>
\ No newline at end of file
diff --git a/adm/member_list_update.php b/adm/member_list_update.php
index 915fdb880..7e250d4af 100644
--- a/adm/member_list_update.php
+++ b/adm/member_list_update.php
@@ -12,6 +12,8 @@ auth_check($auth[$sub_menu], 'w');
check_admin_token();
+$mb_datas = array();
+
if ($_POST['act_button'] == "선택수정") {
for ($i=0; $i alert("'.$msg.'"); ';
alert($msg);
+run_event('admin_member_list_update', $_POST['act_button'], $mb_datas);
+
goto_url('./member_list.php?'.$qstr);
?>
diff --git a/adm/menu_form_search.php b/adm/menu_form_search.php
index f6da6e84e..304bc1609 100644
--- a/adm/menu_form_search.php
+++ b/adm/menu_form_search.php
@@ -52,13 +52,13 @@ if($sql) {
';
+ $link1 = '';
$link2 = '';
}
diff --git a/adm/sql_write.sql b/adm/sql_write.sql
index 21cad8d7f..9f679675b 100644
--- a/adm/sql_write.sql
+++ b/adm/sql_write.sql
@@ -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;
\ No newline at end of file
diff --git a/adm/view.php b/adm/view.php
new file mode 100644
index 000000000..777bd326e
--- /dev/null
+++ b/adm/view.php
@@ -0,0 +1,28 @@
+
\ No newline at end of file
diff --git a/adm/write_count.php b/adm/write_count.php
index 6729e6fd8..c37271627 100644
--- a/adm/write_count.php
+++ b/adm/write_count.php
@@ -6,27 +6,27 @@ check_demo();
auth_check($auth[$sub_menu], 'r');
+$g5['title'] = '글,댓글 현황';
+include_once ('./admin.head.php');
+
// http://www.jqplot.com/
-add_stylesheet('', 0);
-add_javascript('', 0);
-add_javascript('', 0);
-add_javascript('', 0);
-add_javascript('', 0);
-add_javascript('', 0);
+add_stylesheet('', 1);
+add_javascript('', 1);
+add_javascript('', 1);
+add_javascript('', 1);
+add_javascript('', 1);
+add_javascript('', 1);
if (!($graph == 'line' || $graph == 'bar'))
$graph = 'line';
if ($graph == 'bar') {
// 바 타입으로 사용하는 코드입니다.
- add_javascript('', 0);
- add_javascript('', 0);
- add_javascript('', 0);
+ add_javascript('', 1);
+ add_javascript('', 1);
+ add_javascript('', 1);
}
-$g5['title'] = '글,댓글 현황';
-include_once ('./admin.head.php');
-
$period_array = array(
'오늘'=>array('시간', 0),
'어제'=>array('시간', 0),
diff --git a/bbs/board.php b/bbs/board.php
index 18dbac70a..b131a8e9f 100644
--- a/bbs/board.php
+++ b/bbs/board.php
@@ -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.'&wr_id='.$write['wr_parent'].'#c_'.$wr_id);
+ goto_url(get_pretty_url($bo_table, $write['wr_parent'], '#c_'.$wr_id));
}
if (!$bo_table) {
@@ -19,18 +19,18 @@ if (!$bo_table) {
$g5['board_title'] = ((G5_IS_MOBILE && $board['bo_mobile_subject']) ? $board['bo_mobile_subject'] : $board['bo_subject']);
// wr_id 값이 있으면 글읽기
-if (isset($wr_id) && $wr_id) {
+if ((isset($wr_id) && $wr_id) || (isset($wr_seo_title) && $wr_seo_title)) {
// 글이 없을 경우 해당 게시판 목록으로 이동
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.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
+ alert($msg, G5_BBS_URL.'/login.php?wr_id='.$wr_id.$qstr.'&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.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
+ alert('글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.$qstr.'&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.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
+ alert('이 게시판은 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.$qstr.'&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&bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr);
+ goto_url(G5_BBS_URL.'/password.php?w=s&bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr);
}
set_session($ss_name, TRUE);
@@ -144,14 +144,14 @@ if (isset($wr_id) && $wr_id) {
if ($member['mb_id'])
alert('목록을 볼 권한이 없습니다.', G5_URL);
else
- alert('목록을 볼 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.($qstr?'&':'')));
+ alert('목록을 볼 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?'.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.($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.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
+ alert('이 게시판은 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.$qstr.'&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 {
diff --git a/bbs/content.php b/bbs/content.php
index fb19fd7e3..9098192a3 100644
--- a/bbs/content.php
+++ b/bbs/content.php
@@ -8,14 +8,23 @@ if( !isset($g5['content_table']) ){
die('관리자 모드에서 게시판관리->내용 관리를 먼저 확인해 주세요.');
}
+// 내용
+if($co_seo_title){
+ $co = get_content_by_field($g5['content_table'], 'content', 'co_seo_title', generate_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('등록된 내용이 없습니다.');
diff --git a/bbs/delete.php b/bbs/delete.php
index 8f3cc9bcd..1c28e9fcd 100644
--- a/bbs/delete.php
+++ b/bbs/delete.php
@@ -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.'&wr_id='.$wr_id));
+ alert('로그인 후 삭제하세요.', G5_BBS_URL.'/login.php?url='.urlencode(get_pretty_url($bo_table, $wr_id)));
else if (!check_password($wr_password, $write['wr_password']))
alert('비밀번호가 틀리므로 삭제할 수 없습니다.');
}
@@ -80,7 +80,11 @@ while ($row = sql_fetch_array($result))
$sql2 = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' ";
$result2 = sql_query($sql2);
while ($row2 = sql_fetch_array($result2)) {
- @unlink(G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '', $row2['bf_file']));
+
+ $delete_file = run_replace('delete_file_path', G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '', $row2['bf_file']), $row2);
+ if( file_exists($delete_file) ){
+ @unlink($delete_file);
+ }
// 썸네일삭제
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row2['bf_file'])) {
delete_board_thumbnail($bo_table, $row2['bf_file']);
@@ -134,5 +138,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.'&page='.$page.$qstr);
+run_event('bbs_delete', $write, $board);
+
+goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&page='.$page.$qstr));
?>
diff --git a/bbs/delete_all.php b/bbs/delete_all.php
index 943045b19..178cca355 100644
--- a/bbs/delete_all.php
+++ b/bbs/delete_all.php
@@ -98,7 +98,10 @@ for ($i=$chk_count-1; $i>=0; $i--)
$result2 = sql_query($sql2);
while ($row2 = sql_fetch_array($result2)) {
// 파일삭제
- @unlink(G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '',$row2['bf_file']));
+ $delete_file = run_replace('delete_file_path', G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '',$row2['bf_file']), $row2);
+ if( file_exists($delete_file) ){
+ @unlink($delete_file);
+ }
// 썸네일삭제
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row2['bf_file'])) {
@@ -156,5 +159,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.'&page='.$page.$qstr);
+run_event('bbs_delete_all', $tmp_array, $board);
+
+goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&page='.$page.$qstr));
?>
diff --git a/bbs/delete_comment.php b/bbs/delete_comment.php
index 5ec08ae53..76d9df224 100644
--- a/bbs/delete_comment.php
+++ b/bbs/delete_comment.php
@@ -86,5 +86,7 @@ sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$bo_table}'
delete_cache_latest($bo_table);
+run_event('bbs_delete_comment', $comment_id, $board);
+
goto_url(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$write['wr_parent'].'&page='.$page. $qstr);
?>
diff --git a/bbs/download.php b/bbs/download.php
index 5a316d701..e4f7fa3fe 100644
--- a/bbs/download.php
+++ b/bbs/download.php
@@ -15,9 +15,9 @@ 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.'&'.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id));
+ alert('다운로드 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&'.$qstr.'&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' ";
+$sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' ";
$file = sql_fetch($sql);
if (!$file['bf_file'])
alert_close('파일 정보가 존재하지 않습니다.');
@@ -42,13 +42,16 @@ 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.'&'.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id));
+ alert($alert_msg.'\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&'.$qstr.'&url='.urlencode(get_pretty_url($bo_table, $wr_id)));
}
$filepath = G5_DATA_PATH.'/file/'.$bo_table.'/'.$file['bf_file'];
$filepath = addslashes($filepath);
-if (!is_file($filepath) || !file_exists($filepath))
+$file_exist_check = (!is_file($filepath) || !file_exists($filepath)) ? false : true;
+
+if ( false === run_replace('download_file_exist_check', $file_exist_check, $file) ){
alert('파일이 존재하지 않습니다.');
+}
// 사용자 코드 실행
@include_once($board_skin_path.'/download.skin.php');
@@ -101,6 +104,8 @@ $original = urlencode($file['bf_source']);
@include_once($board_skin_path.'/download.tail.skin.php');
+run_event('download_file_header', $file, $file_exist_check);
+
if(preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT']) && preg_match("/5\.5/", $_SERVER['HTTP_USER_AGENT'])) {
header("content-type: doesn/matter");
header("content-length: ".filesize("$filepath"));
diff --git a/bbs/formmail.php b/bbs/formmail.php
index fe099d23e..3415623a5 100644
--- a/bbs/formmail.php
+++ b/bbs/formmail.php
@@ -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정보공개 설정은 회원정보수정에서 하실 수 있습니다.');
diff --git a/bbs/good.php b/bbs/good.php
index d1714c971..6f82443f3 100644
--- a/bbs/good.php
+++ b/bbs/good.php
@@ -1,10 +1,12 @@
\ No newline at end of file
diff --git a/bbs/list.php b/bbs/list.php
index 4752a316c..58961c364 100644
--- a/bbs/list.php
+++ b/bbs/list.php
@@ -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 .= '
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.'&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.'&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('#&page=[0-9]*#', '#&spt=[0-9\-]*#');
@@ -214,14 +221,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.'&spt='.$prev_spt.'&page=1';
+ $prev_part_href = get_pretty_url($bo_table,0,$qstr1.'&spt='.$prev_spt.'&page=1');
$write_pages = page_insertbefore($write_pages, '이전검색');
}
$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.'&spt='.$next_spt.'&page=1';
+ $next_part_href = get_pretty_url($bo_table,0,$qstr1.'&spt='.$next_spt.'&page=1');
$write_pages = page_insertafter($write_pages, '다음검색');
}
}
@@ -229,7 +236,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 +248,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));
diff --git a/bbs/login.php b/bbs/login.php
index 1a1697663..3bfb79390 100644
--- a/bbs/login.php
+++ b/bbs/login.php
@@ -31,5 +31,7 @@ if (!file_exists($login_file))
include_once($member_skin_path.'/login.skin.php');
+run_event('member_login_tail', $login_url, $login_action_url, $member_skin_path, $url);
+
include_once('./_tail.sub.php');
?>
diff --git a/bbs/login_check.php b/bbs/login_check.php
index 3fe856313..983b25020 100644
--- a/bbs/login_check.php
+++ b/bbs/login_check.php
@@ -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'])) ) {
+
+ run_event('password_is_wrong', 'login', $mb);
+
alert('가입된 회원아이디가 아니거나 비밀번호가 틀립니다.\\n비밀번호는 대소문자를 구분합니다.');
}
@@ -51,6 +54,8 @@ if ( is_use_email_certify() && !preg_match("/[1-9]/", $mb['mb_email_certify']))
confirm("{$mb['mb_email']} 메일로 메일인증을 받으셔야 로그인 가능합니다. 다른 메일주소로 변경하여 인증하시려면 취소를 클릭하시기 바랍니다.", G5_URL, G5_BBS_URL.'/register_email.php?mb_id='.$mb_id.'&ckey='.$ckey);
}
+run_event('login_session_before', $mb, $is_social_login);
+
@include_once($member_skin_path.'/login_check.skin.php');
// 회원아이디 세션 생성
@@ -100,6 +105,8 @@ if ($url) {
$post_check_keys[] = 'provider';
}
+ $post_check_keys = run_replace('login_check_post_check_keys', $post_check_keys, $link, $is_social_login);
+
foreach($_POST as $key=>$value) {
if ($key && !in_array($key, $post_check_keys)) {
$link .= "$split$key=$value";
@@ -118,5 +125,7 @@ if(function_exists('social_login_success_after')){
social_login_session_clear(1);
}
+run_event('member_login_check', $mb, $link, $is_social_login);
+
goto_url($link);
?>
diff --git a/bbs/logout.php b/bbs/logout.php
index 81704dbcb..68c49c78b 100644
--- a/bbs/logout.php
+++ b/bbs/logout.php
@@ -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;
}
+run_event('member_logout', $link);
+
goto_url($link);
?>
diff --git a/bbs/memo.php b/bbs/memo.php
index 72ba5b33e..7de13908b 100644
--- a/bbs/memo.php
+++ b/bbs/memo.php
@@ -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 페이지)
+
+run_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;
diff --git a/bbs/memo_delete.php b/bbs/memo_delete.php
index 743d8392e..4d5278e59 100644
--- a/bbs/memo_delete.php
+++ b/bbs/memo_delete.php
@@ -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);
+run_event('memo_delete', $me_id, $row);
goto_url('./memo.php?kind='.$kind);
?>
diff --git a/bbs/memo_form_update.php b/bbs/memo_form_update.php
index dbdcb65dc..c0244eee0 100644
--- a/bbs/memo_form_update.php
+++ b/bbs/memo_form_update.php
@@ -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());
+
+run_event('memo_form_update_before', $recv_list);
+
for ($i=0; $i
\ No newline at end of file
diff --git a/bbs/memo_view.php b/bbs/memo_view.php
index edfa4e53b..144e98f43 100644
--- a/bbs/memo_view.php
+++ b/bbs/memo_view.php
@@ -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.'&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.'&me_id='.$prev['me_id'];
+ $prev['page'] = ceil( (int)$prev['rownum'] / $config['cf_page_rows']); // 이동할 페이지 계산
+ if( (int)$prev['page'] > 0 ) $prev_link .= "&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.'&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 .= "&page=".$next['page'];
+} else {
$next_link = '';
+}
$mb = get_member($memo['me_'.$unkind.'_mb_id']);
diff --git a/bbs/move.php b/bbs/move.php
index c7d435a36..1dfb5c02b 100644
--- a/bbs/move.php
+++ b/bbs/move.php
@@ -156,5 +156,6 @@ function fboardmoveall_submit(f)
diff --git a/bbs/move_update.php b/bbs/move_update.php
index 436b0ce4e..b3c28f09c 100644
--- a/bbs/move_update.php
+++ b/bbs/move_update.php
@@ -126,8 +126,13 @@ while ($row = sql_fetch_array($result))
// 원본파일을 복사하고 퍼미션을 변경
// 제이프로님 코드제안 적용
$copy_file_name = ($bo_table !== $move_bo_table) ? $row3['bf_file'] : $row2['wr_id'].'_copy_'.$insert_id.'_'.$row3['bf_file'];
- @copy($src_dir.'/'.$row3['bf_file'], $dst_dir.'/'.$copy_file_name);
- @chmod($dst_dir.'/'.$copy_file_name, G5_FILE_PERMISSION);
+ $is_exist_file = is_file($src_dir.'/'.$row3['bf_file']) && file_exists($src_dir.'/'.$row3['bf_file']);
+ if( $is_exist_file ){
+ @copy($src_dir.'/'.$row3['bf_file'], $dst_dir.'/'.$copy_file_name);
+ @chmod($dst_dir.'/'.$row3['bf_file'], G5_FILE_PERMISSION);
+ }
+
+ $row3 = run_replace('bbs_move_update_file', $row3, $copy_file_name, $bo_table, $move_bo_table, $insert_id);
}
$sql = " insert into {$g5['board_file_table']}
@@ -138,6 +143,9 @@ while ($row = sql_fetch_array($result))
bf_file = '$copy_file_name',
bf_download = '{$row3['bf_download']}',
bf_content = '".addslashes($row3['bf_content'])."',
+ bf_fileurl = '".addslashes($row3['bf_fileurl'])."',
+ bf_thumburl = '".addslashes($row3['bf_thumburl'])."',
+ bf_storage = '".addslashes($row3['bf_storage'])."',
bf_filesize = '{$row3['bf_filesize']}',
bf_width = '{$row3['bf_width']}',
bf_height = '{$row3['bf_height']}',
@@ -200,7 +208,11 @@ if ($sw == 'move')
{
if( isset($save[$i]['bf_file']) && $save[$i]['bf_file'] ){
for ($k=0; $k
';
+run_event('register_form_update_after', $mb_id, $w);
+
if ($w == '') {
goto_url(G5_HTTP_BBS_URL.'/register_result.php');
} else if ($w == 'u') {
diff --git a/bbs/rss.php b/bbs/rss.php
index 04c9428fb..6042fc6dd 100644
--- a/bbs/rss.php
+++ b/bbs/rss.php
@@ -47,8 +47,8 @@ echo ''."\n";
?>
-
-
+
+
테스트 버전 0.2 (2004-04-26)ko
@@ -69,8 +69,8 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
?>
-
-
+
+
]]>
diff --git a/bbs/scrap_popin.php b/bbs/scrap_popin.php
index 8bb818612..13e5b4cac 100644
--- a/bbs/scrap_popin.php
+++ b/bbs/scrap_popin.php
@@ -4,7 +4,7 @@ include_once('./_common.php');
include_once(G5_PATH.'/head.sub.php');
if ($is_guest) {
- $href = './login.php?'.$qstr.'&url='.urlencode('./board.php?bo_table='.$bo_table.'&wr_id='.$wr_id);
+ $href = './login.php?'.$qstr.'&url='.urlencode(get_pretty_url($bo_table, $wr_id));
$href2 = str_replace('&', '&', $href);
echo <<
@@ -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 <<
if (confirm('이미 스크랩하신 글 입니다.\\n\\n지금 스크랩을 확인하시겠습니까?'))
@@ -48,7 +51,7 @@ if ($row['cnt']) {
HEREDOC;
exit;
diff --git a/bbs/scrap_popin_update.php b/bbs/scrap_popin_update.php
index 48513ea8b..c1fb89399 100644
--- a/bbs/scrap_popin_update.php
+++ b/bbs/scrap_popin_update.php
@@ -5,7 +5,7 @@ include_once(G5_PATH.'/head.sub.php');
if (!$is_member)
{
- $href = './login.php?'.$qstr.'&url='.urlencode('./board.php?bo_table='.$bo_table.'&wr_id='.$wr_id);
+ $href = './login.php?'.$qstr.'&url='.urlencode(get_pretty_url($bo_table, $wr_id));
echo '';
exit;
}
@@ -31,7 +31,7 @@ if ($row['cnt'])
';
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 <<= $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&bo_table='.$bo_table.'&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&bo_table='.$bo_table.'&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&bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr;
+ $update_href = short_url_clean(G5_BBS_URL.'/write.php?w=u&bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr);
set_session('ss_delete_token', $token = uniqid(time()));
- $delete_href ='./delete.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&token='.$token.'&page='.$page.urldecode($qstr);
+ $delete_href = G5_BBS_URL.'/delete.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&token='.$token.'&page='.$page.urldecode($qstr);
}
else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
- $update_href = './password.php?w=u&bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr;
- $delete_href = './password.php?w=d&bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr;
+ $update_href = G5_BBS_URL.'/password.php?w=u&bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr;
+ $delete_href = G5_BBS_URL.'/password.php?w=d&bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr;
}
// 최고, 그룹관리자라면 글 복사, 이동 가능
$copy_href = $move_href = '';
if ($write['wr_reply'] == '' && ($is_admin == 'super' || $is_admin == 'group')) {
- $copy_href = './move.php?sw=copy&bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr;
- $move_href = './move.php?sw=move&bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr;
+ $copy_href = G5_BBS_URL.'/move.php?sw=copy&bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr;
+ $move_href = G5_BBS_URL.'/move.php?sw=move&bo_table='.$bo_table.'&wr_id='.$wr_id.'&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.'&wr_id='.$wr_id;
+ $scrap_href = G5_BBS_URL.'/scrap_popin.php?bo_table='.$bo_table.'&wr_id='.$wr_id;
// 추천 링크
if ($board['bo_use_good'])
- $good_href = './good.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&good=good';
+ $good_href = G5_BBS_URL.'/good.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&good=good';
// 비추천 링크
if ($board['bo_use_nogood'])
- $nogood_href = './good.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&good=nogood';
+ $nogood_href = G5_BBS_URL.'/good.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&good=nogood';
}
$view = get_view($write, $board, $board_skin_path);
diff --git a/bbs/view_comment.php b/bbs/view_comment.php
index 32c87e219..795780110 100644
--- a/bbs/view_comment.php
+++ b/bbs/view_comment.php
@@ -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'] = '댓글내용 확인';
+ $list[$i]['content'] = '댓글내용 확인';
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.'&comment_id='.$row['wr_id'].'&token='.$token.'&page='.$page.$qstr;
+ $list[$i]['del_link'] = G5_BBS_URL.'/delete_comment.php?bo_table='.$bo_table.'&comment_id='.$row['wr_id'].'&token='.$token.'&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&bo_table='.$bo_table.'&comment_id='.$row['wr_id'].'&page='.$page.$qstr;
+ $list[$i]['del_link'] = G5_BBS_URL.'/password.php?w=x&bo_table='.$bo_table.'&comment_id='.$row['wr_id'].'&page='.$page.$qstr;
$list[$i]['is_del'] = true;
}
}
@@ -119,6 +119,7 @@ else
}
$comment_action_url = https_url(G5_BBS_DIR)."/write_comment_update.php";
+$comment_common_url = short_url_clean(G5_BBS_URL.'/board.php?'.clean_query_string($_SERVER['QUERY_STRING']));
include_once($board_skin_path.'/view_comment.skin.php');
diff --git a/bbs/view_image.php b/bbs/view_image.php
index c7a7edca7..1b37753dd 100644
--- a/bbs/view_image.php
+++ b/bbs/view_image.php
@@ -23,57 +23,87 @@ if(strpos($filename, G5_DATA_DIR.'/editor')) {
$filepath = G5_DATA_PATH.'/file/'.$bo_table.'/'.$filename;
}
-if(is_file($filepath)) {
- $size = @getimagesize($filepath);
+$file_exists = (is_file($filepath) && file_exists($filepath)) ? 1 : 0;
+
+if($file_exists = run_replace('exists_view_image', $file_exists, $filepath, $editor_file)) {
+ $size = $file_exists ? run_replace('get_view_imagesize', @getimagesize($filepath), $filepath, $editor_file) : array();
if(empty($size))
alert_close('이미지 파일이 아닙니다.');
- $width = $size[0];
- $height = $size[1];
+ $width = (isset($size[0]) && $size[0]) ? (int) $size[0] : 0;
+ $height = (isset($size[1]) && $size[1]) ? (int) $size[1] : 0;
if($editor_file)
- $fileurl = G5_DATA_URL.'/'.$editor_file;
+ $fileurl = run_replace('get_editor_content_url', G5_DATA_URL.'/'.$editor_file);
else
- $fileurl = G5_DATA_URL.'/file/'.$bo_table.'/'.$filename;
+ $fileurl = run_replace('get_file_board_url', G5_DATA_URL.'/file/'.$bo_table.'/'.$filename, $bo_table);
- $img = '';
+ $img_attr = ($width && $height) ? 'width="'.$width.'" height="'.$height.'"' : '';
+
+ $img = '';
} else {
alert_close('파일이 존재하지 않습니다.');
}
?>
-
+
-
-
-
-
-
-
', 0);
+add_javascript('', 0);
+add_javascript('', 0);
+add_javascript('', 0);
+add_javascript('', 0);
+add_javascript('', 0);
+add_stylesheet('', 0);
+
if(G5_IS_MOBILE) {
- echo ''.PHP_EOL; // overflow scroll 감지
+ add_javascript('', 1); // overflow scroll 감지
}
if(!defined('G5_IS_ADMIN'))
echo $config['cf_add_script'];
diff --git a/index.php b/index.php
index 045a07bb9..6eb147847 100644
--- a/index.php
+++ b/index.php
@@ -19,22 +19,42 @@ include_once(G5_PATH.'/head.php');
최신글
+
+
+
+
+
+
+
+
+
-
'mobile' ";
if(!$is_admin)
- $sql .= " and a.bo_use_cert = '' ";
+ $sql .= " and a.bo_use_cert = '' ";
$sql .= " and a.bo_table not in ('notice', 'gallery') "; //공지사항과 갤러리 게시판은 제외
$sql .= " order by b.gr_order, a.bo_order ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
- if ($i%2==1) $lt_style = "margin-left:2%";
- else $lt_style = "";
+ $lt_style = '';
+ if ($i%3 !== 0 ) $lt_style = "margin-left:2%";
?>
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/install/ajax.install.check.php b/install/ajax.install.check.php
index 534a78b94..fd5616f73 100644
--- a/install/ajax.install.check.php
+++ b/install/ajax.install.check.php
@@ -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;
// 파일이 존재한다면 설치할 수 없다.
diff --git a/install/gnuboard5.sql b/install/gnuboard5.sql
index d8e65347f..81c8645df 100644
--- a/install/gnuboard5.sql
+++ b/install/gnuboard5.sql
@@ -133,6 +133,9 @@ CREATE TABLE IF NOT EXISTS `g5_board_file` (
`bf_file` varchar(255) NOT NULL default '',
`bf_download` int(11) NOT NULL,
`bf_content` text NOT NULL,
+ `bf_fileurl` VARCHAR(255) NOT NULL DEFAULT '',
+ `bf_thumburl` VARCHAR(255) NOT NULL DEFAULT '',
+ `bf_storage` VARCHAR(50) NOT NULL DEFAULT '',
`bf_filesize` int(11) NOT NULL default '0',
`bf_width` int(11) NOT NULL default '0',
`bf_height` smallint(6) NOT NULL default '0',
@@ -186,10 +189,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 +201,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 +276,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 +420,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 +494,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 +520,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 +552,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 +654,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 +810,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 +818,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;
-- --------------------------------------------------------
diff --git a/install/install_db.php b/install/install_db.php
index 21b70baa6..cd20e9080 100644
--- a/install/install_db.php
+++ b/install/install_db.php
@@ -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');
@@ -61,7 +66,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']) {
@@ -86,7 +91,10 @@ $file = preg_replace('/`g5_([^`]+`)/', '`'.$table_prefix.'$1', $file);
$f = explode(';', $file);
for ($i=0; $i
@@ -180,7 +188,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',
@@ -194,9 +202,9 @@ $sql = " insert into `{$table_prefix}member`
sql_query($sql, true, $dblink);
// 내용관리 생성
-sql_query(" insert into `{$table_prefix}content` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '
님의 댓글의 댓글
+ + + 아이피 + () + + 작성일 + + ++- 답변
+ - 수정
+ - 삭제
+
++ "; ?> + +
- --- 답변
- - 수정
- - 삭제
-
- + + +