Merge branch 'master' of github.com:gnuboard/g4s

This commit is contained in:
whitedot
2013-01-23 18:07:14 +09:00
5 changed files with 26 additions and 14 deletions

View File

@ -2,7 +2,7 @@
include_once('./_common.php'); include_once('./_common.php');
$file = addslashes($_GET['file']); $file = addslashes($_GET['file']);
$captcha_path = mk_subdir($g4['cache_dir'].'/'.$g4['captcha_dir']); $captcha_path = mk_subdir($g4['cache_captcha_dir']);
$filepath = $captcha_path.'/'.$file; $filepath = $captcha_path.'/'.$file;
$original = "number.wav"; $original = "number.wav";

View File

@ -247,7 +247,7 @@ function captcha_file($extension='.png')
{ {
global $g4; global $g4;
mk_subdir($g4['cache_dir']); mk_subdir($g4['cache_dir']);
$captcha_path = mk_subdir($g4['cache_dir'].'/'.$g4['captcha_dir']); $captcha_path = mk_subdir($g4['cache_captcha_dir']);
return $captcha_path.'/'.abs_ip2long().'_'.$_COOKIE['PHPSESSID'].$extension; return $captcha_path.'/'.abs_ip2long().'_'.$_COOKIE['PHPSESSID'].$extension;
} }
?> ?>

View File

@ -12,14 +12,16 @@ if ($g4['https_url']) {
$g4['https_bbs_url'] = $g4['https_url'].'/'.$g4['bbs']; $g4['https_bbs_url'] = $g4['https_url'].'/'.$g4['bbs'];
} }
$g4['data_dir'] = 'data'; $g4['data_dir'] = 'data';
$g4['data_url'] = $g4['url'].'/'.$g4['data_dir']; $g4['data_url'] = $g4['url'].'/'.$g4['data_dir'];
$g4['data_path'] = $g4['path'].'/'.$g4['data_dir']; $g4['data_path'] = $g4['path'].'/'.$g4['data_dir'];
$g4['cache_dir'] = 'cache'; $g4['cache_dir'] = 'cache';
$g4['cache_path'] = $g4['data_path'].'/'.$g4['cache_dir']; $g4['cache_path'] = $g4['data_path'].'/'.$g4['cache_dir'];
$g4['captcha_dir'] = 'captcha'; $g4['cache_latest_dir'] = $g4['cache_dir'].'/latest';
$g4['cache_member_dir'] = $g4['cache_dir'].'/member';
$g4['cache_captcha_dir']= $g4['cache_dir'].'/captcha';
// g4s 기본 DHTML EDITOR // g4s 기본 DHTML EDITOR
if (!defined('G4_EDITOR')) define('G4_EDITOR', 0); if (!defined('G4_EDITOR')) define('G4_EDITOR', 0);

View File

@ -1623,8 +1623,7 @@ function is_checked($field)
function mk_subdir($subdir) function mk_subdir($subdir)
{ {
global $g4; global $g4;
$data_path = $g4['path'].'/'.$g4['data_dir']; $data_subpath = $g4['path_path'].'/'.$subdir;
$data_subpath = $data_path.'/'.$subdir;
if (!is_dir($data_subpath)) { if (!is_dir($data_subpath)) {
@mkdir($data_subpath, 0707); @mkdir($data_subpath, 0707);
@chmod($data_subpath, 0707); @chmod($data_subpath, 0707);

View File

@ -25,16 +25,24 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
</div> </div>
</section> </section>
<? if (!empty($view['file'])) {?> <?
if ($view['file']['count']) {
$cnt = 0;
for ($i=0; $i<count($view['file']); $i++) {
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view'])
$cnt++;
}
}
?>
<? if($cnt) { ?>
<section id="bo_v_file"> <section id="bo_v_file">
<h2>첨부파일</h2> <h2>첨부파일</h2>
<ul> <ul>
<? <?
// 가변 파일 // 가변 파일
$cnt = 0;
for ($i=0; $i<count($view['file']); $i++) { for ($i=0; $i<count($view['file']); $i++) {
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) { if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) {
$cnt++;
?> ?>
<li> <li>
<a href="<? echo $view['file'][$i]['href']; ?>" onclick="javascript:file_download('<? echo $view['file'][$i]['href'].'&amp;confirm=yes'; ?>', '<?=$view['file'][$i]['source']?>'); return false;"> <a href="<? echo $view['file'][$i]['href']; ?>" onclick="javascript:file_download('<? echo $view['file'][$i]['href'].'&amp;confirm=yes'; ?>', '<?=$view['file'][$i]['source']?>'); return false;">
@ -52,7 +60,10 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
</section> </section>
<? } ?> <? } ?>
<? if (!empty($view['link'])) {?> <?
$temp_view_link = array_filter($view['link']);
if (!empty($temp_view_link)) {
?>
<section id="bo_v_link"> <section id="bo_v_link">
<h2>관련링크</h2> <h2>관련링크</h2>
<ul> <ul>