Compare commits

..

10 commits

Author SHA1 Message Date
dbe8e28e74
typo 2024-10-23 13:56:18 +09:00
6a248db26c
add shop event 2024-10-23 13:53:31 +09:00
da6ee6a29a
shop update - no category register and listing 2024-10-23 13:39:04 +09:00
eb273fb310
bump version to 2.3.3 2024-10-22 22:57:49 +09:00
2dbf6af274
change check class and method 2024-10-22 22:48:13 +09:00
f945ca1936
install fix 2024-10-22 22:45:49 +09:00
8f2a411c7a
update thumbnail.lib.php 2024-10-21 11:30:05 +09:00
1a5ccfe03b
update readme.md 2024-10-19 13:00:58 +09:00
27c4315c50
update readme.md 2024-10-19 12:58:25 +09:00
188eed347f
bump version v2.3.2 2024-10-19 12:04:03 +09:00
12 changed files with 117 additions and 38 deletions

View file

@ -107,21 +107,25 @@ if (empty($fr_date))
<th scope="row">상점 분류</th>
<td colspan="2">
<select name="ca_name">
<option value="">카테고리 선택</option>
<?php for ($i = 0; $i < count($category); $i++) {
<option value="no_category">미분류</option>
<?php
for ($i = 0; $i < count($category); $i++) {
if (!$category[$i])
continue;
?>
<option value="<?= $category[$i] ?>" <?= $shop['ca_name'] == $category[$i] ? "selected" : "" ?>>
<?= $category[$i] ?></option>
<?php } ?>
echo "<option value=\"{$category[$i]}\"";
if ($shop['ca_name'] == $category[$i]) {
echo " selected";
}
echo ">{$category[$i]}</option>";
} ?>
</td>
</tr>
<tr>
<th scope="row">진열 아이템</th>
<td colspan="2">
<input type="hidden" name="it_id" id="it_id" value="<?= $shop['it_id'] ?>" />
<input type="text" name="it_name" value="<?= get_item_name($shop['it_id']) ?>" id="it_name"
<input type="text" name="it_name" value="<?= Item::getName($shop['it_id']) ?>" id="it_name"
onkeyup="get_ajax_item(this, 'item_list', 'it_id');" />
<div id="item_list" class="ajax-list-box">
<div class="list"></div>

View file

@ -38,6 +38,7 @@ include_once './_common.php';
if ($w == 'u')
check_demo();
auth_check($auth[$sub_menu], 'w');
check_token();
@ -52,11 +53,13 @@ if (isset($sh_side) && is_array($sh_side) && count($sh_side)) {
$sh_side = implode("||", $sh_side);
$sh_side = "||" . $sh_side . "||";
}
// 종족 제한 설정 저장
if (isset($sh_class) && is_array($sh_class) && count($sh_class)) {
$sh_class = implode("||", $sh_class);
$sh_class = "||" . $sh_class . "||";
}
// 랭킹 제한 설정 저장
if (isset($sh_rank) && is_array($sh_rank) && count($sh_rank)) {
$sh_rank = implode("||", $sh_rank);
@ -80,11 +83,11 @@ if (!$sh_has_item && $sh_has_item_name) {
alert("교환 아이템으로 등록되는 아이템의 정보가 없습니다.");
}
}
if (!$sh_has_item_name) {
$sh_has_item = 0;
}
// 교환 타이틀 유효성 여부 체크
if (!$sh_has_title && $sh_has_title_name) {
$has_title = sql_fetch("select ti_id from {$g5['item_table']} where ti_title = '{$sh_has_title_name}'");
@ -93,10 +96,15 @@ if (!$sh_has_title && $sh_has_title_name) {
alert("교환 타이틀로 등록되는 타이틀의 정보가 없습니다.");
}
}
if (!$sh_has_title_name) {
$sh_has_title = 0;
}
if ($ca_name == "no_category") {
$ca_name = "";
}
$sql_common = "
it_id = '{$it_id}',
ca_name = '{$ca_name}',

