Merge branch 'master' of github.com:gnuboard/g4s
This commit is contained in:
32
common.php
32
common.php
@ -104,9 +104,35 @@ if (file_exists($dbconfig_file)) {
|
||||
$select_db = sql_select_db(G4_MYSQL_DB, $connect_db) or die('MySQL DB Error!!!');
|
||||
@mysql_query(" set names utf8 ");
|
||||
} else {
|
||||
echo "<meta http-equiv='content-type' content='text/html; charset=utf-8'>";
|
||||
echo "<h3>$dbconfig_file 파일을 찾을 수 없습니다.<br>프로그램 설치 후 실행하시기 바랍니다.</h3>";
|
||||
echo '<a href="'.G4_URL.'/install/">그누보드4S 설치하기</a>';
|
||||
?>
|
||||
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>오류! 그누보드4S 설치하기</title>
|
||||
<style>
|
||||
body {background:#f7f7f2}
|
||||
h1 {margin:50px auto 30px;width:540px;color:#ff3061;font-size:1.4em}
|
||||
div {margin:0 auto;padding:20px;width:500px;border:1px solid #eee;background:#fff}
|
||||
div p {line-height:1.5em}
|
||||
div a {display:block;margin:50px auto 10px;width:170px;text-align:center}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>오류가 있습니다.</h1>
|
||||
<div>
|
||||
<p>다음 파일을 찾을 수 없습니다.</p>
|
||||
<ul>
|
||||
<li><strong><?=$dbconfig_file?></strong></li>
|
||||
</ul>
|
||||
<p>프로그램 설치 후 실행하시기 바랍니다.</p>
|
||||
<a href="<?=G4_URL?>/install/">그누보드4S 설치하기</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?
|
||||
exit;
|
||||
}
|
||||
//==============================================================================
|
||||
|
||||
@ -73,6 +73,11 @@ CREATE TABLE IF NOT EXISTS `g4s_board` (
|
||||
`bo_content_tail` text NOT NULL,
|
||||
`bo_insert_content` text NOT NULL,
|
||||
`bo_gallery_cols` int(11) NOT NULL default '0',
|
||||
`bo_gallery_width` int(11) NOT NULL default '0',
|
||||
`bo_gallery_height` int(11) NOT NULL default '0',
|
||||
`bo_mobile_gallery_cols` int(11) NOT NULL default '0',
|
||||
`bo_mobile_gallery_width` int(11) NOT NULL default '0',
|
||||
`bo_mobile_gallery_height` int(11) NOT NULL default '0',
|
||||
`bo_upload_size` int(11) NOT NULL default '0',
|
||||
`bo_reply_order` tinyint(4) NOT NULL default '0',
|
||||
`bo_use_search` tinyint(4) NOT NULL default '0',
|
||||
@ -184,9 +189,6 @@ CREATE TABLE IF NOT EXISTS `g4s_config` (
|
||||
`cf_include_head` varchar(255) NOT NULL default '',
|
||||
`cf_include_tail` varchar(255) NOT NULL default '',
|
||||
`cf_add_script` text NOT NULL default '',
|
||||
`cf_include_head` varchar(255) NOT NULL default '',
|
||||
`cf_include_tail` varchar(255) NOT NULL default '',
|
||||
`cf_add_script` text NOT NULL default '',
|
||||
`cf_use_point` tinyint(4) NOT NULL default '0',
|
||||
`cf_use_norobot` tinyint(4) NOT NULL default '0',
|
||||
`cf_use_copy_log` tinyint(4) NOT NULL default '0',
|
||||
|
||||
@ -1,25 +1,28 @@
|
||||
<?
|
||||
$title = "그누보드4S 설치 3단계 중 1단계 라이센스 확인";
|
||||
include_once ('../config.php');
|
||||
include_once ('./install.inc.php');
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>그누보드4 설치 (1/3) - 라이센스(License)</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h4>라이센스(License) 내용을 반드시 확인하십시오.</h4>
|
||||
<textarea name="textarea" style='width:100%;height:300px;' readonly>
|
||||
<?=implode('', file('../LICENSE.txt'));?>
|
||||
</textarea>
|
||||
<form method="post" action="./install_config.php" onsubmit="return frm_submit(this);">
|
||||
<div>
|
||||
<input type="checkbox" id="agree" name="agree" value="동의함">
|
||||
<label for="agree">설치를 원하시면 위 내용에 동의하셔야 합니다.</label><br>
|
||||
동의에 선택하신 후 <다음> 버튼을 클릭해 주세요.
|
||||
<p>
|
||||
<strong class="st_strong">라이센스(License) 내용을 반드시 확인하십시오.</strong><br>
|
||||
라이센스에 동의하시는 경우에만 설치가 진행됩니다.
|
||||
</p>
|
||||
|
||||
<textarea name="textarea" id="idx_license" readonly><?=implode('', file('../LICENSE.txt'));?></textarea>
|
||||
|
||||
</div>
|
||||
<input type="submit" value="다음">
|
||||
|
||||
<form action="./install_config.php" method="post" onsubmit="return frm_submit(this);">
|
||||
<div id="idx_agree">
|
||||
<label for="agree">동의합니다.</label>
|
||||
<input type="checkbox" id="agree" name="agree" value="동의함">
|
||||
</div>
|
||||
|
||||
<div id="btn_confirm">
|
||||
<input type="submit" value="다음">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
||||
@ -1,29 +1,69 @@
|
||||
<?
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
$data_path = '../'.G4_DATA_DIR;
|
||||
|
||||
if (!$title) $title = "그누보드4S 설치";
|
||||
?>
|
||||
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><?=$title?></title>
|
||||
<style>
|
||||
body {margin:0;padding:0;background:#f7f7f7}
|
||||
h1 {margin:50px auto 30px;width:540px;font-size:1.4em}
|
||||
p {line-height:1.5em}
|
||||
table {width:100%;border-collapse:collapse;border-spacing:0}
|
||||
th,td {padding:5px;border:1px solid #ddd}
|
||||
th {text-align:left}
|
||||
|
||||
#wrapper {margin:0 auto;padding:20px;width:500px;border:1px solid #eee;background:#fff}
|
||||
|
||||
#idx_license {padding:10px;width:480px;height:300px;border:1px solid #ccc;background:#000;color:#fff}
|
||||
#idx_agree {padding:20px;font-weight:bold;text-align:center}
|
||||
|
||||
#btn_confirm {text-align:center}
|
||||
|
||||
.outside {margin:0 auto;padding:20px 0;width:542px}
|
||||
.st_strong {color:#ff3061;font-weight:normal}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1><?=$title?></h1>
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
<?
|
||||
// 파일이 존재한다면 설치할 수 없다.
|
||||
$dbconfig_file = $data_path.'/'.G4_DBCONFIG_FILE;
|
||||
if (file_exists($dbconfig_file)) {
|
||||
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
|
||||
echo '<p>프로그램이 이미 설치되어 있습니다.<br />새로 설치하시려면 '.$dbconfig_file.' 파일을 삭제후 설치하시기 바랍니다.</p>';
|
||||
?>
|
||||
<p>프로그램이 이미 설치되어 있습니다.<br />새로 설치하시려면 '.$dbconfig_file.' 파일을 삭제후 설치하시기 바랍니다.</p>
|
||||
<?
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<?
|
||||
// data 디렉토리가 있는가?
|
||||
if (!is_dir($data_path))
|
||||
{
|
||||
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
|
||||
echo '<p>루트 디렉토리에 아래로 '.G4_DATA_DIR.' 디렉토리를 생성하여 주십시오.<br />(common.php 파일이 있는곳이 루트 디렉토리 입니다.)<br /><br />$> mkdir '.G4_DATA_DIR.'<br /><br />위 명령 실행후 다시 설치하여 주십시오.</p>';
|
||||
?>
|
||||
<p>루트 디렉토리에 아래로 '.G4_DATA_DIR.' 디렉토리를 생성하여 주십시오.<br />(common.php 파일이 있는곳이 루트 디렉토리 입니다.)<br /><br />$> mkdir '.G4_DATA_DIR.'<br /><br />위 명령 실행후 다시 설치하여 주십시오.</p>
|
||||
<?
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<?
|
||||
// data 디렉토리에 파일 생성 가능한지 검사.
|
||||
if (!(is_readable($data_path) && is_writeable($data_path) && is_executable($data_path)))
|
||||
{
|
||||
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">'.PHP_EOL;
|
||||
echo '<p>'.G4_DATA_DIR.' 디렉토리의 퍼미션을 707로 변경하여 주십시오.<br /><br />$> chmod 707 '.G4_DATA_DIR.' 또는 chmod uo+rwx '.G4_DATA_DIR.'<br /><br />위 명령 실행후 다시 설치하여 주십시오.</p>';
|
||||
?>
|
||||
<p>'.G4_DATA_DIR.' 디렉토리의 퍼미션을 707로 변경하여 주십시오.<br /><br />$> chmod 707 '.G4_DATA_DIR.' 또는 chmod uo+rwx '.G4_DATA_DIR.'<br /><br />위 명령 실행후 다시 설치하여 주십시오.</p>
|
||||
<?
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@ -1,4 +1,5 @@
|
||||
<?
|
||||
$title = "그누보드4S 설치 3단계 중 2단계 설정";
|
||||
include_once ('../config.php');
|
||||
include_once ('./install.inc.php');
|
||||
|
||||
@ -16,88 +17,90 @@ if ($_POST['agree'] != '동의함') {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>그누보드4 설치 (2/3) - 설정</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form id="frm_install" method="post" action="./install_db.php" onsubmit="return frm_install_submit(this)">
|
||||
<table border>
|
||||
<caption>MySQL 정보입력</caption>
|
||||
<tr>
|
||||
<td width=100>Host</td>
|
||||
<td width=200>
|
||||
<input name="mysql_host" type="text" value="localhost">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>User</td>
|
||||
<td>
|
||||
<input name="mysql_user" type="text">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Password</td>
|
||||
<td>
|
||||
<input name="mysql_pass" type="text">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DB</td>
|
||||
<td>
|
||||
<input name="mysql_db" type="text">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Port</td>
|
||||
<td>
|
||||
<input name="mysql_port" type="text" value="3306">
|
||||
<br>가능한 변경하지 마십시오.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TABLE명 접두사</td>
|
||||
<td>
|
||||
<input name="table_prefix" type="text" value="g4s_">
|
||||
<br>가능한 변경하지 마십시오.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<form id="frm_install" method="post" action="./install_db.php" onsubmit="return frm_install_submit(this)">
|
||||
<table border>
|
||||
<caption>MySQL 정보입력</caption>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="">Host</label></th>
|
||||
<td>
|
||||
<input name="mysql_host" type="text" value="localhost" id="mysql_host">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="">User</label></th>
|
||||
<td>
|
||||
<input name="mysql_user" type="text" id="mysql_user">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="">Password</label></th>
|
||||
<td>
|
||||
<input name="mysql_pass" type="text" id="mysql_pass">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="">DB</label></th>
|
||||
<td>
|
||||
<input name="mysql_db" type="text" id="mysql_db">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="">Port</label></th>
|
||||
<td>
|
||||
<input name="mysql_port" type="text" value="3306" id="mysql_port">
|
||||
<br>가능한 변경하지 마십시오.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="">TABLE명 접두사</label></th>
|
||||
<td>
|
||||
<input name="table_prefix" type="text" value="g4s_" id="table_prefix">
|
||||
<br>가능한 변경하지 마십시오.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table border>
|
||||
<caption>최고관리자 정보입력</caption>
|
||||
<tr>
|
||||
<td width=100>회원 ID</td>
|
||||
<td width=200>
|
||||
<input name="admin_id" type="text" value="admin">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>패스워드</td>
|
||||
<td>
|
||||
<input name="admin_pass" type="text">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>이름</td>
|
||||
<td>
|
||||
<input name="admin_name" type="text" value="최고관리자">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>E-mail</td>
|
||||
<td>
|
||||
<input name="admin_email" type="text" value="admin@domain.com">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border>
|
||||
<caption>최고관리자 정보입력</caption>
|
||||
<tr>
|
||||
<th scope="row"><label for="">회원 ID</label></th>
|
||||
<td>
|
||||
<input name="admin_id" type="text" value="admin" id="admin_id">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="">패스워드</label></th>
|
||||
<td>
|
||||
<input name="admin_pass" type="text" id="admin_pass">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="">이름</label></th>
|
||||
<td>
|
||||
<input name="admin_name" type="text" value="최고관리자" id="admin_name">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="">E-mail</label></th>
|
||||
<td>
|
||||
<input name="admin_email" type="text" value="admin@domain.com" id="admin_email">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4>이미 그누보드4가 존재한다면 DB 자료가 망실되므로 주의하십시오.</h4>
|
||||
</div>
|
||||
|
||||
<input type="submit" value="다음">
|
||||
<p class="outside">
|
||||
<strong class="st_strong">주의! 이미 그누보드4S가 존재한다면 DB 자료가 망실되므로 주의하십시오.</strong><br>
|
||||
주의사항을 읽으셨다면 다음을 눌러 설치를 계속하십시오.
|
||||
</p>
|
||||
|
||||
<div id="btn_confirm">
|
||||
<input type="submit" value="다음">
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function frm_install_submit(f)
|
||||
|
||||
@ -9,9 +9,9 @@ function it_img_thumb($filename, $filepath, $thumb_width, $thumb_height, $is_cre
|
||||
}
|
||||
|
||||
// 게시글리스트 썸네일 생성
|
||||
function get_list_thumbnail($filename, $filepath, $thumb_width, $thumb_height, $is_create=false)
|
||||
function get_list_thumbnail($filename, $filepath, $thumb_width, $thumb_height, $is_create=false, $is_crop=true)
|
||||
{
|
||||
return thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, $is_create);
|
||||
return thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, $is_create, $is_crop);
|
||||
}
|
||||
|
||||
// 게시글보기 썸네일 생성
|
||||
@ -100,7 +100,7 @@ function get_view_thumbnail($contents)
|
||||
}
|
||||
|
||||
//function thumbnail($bo_table, $file, $width, $height, $is_create=false)
|
||||
function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create)
|
||||
function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop=false)
|
||||
{
|
||||
global $g4;
|
||||
|
||||
@ -130,7 +130,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
$target = imagecreate($thumb_width, $thumb_height);
|
||||
imagecolorallocate($target, 250, 250, 250);
|
||||
imagecopy($target, $target, 0, 0, 0, 0, $thumb_width, $thumb_height);
|
||||
imagepng($target, $thumb_file, 0);
|
||||
imagejpeg($target, $thumb_file, 90);
|
||||
@chmod($thumb_file, 0606); // 추후 삭제를 위하여 파일모드 변경
|
||||
}
|
||||
return basename($thumb_file);
|
||||
@ -154,24 +154,36 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
$src = imagecreatefrompng($source_file);
|
||||
}
|
||||
|
||||
$src_width = $size[0];
|
||||
$src_height = $size[1];
|
||||
|
||||
if($is_crop && $thumb_width && $thumb_height) {
|
||||
$ratio = $thumb_height / $thumb_width;
|
||||
if($src_height / $src_width >= $ratio) {
|
||||
$src_height = ceil(($thumb_height * $src_width) / $thumb_width);
|
||||
} else {
|
||||
$src_width = ceil(($thumb_width * $src_height) / $thumb_height);
|
||||
}
|
||||
}
|
||||
|
||||
if ($thumb_width) {
|
||||
if ($thumb_height) {
|
||||
$rate = $thumb_width / $size[0];
|
||||
$tmp_height = (int)($size[1] * $rate);
|
||||
$rate = $thumb_width / $src_width;
|
||||
$tmp_height = (int)($src_height * $rate);
|
||||
if ($tmp_height < $thumb_height) {
|
||||
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
|
||||
$bgcolor = imagecolorallocate($dst, 250, 250, 250); // 배경색 여기야!!!
|
||||
imagefill($dst, 0, 0, $bgcolor);
|
||||
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $size[0], $size[1]);
|
||||
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $src_width, $src_height);
|
||||
} else {
|
||||
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
|
||||
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $size[0], $size[1]);
|
||||
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $src_width, $src_height);
|
||||
}
|
||||
} else {
|
||||
$rate = $thumb_width / $size[0];
|
||||
$tmp_height = (int)($size[1] * $rate);
|
||||
$rate = $thumb_width / $src_width;
|
||||
$tmp_height = (int)($src_height * $rate);
|
||||
$dst = imagecreatetruecolor($thumb_width, $tmp_height);
|
||||
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $tmp_height, $size[0], $size[1]);
|
||||
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $tmp_height, $src_width, $src_height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user