diff --git a/adm/board_form.php b/adm/board_form.php
index 485fa9a2d..efbf2939f 100644
--- a/adm/board_form.php
+++ b/adm/board_form.php
@@ -22,7 +22,7 @@ if (!isset($board['bo_device'])) {
}
if (!isset($board['bo_show_menu'])) {
- sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_show_menu` TINYINT NOT NULL DEFAULT '0' AFTER `bo_order_search`, ADD `bo_order` INT NOT NULL DEFAULT '0' AFTER `bo_show_menu` ", false);
+ sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_show_menu` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_search`, ADD `bo_order` INT NOT NULL DEFAULT '0' AFTER `bo_show_menu` ", false);
}
if (!isset($board['bo_mobile_skin'])) {
diff --git a/adm/qa_config.php b/adm/qa_config.php
index 5c85a4274..8856a8ff9 100644
--- a/adm/qa_config.php
+++ b/adm/qa_config.php
@@ -123,9 +123,9 @@ if(empty($qaconfig)) {
- |
+ |
-
+
|
diff --git a/lib/latest.lib.php b/lib/latest.lib.php
index 38382b6aa..6786c4be1 100644
--- a/lib/latest.lib.php
+++ b/lib/latest.lib.php
@@ -2,10 +2,11 @@
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
-function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40)
+// $cache_time 캐시 갱신시간
+function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=1)
{
global $g5;
- static $css = array();
+ //static $css = array();
if (!$skin_dir) $skin_dir = 'basic';
@@ -17,12 +18,32 @@ function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40)
$latest_skin_url = G5_SKIN_URL.'/latest/'.$skin_dir;
}
- $cache_file = G5_DATA_PATH."/cache/latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}.php";
- if (!G5_USE_CACHE || !file_exists($cache_file)) {
+ $cache_fwrite = false;
+ if(G5_USE_CACHE) {
+ $cache_file = G5_DATA_PATH."/cache/latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}.php";
+
+ if(!file_exists($cache_file)) {
+ $cache_fwrite = true;
+ } else {
+ if($cache_time > 0) {
+ $filetime = filemtime($cache_file);
+ if($filetime && $filetime < (G5_SERVER_TIME - 3600 * $cache_time)) {
+ @unlink($cache_file);
+ $cache_fwrite = true;
+ }
+ }
+
+ if(!$cache_fwrite)
+ include_once($cache_file);
+ }
+ }
+
+ if(!G5_USE_CACHE || $cache_fwrite) {
$list = array();
$sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
$board = sql_fetch($sql);
+ $bo_subject = get_text($board['bo_subject']);
$tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 order by wr_num limit 0, {$rows} ";
@@ -31,14 +52,14 @@ function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40)
$list[$i] = get_list($row, $board, $latest_skin_url, $subject_len);
}
- $handle = fopen($cache_file, 'w');
- $cache_content = "";
- fwrite($handle, $cache_content);
- fclose($handle);
+ if($cache_fwrite) {
+ $handle = fopen($cache_file, 'w');
+ $cache_content = "";
+ fwrite($handle, $cache_content);
+ fclose($handle);
+ }
}
- include_once($cache_file);
-
/*
// 같은 스킨은 .css 를 한번만 호출한다.
if (!in_array($skin_dir, $css) && is_file($latest_skin_path.'/style.css')) {
diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php
index 3b4b97fd9..ceb3e4579 100644
--- a/lib/thumbnail.lib.php
+++ b/lib/thumbnail.lib.php
@@ -108,7 +108,7 @@ function get_view_thumbnail($contents, $thumb_width=0)
continue;
// jpg 이면 exif 체크
- if($size[2] == 2) {
+ if($size[2] == 2 && function_exists('exif_read_data')) {
$degree = 0;
$exif = @exif_read_data($srcfile);
if(!empty($exif['Orientation'])) {
@@ -218,30 +218,33 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
$src = imagecreatefromgif($source_file);
} else if ($size[2] == 2) {
$src = imagecreatefromjpeg($source_file);
- // exif 정보를 기준으로 회전각도 구함
- $exif = @exif_read_data($source_file);
- if(!empty($exif['Orientation'])) {
- switch($exif['Orientation']) {
- case 8:
- $degree = 90;
- break;
- case 3:
- $degree = 180;
- break;
- case 6:
- $degree = -90;
- break;
- }
- // 회전각도 있으면 이미지 회전
- if($degree) {
- $src = imagerotate($src, $degree, 0);
+ if(function_exists('exif_read_data')) {
+ // exif 정보를 기준으로 회전각도 구함
+ $exif = @exif_read_data($source_file);
+ if(!empty($exif['Orientation'])) {
+ switch($exif['Orientation']) {
+ case 8:
+ $degree = 90;
+ break;
+ case 3:
+ $degree = 180;
+ break;
+ case 6:
+ $degree = -90;
+ break;
+ }
- // 세로사진의 경우 가로, 세로 값 바꿈
- if($degree == 90 || $degree == -90) {
- $tmp = $size;
- $size[0] = $tmp[1];
- $size[1] = $tmp[0];
+ // 회전각도 있으면 이미지 회전
+ if($degree) {
+ $src = imagerotate($src, $degree, 0);
+
+ // 세로사진의 경우 가로, 세로 값 바꿈
+ if($degree == 90 || $degree == -90) {
+ $tmp = $size;
+ $size[0] = $tmp[1];
+ $size[1] = $tmp[0];
+ }
}
}
}