View file

@ -148,8 +148,9 @@ $colspan = 19;
</td>
<td style="width:100px;">
<select name="ca_name[<?php echo $i ?>]" style="width:100%;">
<option value="">카테고리</option>
<?php for ($k = 0; $k < count($category); $k++) {
<option value="no_category">미분류</option>
<?php
for ($k = 0; $k < count($category); $k++) {
if (!$category[$k])
continue;
?>

View file

@ -12,9 +12,14 @@ if ($_POST['act_button'] == "선택수정") {
for ($i=0; $i<count($_POST['chk']); $i++) {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$cate_name = $_POST['ca_name'][$k];
if ($cate_name == "no_category") {
$cate_name = "";
}
$sql = "UPDATE {$g5['shop_table']} SET
ca_name = '{$_POST['ca_name'][$k]}',
ca_name = '{$cate_name}',
sh_money = '{$_POST['sh_money'][$k]}',
sh_use_money = '{$_POST['sh_use_money'][$k]}',
sh_exp = '{$_POST['sh_exp'][$k]}',

View file

@ -68,7 +68,7 @@ class Item extends Module
}
}
return [];
return "";
}
public static function getInventoryItem($inventory_id)

View file

@ -7,7 +7,7 @@
********************/
define('G5_VERSION', '아보카도 에디션 : Amber');
define('G5_GNUBOARD_VER', '2.3.1');
define('G5_GNUBOARD_VER', '2.3.3');
define('G5_AMBER', true);
define('_GNUBOARD_', true);

View file

@ -109,7 +109,9 @@ function print_r2($var)
// header("location:URL") 을 대체
function goto_url($url)
{
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("gnuboard.goto_url", $url);
}
$url = str_replace("&amp;", "&", $url);
//echo "<script> location.replace('$url'); </script>";
@ -178,7 +180,9 @@ function alert($msg = '', $url = '', $error = true, $post = false)
{
global $g5, $config, $member, $is_admin;
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("gnuboard.alert", $msg, $url, $error, $post);
}
if (!$msg)
$msg = '올바른 방법으로 이용해 주십시오.';
@ -197,7 +201,9 @@ function alert_close($msg, $error = true)
{
global $g5;
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("gnuboard.alert_close", $msg, $error);
}
$header = '';
if (isset($g5['title'])) {
@ -615,11 +621,13 @@ function html_purifier($html)
* HTMLPurifier 설정을 변경할 있는 Event hook
* 리스너에서는 첫번째 인자($config) `HTMLPurifier_Config` 객체를 받을 있다
*/
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("gnuboard.html_purifier_config", $config, [
'html' => $html,
'write' => $write,
'is_admin' => $is_admin
]);
}
$purifier = new HTMLPurifier($config);
@ -1599,7 +1607,9 @@ function sql_query($sql, $error = G5_DISPLAY_SQL_ERROR, $link = null)
return null;
}
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("gnuboard.sql_query_after", $result, $sql, $error);
}
return $result;
}
@ -2308,8 +2318,10 @@ function delete_cache_latest($bo_table)
unlink($filename);
}
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("gnuboard.delete_cache_latest", $bo_table);
}
}
// 게시판 첨부파일 썸네일 삭제
function delete_board_thumbnail($bo_table, $file)
@ -2347,7 +2359,9 @@ function delete_editor_thumbnail($contents)
if (!$contents)
return;
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("gnuboard.delete_editor_thumbnail_before", $contents);
}
// $contents 중 img 태그 추출
$matchs = get_editor_image($contents);
@ -2369,8 +2383,10 @@ function delete_editor_thumbnail($contents)
}
}
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("gnuboard.delete_editor_thumbnail_after", $contents, $matchs);
}
}
// 1:1문의 첨부파일 썸네일 삭제
function delete_qa_thumbnail($file)
@ -3024,8 +3040,10 @@ function member_delete($mb_id)
// 아이콘 삭제
@unlink(G5_DATA_PATH . '/member/' . substr($mb_id, 0, 2) . '/' . $mb_id . '.gif');
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("gnuboard.member_delete_after", $mb_id);
}
}
// 이메일 주소 추출
function get_email_address($email)

