Merge branch 'master' of github.com:gnuboard/gnuboard5
This commit is contained in:
@ -191,7 +191,6 @@ if ($copy_case == 'schema_data_both') {
|
|||||||
sql_query($sql, false);
|
sql_query($sql, false);
|
||||||
|
|
||||||
// 4.00.01
|
// 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);
|
$result = sql_query($sql, false);
|
||||||
for ($i = 0; $row = sql_fetch_array($result); $i++) {
|
for ($i = 0; $row = sql_fetch_array($result); $i++) {
|
||||||
|
|||||||
@ -258,7 +258,6 @@ if ($w == '' || $w == 'r') {
|
|||||||
$wr_reply = '';
|
$wr_reply = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// wr_num 서브쿼리 kkigomi 님 제안
|
|
||||||
$sql = " insert into $write_table
|
$sql = " insert into $write_table
|
||||||
set wr_num = " . ($w == 'r' ? "'$wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $write_table sq) ") . ",
|
set wr_num = " . ($w == 'r' ? "'$wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $write_table sq) ") . ",
|
||||||
wr_reply = '$wr_reply',
|
wr_reply = '$wr_reply',
|
||||||
|
|||||||
14
common.php
14
common.php
@ -484,6 +484,7 @@ if (isset($_REQUEST['w'])) {
|
|||||||
$w = '';
|
$w = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var int $wr_id 게시판 글의 ID */
|
||||||
if (isset($_REQUEST['wr_id'])) {
|
if (isset($_REQUEST['wr_id'])) {
|
||||||
$wr_id = (int)$_REQUEST['wr_id'];
|
$wr_id = (int)$_REQUEST['wr_id'];
|
||||||
} else {
|
} else {
|
||||||
@ -581,27 +582,30 @@ if (isset($_SESSION['ss_mb_id']) && $_SESSION['ss_mb_id']) { // 로그인중이
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** @var array $write 글 데이터 */
|
||||||
$write = array();
|
$write = array();
|
||||||
|
/** @var string $write_table 게시판 테이블 전체이름 */
|
||||||
$write_table = '';
|
$write_table = '';
|
||||||
if ($bo_table) {
|
if ($bo_table) {
|
||||||
$board = get_board_db($bo_table, true);
|
$board = get_board_db($bo_table, true);
|
||||||
if (isset($board['bo_table']) && $board['bo_table']) {
|
if (isset($board['bo_table']) && $board['bo_table']) {
|
||||||
set_cookie("ck_bo_table", $board['bo_table'], 86400 * 1);
|
set_cookie("ck_bo_table", $board['bo_table'], 86400 * 1);
|
||||||
$gr_id = $board['gr_id'];
|
$gr_id = $board['gr_id'];
|
||||||
$write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
|
// 게시판 테이블 전체이름
|
||||||
|
$write_table = $g5['write_prefix'] . $bo_table;
|
||||||
|
|
||||||
if (isset($wr_id) && $wr_id) {
|
if (isset($wr_id) && $wr_id) {
|
||||||
$write = get_write($write_table, $wr_id);
|
$write = get_write($write_table, $wr_id);
|
||||||
} else if (isset($wr_seo_title) && $wr_seo_title) {
|
} else if (isset($wr_seo_title) && $wr_seo_title) {
|
||||||
$write = get_content_by_field($write_table, 'bbs', 'wr_seo_title', generate_seo_title($wr_seo_title));
|
$write = get_content_by_field($write_table, 'bbs', 'wr_seo_title', generate_seo_title($wr_seo_title));
|
||||||
if( isset($write['wr_id']) ){
|
if (isset($write['wr_id'])) {
|
||||||
$wr_id = $write['wr_id'];
|
$wr_id = (int) $write['wr_id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 게시판에서
|
// 게시판에서 사용하는 에디터를 설정
|
||||||
if (isset($board['bo_select_editor']) && $board['bo_select_editor']){
|
if (isset($board['bo_select_editor']) && $board['bo_select_editor']) {
|
||||||
$config['cf_editor'] = $board['bo_select_editor'];
|
$config['cf_editor'] = $board['bo_select_editor'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,7 +72,6 @@ Class G5_object_cache {
|
|||||||
* @param string $key
|
* @param string $key
|
||||||
* @param string $group
|
* @param string $group
|
||||||
* @return bool
|
* @return bool
|
||||||
* kkigomi 님이 고쳐주심
|
|
||||||
*/
|
*/
|
||||||
function delete($type, $key, $group = 'default')
|
function delete($type, $key, $group = 'default')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2475,14 +2475,19 @@ function check_device($device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 게시판 최신글 캐시 파일 삭제
|
/**
|
||||||
|
* 게시판 최신글 캐시 파일 삭제
|
||||||
|
* @param string $bo_table 게시판 ID
|
||||||
|
*/
|
||||||
function delete_cache_latest($bo_table)
|
function delete_cache_latest($bo_table)
|
||||||
{
|
{
|
||||||
if (!preg_match("/^([A-Za-z0-9_]{1,20})$/", $bo_table)) {
|
if (!preg_match("/^([A-Za-z0-9_]{1,20})$/", $bo_table)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g5_delete_cache_by_prefix('latest-'.$bo_table.'-');
|
run_event('delete_cache_latest', $bo_table);
|
||||||
|
|
||||||
|
g5_delete_cache_by_prefix('latest-' . $bo_table . '-');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 게시판 첨부파일 썸네일 삭제
|
// 게시판 첨부파일 썸네일 삭제
|
||||||
@ -3815,7 +3820,7 @@ function check_vaild_callback($callback){
|
|||||||
class str_encrypt
|
class str_encrypt
|
||||||
{
|
{
|
||||||
var $salt;
|
var $salt;
|
||||||
var $lenght;
|
var $length;
|
||||||
|
|
||||||
function __construct($salt='')
|
function __construct($salt='')
|
||||||
{
|
{
|
||||||
@ -4168,7 +4173,7 @@ function get_random_token_string($length=6)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||||
$output = substr(str_shuffle($characters), 0, $length); // jihan001 님 제안코드로 수정
|
$output = substr(str_shuffle($characters), 0, $length);
|
||||||
|
|
||||||
return bin2hex($output);
|
return bin2hex($output);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user