replace sql query uppercase

This commit is contained in:
Amberstone 2024-09-30 01:58:32 +09:00
parent 31958f6c73
commit d7d7c5da99
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
146 changed files with 604 additions and 596 deletions

View file

@ -232,7 +232,7 @@ function get_member_id_select($name, $level, $selected = "", $event = "")
{
global $g5;
$sql = " select mb_id from {$g5['member_table']} where mb_level >= '{$level}' ";
$sql = "SELECT mb_id FROM {$g5['member_table']} WHERE mb_level >= '{$level}' ";
$result = sql_query($sql);
$str = '<select id="' . $name . '" name="' . $name . '" ' . $event . '><option value="">선택안함</option>';
for ($i = 0; $row = sql_fetch_array($result); $i++) {
@ -446,7 +446,7 @@ if (!$member['mb_id']) {
goto_url(G5_BBS_URL . '/login.php?url=' . urlencode(G5_ADMIN_URL));
} else if ($is_admin != 'super') {
$auth = [];
$sql = " select au_menu, au_auth from {$g5['auth_table']} where mb_id = '{$member['mb_id']}' ";
$sql = "SELECT au_menu, au_auth FROM {$g5['auth_table']} WHERE mb_id = '{$member['mb_id']}' ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$auth[$row['au_menu']] = $row['au_auth'];

View file

@ -31,7 +31,7 @@ if ($w == '' && in_array($target_table, get_bo_table_banned_word())) {
alert('입력한 게시판 TABLE명을 사용할수 없습니다. 다른 이름으로 입력해 주세요.');
}
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where bo_table = '$target_table' ");
$row = sql_fetch("SELECT count(*) AS cnt FROM {$g5['board_table']} WHERE bo_table = '$target_table' ");
if ($row['cnt']) {
alert($target_table . '은(는) 이미 존재하는 게시판 테이블명 입니다.\\n복사할 테이블명으로 사용할 수 없습니다.');
}
@ -182,17 +182,17 @@ if ($copy_case == 'schema_data_both') {
EventHandler::triggerEvent("gnuboard.admin.board_copy_file", $bo_table, $target_table);
// 글복사
$sql = " insert into {$g5['write_prefix']}$target_table select * from {$g5['write_prefix']}$bo_table ";
$sql = "INSERT INTO {$g5['write_prefix']}$target_tableSELECT * FROM {$g5['write_prefix']}$bo_table ";
sql_query($sql, false);
// 게시글수 저장
$sql = " select bo_count_write, bo_count_comment from {$g5['board_table']} where bo_table = '$bo_table' ";
$sql = "SELECT bo_count_write, bo_count_comment FROM {$g5['board_table']} WHERE bo_table = '$bo_table' ";
$row = sql_fetch($sql);
$sql = " update {$g5['board_table']} set bo_count_write = '{$row['bo_count_write']}', bo_count_comment = '{$row['bo_count_comment']}' where bo_table = '$target_table' ";
$sql = "UPDATE {$g5['board_table']} SET bo_count_write = '{$row['bo_count_write']}', bo_count_comment = '{$row['bo_count_comment']}' WHERE bo_table = '$target_table' ";
sql_query($sql, false);
// 4.00.01
$sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' ";
$sql = "SELECT * FROM {$g5['board_file_table']} WHERE bo_table = '$bo_table' ";
$result = sql_query($sql, false);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$file_copy[$i] = $row;
@ -203,8 +203,8 @@ if (count($file_copy)) {
for ($i = 0; $i < count($file_copy); $i++) {
$file_copy[$i] = run_replace('admin_copy_update_file', $file_copy[$i], $file_copy[$i]['bf_file'], $bo_table, $target_table);
$sql = " insert into {$g5['board_file_table']}
set bo_table = '$target_table',
$sql = "INSERT INTO {$g5['board_file_table']}
SET bo_table = '$target_table',
wr_id = '{$file_copy[$i]['wr_id']}',
bf_no = '{$file_copy[$i]['bf_no']}',
bf_source = '" . addslashes($file_copy[$i]['bf_source']) . "',

View file

@ -12,7 +12,7 @@ if (!$tmp_bo_table) {
}
// 게시판 1개는 삭제 불가 (게시판 복사를 위해서)
//$row = sql_fetch(" select count(*) as cnt from $g5['board_table'] ");
//$row = sql_fetch("SELECT count(*) as cnt FROM $g5['board_table'] ");
//if ($row['cnt'] <= 1) { return; }
// 게시판 설정 삭제

View file

@ -5,7 +5,7 @@ include_once G5_EDITOR_LIB;
auth_check($auth[$sub_menu], 'w');
$sql = " select count(*) as cnt from {$g5['group_table']} ";
$sql = "SELECT count(*) AS cnt FROM {$g5['group_table']} ";
$row = sql_fetch($sql);
if (!$row['cnt'])
alert('게시판그룹이 한개 이상 생성되어야 합니다.', './boardgroup_form.php');
@ -58,7 +58,7 @@ if (!isset($board['bo_pass'])) {
if (!isset($board['bo_use_sns'])) {
sql_query("ALTER TABLE `{$g5['board_table']}` ADD `bo_use_sns` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_cert` ", false);
$result = sql_query(" select bo_table from `{$g5['board_table']}` ");
$result = sql_query("SELECT bo_table FROM `{$g5['board_table']}` ");
for ($i = 0; $row = sql_fetch_array($result); $i++) {
sql_query("ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}`
ADD `wr_facebook_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_ip`,
@ -75,7 +75,7 @@ if (strpos($row['Type'], 'hp-') === false) {
if (!isset($board['bo_use_list_file'])) {
sql_query("ALTER TABLE `{$g5['board_table']}` ADD `bo_use_list_file` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_list_view` ", false);
$result = sql_query(" select bo_table from `{$g5['board_table']}` ");
$result = sql_query("SELECT bo_table FROM `{$g5['board_table']}` ");
for ($i = 0; $row = sql_fetch_array($result); $i++) {
sql_query("ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}`
ADD `wr_file` TINYINT NOT NULL DEFAULT '0' AFTER `wr_datetime` ", false);

View file

@ -170,12 +170,12 @@ $sql_common = " gr_id = '{$_POST['gr_id']}',
if ($w == '') {
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where bo_table = '{$bo_table}' ");
$row = sql_fetch("SELECT count(*) as cnt FROM {$g5['board_table']} WHERE bo_table = '{$bo_table}' ");
if ($row['cnt'])
alert($bo_table . ' 은(는) 이미 존재하는 TABLE 입니다.');
$sql = " insert into {$g5['board_table']}
set bo_table = '{$bo_table}',
$sql = "INSERT INTO {$g5['board_table']}
SET bo_table = '{$bo_table}',
bo_count_write = '0',
bo_count_comment = '0',
$sql_common ";
@ -200,12 +200,12 @@ if ($w == '') {
}
// 게시판의 글 수
$sql = " select count(*) as cnt from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 0 ";
$sql = "SELECT count(*) as cnt FROM {$g5['write_prefix']}{$bo_table} WHERE wr_is_comment = 0 ";
$row = sql_fetch($sql);
$bo_count_write = $row['cnt'];
// 게시판의 코멘트 수
$sql = " select count(*) as cnt from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 1 ";
$sql = "SELECT count(*) as cnt FROM {$g5['write_prefix']}{$bo_table} WHERE wr_is_comment = 1 ";
$row = sql_fetch($sql);
$bo_count_comment = $row['cnt'];
@ -216,17 +216,17 @@ if ($w == '') {
*/
if (isset($_POST['proc_count'])) {
// 원글을 얻습니다.
//$sql = " select wr_id from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 0 ";
$sql = " select a.wr_id, (count(b.wr_parent) - 1) as cnt from {$g5['write_prefix']}{$bo_table} a, {$g5['write_prefix']}{$bo_table} b where a.wr_id=b.wr_parent and a.wr_is_comment=0 group by a.wr_id ";
//$sql = "SELECT wr_id FROM {$g5['write_prefix']}{$bo_table} where wr_is_comment = 0 ";
$sql = "SELECT a.wr_id, (count(b.wr_parent) - 1) AS cnt FROM {$g5['write_prefix']}{$bo_table} a, {$g5['write_prefix']}{$bo_table} b WHERE a.wr_id=b.wr_parent AND a.wr_is_comment=0 GROUP BY a.wr_id ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
/*
// 코멘트수를 얻습니다.
$sql2 = " select count(*) as cnt from {$g5['write_prefix']}$bo_table where wr_parent = '{$row['wr_id']}' and wr_is_comment = 1 ";
$sql2 = "SELECT count(*) as cnt FROM {$g5['write_prefix']}$bo_table where wr_parent = '{$row['wr_id']}' and wr_is_comment = 1 ";
$row2 = sql_fetch($sql2);
*/
sql_query(" update {$g5['write_prefix']}{$bo_table} set wr_comment = '{$row['cnt']}' where wr_id = '{$row['wr_id']}' ");
sql_query("UPDATE {$g5['write_prefix']}{$bo_table} SET wr_comment = '{$row['cnt']}' where wr_id = '{$row['wr_id']}' ");
}
}
@ -237,7 +237,7 @@ if ($w == '') {
$tmp_array = explode(",", $board['bo_notice']);
for ($i = 0; $i < count($tmp_array); $i++) {
$tmp_wr_id = trim($tmp_array[$i]);
$row = sql_fetch(" select count(*) as cnt from {$g5['write_prefix']}{$bo_table} where wr_id = '{$tmp_wr_id}' ");
$row = sql_fetch("SELECT count(*) as cnt FROM {$g5['write_prefix']}{$bo_table} WHERE wr_id = '{$tmp_wr_id}' ");
if ($row['cnt']) {
$bo_notice .= $lf . $tmp_wr_id;
$lf = ",";
@ -400,7 +400,7 @@ for ($i = 1; $i <= 10; $i++) {
}
if ($grp_fields) {
sql_query(" update {$g5['board_table']} set bo_table = bo_table {$grp_fields} where gr_id = '$gr_id' ");
sql_query("UPDATE {$g5['board_table']} SET bo_table = bo_table {$grp_fields} where gr_id = '$gr_id' ");
}
@ -548,7 +548,7 @@ for ($i = 1; $i <= 10; $i++) {
}
if ($all_fields) {
sql_query(" update {$g5['board_table']} set bo_table = bo_table {$all_fields} ");
sql_query("UPDATE {$g5['board_table']} SET bo_table = bo_table {$all_fields} ");
}
delete_cache_latest($bo_table);

View file

@ -17,7 +17,7 @@ if ($w == '') {
$html_title .= ' 생성';
} else if ($w == 'u') {
$gr_id_attr = 'readonly';
$gr = sql_fetch(" select * from {$g5['group_table']} where gr_id = '$gr_id' ");
$gr = sql_fetch("SELECT * FROM {$g5['group_table']} where gr_id = '$gr_id' ");
$html_title .= ' 수정';
} else
alert('제대로 된 값이 넘어오지 않았습니다.');

View file

@ -48,12 +48,12 @@ else
if ($w == '') {
$sql = " select count(*) as cnt from {$g5['group_table']} where gr_id = '{$_POST['gr_id']}' ";
$sql = "SELECT count(*) as cnt FROM {$g5['group_table']} where gr_id = '{$_POST['gr_id']}' ";
$row = sql_fetch($sql);
if ($row['cnt'])
alert('이미 존재하는 그룹 ID 입니다.');
$sql = " insert into {$g5['group_table']}
$sql = "INSERT INTO {$g5['group_table']}
set gr_id = '{$_POST['gr_id']}',
{$sql_common} ";
sql_query($sql);

View file

@ -36,7 +36,7 @@ if ($stx) {
if ($sst)
$sql_order = " order by {$sst} {$sod} ";
else
$sql_order = " order by gr_id asc ";
$sql_order = " ORDER BY gr_id ASC ";
$sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
$row = sql_fetch($sql);
@ -120,11 +120,11 @@ $colspan = 10;
<?php
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 접근회원수
$sql1 = " select count(*) as cnt from {$g5['group_member_table']} where gr_id = '{$row['gr_id']}' ";
$sql1 = "SELECT count(*) as cnt FROM {$g5['group_member_table']} where gr_id = '{$row['gr_id']}' ";
$row1 = sql_fetch($sql1);
// 게시판수
$sql2 = " select count(*) as cnt from {$g5['board_table']} where gr_id = '{$row['gr_id']}' ";
$sql2 = "SELECT count(*) as cnt FROM {$g5['board_table']} where gr_id = '{$row['gr_id']}' ";
$row2 = sql_fetch($sql2);
$s_upd = '<a href="./boardgroup_form.php?' . $qstr . '&amp;w=u&amp;gr_id=' . $row['gr_id'] . '">수정</a>';

View file

@ -30,7 +30,7 @@ for ($i = 0; $i < $count; $i++) {
$sql .= " and gr_admin = '{$_POST['gr_admin'][$k]}' ";
sql_query($sql);
} else if ($_POST['act_button'] == '선택삭제') {
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where gr_id = '$gr_id' ");
$row = sql_fetch("SELECT count(*) as cnt FROM {$g5['board_table']} where gr_id = '$gr_id' ");
if ($row['cnt'])
alert("이 그룹에 속한 게시판이 존재하여 게시판 그룹을 삭제할 수 없습니다.\\n\\n이 그룹에 속한 게시판을 먼저 삭제하여 주십시오.", './board_list.php?sfl=gr_id&amp;stx=' . $gr_id);

View file

@ -69,12 +69,12 @@ $colspan = 4;
</thead>
<tbody>
<?php
$sql = " select * from {$g5['group_member_table']} a, {$g5['group_table']} b
$sql = "SELECT * FROM {$g5['group_member_table']} a, {$g5['group_table']} b
where a.mb_id = '{$mb['mb_id']}'
and a.gr_id = b.gr_id ";
if ($is_admin != 'super')
$sql .= " and b.gr_admin = '{$member['mb_id']}' ";
$sql .= " order by a.gr_id desc ";
$sql .= " ORDER BY a.gr_id DESC ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
?>

View file

@ -99,7 +99,7 @@ $colspan = 7;
<?php
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 접근가능한 그룹수
$sql2 = " select count(*) as cnt from {$g5['group_member_table']} where mb_id = '{$row['mb_id']}' ";
$sql2 = "SELECT count(*) as cnt FROM {$g5['group_member_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2);
$group = "";
if ($row2['cnt'])

View file

@ -27,10 +27,10 @@ if ($w == '') {
} else {
check_admin_token();
$sql = " insert into {$g5['group_member_table']}
set gr_id = '{$_POST['gr_id']}',
mb_id = '{$_POST['mb_id']}',
gm_datetime = '" . G5_TIME_YMDHIS . "' ";
$sql = "INSERT INTO {$g5['group_member_table']}
set gr_id = '{$_POST['gr_id']}',
mb_id = '{$_POST['mb_id']}',
gm_datetime = '" . G5_TIME_YMDHIS . "' ";
sql_query($sql);
}
} else if ($w == 'd' || $w == 'ld') {
@ -44,7 +44,7 @@ if ($w == '') {
for ($i = 0; $i < $count; $i++) {
$gm_id = $_POST['chk'][$i];
$sql = " select * from {$g5['group_member_table']} where gm_id = '$gm_id' ";
$sql = "SELECT * FROM {$g5['group_member_table']} where gm_id = '$gm_id' ";
$gm = sql_fetch($sql);
if (!$gm['gm_id']) {
if ($count == 1)

View file

@ -29,7 +29,7 @@ if (!$rows)
$rows = 100;
$sql_common = " from {$g5['visit_table']} where vi_agent <> '' and ( vi_browser = '' or vi_os = '' or vi_device = '' ) ";
$sql_order = " order by vi_id desc ";
$sql_order = " ORDER BY vi_id DESC ";
$sql_limit = " limit 0, $rows ";
$sql = " select count(vi_id) as cnt $sql_common ";

View file

@ -44,7 +44,7 @@ if (!isset($config['cf_googl_shorturl_apikey'])) {
if (!isset($config['cf_mobile_pages'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}`
ADD `cf_mobile_pages` INT(11) NOT NULL DEFAULT '0' AFTER `cf_write_pages` ", true);
sql_query(" UPDATE `{$g5['config_table']}` SET cf_mobile_pages = '5' ", true);
sql_query("UPDATE `{$g5['config_table']}` SET cf_mobile_pages = '5' ", true);
}
if (!isset($config['cf_facebook_appid'])) {
@ -64,7 +64,7 @@ if (!sql_query(" DESC {$g5['uniqid_table']} ", false)) {
) ", false);
}
if (!sql_query(" SELECT uq_ip from {$g5['uniqid_table']} limit 1 ", false)) {
if (!sql_query("SELECT uq_ip FROM {$g5['uniqid_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE {$g5['uniqid_table']} ADD `uq_ip` VARCHAR(255) NOT NULL ");
}
@ -103,8 +103,8 @@ if (!isset($config['cf_cert_use'])) {
ADD `cf_cert_limit` INT(11) NOT NULL DEFAULT '0' AFTER `cf_cert_kcp_cd` ", true);
sql_query(" ALTER TABLE `{$g5['member_table']}`
CHANGE `mb_hp_certify` `mb_certify` VARCHAR(20) NOT NULL DEFAULT '' ", true);
sql_query(" update {$g5['member_table']} set mb_certify = 'hp' where mb_certify = '1' ");
sql_query(" update {$g5['member_table']} set mb_certify = '' where mb_certify = '0' ");
sql_query("UPDATE {$g5['member_table']} SET mb_certify = 'hp' where mb_certify = '1' ");
sql_query("UPDATE {$g5['member_table']} SET mb_certify = '' where mb_certify = '0' ");
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['cert_history_table']}` (
`cr_id` int(11) NOT NULL auto_increment,
`mb_id` varchar(255) NOT NULL DEFAULT '',
@ -188,7 +188,7 @@ if (!isset($config['cf_sms_type'])) {
}
// 접속자 정보 필드 추가
if (!sql_query(" select vi_browser from {$g5['visit_table']} limit 1 ")) {
if (!sql_query("SELECT vi_browser FROM {$g5['visit_table']} limit 1 ")) {
sql_query(" ALTER TABLE `{$g5['visit_table']}`
ADD `vi_browser` varchar(255) NOT NULL DEFAULT '' AFTER `vi_agent`,
ADD `vi_os` varchar(255) NOT NULL DEFAULT '' AFTER `vi_browser`,

View file

@ -6,31 +6,31 @@ include_once G5_EDITOR_LIB;
auth_check($auth[$sub_menu], "w");
// 상단, 하단 파일경로 필드 추가
if (!sql_query(" select co_include_head from {$g5['content_table']} limit 1 ", false)) {
if (!sql_query("SELECT co_include_head FROM {$g5['content_table']} limit 1 ", false)) {
$sql = " ALTER TABLE `{$g5['content_table']}` ADD `co_include_head` VARCHAR( 255 ) NOT NULL ,
ADD `co_include_tail` VARCHAR( 255 ) NOT NULL ";
sql_query($sql, false);
}
// html purifier 사용여부 필드
if (!sql_query(" select co_tag_filter_use from {$g5['content_table']} limit 1 ", false)) {
if (!sql_query("SELECT co_tag_filter_use FROM {$g5['content_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}`
ADD `co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `co_content` ", true);
sql_query(" update {$g5['content_table']} set co_tag_filter_use = '1' ");
sql_query("UPDATE {$g5['content_table']} SET co_tag_filter_use = '1' ");
}
// 모바일 내용 추가
if (!sql_query(" select co_mobile_content from {$g5['content_table']} limit 1", false)) {
if (!sql_query("SELECT co_mobile_content FROM {$g5['content_table']} limit 1", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}`
ADD `co_mobile_content` longtext NOT NULL AFTER `co_content` ", true);
}
// 스킨 설정 추가
if (!sql_query(" select co_skin from {$g5['content_table']} limit 1 ", false)) {
if (!sql_query("SELECT co_skin FROM {$g5['content_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}`
ADD `co_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_mobile_content`,
ADD `co_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_skin` ", true);
sql_query(" update {$g5['content_table']} set co_skin = 'basic', co_mobile_skin = 'basic' ");
sql_query("UPDATE {$g5['content_table']} SET co_skin = 'basic', co_mobile_skin = 'basic' ");
}
$html_title = "내용";
@ -41,7 +41,7 @@ if ($w == "u") {
$html_title .= " 수정";
$readonly = " readonly";
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$sql = "SELECT * FROM {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql);
if (!$co['co_id'])
alert('등록된 자료가 없습니다.');

View file

@ -16,7 +16,7 @@ if ($w == "" || $w == "u") {
if (preg_match("/[^a-z0-9_]/i", $co_id))
alert("ID 는 영문자, 숫자, _ 만 가능합니다.");
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$sql = "SELECT * FROM {$g5['content_table']} where co_id = '$co_id' ";
$co_row = sql_fetch($sql);
}

View file

@ -24,9 +24,9 @@ if (!sql_query(" DESCRIBE {$g5['content_table']} ", false)) {
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
// 내용관리 생성
sql_query(" insert into `{$g5['content_table']}` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>' ", false);
sql_query(" insert into `{$g5['content_table']}` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '<p align=center><b>개인정보 처리방침에 대한 내용을 입력하십시오.</b></p>' ", false);
sql_query(" insert into `{$g5['content_table']}` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '<p align=center><b>서비스 이용약관에 대한 내용을 입력하십시오.</b></p>' ", false);
sql_query("INSERT INTO `{$g5['content_table']}` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>' ", false);
sql_query("INSERT INTO `{$g5['content_table']}` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '<p align=center><b>개인정보 처리방침에 대한 내용을 입력하십시오.</b></p>' ", false);
sql_query("INSERT INTO `{$g5['content_table']}` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '<p align=center><b>서비스 이용약관에 대한 내용을 입력하십시오.</b></p>' ", false);
}
}

View file

@ -46,7 +46,7 @@ if (!isset($config['cf_member_img_size'])) {
ADD `cf_member_img_height` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_width`
", true);
$sql = " update {$g5['config_table']} set cf_member_img_size = 50000, cf_member_img_width = 60, cf_member_img_height = 60 ";
$sql = "UPDATE {$g5['config_table']} SET cf_member_img_size = 50000, cf_member_img_width = 60, cf_member_img_height = 60 ";
sql_query($sql, false);
$is_check = true;
@ -75,7 +75,7 @@ if (isset($g5['social_profile_table']) && !sql_query(" DESC {$g5['social_profile
}
// 게시판 짧은 주소
$sql = " select bo_table from {$g5['board_table']} ";
$sql = "SELECT bo_table FROM {$g5['board_table']} ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
@ -107,7 +107,7 @@ if (!$row) {
$is_check = true;
}
$sql = "select * from {$g5['content_table']} limit 100 ";
$sql = "SELECT * FROM {$g5['content_table']} limit 100 ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
@ -228,7 +228,7 @@ if (
}
// qa config 테이블 auto id key 추가
$row = sql_fetch("select * from `{$g5['qa_config_table']}` limit 1");
$row = sql_fetch("SELECT * FROM `{$g5['qa_config_table']}` limit 1");
if (!isset($row['qa_id'])) {
sql_query(" ALTER TABLE `{$g5['qa_config_table']}` ADD COLUMN `qa_id` INT(11) NOT NULL AUTO_INCREMENT FIRST,
ADD PRIMARY KEY (`qa_id`); ", true);
@ -246,7 +246,7 @@ if (!isset($config['cf_id'])) {
}
// login 테이블 auto id key 추가
$row = sql_fetch("select * from `{$g5['login_table']}` limit 1");
$row = sql_fetch("SELECT * FROM `{$g5['login_table']}` limit 1");
if (!isset($row['lo_id'])) {
sql_query(" ALTER TABLE `{$g5['login_table']}`
ADD COLUMN `lo_id` INT(11) NOT NULL AUTO_INCREMENT FIRST,

View file

@ -14,7 +14,7 @@ if ($is_admin != 'super')
$g5['title'] = '디자인 설정';
include_once "./admin.head.php";
$design_result = sql_query("select * from {$g5['css_table']}");
$design_result = sql_query("SELECT * FROM {$g5['css_table']}");
$de = [];
for ($i = 0; $row = sql_fetch_array($design_result); $i++) {
$de[$row['cs_name']] = $row;

View file

@ -2,7 +2,7 @@
@include_once "./_common.php";
// CSS 설정 가져오기
$css_sql = sql_query("select * from {$g5['css_table']}");
$css_sql = sql_query("SELECT * FROM {$g5['css_table']}");
$css = [];
for ($i = 0; $cs = sql_fetch_array($css_sql); $i++) {
$css[$cs['cs_name']][0] = $cs['cs_value'];

View file

@ -14,7 +14,7 @@ $site_style_url = G5_DATA_URL . "/site";
for ($i = 0; $i < count($cs_name); $i++) {
$de = sql_fetch("select * from {$g5['css_table']} where cs_name = '{$cs_name[$i]}'");
$de = sql_fetch("SELECT * FROM {$g5['css_table']} where cs_name = '{$cs_name[$i]}'");
if (is_array($cs_etc_1[$i]))
$cs_etc_1[$i] = "||" . implode("||", $cs_etc_1[$i]) . "||";
@ -102,7 +102,7 @@ for ($i = 0; $i < count($cs_name); $i++) {
} else {
// 입력
$sql = " insert into {$g5['css_table']}
$sql = "INSERT INTO {$g5['css_table']}
set cs_name = '{$cs_name[$i]}',
cs_value = '{$cs_value[$i]}',
cs_descript = '{$cs_descript[$i]}',

View file

@ -21,7 +21,7 @@ if (!sql_fetch_array(sql_query("DESC {$g5['font_table']}"))) {
}
// 목록 출력
$sql = " SELECT * FROM {$g5['font_table']} ORDER BY font_family ASC ";
$sql = "SELECT * FROM {$g5['font_table']} ORDER BY font_family ASC ";
$result = sql_query($sql);
$g5['title'] = "에디터 폰트 관리";

View file

@ -113,18 +113,18 @@ if ($w == '') {
alert('이미 존재하는 회원아이디입니다.\\n : ' . $mb['mb_id'] . '\\n이름 : ' . $mb['mb_name'] . '\\n닉네임 : ' . $mb['mb_nick'] . '\\n메일 : ' . $mb['mb_email']);
// 닉네임중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$_POST['mb_nick']}' ";
$sql = "SELECT mb_id, mb_name, mb_nick, mb_email FROM {$g5['member_table']} where mb_nick = '{$_POST['mb_nick']}' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
alert('이미 존재하는 닉네임입니다.\\n : ' . $row['mb_id'] . '\\n이름 : ' . $row['mb_name'] . '\\n닉네임 : ' . $row['mb_nick'] . '\\n메일 : ' . $row['mb_email']);
// 이메일중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$_POST['mb_email']}' ";
$sql = "SELECT mb_id, mb_name, mb_nick, mb_email FROM {$g5['member_table']} where mb_email = '{$_POST['mb_email']}' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
alert('이미 존재하는 이메일입니다.\\n : ' . $row['mb_id'] . '\\n이름 : ' . $row['mb_name'] . '\\n닉네임 : ' . $row['mb_nick'] . '\\n메일 : ' . $row['mb_email']);
sql_query(" insert into {$g5['member_table']} set mb_id = '{$mb_id}', mb_password = '" . get_encrypt_string($mb_password) . "', mb_datetime = '" . G5_TIME_YMDHIS . "', mb_ip = '{$_SERVER['REMOTE_ADDR']}', mb_email_certify = '" . G5_TIME_YMDHIS . "', {$sql_common} ");
sql_query("INSERT INTO {$g5['member_table']} set mb_id = '{$mb_id}', mb_password = '" . get_encrypt_string($mb_password) . "', mb_datetime = '" . G5_TIME_YMDHIS . "', mb_ip = '{$_SERVER['REMOTE_ADDR']}', mb_email_certify = '" . G5_TIME_YMDHIS . "', {$sql_common} ");
} else if ($w == 'u') {
$mb = get_member($mb_id);
if (!$mb['mb_id'])
@ -137,13 +137,13 @@ if ($w == '') {
alert($mb['mb_id'] . ' : 로그인 중인 관리자 레벨은 수정 할 수 없습니다.');
// 닉네임중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$_POST['mb_nick']}' and mb_id <> '{$mb_id}' ";
$sql = "SELECT mb_id, mb_name, mb_nick, mb_email FROM {$g5['member_table']} where mb_nick = '{$_POST['mb_nick']}' and mb_id <> '{$mb_id}' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
alert('이미 존재하는 닉네임입니다.\\n : ' . $row['mb_id'] . '\\n이름 : ' . $row['mb_name'] . '\\n닉네임 : ' . $row['mb_nick'] . '\\n메일 : ' . $row['mb_email']);
// 이메일중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$_POST['mb_email']}' and mb_id <> '$mb_id' ";
$sql = "SELECT mb_id, mb_name, mb_nick, mb_email FROM {$g5['member_table']} where mb_email = '{$_POST['mb_email']}' and mb_id <> '$mb_id' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
alert('이미 존재하는 이메일입니다.\\n : ' . $row['mb_id'] . '\\n이름 : ' . $row['mb_name'] . '\\n닉네임 : ' . $row['mb_nick'] . '\\n메일 : ' . $row['mb_email']);

View file

@ -18,7 +18,7 @@ if (!in_array("me_parent", $columns)) {
sql_query("ALTER TABLE {$g5['menu_table']} ADD COLUMN me_parent VARCHAR(50) DEFAULT ''");
}
$sql = " select * from {$g5['menu_table']} order by me_order*1, me_id ";
$sql = "SELECT * FROM {$g5['menu_table']} order by me_order*1, me_id ";
$result = sql_query($sql);
$g5['title'] = "메뉴설정";

View file

@ -47,7 +47,7 @@ if (!isset($config['cf_googl_shorturl_apikey'])) {
if (!isset($config['cf_mobile_pages'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}`
ADD `cf_mobile_pages` INT(11) NOT NULL DEFAULT '0' AFTER `cf_write_pages` ", true);
sql_query(" UPDATE `{$g5['config_table']}` SET cf_mobile_pages = '5' ", true);
sql_query("UPDATE `{$g5['config_table']}` SET cf_mobile_pages = '5' ", true);
}
if (!isset($config['cf_facebook_appid'])) {
@ -67,7 +67,7 @@ if (!sql_query(" DESC {$g5['uniqid_table']} ", false)) {
) ", false);
}
if (!sql_query(" SELECT uq_ip from {$g5['uniqid_table']} limit 1 ", false)) {
if (!sql_query("SELECT uq_ip FROM {$g5['uniqid_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE {$g5['uniqid_table']} ADD `uq_ip` VARCHAR(255) NOT NULL ");
}
@ -106,8 +106,8 @@ if (!isset($config['cf_cert_use'])) {
ADD `cf_cert_limit` INT(11) NOT NULL DEFAULT '0' AFTER `cf_cert_kcp_cd` ", true);
sql_query(" ALTER TABLE `{$g5['member_table']}`
CHANGE `mb_hp_certify` `mb_certify` VARCHAR(20) NOT NULL DEFAULT '' ", true);
sql_query(" update {$g5['member_table']} set mb_certify = 'hp' where mb_certify = '1' ");
sql_query(" update {$g5['member_table']} set mb_certify = '' where mb_certify = '0' ");
sql_query("UPDATE {$g5['member_table']} SET mb_certify = 'hp' where mb_certify = '1' ");
sql_query("UPDATE {$g5['member_table']} SET mb_certify = '' where mb_certify = '0' ");
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['cert_history_table']}` (
`cr_id` int(11) NOT NULL auto_increment,
`mb_id` varchar(255) NOT NULL DEFAULT '',
@ -197,7 +197,7 @@ if (!isset($config['cf_cursor'])) {
}
// 접속자 정보 필드 추가
if (!sql_query(" select vi_browser from {$g5['visit_table']} limit 1 ")) {
if (!sql_query("SELECT vi_browser FROM {$g5['visit_table']} limit 1 ")) {
sql_query(" ALTER TABLE `{$g5['visit_table']}`
ADD `vi_browser` varchar(255) NOT NULL DEFAULT '' AFTER `vi_agent`,
ADD `vi_os` varchar(255) NOT NULL DEFAULT '' AFTER `vi_browser`,

View file

@ -18,7 +18,7 @@ $total_count = count($theme);
// 설정된 테마가 존재하지 않는다면 cf_theme 초기화
if ($config['cf_theme'] && !in_array($config['cf_theme'], $theme))
sql_query(" update {$g5['config_table']} set cf_theme = '' ");
sql_query("UPDATE {$g5['config_table']} SET cf_theme = '' ");
$g5['title'] = "테마설정";
include_once "./admin.head.php";

View file

@ -23,7 +23,7 @@ $qstr_index = '&amp;mode=index';
$qstr_list = '&amp;mode=list';
$qstr_view = '&amp;mode=view';
$conf = sql_fetch(" select cf_theme from {$g5['config_table']} ");
$conf = sql_fetch("SELECT cf_theme FROM {$g5['config_table']} ");
$name = get_text($info['theme_name']);
if ($conf['cf_theme'] != $theme) {
if ($tconfig['set_default_skin'])

View file

@ -14,7 +14,7 @@ $post_set_default_skin = isset($_POST['set_default_skin']) ? clean_xss_tags($_PO
$theme_dir = get_theme_dir();
if ($post_type == 'reset') {
$sql = " update {$g5['config_table']} set cf_theme = '' ";
$sql = "UPDATE {$g5['config_table']} SET cf_theme = '' ";
sql_query($sql);
die('');
}
@ -23,7 +23,7 @@ if (!in_array($theme, $theme_dir))
die('선택하신 테마가 설치되어 있지 않습니다.');
// 테마적용
$sql = " update {$g5['config_table']} set cf_theme = '$theme' ";
$sql = "UPDATE {$g5['config_table']} SET cf_theme = '$theme' ";
sql_query($sql);
// 테마 설정 스킨 적용
@ -75,17 +75,17 @@ if ($post_set_default_skin == 1) {
}
if (!empty($sql_common)) {
$sql = " update {$g5['config_table']} set " . implode(', ', $sql_common);
$sql = "UPDATE {$g5['config_table']} SET " . implode(', ', $sql_common);
sql_query($sql);
}
if (!empty($qa_sql_common)) {
$sql = " update {$g5['qa_config_table']} set " . implode(', ', $qa_sql_common);
$sql = "UPDATE {$g5['qa_config_table']} SET " . implode(', ', $qa_sql_common);
sql_query($sql);
}
if (!empty($de_sql_common)) {
$sql = " update {$g5['g5_shop_default_table']} set " . implode(', ', $de_sql_common);
$sql = "UPDATE {$g5['g5_shop_default_table']} SET " . implode(', ', $de_sql_common);
sql_query($sql);
}
}

View file

@ -14,7 +14,7 @@ include_once "./admin.head.php";
if (defined("G5_THEME_PATH") && file_exists(G5_THEME_PATH . "/config/viewer_form.php")) {
include_once G5_THEME_PATH . "/config/viewer_form.php";
} else {
$sql = " select * from {$g5['content_table']} where co_id = 'site_main' ";
$sql = "SELECT * FROM {$g5['content_table']} where co_id = 'site_main' ";
$main_co = sql_fetch($sql);
?>
<form name="fviewerform" id="fviewerform" method="post" onsubmit="return fviewerform_submit(this);"

View file

@ -9,7 +9,7 @@ if (defined("G5_THEME_PATH") && file_exists(G5_THEME_PATH . "/config/viewer_form
co_tag_filter_use = '0' ";
// -- 메인 정보 가져오기
$sql = " select co_id from {$g5['content_table']} where co_id = 'site_main' ";
$sql = "SELECT co_id FROM {$g5['content_table']} where co_id = 'site_main' ";
$main_co = sql_fetch($sql);
if (!$main_co['co_id']) {
// Insert

View file

@ -11,7 +11,7 @@ $colspan = 5;
$max = 0;
$sum_count = 0;
$sql = " select * from {$g5['visit_table']}
$sql = "SELECT * FROM {$g5['visit_table']}
where vi_date between '{$fr_date}' and '{$to_date}' ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {

View file

@ -18,7 +18,7 @@ $sum_count = 0;
$sql = " select vs_date, vs_count as cnt
from {$g5['visit_sum_table']}
where vs_date between '{$fr_date}' and '{$to_date}'
order by vs_date desc ";
ORDER BY vs_date DESC ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$arr[$row['vs_date']] = $row['cnt'];

View file

@ -8,7 +8,7 @@ $g5['title'] = '접속자로그삭제';
include_once "./admin.head.php";
// 최소년도 구함
$sql = " select min(vi_date) as min_date from {$g5['visit_table']} ";
$sql = "SELECT min(vi_date) as min_date FROM {$g5['visit_table']} ";
$row = sql_fetch($sql);
$min_year = (int) substr($row['min_date'], 0, 4);

View file

@ -43,7 +43,7 @@ switch ($method) {
}
// 총 로그수
$sql = " select count(*) as cnt from {$g5['visit_table']} ";
$sql = "SELECT count(*) as cnt FROM {$g5['visit_table']} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
@ -52,7 +52,7 @@ $sql = " delete from {$g5['visit_table']} {$sql_common} ";
sql_query($sql);
// 삭제 후 총 로그수
$sql = " select count(*) as cnt from {$g5['visit_table']} ";
$sql = "SELECT count(*) as cnt FROM {$g5['visit_table']} ";
$row = sql_fetch($sql);
$total_count2 = $row['cnt'];

View file

@ -11,7 +11,7 @@ $colspan = 5;
$max = 0;
$sum_count = 0;
$sql = " select * from {$g5['visit_table']}
$sql = "SELECT * FROM {$g5['visit_table']}
where vi_date between '{$fr_date}' and '{$to_date}' ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {

View file

@ -11,7 +11,7 @@ $colspan = 5;
$max = 0;
$sum_count = 0;
$sql = " select * from {$g5['visit_table']}
$sql = "SELECT * FROM {$g5['visit_table']}
where vi_date between '{$fr_date}' and '{$to_date}' ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {

View file

@ -30,7 +30,7 @@ $from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select *
{$sql_common}
{$sql_search}
order by vi_id desc
ORDER BY vi_id DESC
limit {$from_record}, {$rows} ";
$result = sql_query($sql);
?>

View file

@ -19,7 +19,7 @@ $sql = " select SUBSTRING(vs_date,1,7) as vs_month, SUM(vs_count) as cnt
from {$g5['visit_sum_table']}
where vs_date between '{$fr_date}' and '{$to_date}'
group by vs_month
order by vs_month desc ";
ORDER BY vs_month DESC ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$arr[$row['vs_month']] = $row['cnt'];

View file

@ -11,7 +11,7 @@ $colspan = 5;
$max = 0;
$sum_count = 0;
$sql = " select * from {$g5['visit_table']}
$sql = "SELECT * FROM {$g5['visit_table']}
where vi_date between '{$fr_date}' and '{$to_date}' ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {

View file

@ -65,7 +65,7 @@ $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '">처음</a>'; //페이지
$sql = " select *
{$sql_common}
{$sql_search}
order by vi_id desc
ORDER BY vi_id DESC
limit {$from_record}, {$rows} ";
$result = sql_query($sql);

View file

@ -19,7 +19,7 @@ $sql = " select SUBSTRING(vs_date,1,4) as vs_year, SUM(vs_count) as cnt
from {$g5['visit_sum_table']}
where vs_date between '{$fr_date}' and '{$to_date}'
group by vs_year
order by vs_year desc ";
ORDER BY vs_year DESC ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$arr[$row['vs_year']] = $row['cnt'];

View file

@ -77,7 +77,7 @@ if ($bo_table)
switch ($day) {
case '시간':
$sql = " select substr(bn_datetime,6,8) as hours, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by hours order by bn_datetime ";
$sql = "SELECT substr(bn_datetime,6,8) as hours, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount FROM {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by hours order by bn_datetime ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 월-일 시간
@ -86,7 +86,7 @@ switch ($day) {
}
break;
case '일':
$sql = " select substr(bn_datetime,1,10) as days, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by days order by bn_datetime ";
$sql = "SELECT substr(bn_datetime,1,10) as days, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount FROM {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by days order by bn_datetime ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 월-일
@ -95,7 +95,7 @@ switch ($day) {
}
break;
case '주':
$sql = " select concat(substr(bn_datetime,1,4), '-', weekofyear(bn_datetime)) as weeks, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by weeks order by bn_datetime ";
$sql = "SELECT concat(substr(bn_datetime,1,4), '-', weekofyear(bn_datetime)) as weeks, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount FROM {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by weeks order by bn_datetime ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 올해의 몇주로 보여주면 바로 확인이 안되므로 주를 날짜로 바꾼다.
@ -107,7 +107,7 @@ switch ($day) {
}
break;
case '월':
$sql = " select substr(bn_datetime,1,7) as months, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by months order by bn_datetime ";
$sql = "SELECT substr(bn_datetime,1,7) as months, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount FROM {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by months order by bn_datetime ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 년-월
@ -116,7 +116,7 @@ switch ($day) {
}
break;
case '년':
$sql = " select substr(bn_datetime,1,4) as years, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by years order by bn_datetime ";
$sql = "SELECT substr(bn_datetime,1,4) as years, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount FROM {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by years order by bn_datetime ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 년(4자리)
@ -131,7 +131,7 @@ switch ($day) {
<select name="bo_table">
<option value="">전체게시판</a>
<?php
$sql = " select bo_table, bo_subject from {$g5['board_table']} order by bo_count_write desc ";
$sql = "SELECT bo_table, bo_subject FROM {$g5['board_table']} ORDER BY bo_count_write DESC ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
echo "<option value=\"{$row['bo_table']}\"";

View file

@ -9,10 +9,10 @@ $subject = isset($_REQUEST['subject']) ? preg_replace("#[\\\]+$#", "", substr(tr
$content = isset($_REQUEST['content']) ? preg_replace("#[\\\]+$#", "", substr(trim($_POST['content']),0,65536)) : '';
if ($subject && $content) {
$sql = " select count(*) as cnt from {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' and as_subject = '$subject' and as_content = '$content' ";
$sql = "SELECT count(*) as cnt FROM {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' and as_subject = '$subject' and as_content = '$content' ";
$row = sql_fetch($sql);
if (!$row['cnt']) {
$sql = " insert into {$g5['autosave_table']} set mb_id = '{$member['mb_id']}', as_uid = '{$uid}', as_subject = '$subject', as_content = '$content', as_datetime = '" . G5_TIME_YMDHIS . "' on duplicate key update as_subject = '$subject', as_content = '$content', as_datetime = '" . G5_TIME_YMDHIS . "' ";
$sql = "INSERT INTO {$g5['autosave_table']} set mb_id = '{$member['mb_id']}', as_uid = '{$uid}', as_subject = '$subject', as_content = '$content', as_datetime = '" . G5_TIME_YMDHIS . "' on duplicate key update as_subject = '$subject', as_content = '$content', as_datetime = '" . G5_TIME_YMDHIS . "' ";
$result = sql_query($sql, false);
echo autosave_count($member['mb_id']);

View file

@ -4,7 +4,7 @@ include_once "./_common.php";
if (!$is_member)
die('');
$sql = " select as_id, as_uid, as_subject, as_datetime from {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' order by as_id desc ";
$sql = "SELECT as_id, as_uid, as_subject, as_datetime FROM {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' ORDER BY as_id DESC ";
$result = sql_query($sql);
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
echo "<list>\n";

View file

@ -6,7 +6,7 @@ if (!$is_member)
$as_id = (int) $_REQUEST['as_id'];
$sql = " select as_subject, as_content from {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' and as_id = {$as_id} ";
$sql = "SELECT as_subject, as_content FROM {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' and as_id = {$as_id} ";
$row = sql_fetch($sql);
$subject = $row['as_subject'];
$content = $row['as_content'];

View file

@ -36,7 +36,7 @@ if (isset($wr_id) && $wr_id) {
;
} else {
// 그룹접근
$sql = " select count(*) as cnt from {$g5['group_member_table']} where gr_id = '{$board['gr_id']}' and mb_id = '{$member['mb_id']}' ";
$sql = "SELECT count(*) as cnt FROM {$g5['group_member_table']} where gr_id = '{$board['gr_id']}' and mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if (!$row['cnt']) {
alert("접근 권한이 없으므로 글읽기가 불가합니다.\\n\\n궁금하신 사항은 관리자에게 문의 바랍니다.", G5_URL);
@ -86,7 +86,7 @@ if (isset($wr_id) && $wr_id) {
// 회원이 관리자가 올린 답변글을 바로 볼 수 없던 오류를 수정
$is_owner = false;
if ($write['wr_reply'] && $member['mb_id']) {
$sql = " select mb_id from {$write_table}
$sql = "SELECT mb_id FROM {$write_table}
where wr_num = '{$write['wr_num']}'
and wr_reply = ''
and wr_is_comment = 0 ";
@ -113,7 +113,7 @@ if (isset($wr_id) && $wr_id) {
// 한번 읽은글은 브라우저를 닫기전까지는 카운트를 증가시키지 않음
$ss_name = 'ss_view_' . $bo_table . '_' . $wr_id;
if (!get_session($ss_name)) {
sql_query(" update {$write_table} set wr_hit = wr_hit + 1 where wr_id = '{$wr_id}' ");
sql_query("UPDATE {$write_table} SET wr_hit = wr_hit + 1 where wr_id = '{$wr_id}' ");
// 자신의 글이면 통과
if ($write['mb_id'] && $write['mb_id'] == $member['mb_id']) {

View file

@ -75,7 +75,7 @@ $colspan = 8;
/** 세력 정보 **/
$ch_si = [];
if ($config['cf_side_title']) {
$side_result = sql_query("select si_id, si_name from {$g5['side_table']} where si_auth <= '{$member['mb_level']}' order by si_id asc");
$side_result = sql_query("SELECT si_id, si_name FROM {$g5['side_table']} where si_auth <= '{$member['mb_level']}' ORDER BY si_id ASC");
for ($i = 0; $row = sql_fetch_array($side_result); $i++) {
$ch_si[$i]['name'] = $row['si_name'];
$ch_si[$i]['id'] = $row['si_id'];
@ -85,7 +85,7 @@ if ($config['cf_side_title']) {
/** 종족 정보 **/
$ch_cl = [];
if ($config['cf_class_title']) {
$class_result = sql_query("select cl_id, cl_name from {$g5['class_table']} where cl_auth <= '{$member['mb_level']}' order by cl_id asc");
$class_result = sql_query("SELECT cl_id, cl_name FROM {$g5['class_table']} where cl_auth <= '{$member['mb_level']}' ORDER BY cl_id ASC");
for ($i = 0; $row = sql_fetch_array($class_result); $i++) {
$ch_cl[$i]['name'] = $row['cl_name'];
$ch_cl[$i]['id'] = $row['cl_id'];
@ -93,7 +93,7 @@ if ($config['cf_class_title']) {
}
$profile = sql_fetch(" select ad_use_rank from {$g5['article_default_table']} ");
$profile = sql_fetch("SELECT ad_use_rank FROM {$g5['article_default_table']} ");
if ($profile['ad_use_rank']) {
$colspan++;
}

View file

@ -7,7 +7,7 @@ if (!isset($g5['content_table'])) {
}
// 내용
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$sql = "SELECT * FROM {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql);
if (!$co['co_id'])
alert('등록된 내용이 없습니다.');

View file

@ -9,7 +9,7 @@ $list = [];
$sql = " select a.mb_id, b.mb_nick, b.mb_name, b.mb_email, b.mb_homepage, b.mb_open, b.mb_point, a.lo_ip, a.lo_location, a.lo_url
from {$g5['login_table']} a left join {$g5['member_table']} b on (a.mb_id = b.mb_id)
where a.mb_id <> '{$config['cf_admin']}'
order by a.lo_datetime desc ";
ORDER BY a.lo_datetime DESC ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$row['lo_url'] = get_text($row['lo_url']);
@ -18,7 +18,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++) {
if ($row['mb_id']) {
$list[$i]['name'] = get_sideview($row['mb_id'], cut_str($row['mb_nick'], $config['cf_cut_name']), $row['mb_email'], $row['mb_homepage']);
} else {
$ip_member = sql_fetch("select mb_name, mb_id from {$g5['member_table']} where mb_login_ip = '{$row['lo_ip']}' OR mb_ip = '{$row['lo_ip']}'");
$ip_member = sql_fetch("SELECT mb_name, mb_id FROM {$g5['member_table']} where mb_login_ip = '{$row['lo_ip']}' OR mb_ip = '{$row['lo_ip']}'");
if ($ip_member['mb_id']) {
$list[$i]['name'] = $ip_member['mb_name'];
} else {

View file

@ -42,9 +42,10 @@ if ($config['cf_memo_del'] > 0) {
// 탈퇴회원 자동 삭제
if ($config['cf_leave_day'] > 0) {
$sql = " select mb_id from {$g5['member_table']}
where (TO_DAYS('" . G5_TIME_YMDHIS . "') - TO_DAYS(mb_leave_date)) > '{$config['cf_leave_day']}'
and mb_memo not regexp '^[0-9]{8}.*삭제함' ";
$time = G5_TIME_YMDHIS;
$sql = "SELECT mb_id FROM {$g5['member_table']}
WHERE (TO_DAYS('{$time}') - TO_DAYS(mb_leave_date)) > '{$config['cf_leave_day']}'
AND mb_memo NOT regexp '^[0-9]{8}.*삭제함' ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
// 회원자료 삭제
@ -64,5 +65,5 @@ if ($captcha_mp3 && is_array($captcha_mp3)) {
// 실행일 기록
if (isset($config['cf_optimize_date'])) {
sql_query(" update {$g5['config_table']} set cf_optimize_date = '" . G5_TIME_YMD . "' ");
sql_query("UPDATE {$g5['config_table']} SET cf_optimize_date = '" . G5_TIME_YMD . "' ");
}

View file

@ -7,7 +7,7 @@ set_session('ss_delete_token', '');
if (!($token && $delete_token == $token))
alert('토큰 에러로 삭제 불가합니다.');
*/
//$wr = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
//$wr = sql_fetch("SELECT * FROM $write_table where wr_id = '$wr_id' ");
@include_once $board_skin_path . '/delete.head.skin.php';
@ -41,7 +41,7 @@ if ($len < 0)
$reply = substr($write['wr_reply'], 0, $len);
// 원글만 구한다.
$sql = " select count(*) as cnt from $write_table
$sql = "SELECT count(*) as cnt FROM $write_table
where wr_reply like '$reply%'
and wr_id <> '{$write['wr_id']}'
and wr_num = '{$write['wr_num']}'
@ -51,7 +51,7 @@ if ($row['cnt'] && !$is_admin)
alert('이 글과 관련된 답변글이 존재하므로 삭제 할 수 없습니다.\\n\\n우선 답변글부터 삭제하여 주십시오.');
// 코멘트 달린 원글의 삭제 여부
$sql = " select count(*) as cnt from $write_table
$sql = "SELECT count(*) as cnt FROM $write_table
where wr_parent = '$wr_id'
and mb_id <> '{$member['mb_id']}'
and wr_is_comment = 1 ";
@ -64,8 +64,8 @@ if ($row['cnt'] >= $board['bo_count_delete'] && !$is_admin)
@include_once $board_skin_path . '/delete.skin.php';
// 나라오름님 수정 : 원글과 코멘트수가 정상적으로 업데이트 되지 않는 오류를 잡아 주셨습니다.
//$sql = " select wr_id, mb_id, wr_comment from $write_table where wr_parent = '$write['wr_id']' order by wr_id ";
$sql = " select wr_id, mb_id, wr_is_comment, wr_content from $write_table where wr_parent = '{$write['wr_id']}' order by wr_id ";
//$sql = "SELECT wr_id, mb_id, wr_comment FROM $write_table where wr_parent = '$write['wr_id']' order by wr_id ";
$sql = "SELECT wr_id, mb_id, wr_is_comment, wr_content FROM $write_table where wr_parent = '{$write['wr_id']}' order by wr_id ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
// 원글이라면
@ -75,7 +75,7 @@ while ($row = sql_fetch_array($result)) {
insert_point($row['mb_id'], $board['bo_write_point'] * (-1), "{$board['bo_subject']} {$row['wr_id']} 글삭제");
// 업로드된 파일이 있다면 파일삭제
$sql2 = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' ";
$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 . '/' . $row2['bf_file']);
@ -120,11 +120,11 @@ for ($k=0; $k<count($notice_array); $k++)
$bo_notice = trim($bo_notice);
*/
$bo_notice = board_notice($board['bo_notice'], $write['wr_id']);
sql_query(" update {$g5['board_table']} set bo_notice = '$bo_notice' where bo_table = '$bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_notice = '$bo_notice' where bo_table = '$bo_table' ");
// 글숫자 감소
if ($count_write > 0 || $count_comment > 0)
sql_query(" update {$g5['board_table']} set bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' where bo_table = '$bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' where bo_table = '$bo_table' ");
@include_once $board_skin_path . '/delete.tail.skin.php';

View file

@ -27,7 +27,7 @@ if ($chk_count > (G5_IS_MOBILE ? $board['bo_mobile_page_rows'] : $board['bo_page
// 거꾸로 읽는 이유는 답변글부터 삭제가 되어야 하기 때문임
for ($i = $chk_count - 1; $i >= 0; $i--) {
$write = sql_fetch(" select * from $write_table where wr_id = '$tmp_array[$i]' ");
$write = sql_fetch("SELECT * FROM $write_table WHERE wr_id = '$tmp_array[$i]' ");
if ($is_admin == 'super') // 최고관리자 통과
;
@ -67,18 +67,18 @@ for ($i = $chk_count - 1; $i >= 0; $i--) {
$reply = substr($write['wr_reply'], 0, $len);
// 원글만 구한다.
$sql = " select count(*) as cnt from $write_table
where wr_reply like '$reply%'
and wr_id <> '{$write['wr_id']}'
and wr_num = '{$write['wr_num']}'
and wr_is_comment = 0 ";
$sql = "SELECT count(*) as cnt FROM $write_table
WHERE wr_reply LIKE '$reply%'
AND wr_id <> '{$write['wr_id']}'
AND wr_num = '{$write['wr_num']}'
AND wr_is_comment = 0 ";
$row = sql_fetch($sql);
if ($row['cnt'])
continue;
// 나라오름님 수정 : 원글과 코멘트수가 정상적으로 업데이트 되지 않는 오류를 잡아 주셨습니다.
//$sql = " select wr_id, mb_id, wr_comment from {$write_table} where wr_parent = '{$write['wr_id']}' order by wr_id ";
$sql = " select wr_id, mb_id, wr_is_comment, wr_content from $write_table where wr_parent = '{$write['wr_id']}' order by wr_id ";
//$sql = "SELECT wr_id, mb_id, wr_comment FROM {$write_table} where wr_parent = '{$write['wr_id']}' order by wr_id ";
$sql = "SELECT wr_id, mb_id, wr_is_comment, wr_content FROM $write_table WHERE wr_parent = '{$write['wr_id']}' ORDER BY wr_id ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
// 원글이라면
@ -88,7 +88,7 @@ for ($i = $chk_count - 1; $i >= 0; $i--) {
insert_point($row['mb_id'], $board['bo_write_point'] * (-1), "{$board['bo_subject']} {$row['wr_id']} 글 삭제");
// 업로드된 파일이 있다면
$sql2 = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' ";
$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)) {
// 파일삭제
@ -135,13 +135,13 @@ for ($i = $chk_count - 1; $i >= 0; $i--) {
$bo_notice = trim($bo_notice);
*/
$bo_notice = board_notice($board['bo_notice'], $write['wr_id']);
sql_query(" update {$g5['board_table']} set bo_notice = '$bo_notice' where bo_table = '$bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_notice = '$bo_notice' WHERE bo_table = '$bo_table' ");
$board['bo_notice'] = $bo_notice;
}
// 글숫자 감소
if ($count_write > 0 || $count_comment > 0)
sql_query(" update {$g5['board_table']} set bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' where bo_table = '$bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' WHERE bo_table = '$bo_table' ");
// 4.11
@include_once $board_skin_path . '/delete_all.tail.skin.php';

View file

@ -11,7 +11,7 @@ if (!($token && $delete_comment_token == $token))
// 4.1
@include_once $board_skin_path . '/delete_comment.head.skin.php';
$write = sql_fetch(" select * from {$write_table} where wr_id = '{$comment_id}' ");
$write = sql_fetch("SELECT * FROM {$write_table} WHERE wr_id = '{$comment_id}' ");
if (!$write['wr_id'] || !$write['wr_is_comment'])
alert('등록된 코멘트가 없거나 코멘트 글이 아닙니다.');
@ -49,7 +49,7 @@ if ($len < 0)
$len = 0;
$comment_reply = substr($write['wr_comment_reply'], 0, $len);
$sql = " select count(*) as cnt from {$write_table}
$sql = "SELECT count(*) as cnt FROM {$write_table}
where wr_comment_reply like '{$comment_reply}%'
and wr_id <> '{$comment_id}'
and wr_parent = '{$write['wr_parent']}'
@ -67,14 +67,14 @@ if (!delete_point($write['mb_id'], $bo_table, $comment_id, '댓글'))
sql_query(" delete from {$write_table} where wr_id = '{$comment_id}' ");
// 코멘트가 삭제되므로 해당 게시물에 대한 최근 시간을 다시 얻는다.
$sql = " select max(wr_datetime) as wr_last from {$write_table} where wr_parent = '{$write['wr_parent']}' ";
$sql = "SELECT max(wr_datetime) as wr_last FROM {$write_table} where wr_parent = '{$write['wr_parent']}' ";
$row = sql_fetch($sql);
// 원글의 코멘트 숫자를 감소
sql_query(" update {$write_table} set wr_comment = wr_comment - 1, wr_last = '{$row['wr_last']}' where wr_id = '{$write['wr_parent']}' ");
sql_query("UPDATE {$write_table} SET wr_comment = wr_comment - 1, wr_last = '{$row['wr_last']}' where wr_id = '{$write['wr_parent']}' ");
// 코멘트 숫자 감소
sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment - 1 where bo_table = '{$bo_table}' ");
sql_query("UPDATE {$g5['board_table']} SET bo_count_comment = bo_count_comment - 1 where bo_table = '{$bo_table}' ");
// 새글 삭제
sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$bo_table}' and wr_id = '{$comment_id}' ");

View file

@ -17,7 +17,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));
$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 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);
if (!$file['bf_file'])
alert_close('파일 정보가 존재하지 않습니다.');
@ -67,7 +67,7 @@ if (!get_session($ss_name)) {
}
// 다운로드 카운트 증가
$sql = " update {$g5['board_file_table']} set bf_download = bf_download + 1 where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' ";
$sql = "UPDATE {$g5['board_file_table']} SET bf_download = bf_download + 1 where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' ";
sql_query($sql);
set_session($ss_name, TRUE);

View file

@ -4,17 +4,17 @@ include_once "./_common.php";
$mb_id = trim($_GET['mb_id']);
$mb_md5 = trim($_GET['mb_md5']);
$sql = " select mb_id, mb_email_certify2 from {$g5['member_table']} where mb_id = '{$mb_id}' ";
$sql = "SELECT mb_id, mb_email_certify2 FROM {$g5['member_table']} where mb_id = '{$mb_id}' ";
$row = sql_fetch($sql);
if (!$row['mb_id'])
alert('존재하는 회원이 아닙니다.', G5_URL);
// 인증 링크는 한번만 처리가 되게 한다.
sql_query(" update {$g5['member_table']} set mb_email_certify2 = '' where mb_id = '$mb_id' ");
sql_query("UPDATE {$g5['member_table']} SET mb_email_certify2 = '' where mb_id = '$mb_id' ");
if ($mb_md5) {
if ($mb_md5 == $row['mb_email_certify2']) {
sql_query(" update {$g5['member_table']} set mb_email_certify = '" . G5_TIME_YMDHIS . "' where mb_id = '{$mb_id}' ");
sql_query("UPDATE {$g5['member_table']} SET mb_email_certify = '" . G5_TIME_YMDHIS . "' where mb_id = '{$mb_id}' ");
alert("메일인증 처리를 완료 하였습니다.\\n\\n지금부터 {$mb_id} 아이디로 로그인 가능합니다.", G5_URL);
} else {

View file

@ -1,7 +1,7 @@
<?php
include_once "./_common.php";
$sql = " select mb_id, mb_email, mb_datetime from {$g5['member_table']} where mb_id = '{$mb_id}' ";
$sql = "SELECT mb_id, mb_email, mb_datetime FROM {$g5['member_table']} where mb_id = '{$mb_id}' ";
$row = sql_fetch($sql);
if (!$row['mb_id'])
alert('존재하는 회원이 아닙니다.', G5_URL);
@ -9,7 +9,7 @@ if (!$row['mb_id'])
if ($mb_md5) {
$tmp_md5 = md5($row['mb_id'] . $row['mb_email'] . $row['mb_datetime']);
if ($mb_md5 == $tmp_md5) {
sql_query(" update {$g5['member_table']} set mb_mailling = 0 where mb_id = '{$mb_id}' ");
sql_query("UPDATE {$g5['member_table']} SET mb_mailling = 0 where mb_id = '{$mb_id}' ");
alert('정보메일을 보내지 않도록 수신거부 하였습니다.', G5_URL);
}

View file

@ -8,7 +8,7 @@ if (!isset($g5['faq_table']) || !isset($g5['faq_master_table'])) {
// FAQ MASTER
$faq_master_list = [];
$sql = " select * from {$g5['faq_master_table']} order by fm_order,fm_id ";
$sql = "SELECT * FROM {$g5['faq_master_table']} order by fm_order,fm_id ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
$key = $row['fm_id'];

View file

@ -32,7 +32,7 @@ if ($_POST['js'] == "on") {
print_result($error, $count);
}
$row = sql_fetch(" select count(*) as cnt from {$g5['write_prefix']}{$bo_table} ", FALSE);
$row = sql_fetch("SELECT count(*) as cnt FROM {$g5['write_prefix']}{$bo_table} ", FALSE);
if (!$row['cnt']) {
$error = '존재하는 게시판이 아닙니다.';
print_result($error, $count);
@ -54,7 +54,7 @@ if ($_POST['js'] == "on") {
print_result($error, $count);
}
$sql = " select bg_flag from {$g5['board_good_table']}
$sql = "SELECT bg_flag FROM {$g5['board_good_table']}
where bo_table = '{$bo_table}'
and wr_id = '{$wr_id}'
and mb_id = '{$member['mb_id']}'
@ -70,11 +70,11 @@ if ($_POST['js'] == "on") {
print_result($error, $count);
} else {
// 추천(찬성), 비추천(반대) 카운트 증가
sql_query(" update {$g5['write_prefix']}{$bo_table} set wr_{$good} = wr_{$good} + 1 where wr_id = '{$wr_id}' ");
sql_query("UPDATE {$g5['write_prefix']}{$bo_table} SET wr_{$good} = wr_{$good} + 1 where wr_id = '{$wr_id}' ");
// 내역 생성
sql_query(" insert {$g5['board_good_table']} set bo_table = '{$bo_table}', wr_id = '{$wr_id}', mb_id = '{$member['mb_id']}', bg_flag = '{$good}', bg_datetime = '" . G5_TIME_YMDHIS . "' ");
$sql = " select wr_{$good} as count from {$g5['write_prefix']}{$bo_table} where wr_id = '$wr_id' ";
$sql = "SELECT wr_{$good} as count FROM {$g5['write_prefix']}{$bo_table} where wr_id = '$wr_id' ";
$row = sql_fetch($sql);
$count = $row['count'];
@ -100,7 +100,7 @@ if ($_POST['js'] == "on") {
if (!get_session($ss_name))
alert('해당 게시물에서만 추천 또는 비추천 하실 수 있습니다.');
$row = sql_fetch(" select count(*) as cnt from {$g5['write_prefix']}{$bo_table} ", FALSE);
$row = sql_fetch("SELECT count(*) as cnt FROM {$g5['write_prefix']}{$bo_table} ", FALSE);
if (!$row['cnt'])
alert('존재하는 게시판이 아닙니다.');
@ -114,7 +114,7 @@ if ($_POST['js'] == "on") {
if (!$board['bo_use_nogood'] && $good == 'nogood')
alert('이 게시판은 비추천 기능을 사용하지 않습니다.');
$sql = " select bg_flag from {$g5['board_good_table']}
$sql = "SELECT bg_flag FROM {$g5['board_good_table']}
where bo_table = '{$bo_table}'
and wr_id = '{$wr_id}'
and mb_id = '{$member['mb_id']}'
@ -129,7 +129,7 @@ if ($_POST['js'] == "on") {
alert("이미 $status 하신 글 입니다.");
} else {
// 추천(찬성), 비추천(반대) 카운트 증가
sql_query(" update {$g5['write_prefix']}{$bo_table} set wr_{$good} = wr_{$good} + 1 where wr_id = '{$wr_id}' ");
sql_query("UPDATE {$g5['write_prefix']}{$bo_table} SET wr_{$good} = wr_{$good} + 1 where wr_id = '{$wr_id}' ");
// 내역 생성
sql_query(" insert {$g5['board_good_table']} set bo_table = '{$bo_table}', wr_id = '{$wr_id}', mb_id = '{$member['mb_id']}', bg_flag = '{$good}', bg_datetime = '" . G5_TIME_YMDHIS . "' ");

View file

@ -7,7 +7,7 @@ $side = [];
$ch_list = [];
if ($config['cf_side_title']) {
$side_result = sql_query("select * from {$g5['side_table']}");
$side_result = sql_query("SELECT * FROM {$g5['side_table']}");
for ($i = 0; $si = sql_fetch_array($side_result); $i++) {
$list[] = get_character_list($si['si_id']);
$side[] = $si;

View file

@ -7,7 +7,7 @@ if (!($bo_table && $wr_id && $no))
alert_close('값이 제대로 넘어오지 않았습니다.');
// SQL Injection 예방
$row = sql_fetch(" select count(*) as cnt from {$g5['write_prefix']}{$bo_table} ", FALSE);
$row = sql_fetch("SELECT count(*) as cnt FROM {$g5['write_prefix']}{$bo_table} ", FALSE);
if (!$row['cnt'])
alert_close('존재하는 게시판이 아닙니다.');
@ -16,7 +16,7 @@ if (!$write['wr_link' . $no])
$ss_name = 'ss_link_' . $bo_table . '_' . $wr_id . '_' . $no;
if (empty($_SESSION[$ss_name])) {
$sql = " update {$g5['write_prefix']}{$bo_table} set wr_link{$no}_hit = wr_link{$no}_hit + 1 where wr_id = '{$wr_id}' ";
$sql = "UPDATE {$g5['write_prefix']}{$bo_table} SET wr_link{$no}_hit = wr_link{$no}_hit + 1 where wr_id = '{$wr_id}' ";
sql_query($sql);
set_session($ss_name, true);

View file

@ -38,7 +38,7 @@ if ($sca || $stx) {
$sql_search = get_sql_search_mmb($sca, $sfl, $stx, $sop, $single);
// 가장 작은 번호를 얻어서 변수에 저장 (하단의 페이징에서 사용)
$sql = " select MIN(wr_num) as min_wr_num from {$write_table} ";
$sql = "SELECT MIN(wr_num) as min_wr_num FROM {$write_table} ";
$row = sql_fetch($sql);
$min_spt = (int) $row['min_wr_num'];
@ -49,11 +49,11 @@ if ($sca || $stx) {
// 원글만 얻는다. (코멘트의 내용도 검색하기 위함)
// 라엘님 제안 코드로 대체 http://sir.co.kr/bbs/board.php?bo_table=g5_bug&wr_id=2922
$sql = " SELECT COUNT(DISTINCT `wr_parent`) AS `cnt` FROM {$write_table} WHERE {$sql_search} ";
$sql = "SELECT COUNT(DISTINCT `wr_parent`) AS `cnt` FROM {$write_table} WHERE {$sql_search} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
/*
$sql = " select distinct wr_parent from {$write_table} where {$sql_search} ";
$sql = "SELECT distinct wr_parent FROM {$write_table} where {$sql_search} ";
$result = sql_query($sql);
$total_count = mysql_num_rows($result);
*/
@ -94,7 +94,7 @@ if (!$sca && !$stx) {
if (trim($arr_notice[$k]) == '')
continue;
$row = sql_fetch(" select * from {$write_table} where wr_id = '{$arr_notice[$k]}' ");
$row = sql_fetch("SELECT * FROM {$write_table} where wr_id = '{$arr_notice[$k]}' ");
if (!$row['wr_id'])
continue;
@ -169,9 +169,9 @@ if ($sst) {
}
if ($sca || $stx) {
$sql = " select distinct wr_parent from {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows ";
$sql = "SELECT distinct wr_parent FROM {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows ";
} else {
$sql = " select * from {$write_table} where wr_is_comment = 0 ";
$sql = "SELECT * FROM {$write_table} where wr_is_comment = 0 ";
if (!empty($notice_array))
$sql .= " and wr_id not in (" . implode(', ', $notice_array) . ") ";
$sql .= " {$sql_order} limit {$from_record}, $page_rows ";
@ -186,7 +186,7 @@ if ($page_rows > 0) {
while ($row = sql_fetch_array($result)) {
// 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다
if ($sca || $stx)
$row = sql_fetch(" select * from {$write_table} where wr_id = '{$row['wr_parent']}' ");
$row = sql_fetch("SELECT * FROM {$write_table} where wr_id = '{$row['wr_parent']}' ");
$list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
if (strstr($sfl, 'subject')) {

View file

@ -42,7 +42,7 @@ if ($sca || $stx) {
$sql_search = get_sql_search($sca, $sfl, $stx, $sop);
// 가장 작은 번호를 얻어서 변수에 저장 (하단의 페이징에서 사용)
$sql = " select MIN(wr_num) as min_wr_num from {$write_table} ";
$sql = "SELECT MIN(wr_num) as min_wr_num FROM {$write_table} ";
$row = sql_fetch($sql);
$min_spt = (int) $row['min_wr_num'];
@ -53,11 +53,11 @@ if ($sca || $stx) {
// 원글만 얻는다. (코멘트의 내용도 검색하기 위함)
// 라엘님 제안 코드로 대체 http://sir.kr/g5_bug/2922
$sql = " SELECT COUNT(DISTINCT `wr_parent`) AS `cnt` FROM {$write_table} WHERE {$sql_search} ";
$sql = "SELECT COUNT(DISTINCT `wr_parent`) AS `cnt` FROM {$write_table} WHERE {$sql_search} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
/*
$sql = " select distinct wr_parent from {$write_table} where {$sql_search} ";
$sql = "SELECT distinct wr_parent FROM {$write_table} where {$sql_search} ";
$result = sql_query($sql);
$total_count = sql_num_rows($result);
*/
@ -99,7 +99,7 @@ if (!$sca && !$stx) {
if (trim($arr_notice[$k]) == '')
continue;
$row = sql_fetch(" select * from {$write_table} where wr_id = '{$arr_notice[$k]}' ");
$row = sql_fetch("SELECT * FROM {$write_table} where wr_id = '{$arr_notice[$k]}' ");
if (!$row['wr_id'])
continue;
@ -181,9 +181,9 @@ if ($sst) {
}
if ($sca || $stx) {
$sql = " select distinct wr_parent from {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows ";
$sql = "SELECT distinct wr_parent FROM {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows ";
} else {
$sql = " select * from {$write_table} where wr_is_comment = 0 ";
$sql = "SELECT * FROM {$write_table} where wr_is_comment = 0 ";
if (!empty($notice_array))
$sql .= " and wr_id not in (" . implode(', ', $notice_array) . ") ";
$sql .= " {$sql_order} limit {$from_record}, $page_rows ";
@ -198,7 +198,7 @@ if ($page_rows > 0) {
while ($row = sql_fetch_array($result)) {
// 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다
if ($sca || $stx)
$row = sql_fetch(" select * from {$write_table} where wr_id = '{$row['wr_parent']}' ");
$row = sql_fetch("SELECT * FROM {$write_table} where wr_id = '{$row['wr_parent']}' ");
$list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
if (strstr($sfl, 'subject')) {

View file

@ -50,7 +50,7 @@ generate_mb_key($mb);
if ($config['cf_use_point']) {
$sum_point = get_point_sum($mb['mb_id']);
$sql = " update {$g5['member_table']} set mb_point = '$sum_point' where mb_id = '{$mb['mb_id']}' ";
$sql = "UPDATE {$g5['member_table']} SET mb_point = '$sum_point' where mb_id = '{$mb['mb_id']}' ";
sql_query($sql);
}

View file

@ -12,7 +12,7 @@ if (!($_POST['mb_password'] && check_password($_POST['mb_password'], $member['mb
// 회원탈퇴일을 저장
$date = date("Ymd");
$sql = " update {$g5['member_table']} set mb_leave_date = '{$date}' where mb_id = '{$member['mb_id']}' ";
$sql = "UPDATE {$g5['member_table']} SET mb_leave_date = '{$date}' where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
EventHandler::triggerEvent("gnuboard.member.leave", $member);

View file

@ -25,7 +25,7 @@ if ($page < 1) {
EventHandler::triggerEvent("gnuboard.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' ";
$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'];
@ -48,7 +48,7 @@ $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']}' and a.me_type = '$kind'
order by a.me_id desc limit $from_record, {$config['cf_page_rows']} ";
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++) {

View file

@ -6,7 +6,7 @@ if (!$is_member)
$me_id = (int) $_REQUEST['me_id'];
$sql = " select * from {$g5['memo_table']} where me_id = '{$me_id}' ";
$sql = "SELECT * FROM {$g5['memo_table']} where me_id = '{$me_id}' ";
$row = sql_fetch($sql);
if (!$row['me_read_datetime'][0]) // 메모 받기전이면

View file

@ -19,7 +19,7 @@ if ($me_recv_mb_id) {
alert_close('정보공개를 하지 않았습니다.');
// 4.00.15
$row = sql_fetch(" select me_memo 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']}') ");
$row = sql_fetch("SELECT me_memo 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']}') ");
if ($row['me_memo']) {
$content = "\n\n\n" . ' >'
. "\n" . ' >'

View file

@ -23,7 +23,7 @@ EventHandler::triggerEvent("gnuboard.memo.form_update_before", $recv_list);
for ($i = 0; $i < count($recv_list); $i++) {
$recv_list_id = substr(preg_replace("/[^a-zA-Z0-9_]*/", "", $recv_list[$i]), 0, 20);
$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_id}' ");
$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_id}' ");
if ($row) {
if ($is_admin || ($row['mb_open'] && (!$row['mb_leave_date'] || !$row['mb_intercept_date']))) {
$member_list['id'][] = $row['mb_id'];
@ -55,28 +55,28 @@ if (!$is_admin) {
}
for ($i = 0; $i < count($member_list['id']); $i++) {
$tmp_row = sql_fetch(" select max(me_id) as max_me_id from {$g5['memo_table']} ");
$tmp_row = sql_fetch("SELECT max(me_id) as max_me_id FROM {$g5['memo_table']} ");
$me_id = $tmp_row['max_me_id'] + 1;
$recv_mb_id = $member_list['id'][$i];
$recv_mb_nick = get_text($member_list['nick'][$i]);
// 받는 회원 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_type, me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '" . G5_TIME_YMDHIS . "', '{$me_memo}', '0000-00-00 00:00:00' , 'recv', '{$_SERVER['REMOTE_ADDR']}' ) ";
$sql = "INSERT INTO {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_type, me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '" . G5_TIME_YMDHIS . "', '{$me_memo}', '0000-00-00 00:00:00' , '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_read_datetime, me_send_id, me_type , me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '" . G5_TIME_YMDHIS . "', '{$me_memo}', '0000-00-00 00:00:00', '$me_id', 'send', '{$_SERVER['REMOTE_ADDR']}' ) ";
$sql = "INSERT INTO {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_send_id, me_type , me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '" . G5_TIME_YMDHIS . "', '{$me_memo}', '0000-00-00 00:00:00', '$me_id', 'send', '{$_SERVER['REMOTE_ADDR']}' ) ";
sql_query($sql);
$member_list['me_id'][$i] = $me_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 = "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) {

View file

@ -26,16 +26,16 @@ if ($kind == 'recv') {
$g5['title'] = $t . ' 쪽지 보기';
include_once G5_PATH . "/head.sub.php";
$sql = " select * from {$g5['memo_table']}
$sql = "SELECT * FROM {$g5['memo_table']}
where me_id = '$me_id'
and me_{$kind}_mb_id = '{$member['mb_id']}' ";
$memo = sql_fetch($sql);
// 이전 쪽지
$sql = " select * from {$g5['memo_table']}
$sql = "SELECT * FROM {$g5['memo_table']}
where me_id > '{$me_id}'
and me_{$kind}_mb_id = '{$member['mb_id']}'
order by me_id asc
ORDER BY me_id ASC
limit 1 ";
$prev = sql_fetch($sql);
if ($prev['me_id'])
@ -46,10 +46,10 @@ else
// 다음 쪽지
$sql = " select * from {$g5['memo_table']}
$sql = "SELECT * FROM {$g5['memo_table']}
where me_id < '{$me_id}'
and me_{$kind}_mb_id = '{$member['mb_id']}'
order by me_id desc
ORDER BY me_id DESC
limit 1 ";
$next = sql_fetch($sql);
if ($next['me_id'])

View file

@ -26,9 +26,9 @@ else {
}
}
//$sql = " select * from {$g5['board_table']} a, {$g5['group_table']} b where a.gr_id = b.gr_id and bo_table <> '$bo_table' ";
//$sql = "SELECT * FROM {$g5['board_table']} a, {$g5['group_table']} b where a.gr_id = b.gr_id and bo_table <> '$bo_table' ";
// 원본 게시판을 선택 할 수 있도록 함.
$sql = " select * from {$g5['board_table']} a, {$g5['group_table']} b where a.gr_id = b.gr_id ";
$sql = "SELECT * FROM {$g5['board_table']} a, {$g5['group_table']} b where a.gr_id = b.gr_id ";
if ($is_admin == 'group')
$sql .= " and b.gr_admin = '{$member['mb_id']}' ";
else if ($is_admin == 'board')

View file

@ -21,7 +21,7 @@ $cnt = 0;
$wr_id_list = preg_replace('/[^0-9\,]/', '', $_POST['wr_id_list']);
$sql = " select distinct wr_num from $write_table where wr_id in ({$wr_id_list}) order by wr_id ";
$sql = "SELECT distinct wr_num FROM $write_table where wr_id in ({$wr_id_list}) order by wr_id ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
$wr_num = $row['wr_num'];
@ -37,7 +37,7 @@ while ($row = sql_fetch_array($result)) {
$next_wr_num = get_next_num($move_write_table);
$sql2 = " select * from $write_table where wr_num = '$wr_num' order by wr_parent, wr_is_comment, wr_comment desc, wr_id ";
$sql2 = "SELECT * FROM $write_table where wr_num = '$wr_num' ORDER BY wr_parent, wr_is_comment, wr_comment DESC, wr_id ";
$result2 = sql_query($sql2);
while ($row2 = sql_fetch_array($result2)) {
$nick = cut_str($member['mb_nick'], $config['cf_cut_name']);
@ -60,7 +60,7 @@ while ($row = sql_fetch_array($result)) {
$wr_nogood = $row2['wr_nogood'];
}
$sql = " insert into $move_write_table
$sql = "INSERT INTO $move_write_table
set wr_num = '$next_wr_num',
wr_reply = '{$row2['wr_reply']}',
wr_is_comment = '{$row2['wr_is_comment']}',
@ -104,7 +104,7 @@ while ($row = sql_fetch_array($result)) {
if (!$row2['wr_is_comment']) {
$save_parent = $insert_id;
$sql3 = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' order by bf_no ";
$sql3 = "SELECT * FROM {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' order by bf_no ";
$result3 = sql_query($sql3);
for ($k = 0; $row3 = sql_fetch_array($result3); $k++) {
if ($row3['bf_file']) {
@ -113,7 +113,7 @@ while ($row = sql_fetch_array($result)) {
@chmod($dst_dir / $row3['bf_file'], G5_FILE_PERMISSION);
}
$sql = " insert into {$g5['board_file_table']}
$sql = "INSERT INTO {$g5['board_file_table']}
set bo_table = '$move_bo_table',
wr_id = '$insert_id',
bf_no = '{$row3['bf_no']}',
@ -136,24 +136,24 @@ while ($row = sql_fetch_array($result)) {
if ($sw == 'move' && $i == 0) {
// 스크랩 이동
sql_query(" update {$g5['scrap_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
sql_query("UPDATE {$g5['scrap_table']} SET bo_table = '$move_bo_table', wr_id = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
// 최신글 이동
sql_query(" update {$g5['board_new_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent', wr_parent = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
sql_query("UPDATE {$g5['board_new_table']} SET bo_table = '$move_bo_table', wr_id = '$save_parent', wr_parent = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
// 추천데이터 이동
sql_query(" update {$g5['board_good_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
sql_query("UPDATE {$g5['board_good_table']} SET bo_table = '$move_bo_table', wr_id = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
}
} else {
$count_comment++;
if ($sw == 'move') {
// 최신글 이동
sql_query(" update {$g5['board_new_table']} set bo_table = '$move_bo_table', wr_id = '$insert_id', wr_parent = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
sql_query("UPDATE {$g5['board_new_table']} SET bo_table = '$move_bo_table', wr_id = '$insert_id', wr_parent = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
}
}
sql_query(" update $move_write_table set wr_parent = '$save_parent' where wr_id = '$insert_id' ");
sql_query("UPDATE $move_write_table SET wr_parent = '$save_parent' where wr_id = '$insert_id' ");
if ($sw == 'move')
$save[$cnt]['wr_id'] = $row2['wr_parent'];
@ -163,8 +163,8 @@ while ($row = sql_fetch_array($result)) {
EventHandler::triggerEvent("gnuboard.bbs.move_copy", $row2, $move_bo_table, $insert_id, $next_wr_num, $sw);
}
sql_query(" update {$g5['board_table']} set bo_count_write = bo_count_write + '$count_write' where bo_table = '$move_bo_table' ");
sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment + '$count_comment' where bo_table = '$move_bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_count_write = bo_count_write + '$count_write' where bo_table = '$move_bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_count_comment = bo_count_comment + '$count_comment' where bo_table = '$move_bo_table' ");
delete_cache_latest($move_bo_table);
}
@ -184,7 +184,7 @@ if ($sw == 'move') {
sql_query(" delete from {$g5['board_new_table']} where bo_table = '$bo_table' and wr_id = '{$save[$i]['wr_id']}' ");
sql_query(" delete from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$save[$i]['wr_id']}' ");
}
sql_query(" update {$g5['board_table']} set bo_count_write = bo_count_write - '$save_count_write', bo_count_comment = bo_count_comment - '$save_count_comment' where bo_table = '$bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_count_write = bo_count_write - '$save_count_write', bo_count_comment = bo_count_comment - '$save_count_comment' where bo_table = '$bo_table' ");
}
$msg = '해당 게시물을 선택한 게시판으로 ' . $act . ' 하였습니다.';

View file

@ -26,7 +26,7 @@ $mb_id = substr(preg_replace('#[^a-z0-9_]#i', '', $mb_id), 0, 20);
if ($mb_id) {
$sql_common .= " and a.mb_id = '{$mb_id}' ";
}
$sql_order = " order by a.bn_id desc ";
$sql_order = " ORDER BY a.bn_id DESC ";
$sql = " select count(*) as cnt {$sql_common} ";
$row = sql_fetch($sql);
@ -39,7 +39,7 @@ if ($page < 1)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$group_select = '<label for="gr_id" class="sound_only">그룹</label><select name="gr_id" id="gr_id"><option value="">전체그룹';
$sql = " select gr_id, gr_subject from {$g5['group_table']} order by gr_id ";
$sql = "SELECT gr_id, gr_subject FROM {$g5['group_table']} order by gr_id ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$group_select .= "<option value=\"" . $row['gr_id'] . "\">" . $row['gr_subject'];
@ -57,7 +57,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 원글
$comment = "";
$comment_link = "";
$row2 = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
$row2 = sql_fetch("SELECT * FROM {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
$list[$i] = $row2;
$name = get_sideview($row2['mb_id'], get_text(cut_str($row2['wr_name'], $config['cf_cut_name'])), $row2['wr_email'], $row2['wr_homepage']);
@ -75,8 +75,8 @@ for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 코멘트
$comment = '[코] ';
$comment_link = '#c_' . $row['wr_id'];
$row2 = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_parent']}' ");
$row3 = sql_fetch(" select mb_id, wr_name, wr_email, wr_homepage, wr_datetime from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
$row2 = sql_fetch("SELECT * FROM {$tmp_write_table} where wr_id = '{$row['wr_parent']}' ");
$row3 = sql_fetch("SELECT mb_id, wr_name, wr_email, wr_homepage, wr_datetime FROM {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
$list[$i] = $row2;
$list[$i]['wr_id'] = $row['wr_id'];
$list[$i]['mb_id'] = $row3['mb_id'];

View file

@ -21,9 +21,9 @@ for ($i = 0; $i < count($_POST['chk_bn_id']); $i++) {
$write_table = $g5['write_prefix'] . $bo_table;
if ($board['bo_table'] != $bo_table)
$board = sql_fetch(" select bo_subject, bo_write_point, bo_comment_point, bo_notice from {$g5['board_table']} where bo_table = '$bo_table' ");
$board = sql_fetch("SELECT bo_subject, bo_write_point, bo_comment_point, bo_notice FROM {$g5['board_table']} where bo_table = '$bo_table' ");
$sql = " select * from $write_table where wr_id = '$wr_id' ";
$sql = "SELECT * FROM $write_table where wr_id = '$wr_id' ";
$write = sql_fetch($sql);
if (!$write)
continue;
@ -36,7 +36,7 @@ for ($i = 0; $i < count($_POST['chk_bn_id']); $i++) {
$reply = substr($write['wr_reply'], 0, $len);
// 나라오름님 수정 : 원글과 코멘트수가 정상적으로 업데이트 되지 않는 오류를 잡아 주셨습니다.
$sql = " select wr_id, mb_id, wr_is_comment from $write_table where wr_parent = '{$write['wr_id']}' order by wr_id ";
$sql = "SELECT wr_id, mb_id, wr_is_comment FROM $write_table where wr_parent = '{$write['wr_id']}' order by wr_id ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
// 원글이라면
@ -45,7 +45,7 @@ for ($i = 0; $i < count($_POST['chk_bn_id']); $i++) {
insert_point($row['mb_id'], $board['bo_write_point'] * (-1), "{$board['bo_subject']} {$row['wr_id']} 글삭제");
// 업로드된 파일이 있다면 파일삭제
$sql2 = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' ";
$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 . '/' . $row2['bf_file']);
@ -65,7 +65,7 @@ for ($i = 0; $i < count($_POST['chk_bn_id']); $i++) {
if ($pressed == '선택내용삭제') {
// 게시글 내용만 삭제
sql_query(" update $write_table set wr_subject = '{$g5['time_ymdhis']} - 본인 요청으로 인한 삭제 (냉무) ☆', wr_content = '', wr_name='본인요청삭제☆' where wr_id = '{$write['wr_id']}' ");
sql_query("UPDATE $write_table SET wr_subject = '{$g5['time_ymdhis']} - 본인 요청으로 인한 삭제 (냉무) ☆', wr_content = '', wr_name='본인요청삭제☆' where wr_id = '{$write['wr_id']}' ");
} else {
// 게시글 삭제
sql_query(" delete from $write_table where wr_parent = '{$write['wr_id']}' ");
@ -89,12 +89,12 @@ for ($i = 0; $i < count($_POST['chk_bn_id']); $i++) {
$lf = ',';
}
$bo_notice = trim($bo_notice);
sql_query(" update {$g5['board_table']} set bo_notice = '$bo_notice' where bo_table = '$bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_notice = '$bo_notice' where bo_table = '$bo_table' ");
if ($pressed == '선택삭제') {
// 글숫자 감소
if ($count_write > 0 || $count_comment > 0) {
sql_query(" update {$g5['board_table']} set bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' where bo_table = '$bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' where bo_table = '$bo_table' ");
}
}
} else // 코멘트 삭제
@ -120,14 +120,14 @@ for ($i = 0; $i < count($_POST['chk_bn_id']); $i++) {
sql_query(" delete from $write_table where wr_id = '$comment_id' ");
// 코멘트가 삭제되므로 해당 게시물에 대한 최근 시간을 다시 얻는다.
$sql = " select max(wr_datetime) as wr_last from $write_table where wr_parent = '{$write['wr_parent']}' ";
$sql = "SELECT max(wr_datetime) as wr_last FROM $write_table where wr_parent = '{$write['wr_parent']}' ";
$row = sql_fetch($sql);
// 원글의 코멘트 숫자를 감소
sql_query(" update $write_table set wr_comment = wr_comment - 1, wr_last = '{$row['wr_last']}' where wr_id = '{$write['wr_parent']}' ");
sql_query("UPDATE $write_table SET wr_comment = wr_comment - 1, wr_last = '{$row['wr_last']}' where wr_id = '{$write['wr_parent']}' ");
// 코멘트 숫자 감소
sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment - 1 where bo_table = '$bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_count_comment = bo_count_comment - 1 where bo_table = '$bo_table' ");
// 새글 삭제
sql_query(" delete from {$g5['board_new_table']} where bo_table = '$bo_table' and wr_id = '$comment_id' ");

View file

@ -2,10 +2,10 @@
if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가
$sql = " select * from {$g5['new_win_table']}
$sql = "SELECT * FROM {$g5['new_win_table']}
where '" . G5_TIME_YMDHIS . "' between nw_begin_time and nw_end_time
and nw_device IN ( 'both', 'pc' )
order by nw_id asc ";
ORDER BY nw_id ASC ";
$result = sql_query($sql, false);
?>

View file

@ -16,7 +16,7 @@ switch ($w) {
case 'x':
set_session('ss_delete_comment_' . $comment_id . '_token', $token = uniqid(time()));
$action = './delete_comment.php?token=' . $token;
$row = sql_fetch(" select wr_parent from $write_table where wr_id = '$comment_id' ");
$row = sql_fetch("SELECT wr_parent FROM $write_table where wr_id = '$comment_id' ");
$return_url = './board.php?bo_table=' . $bo_table . '&amp;wr_id=' . $row['wr_parent'];
break;
case 's':
@ -56,7 +56,7 @@ include_once(G5_PATH . '/head.sub.php');
//if ($board['bo_content_head']) { echo stripslashes($board['bo_content_head']); }
/* 비밀글의 제목을 가져옴 지운아빠 2013-01-29 */
$sql = " select wr_subject from {$write_table}
$sql = "SELECT wr_subject FROM {$write_table}
where wr_num = '{$write['wr_num']}'
and wr_reply = ''
and wr_is_comment = 0 ";

View file

@ -60,7 +60,7 @@ if ($w == 's') {
} else if ($w == 'bs') {
$qstr = 'bo_table=' . $bo_table . '&amp;sfl=' . $sfl . '&amp;stx=' . $stx . '&amp;sop=' . $sop . '&amp;wr_id=' . $wr_id . '&amp;page=' . $page;
$bo = sql_fetch("select bo_pass from {$g5['board_table']} where bo_table='{$bo_table}'");
$bo = sql_fetch("SELECT bo_pass FROM {$g5['board_table']} where bo_table='{$bo_table}'");
$pw = get_encrypt_string($bo['bo_pass']);
if (!check_password($wr_password, $pw)) {
EventHandler::triggerEvent("gnuboard.member.password_is_wrong", 'bbs', $wr, $qstr);

View file

@ -16,12 +16,12 @@ $email = trim($_POST['mb_email']);
if (!$email)
alert_close('메일주소 오류입니다.');
$sql = " select count(*) as cnt from {$g5['member_table']} where mb_email = '$email' ";
$sql = "SELECT count(*) as cnt FROM {$g5['member_table']} where mb_email = '$email' ";
$row = sql_fetch($sql);
if ($row['cnt'] > 1)
alert('동일한 메일주소가 2개 이상 존재합니다.\\n\\n관리자에게 문의하여 주십시오.');
$sql = " select mb_no, mb_id, mb_name, mb_nick, mb_email, mb_datetime from {$g5['member_table']} where mb_email = '$email' ";
$sql = "SELECT mb_no, mb_id, mb_name, mb_nick, mb_email, mb_datetime FROM {$g5['member_table']} where mb_email = '$email' ";
$mb = sql_fetch($sql);
if (!$mb['mb_id'])
alert('존재하지 않는 회원입니다.');
@ -36,7 +36,7 @@ $mb_lost_certify = get_encrypt_string($change_password);
$mb_nonce = md5(pack('V*', rand(), rand(), rand(), rand()));
// 임시비밀번호와 난수를 mb_lost_certify 필드에 저장
$sql = " update {$g5['member_table']} set mb_lost_certify = '$mb_nonce $mb_lost_certify' where mb_id = '{$mb['mb_id']}' ";
$sql = "UPDATE {$g5['member_table']} SET mb_lost_certify = '$mb_nonce $mb_lost_certify' where mb_id = '{$mb['mb_id']}' ";
sql_query($sql);
// 인증 링크 생성

View file

@ -14,18 +14,18 @@ $mb_no = trim($_GET['mb_no']);
$mb_nonce = trim($_GET['mb_nonce']);
// 회원아이디가 아닌 회원고유번호로 회원정보를 구한다.
$sql = " select mb_id, mb_lost_certify from {$g5['member_table']} where mb_no = '$mb_no' ";
$sql = "SELECT mb_id, mb_lost_certify FROM {$g5['member_table']} where mb_no = '$mb_no' ";
$mb = sql_fetch($sql);
if (strlen($mb['mb_lost_certify']) < 33)
die("Error");
// 인증 링크는 한번만 처리가 되게 한다.
sql_query(" update {$g5['member_table']} set mb_lost_certify = '' where mb_no = '$mb_no' ");
sql_query("UPDATE {$g5['member_table']} SET mb_lost_certify = '' where mb_no = '$mb_no' ");
// 인증을 위한 난수가 제대로 넘어온 경우 임시비밀번호를 실제 비밀번호로 바꿔준다.
if ($mb_nonce === substr($mb['mb_lost_certify'], 0, 32)) {
$new_password_hash = substr($mb['mb_lost_certify'], 33);
sql_query(" update {$g5['member_table']} set mb_password = '$new_password_hash' where mb_no = '$mb_no' ");
sql_query("UPDATE {$g5['member_table']} SET mb_password = '$new_password_hash' where mb_no = '$mb_no' ");
EventHandler::triggerEvent("gnuboard.member.password_lost_certify_after", $mb, $mb_nonce);

View file

@ -10,7 +10,7 @@ include_once(G5_PATH . '/head.sub.php');
$list = [];
$sql_common = " from {$g5['point_table']} where mb_id = '" . escape_trim($member['mb_id']) . "' ";
$sql_order = " order by po_id desc ";
$sql_order = " ORDER BY po_id DESC ";
$sql = " select count(*) as cnt {$sql_common} ";
$row = sql_fetch($sql);

View file

@ -7,14 +7,14 @@ if ($w == '') {
$pc_name = $_POST['pc_name'];
$pc_idea = $_POST['pc_idea'];
$po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '{$po_id}' ");
$po = sql_fetch("SELECT * FROM {$g5['poll_table']} where po_id = '{$po_id}' ");
if (!$po['po_id'])
alert('po_id 값이 제대로 넘어오지 않았습니다.');
$tmp_row = sql_fetch(" select max(pc_id) as max_pc_id from {$g5['poll_etc_table']} ");
$tmp_row = sql_fetch("SELECT max(pc_id) as max_pc_id FROM {$g5['poll_etc_table']} ");
$pc_id = $tmp_row['max_pc_id'] + 1;
$sql = " insert into {$g5['poll_etc_table']}
$sql = "INSERT INTO {$g5['poll_etc_table']}
( pc_id, po_id, mb_id, pc_name, pc_idea, pc_datetime )
values ( '{$pc_id}', '{$po_id}', '{$member['mb_id']}', '{$pc_name}', '{$pc_idea}', '" . G5_TIME_YMDHIS . "' ) ";
sql_query($sql);

View file

@ -2,7 +2,7 @@
include_once "./_common.php";
include_once(G5_CAPTCHA_PATH . '/captcha.lib.php');
$po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '{$po_id}' ");
$po = sql_fetch("SELECT * FROM {$g5['poll_table']} where po_id = '{$po_id}' ");
if (!$po['po_id'])
alert('설문조사 정보가 없습니다.');
@ -53,7 +53,7 @@ $list2 = [];
$sql = " select a.*, b.mb_open
from {$g5['poll_etc_table']} a
left join {$g5['member_table']} b on (a.mb_id = b.mb_id)
where po_id = '{$po_id}' order by pc_id desc ";
where po_id = '{$po_id}' ORDER BY pc_id DESC ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$list2[$i]['pc_name'] = get_text($row['pc_name']);
@ -80,7 +80,7 @@ if ($po['po_etc']) {
$list3 = [];
// 다른투표
$sql = " select po_id, po_subject, po_date from {$g5['poll_table']} order by po_id desc ";
$sql = "SELECT po_id, po_subject, po_date FROM {$g5['poll_table']} ORDER BY po_id DESC ";
$result = sql_query($sql);
for ($i = 0; $row2 = sql_fetch_array($result); $i++) {
$list3[$i]['po_id'] = $row2['po_id'];

View file

@ -1,7 +1,7 @@
<?php
include_once "./_common.php";
$po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '{$_POST['po_id']}' ");
$po = sql_fetch("SELECT * FROM {$g5['poll_table']} where po_id = '{$_POST['po_id']}' ");
if (!$po['po_id'])
alert('po_id 값이 제대로 넘어오지 않았습니다.');
@ -43,9 +43,9 @@ if (!($search_ip || $search_mb_id)) {
$mb_ids = $po['mb_ids'];
if ($is_member) { // 회원일 때는 id만 추가
$mb_ids .= $member['mb_id'] . ',';
$sql = " update {$g5['poll_table']} set po_cnt{$gb_poll} = po_cnt{$gb_poll} + 1, mb_ids = '$mb_ids' where po_id = '$po_id' ";
$sql = "UPDATE {$g5['poll_table']} SET po_cnt{$gb_poll} = po_cnt{$gb_poll} + 1, mb_ids = '$mb_ids' where po_id = '$po_id' ";
} else {
$sql = " update {$g5['poll_table']} set po_cnt{$gb_poll} = po_cnt{$gb_poll} + 1, po_ips = '$po_ips' where po_id = '$po_id' ";
$sql = "UPDATE {$g5['poll_table']} SET po_cnt{$gb_poll} = po_cnt{$gb_poll} + 1, po_ips = '$po_ips' where po_id = '$po_id' ";
}
sql_query($sql);

View file

@ -58,7 +58,7 @@ for ($i = 0; $i < $count; $i++) {
// 답변이 있는 질문글이라면 답변글 삭제
if (!$row['qa_type'] && $row['qa_status']) {
$answer = sql_fetch(" SELECT qa_id, qa_content, qa_file1, qa_file2 from {$g5['qa_content_table']} where qa_type = 1 AND qa_parent = {$qa_id} ");
$answer = sql_fetch("SELECT qa_id, qa_content, qa_file1, qa_file2 FROM {$g5['qa_content_table']} where qa_type = 1 AND qa_parent = {$qa_id} ");
// 첨부파일 삭제
for ($k = 1; $k <= 2; $k++) {
@unlink(G5_DATA_PATH . '/qa/' . clean_relative_paths($answer['qa_file' . $k]));
@ -78,7 +78,7 @@ for ($i = 0; $i < $count; $i++) {
// 답변글 삭제시 질문글의 상태변경
if ($row['qa_type']) {
sql_query(" update {$g5['qa_content_table']} set qa_status = '0' where qa_id = '{$row['qa_parent']}' ");
sql_query("UPDATE {$g5['qa_content_table']} SET qa_status = '0' where qa_id = '{$row['qa_parent']}' ");
}
// 글삭제

View file

@ -11,7 +11,7 @@ $no = (int) $no;
if (!get_session('ss_qa_view_' . $qa_id))
alert('잘못된 접근입니다.');
$sql = " select qa_subject, qa_file{$no}, qa_source{$no} from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
$sql = "SELECT qa_subject, qa_file{$no}, qa_source{$no} FROM {$g5['qa_content_table']} where qa_id = '$qa_id' ";
$file = sql_fetch($sql);
if (!$file['qa_file' . $no])
alert_close('파일 정보가 존재하지 않습니다.');

View file

@ -13,7 +13,7 @@ include_once "./qahead.php";
$skin_file = $qa_skin_path . '/view.skin.php';
if (is_file($skin_file)) {
$sql = " select * from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
$sql = "SELECT * FROM {$g5['qa_content_table']} where qa_id = '$qa_id' ";
if (!$is_admin) {
$sql .= " and mb_id = '{$member['mb_id']}' ";
}
@ -48,7 +48,7 @@ if (is_file($skin_file)) {
}
// 이전글
$prev_search = " and qa_num < '{$view['qa_num']}' order by qa_num desc limit 1 ";
$prev_search = " and qa_num < '{$view['qa_num']}' ORDER BY qa_num DESC limit 1 ";
$prev = sql_fetch($sql . $prev_search);
$prev_href = '';
@ -58,7 +58,7 @@ if (is_file($skin_file)) {
}
// 다음글
$next_search = " and qa_num > '{$view['qa_num']}' order by qa_num asc limit 1 ";
$next_search = " and qa_num > '{$view['qa_num']}' ORDER BY qa_num ASC limit 1 ";
$next = sql_fetch($sql . $next_search);
$next_href = '';

View file

@ -24,7 +24,7 @@ if (is_file($skin_file)) {
==========================*/
if ($w == 'u' || $w == 'r') {
$sql = " select * from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
$sql = "SELECT * FROM {$g5['qa_content_table']} WHERE qa_id = '$qa_id' ";
if (!$is_admin) {
$sql .= " and mb_id = '{$member['mb_id']}' ";
}

View file

@ -83,7 +83,7 @@ if ($w == 'u' || $w == 'a' || $w == 'r') {
if ($w == 'a' && !$is_admin)
alert('답변은 관리자만 등록할 수 있습니다.');
$sql = " select * from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
$sql = "SELECT * FROM {$g5['qa_content_table']} where qa_id = '$qa_id' ";
if (!$is_admin) {
$sql .= " and mb_id = '{$member['mb_id']}' ";
}
@ -221,7 +221,7 @@ for ($i = 1; $i <= count($_FILES['bf_file']['name']); $i++) {
if ($w == '' || $w == 'a' || $w == 'r') {
if ($w == '' || $w == 'r') {
$row = sql_fetch(" select MIN(qa_num) as min_qa_num from {$g5['qa_content_table']} ");
$row = sql_fetch("SELECT MIN(qa_num) as min_qa_num FROM {$g5['qa_content_table']} ");
$qa_num = $row['min_qa_num'] - 1;
}
@ -234,7 +234,7 @@ if ($w == '' || $w == 'a' || $w == 'r') {
$qa_status = 1;
}
$sql = " insert into {$g5['qa_content_table']}
$sql = "INSERT INTO {$g5['qa_content_table']}
set qa_num = '$qa_num',
mb_id = '{$member['mb_id']}',
qa_name = '" . addslashes($member['mb_nick']) . "',

View file

@ -6,7 +6,7 @@ $g5['title'] = '메일인증 메일주소 변경';
include_once "./_head.php";
$mb_id = substr(clean_xss_tags($_GET['mb_id']), 0, 20);
$sql = " select mb_email, mb_datetime, mb_ip, mb_email_certify from {$g5['member_table']} where mb_id = '{$mb_id}' ";
$sql = "SELECT mb_email, mb_datetime, mb_ip, mb_email_certify FROM {$g5['member_table']} where mb_id = '{$mb_id}' ";
$mb = sql_fetch($sql);
if (substr($mb['mb_email_certify'], 0, 1) != 0) {
alert("이미 메일인증 하신 회원입니다.", G5_URL);

View file

@ -9,7 +9,7 @@ $mb_email = get_email_address(trim($_POST['mb_email']));
if (!$mb_id || !$mb_email)
alert('올바른 방법으로 이용해 주십시오.', G5_URL);
$sql = " select mb_name from {$g5['member_table']} where mb_id = '{$mb_id}' and substring(mb_email_certify, 1, 1) = '0' ";
$sql = "SELECT mb_name FROM {$g5['member_table']} where mb_id = '{$mb_id}' and substring(mb_email_certify, 1, 1) = '0' ";
$mb = sql_fetch($sql);
if (!$mb) {
alert("이미 메일인증 하신 회원입니다.", G5_URL);
@ -19,7 +19,7 @@ if (!chk_captcha()) {
alert('자동등록방지 숫자가 틀렸습니다.');
}
$sql = " select count(*) as cnt from {$g5['member_table']} where mb_id <> '{$mb_id}' and mb_email = '$mb_email' ";
$sql = "SELECT count(*) as cnt FROM {$g5['member_table']} where mb_id <> '{$mb_id}' and mb_email = '$mb_email' ";
$row = sql_fetch($sql);
if ($row['cnt']) {
alert("{$mb_email} 메일은 이미 존재하는 메일주소 입니다.\\n\\n다른 메일주소를 입력해 주십시오.");
@ -33,7 +33,7 @@ $mb_name = $mb['mb_name'];
// 어떠한 회원정보도 포함되지 않은 일회용 난수를 생성하여 인증에 사용
$mb_md5 = md5(pack('V*', rand(), rand(), rand(), rand()));
sql_query(" update {$g5['member_table']} set mb_email_certify2 = '$mb_md5' where mb_id = '$mb_id' ");
sql_query("UPDATE {$g5['member_table']} SET mb_email_certify2 = '$mb_md5' where mb_id = '$mb_id' ");
$certify_href = G5_BBS_URL . '/email_certify.php?mb_id=' . $mb_id . '&amp;mb_md5=' . $mb_md5;
@ -44,7 +44,7 @@ ob_end_clean();
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb_email, $subject, $content, 1);
$sql = " update {$g5['member_table']} set mb_email = '$mb_email' where mb_id = '$mb_id' ";
$sql = "UPDATE {$g5['member_table']} SET mb_email = '$mb_email' where mb_id = '$mb_id' ";
sql_query($sql);
alert("인증메일을 {$mb_email} 메일로 다시 보내 드렸습니다.\\n\\n잠시후 {$mb_email} 메일을 확인하여 주십시오.", G5_URL);

View file

@ -174,7 +174,7 @@ if ($w == '' || $w == 'u') {
/*$mb_hp = hyphen_hp_number($mb_hp);
if($config['cf_cert_use'] && $_SESSION['ss_cert_type'] && $_SESSION['ss_cert_dupinfo']) {
// 중복체크
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$_SESSION['ss_cert_dupinfo']}' ";
$sql = "SELECT mb_id FROM {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$_SESSION['ss_cert_dupinfo']}' ";
$row = sql_fetch($sql);
if ($row['mb_id']) {
alert("입력하신 본인확인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']);
@ -214,7 +214,7 @@ if ($config['cf_cert_use'] && $cert_type && $md5_cert_no) {
//===============================================================
if ($w == '') {
$sql = " insert into {$g5['member_table']}
$sql = "INSERT INTO {$g5['member_table']}
set mb_id = '{$mb_id}',
mb_password = '" . get_encrypt_string($mb_password) . "',
mb_name = '{$mb_name}',
@ -273,7 +273,7 @@ if ($w == '') {
// 어떠한 회원정보도 포함되지 않은 일회용 난수를 생성하여 인증에 사용
if ($config['cf_use_email_certify']) {
$mb_md5 = md5(pack('V*', rand(), rand(), rand(), rand()));
sql_query(" update {$g5['member_table']} set mb_email_certify2 = '$mb_md5' where mb_id = '$mb_id' ");
sql_query("UPDATE {$g5['member_table']} SET mb_email_certify2 = '$mb_md5' where mb_id = '$mb_id' ");
$certify_href = G5_BBS_URL . '/email_certify.php?mb_id=' . $mb_id . '&amp;mb_md5=' . $mb_md5;
}
@ -426,7 +426,7 @@ if ($config['cf_use_email_certify'] && $old_email != $mb_email) {
// 어떠한 회원정보도 포함되지 않은 일회용 난수를 생성하여 인증에 사용
$mb_md5 = md5(pack('V*', rand(), rand(), rand(), rand()));
sql_query(" update {$g5['member_table']} set mb_email_certify2 = '$mb_md5' where mb_id = '$mb_id' ");
sql_query("UPDATE {$g5['member_table']} SET mb_email_certify2 = '$mb_md5' where mb_id = '$mb_id' ");
$certify_href = G5_BBS_URL . '/email_certify.php?mb_id=' . $mb_id . '&amp;mb_md5=' . $mb_md5;
@ -458,7 +458,7 @@ EventHandler::triggerEvent("gnuboard.member.register_form_update_after", $mb_id,
if ($w == '') {
goto_url(G5_HTTP_BBS_URL . '/register_result.php');
} else if ($w == 'u') {
$row = sql_fetch(" select mb_password from {$g5['member_table']} where mb_id = '{$member['mb_id']}' ");
$row = sql_fetch("SELECT mb_password FROM {$g5['member_table']} where mb_id = '{$member['mb_id']}' ");
$tmp_password = $row['mb_password'];
if ($old_email != $mb_email && $config['cf_use_email_certify']) {

View file

@ -19,7 +19,7 @@ function specialchars_replace($str, $len = 0)
return $str;
}
$sql = " select gr_id, bo_subject, bo_page_rows, bo_read_level, bo_use_rss_view from {$g5['board_table']} where bo_table = '$bo_table' ";
$sql = "SELECT gr_id, bo_subject, bo_page_rows, bo_read_level, bo_use_rss_view FROM {$g5['board_table']} where bo_table = '$bo_table' ";
$row = sql_fetch($sql);
$subj2 = specialchars_replace($row['bo_subject'], 255);
$lines = $row['bo_page_rows'];
@ -40,7 +40,7 @@ header('Content-type: text/xml');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
$sql = " select gr_subject from {$g5['group_table']} where gr_id = '{$row['gr_id']}' ";
$sql = "SELECT gr_subject FROM {$g5['group_table']} where gr_id = '{$row['gr_id']}' ";
$row = sql_fetch($sql);
$subj1 = specialchars_replace($row['gr_subject'], 255);

View file

@ -8,7 +8,7 @@ $g5['title'] = get_text($member['mb_nick']) . '님의 스크랩';
include_once(G5_PATH . '/head.sub.php');
$sql_common = " from {$g5['scrap_table']} where mb_id = '{$member['mb_id']}' ";
$sql_order = " order by ms_id desc ";
$sql_order = " ORDER BY ms_id DESC ";
$sql = " select count(*) as cnt $sql_common ";
$row = sql_fetch($sql);
@ -35,14 +35,14 @@ for ($i = 0; $row = sql_fetch_array($result); $i++) {
$num = $total_count - ($page - 1) * $rows - $i;
// 게시판 제목
$sql2 = " select bo_subject from {$g5['board_table']} where bo_table = '{$row['bo_table']}' ";
$sql2 = "SELECT bo_subject FROM {$g5['board_table']} where bo_table = '{$row['bo_table']}' ";
$row2 = sql_fetch($sql2);
if (!$row2['bo_subject'])
$row2['bo_subject'] = '[게시판 없음]';
// 게시물 제목
$tmp_write_table = $g5['write_prefix'] . $row['bo_table'];
$sql3 = " select wr_subject from $tmp_write_table where wr_id = '{$row['wr_id']}' ";
$sql3 = "SELECT wr_subject FROM $tmp_write_table where wr_id = '{$row['wr_id']}' ";
$row3 = sql_fetch($sql3, FALSE);
$subject = get_text(cut_str($row3['wr_subject'], 100));
if (!$row3['wr_subject'])

View file

@ -32,7 +32,7 @@ HEREDOC;
if ($write['wr_is_comment'])
alert_close('코멘트는 스크랩 할 수 없습니다.');
$sql = " select count(*) as cnt from {$g5['scrap_table']}
$sql = "SELECT count(*) as cnt FROM {$g5['scrap_table']}
where mb_id = '{$member['mb_id']}'
and bo_table = '$bo_table'
and wr_id = '$wr_id' ";

View file

@ -13,7 +13,7 @@ if (!$is_member) {
if (!$write['wr_id'])
alert_close('스크랩하시려는 게시글이 존재하지 않습니다.');
$sql = " select count(*) as cnt from {$g5['scrap_table']}
$sql = "SELECT count(*) as cnt FROM {$g5['scrap_table']}
where mb_id = '{$member['mb_id']}'
and bo_table = '$bo_table'
and wr_id = '$wr_id' ";
@ -47,12 +47,12 @@ if ($wr_content && ($member['mb_level'] >= $board['bo_comment_level'])) {
$wr_email = addslashes($member['mb_email']);
$wr_homepage = addslashes(clean_xss_tags($member['mb_homepage']));
$sql = " select max(wr_comment) as max_comment from $write_table
$sql = "SELECT max(wr_comment) as max_comment FROM $write_table
where wr_parent = '$wr_id' and wr_is_comment = '1' ";
$row = sql_fetch($sql);
$row['max_comment'] += 1;
$sql = " insert into $write_table
$sql = "INSERT INTO $write_table
set ca_name = '{$wr['ca_name']}',
wr_option = '',
wr_num = '{$wr['wr_num']}',
@ -73,20 +73,20 @@ if ($wr_content && ($member['mb_level'] >= $board['bo_comment_level'])) {
$comment_id = sql_insert_id();
// 원글에 코멘트수 증가
sql_query(" update $write_table set wr_comment = wr_comment + 1 where wr_id = '$wr_id' ");
sql_query("UPDATE $write_table SET wr_comment = wr_comment + 1 where wr_id = '$wr_id' ");
// 새글 INSERT
sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '" . G5_TIME_YMDHIS . "', '{$member['mb_id']}' ) ");
sql_query("INSERT INTO {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '" . G5_TIME_YMDHIS . "', '{$member['mb_id']}' ) ");
// 코멘트 1 증가
sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' ");
// 포인트 부여
insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id}-{$comment_id} 코멘트쓰기", $bo_table, $comment_id, '코멘트');
}
}
$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 = "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);
delete_cache_latest($bo_table);

View file

@ -24,7 +24,7 @@ if ($stx) {
$g5_search['tables'] = [];
$g5_search['read_level'] = [];
$sql = " select gr_id, bo_table, bo_read_level from {$g5['board_table']} where bo_use_search = 1 and bo_list_level <= '{$member['mb_level']}' ";
$sql = "SELECT gr_id, bo_table, bo_read_level FROM {$g5['board_table']} where bo_use_search = 1 and bo_list_level <= '{$member['mb_level']}' ";
if ($gr_id)
$sql .= " and gr_id = '{$gr_id}' ";
$onetable = isset($onetable) ? preg_replace('/[^a-z0-9_]/i', '', $onetable) : '';
@ -35,7 +35,7 @@ if ($stx) {
for ($i = 0; $row = sql_fetch_array($result); $i++) {
if ($is_admin != 'super') {
// 그룹접근 사용에 대한 검색 차단
$sql2 = " select gr_use_access, gr_admin from {$g5['group_table']} where gr_id = '{$row['gr_id']}' ";
$sql2 = "SELECT gr_use_access, gr_admin FROM {$g5['group_table']} where gr_id = '{$row['gr_id']}' ";
$row2 = sql_fetch($sql2);
// 그룹접근을 사용한다면
if ($row2['gr_use_access']) {
@ -43,7 +43,7 @@ if ($stx) {
if ($row2['gr_admin'] && $row2['gr_admin'] == $member['mb_id']) {
;
} else {
$sql3 = " select count(*) as cnt from {$g5['group_member_table']} where gr_id = '{$row['gr_id']}' and mb_id = '{$member['mb_id']}' and mb_id <> '' ";
$sql3 = "SELECT count(*) as cnt FROM {$g5['group_member_table']} where gr_id = '{$row['gr_id']}' and mb_id = '{$member['mb_id']}' and mb_id <> '' ";
$row3 = sql_fetch($sql3);
if (!$row3['cnt'])
continue;
@ -119,7 +119,7 @@ if ($stx) {
for ($i = 0; $i < count($g5_search['tables']); $i++) {
$tmp_write_table = $g5['write_prefix'] . $g5_search['tables'][$i];
$sql = " select wr_id from {$tmp_write_table} where {$sql_search} ";
$sql = "SELECT wr_id FROM {$tmp_write_table} where {$sql_search} ";
$result = sql_query($sql, false);
$row['cnt'] = @sql_num_rows($result);
@ -130,7 +130,7 @@ if ($stx) {
$read_level[] = $g5_search['read_level'][$i];
$search_table_count[] = $total_count;
$sql2 = " select bo_subject, bo_mobile_subject from {$g5['board_table']} where bo_table = '{$g5_search['tables'][$i]}' ";
$sql2 = "SELECT bo_subject, bo_mobile_subject FROM {$g5['board_table']} where bo_table = '{$g5_search['tables'][$i]}' ";
$row2 = sql_fetch($sql2);
$sch_class = "";
$sch_all = "";
@ -162,13 +162,13 @@ if ($stx) {
$k = 0;
for ($idx = $table_index; $idx < count($search_table); $idx++) {
$sql = " select bo_subject, bo_mobile_subject from {$g5['board_table']} where bo_table = '{$search_table[$idx]}' ";
$sql = "SELECT bo_subject, bo_mobile_subject FROM {$g5['board_table']} where bo_table = '{$search_table[$idx]}' ";
$row = sql_fetch($sql);
$bo_subject[$idx] = ((G5_IS_MOBILE && $row['bo_mobile_subject']) ? $row['bo_mobile_subject'] : $row['bo_subject']);
$tmp_write_table = $g5['write_prefix'] . $search_table[$idx];
$sql = " select * from {$tmp_write_table} where {$sql_search} order by wr_id desc limit {$from_record}, {$rows} ";
$sql = "SELECT * FROM {$tmp_write_table} where {$sql_search} ORDER BY wr_id DESC limit {$from_record}, {$rows} ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 검색어까지 링크되면 게시판 부하가 일어남
@ -176,7 +176,7 @@ if ($stx) {
$list[$idx][$i]['href'] = './board.php?bo_table=' . $search_table[$idx] . '&amp;wr_id=' . $row['wr_parent'];
if ($row['wr_is_comment']) {
$sql2 = " select wr_subject, wr_option from {$tmp_write_table} where wr_id = '{$row['wr_parent']}' ";
$sql2 = "SELECT wr_subject, wr_option FROM {$tmp_write_table} where wr_id = '{$row['wr_parent']}' ";
$row2 = sql_fetch($sql2);
//$row['wr_subject'] = $row2['wr_subject'];
$row['wr_subject'] = get_text($row2['wr_subject']);
@ -223,7 +223,7 @@ if ($stx) {
}
$group_select = '<label for="gr_id" class="sound_only">게시판 그룹선택</label><select name="gr_id" id="gr_id" class="select"><option value="">전체 분류';
$sql = " select gr_id, gr_subject from {$g5['group_table']} order by gr_id ";
$sql = "SELECT gr_id, gr_subject FROM {$g5['group_table']} order by gr_id ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++)
$group_select .= "<option value=\"" . $row['gr_id'] . "\"" . get_selected($_GET['gr_id'], $row['gr_id']) . ">" . $row['gr_subject'] . "</option>";

View file

@ -26,20 +26,20 @@ if (!$board['bo_use_list_view']) {
$sql_search = " and " . $sql_search;
// 윗글을 얻음
$sql = " select wr_id, wr_subject from {$write_table} where wr_is_comment = 0 and wr_num = '{$write['wr_num']}' and wr_reply < '{$write['wr_reply']}' {$sql_search} order by wr_num desc, wr_reply desc limit 1 ";
$sql = "SELECT wr_id, wr_subject FROM {$write_table} where wr_is_comment = 0 and wr_num = '{$write['wr_num']}' and wr_reply < '{$write['wr_reply']}' {$sql_search} ORDER BY wr_num DESC, wr_reply desc limit 1 ";
$prev = sql_fetch($sql);
// 위의 쿼리문으로 값을 얻지 못했다면
if (!$prev['wr_id']) {
$sql = " select wr_id, wr_subject from {$write_table} where wr_is_comment = 0 and wr_num < '{$write['wr_num']}' {$sql_search} order by wr_num desc, wr_reply desc limit 1 ";
$sql = "SELECT wr_id, wr_subject FROM {$write_table} where wr_is_comment = 0 and wr_num < '{$write['wr_num']}' {$sql_search} ORDER BY wr_num DESC, wr_reply desc limit 1 ";
$prev = sql_fetch($sql);
}
// 아래글을 얻음
$sql = " select wr_id, wr_subject from {$write_table} where wr_is_comment = 0 and wr_num = '{$write['wr_num']}' and wr_reply > '{$write['wr_reply']}' {$sql_search} order by wr_num, wr_reply limit 1 ";
$sql = "SELECT wr_id, wr_subject FROM {$write_table} where wr_is_comment = 0 and wr_num = '{$write['wr_num']}' and wr_reply > '{$write['wr_reply']}' {$sql_search} order by wr_num, wr_reply limit 1 ";
$next = sql_fetch($sql);
// 위의 쿼리문으로 값을 얻지 못했다면
if (!$next['wr_id']) {
$sql = " select wr_id, wr_subject from {$write_table} where wr_is_comment = 0 and wr_num > '{$write['wr_num']}' {$sql_search} order by wr_num, wr_reply limit 1 ";
$sql = "SELECT wr_id, wr_subject FROM {$write_table} where wr_is_comment = 0 and wr_num > '{$write['wr_num']}' {$sql_search} order by wr_num, wr_reply limit 1 ";
$next = sql_fetch($sql);
}
}

View file

@ -17,8 +17,8 @@ if ($member['mb_level'] >= $board['bo_comment_level'])
$is_comment_write = true;
// 코멘트 출력
//$sql = " select * from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";
$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
//$sql = "SELECT * FROM {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 ORDER BY wr_comment DESC, wr_comment_reply ";
$sql = "SELECT * FROM $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$list[$i] = $row;

View file

@ -6,7 +6,7 @@ if (!defined('_GNUBOARD_'))
if (get_cookie('ck_visit_ip') != $_SERVER['REMOTE_ADDR']) {
set_cookie('ck_visit_ip', $_SERVER['REMOTE_ADDR'], 86400); // 하루동안 저장
$tmp_row = sql_fetch(" select max(vi_id) as max_vi_id from {$g5['visit_table']} ");
$tmp_row = sql_fetch("SELECT max(vi_id) as max_vi_id FROM {$g5['visit_table']} ");
$vi_id = $tmp_row['max_vi_id'] + 1;
// $_SERVER 배열변수 값의 변조를 이용한 SQL Injection 공격을 막는 코드입니다. 110810
@ -31,7 +31,7 @@ if (get_cookie('ck_visit_ip') != $_SERVER['REMOTE_ADDR']) {
// DUPLICATE 오류가 발생한다면 이미 날짜별 행이 생성되었으므로 UPDATE 실행
if (!$result) {
$sql = " update {$g5['visit_sum_table']} set vs_count = vs_count + 1 where vs_date = '" . G5_TIME_YMD . "' ";
$sql = "UPDATE {$g5['visit_sum_table']} SET vs_count = vs_count + 1 where vs_date = '" . G5_TIME_YMD . "' ";
$result = sql_query($sql);
}
@ -39,22 +39,22 @@ if (get_cookie('ck_visit_ip') != $_SERVER['REMOTE_ADDR']) {
// 방문객 접속시마다 따로 쿼리를 하지 않기 위함 (엄청난 쿼리를 줄임 ^^)
// 오늘
$sql = " select vs_count as cnt from {$g5['visit_sum_table']} where vs_date = '" . G5_TIME_YMD . "' ";
$sql = "SELECT vs_count as cnt FROM {$g5['visit_sum_table']} where vs_date = '" . G5_TIME_YMD . "' ";
$row = sql_fetch($sql);
$vi_today = $row['cnt'];
// 어제
$sql = " select vs_count as cnt from {$g5['visit_sum_table']} where vs_date = DATE_SUB('" . G5_TIME_YMD . "', INTERVAL 1 DAY) ";
$sql = "SELECT vs_count as cnt FROM {$g5['visit_sum_table']} where vs_date = DATE_SUB('" . G5_TIME_YMD . "', INTERVAL 1 DAY) ";
$row = sql_fetch($sql);
$vi_yesterday = $row['cnt'];
// 최대
$sql = " select max(vs_count) as cnt from {$g5['visit_sum_table']} ";
$sql = "SELECT max(vs_count) as cnt FROM {$g5['visit_sum_table']} ";
$row = sql_fetch($sql);
$vi_max = $row['cnt'];
// 전체
$sql = " select sum(vs_count) as total from {$g5['visit_sum_table']} ";
$sql = "SELECT sum(vs_count) as total FROM {$g5['visit_sum_table']} ";
$row = sql_fetch($sql);
$vi_sum = $row['total'];
@ -63,6 +63,6 @@ if (get_cookie('ck_visit_ip') != $_SERVER['REMOTE_ADDR']) {
// 기본설정 테이블에 방문자수를 기록한 후
// 방문자수 테이블을 읽지 않고 출력한다.
// 쿼리의 수를 상당부분 줄임
sql_query(" update {$g5['config_table']} set cf_visit = '{$visit}' ");
sql_query("UPDATE {$g5['config_table']} SET cf_visit = '{$visit}' ");
}
}

View file

@ -75,20 +75,20 @@ if ($w == '') {
$reply = substr($write['wr_reply'], 0, $len);
// 원글만 구한다.
$sql = " select count(*) as cnt from {$write_table}
where wr_reply like '{$reply}%'
and wr_id <> '{$write['wr_id']}'
and wr_num = '{$write['wr_num']}'
and wr_is_comment = 0 ";
$sql = "SELECT count(*) as cnt FROM {$write_table}
where wr_reply like '{$reply}%'
and wr_id <> '{$write['wr_id']}'
and wr_num = '{$write['wr_num']}'
and wr_is_comment = 0 ";
$row = sql_fetch($sql);
if ($row['cnt'] && !$is_admin)
alert('이 글과 관련된 답변글이 존재하므로 수정 할 수 없습니다.\\n\\n답변글이 있는 원글은 수정할 수 없습니다.');
// 코멘트 달린 원글의 수정 여부
$sql = " select count(*) as cnt from {$write_table}
where wr_parent = '{$wr_id}'
and mb_id <> '{$member['mb_id']}'
and wr_is_comment = 1 ";
$sql = "SELECT count(*) as cnt FROM {$write_table}
where wr_parent = '{$wr_id}'
and mb_id <> '{$member['mb_id']}'
and wr_is_comment = 1 ";
$row = sql_fetch($sql);
if ($board['bo_count_modify'] && $row['cnt'] >= $board['bo_count_modify'] && !$is_admin)
alert('이 글과 관련된 댓글이 존재하므로 수정 할 수 없습니다.\\n\\n댓글이 ' . $board['bo_count_modify'] . '건 이상 달린 원글은 수정할 수 없습니다.');
@ -142,12 +142,12 @@ if ($w == '') {
$begin_reply_char = 'A';
$end_reply_char = 'Z';
$reply_number = +1;
$sql = " select MAX(SUBSTRING(wr_reply, {$reply_len}, 1)) as reply from {$write_table} where wr_num = '{$reply_array['wr_num']}' and SUBSTRING(wr_reply, {$reply_len}, 1) <> '' ";
$sql = "SELECT MAX(SUBSTRING(wr_reply, {$reply_len}, 1)) as reply FROM {$write_table} where wr_num = '{$reply_array['wr_num']}' and SUBSTRING(wr_reply, {$reply_len}, 1) <> '' ";
} else {
$begin_reply_char = 'Z';
$end_reply_char = 'A';
$reply_number = -1;
$sql = " select MIN(SUBSTRING(wr_reply, {$reply_len}, 1)) as reply from {$write_table} where wr_num = '{$reply_array['wr_num']}' and SUBSTRING(wr_reply, {$reply_len}, 1) <> '' ";
$sql = "SELECT MIN(SUBSTRING(wr_reply, {$reply_len}, 1)) as reply FROM {$write_table} where wr_num = '{$reply_array['wr_num']}' and SUBSTRING(wr_reply, {$reply_len}, 1) <> '' ";
}
if ($reply_array['wr_reply'])
$sql .= " and wr_reply like '{$reply_array['wr_reply']}%' ";
@ -177,7 +177,7 @@ if (!empty($group['gr_use_access'])) {
; // 통과
} else {
// 그룹접근
$sql = " select gr_id from {$g5['group_member_table']} where gr_id = '{$board['gr_id']}' and mb_id = '{$member['mb_id']}' ";
$sql = "SELECT gr_id FROM {$g5['group_member_table']} where gr_id = '{$board['gr_id']}' and mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if (!$row['gr_id'])
alert('접근 권한이 없으므로 글쓰기가 불가합니다.\\n\\n궁금하신 사항은 관리자에게 문의 바랍니다.');

View file

@ -78,7 +78,7 @@ if ($w == 'c') // 댓글 입력
// 댓글 답변
if ($comment_id) {
$sql = " select wr_id, wr_parent, wr_comment, wr_comment_reply from $write_table
$sql = "SELECT wr_id, wr_parent, wr_comment, wr_comment_reply FROM $write_table
where wr_id = '$comment_id' ";
$reply_array = sql_fetch($sql);
if (!$reply_array['wr_id'])
@ -125,7 +125,7 @@ if ($w == 'c') // 댓글 입력
$tmp_comment_reply = $reply_array['wr_comment_reply'] . $reply_char;
} else {
$sql = " select max(wr_comment) as max_comment from $write_table
$sql = "SELECT max(wr_comment) as max_comment FROM $write_table
where wr_parent = '$wr_id' and wr_is_comment = 1 ";
$row = sql_fetch($sql);
//$row['max_comment'] -= 1;
@ -179,13 +179,13 @@ if ($w == 'c') // 댓글 입력
$comment_id = sql_insert_id();
// 원글에 댓글수 증가 & 마지막 시간 반영
sql_query(" update $write_table set wr_comment = wr_comment + 1, wr_last = '" . G5_TIME_YMDHIS . "' where wr_id = '$wr_id' ");
sql_query("UPDATE $write_table SET wr_comment = wr_comment + 1, wr_last = '" . G5_TIME_YMDHIS . "' where wr_id = '$wr_id' ");
// 새글 INSERT
sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '" . G5_TIME_YMDHIS . "', '{$member['mb_id']}' ) ");
sql_query("INSERT INTO {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '" . G5_TIME_YMDHIS . "', '{$member['mb_id']}' ) ");
// 댓글 1 증가
sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' ");
sql_query("UPDATE {$g5['board_table']} SET bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' ");
// 포인트 부여
insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id}-{$comment_id} 댓글쓰기", $bo_table, $comment_id, '댓글');
@ -230,7 +230,7 @@ if ($w == 'c') // 댓글 입력
// 댓글 쓴 모든이에게 메일 발송이 되어 있다면 (자신에게는 발송하지 않는다)
if ($config['cf_email_wr_comment_all']) {
$sql = " select distinct wr_email from {$write_table}
$sql = "SELECT distinct wr_email FROM {$write_table}
where wr_email not in ( '{$wr['wr_email']}', '{$member['mb_email']}', '' )
and wr_parent = '$wr_id' ";
$result = sql_query($sql);
@ -257,7 +257,7 @@ if ($w == 'c') // 댓글 입력
}
} else if ($w == 'cu') // 댓글 수정
{
$sql = " select mb_id, wr_password, wr_comment, wr_comment_reply from $write_table
$sql = "SELECT mb_id, wr_password, wr_comment, wr_comment_reply FROM $write_table
where wr_id = '$comment_id' ";
$comment = $reply_array = sql_fetch($sql);
$tmp_comment = $reply_array['wr_comment'];
@ -296,7 +296,7 @@ if ($w == 'c') // 댓글 입력
alert('댓글을 수정할 권한이 없습니다.');
}
$sql = " select count(*) as cnt from $write_table
$sql = "SELECT count(*) as cnt FROM $write_table
where wr_comment_reply like '$comment_reply%'
and wr_id <> '$comment_id'
and wr_parent = '$wr_id'

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