View file

@ -5,7 +5,7 @@ if (!defined('_GNUBOARD_'))
@ini_set('memory_limit', '-1');
// 게시글리스트 썸네일 생성
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create = false, $is_crop = false, $crop_mode = 'center', $is_sharpen = false, $um_value = '80/0.5/3')
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create = false, $is_crop = false, $crop_mode = 'center', $is_sharpen = false, $um_value = '80/0.5/3', $distance = '0')
{
global $g5, $config;
$filename = $alt = $data_path = '';
@ -66,7 +66,7 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
return $thumbnail_info;
}
$tname = thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, $is_create, $is_crop, $crop_mode, $is_sharpen, $um_value);
$tname = thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, $is_create, $is_crop, $crop_mode, $is_sharpen, $um_value, $distance);
if ($tname) {
if ($edt) {
@ -229,7 +229,7 @@ function get_view_thumbnail($contents, $thumb_width = 0)
return run_replace('get_view_thumbnail', $contents);
}
function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop = false, $crop_mode = 'center', $is_sharpen = false, $um_value = '80/0.5/3')
function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop = false, $crop_mode = 'center', $is_sharpen = false, $um_value = '80/0.5/3', $distance = '0')
{
global $g5;
@ -384,6 +384,14 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
$src_x = round(($size[0] - $src_w) / 2);
}
break;
case 'custom':
if ($size[1] / $size[0] >= $ratio) {
$src_h = round($src_w * $ratio);
$src_y = $distance;
} else {
$src_w = round($size[1] / $ratio);
}
break;
default:
if ($size[1] / $size[0] >= $ratio) {
$src_h = round($src_w * $ratio);

View file

@ -3,8 +3,11 @@
* @var string|int $sh_id
*/
include_once "./_common.php";
$item = sql_fetch("SELECT * FROM {$g5['shop_table']} shop, {$g5['item_table']} item WHERE shop.it_id = item.it_id AND shop.sh_id = '{$sh_id}'");
$item = sql_fetch("select * from {$g5['shop_table']} shop, {$g5['item_table']} item where shop.it_id = item.it_id and shop.sh_id = '{$sh_id}'");
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("amber.shop_ajax.before", $sh_id);
}
if ($item['sh_id']) {
@ -32,6 +35,10 @@ if ($item['sh_id']) {
}
}
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("amber.shop_ajax.after", $item);
}
if (defined('G5_THEME_PATH') && is_file(G5_THEME_PATH . "/shop/shop.item.skin.php")) {
include G5_THEME_PATH . "/shop/shop.item.skin.php";
} else {

View file

@ -4,9 +4,13 @@
*/
include_once "./_common.php";
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("amber.shop_ajax_update.before");
}
if ($character['ch_id'] && $character['ch_state'] == '승인') {
$msg = "";
$item = sql_fetch("select * from {$g5['shop_table']} shop, {$g5['item_table']} item where shop.it_id = item.it_id and shop.sh_id = '{$sh_id}'");
$item = sql_fetch("SELECT * FROM {$g5['shop_table']} shop, {$g5['item_table']} item WHERE shop.it_id = item.it_id AND shop.sh_id = '{$sh_id}'");
if ($item['sh_id']) {
// 구매 가능한 아이템인지 체크한다.
@ -57,7 +61,7 @@ if ($character['ch_id'] && $character['ch_state'] == '승인') {
if ($in['cnt'] < $item['sh_has_item_count']) {
// 필요 아이템 미소유
$has_item_name = get_item_name($item['sh_has_item']);
$has_item_name = Item::getName($item['sh_has_item']);
$msg .= $has_item_name . j($has_item_name, '이') . " " . $item['sh_has_item_count'] . "개 있어야 살 수 있습니다.<br />";
$is_able_buy = false;
} else if ($item['sh_use_has_item']) {
@ -121,6 +125,11 @@ if ($character['ch_id'] && $character['ch_state'] == '승인') {
}
if ($is_able_buy) {
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("amber.shop_ajax_update.buyitem_before");
}
Item::giveItem($character['ch_id'], $item['it_id'], $item, 1, "구매", true);
if ($use_point) {
@ -151,6 +160,10 @@ if ($character['ch_id'] && $character['ch_state'] == '승인') {
sql_query("delete from {$g5['title_has_table']} where hi_id = '{$use_has_title}'");
}
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("amber.shop_ajax_update.buyitem_after", $use_point, $use_exp_point, $use_inventory_item, $use_inventory_item_count);
}
$msg = "" . $item['it_name'] . " 》 구매 되었습니다.";
}
}
@ -163,3 +176,7 @@ if (defined('G5_THEME_PATH') && is_file(G5_THEME_PATH . "/shop/shop.result.skin.
} else {
include G5_PATH . "/shop/skin/shop.result.skin.php";
}
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("amber.shop_ajax_update.after");
}

View file

@ -3,14 +3,24 @@ include_once './_common.php';
$g5['title'] = "상점";
include_once './_head.php';
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("amber.shop.before");
}
$shop_cate = explode("||", $config['cf_shop_category']);
if (isset($shop_cate)) {
$shop_cate = array_merge(["전체"], $shop_cate);
} else {
$shop_cate = [];
}
if (!$cate) {
$cate = $shop_cate[0];
}
$sql_common = " from {$g5['shop_table']} ";
$sql_search = " where sh_use = '1' and ca_name = '{$cate}' ";
$sql_search = " where sh_use = '1'" . ($cate !== "전체" ? " and ca_name = '{$cate}'" : "");
$sql_order = " order by sh_order asc ";
$sql_limit = "";
@ -142,3 +152,6 @@ function ajax_shop_link_url(url, obj_id) {
<?php
include_once './_tail.php';
if (class_exists('EventHandler') && method_exists('EventHandler', 'triggerEvent')) {
EventHandler::triggerEvent("amber.shop.after");
}

View file

@ -18,7 +18,6 @@ AvocadoEdition Light 의 구조를 바탕으로 GNUBoard 기능과 함께 재수
-----------------------------
## 오류 제보
- [여기](../../../issues)에 직접 이슈를 남길 수 있습니다.
- [crepe](https://crepe.cm/@sharlayan)
- [mastodon](https://drk.st/@notice)
@ -29,17 +28,16 @@ AvocadoEdition Light 의 구조를 바탕으로 GNUBoard 기능과 함께 재수
-----------------------------
## Migration Guide
기존에 개조된 코드가 있다면 git을 이용해 병합하는 것을 추천합니다.
버전 변경에 대한 의뢰도 가능합니다.
## 기타
- 커뮤니티 기능 사용 시 [멤버 활동 및 신청서 합격 관리 추가 기능](https://github.com/tateck-develop/AvocadoEdition_CharacterManager) 이 포함되어 있습니다.
- 커뮤니티 기능을 끄고 켤 수 있습니다. 커뮤니티 용도로 사용하지 않는 경우
옵션을 사용하지 않음으로 설정하여 관리 페이지에서 기능을 숨길 수 있습니다.
## 설치
`AvocadoAmber` 경로 아래의 파일들을 호스팅의 `public` 또는 `www`, `public_html` 폴더에 업로드합니다.
- [여기](../../../releases/latest)에서 압축 파일 (tar.gz) 을 받습니다.
- 압축을 풀어 호스팅의 `public` 또는 `www`, `public_html` 폴더에 업로드합니다.
(또는 ssh 로 접속하여 직접 업로드하고 압축을 해제해도 됩니다.)
이후 호스팅 주소로 접속하여 설치 프로그램을 실행합니다.