add emoticon

This commit is contained in:
Amberstone 2024-10-04 23:34:30 +09:00
parent 9a1bf72661
commit 567bc42051
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
11 changed files with 393 additions and 37 deletions

View file

@ -1,10 +1,25 @@
<?php
if (!defined('_GNUBOARD_'))
exit;
/**
* 메뉴 추가가 필요한 경우 파일을 직접 수정하지 않고
* 파일 추가 변수 호출을 통해 사용하세요
if (!defined('_GNUBOARD_'))
exit;
if (!isset($menu["board"])) {
$menu["board"] = new MenuCategory("board", "board", "게시판관리", "/board_list.php", true, 2, "", 0);
}
$menu["board"]->addChildMenu("board", "게시판관리", G5_ADMIN_URL . "/board_list.php", true, 1, "\F463", 0);
$menu["board"]->addChildMenu("board", "커스텀메뉴", G5_ADMIN_URL . "/{your_file_name}.php", true, 1, "{bootstrap icon css code}", 0);
$menu["board"]->getLastAddedMenu()->addSubURL("/{your_subfile_name}.php");
*/
if (!isset($menu["board"])) {
$menu["board"] = new MenuCategory("board", "board", "게시판관리", "/board_list.php", true, 2, "", 0);
}
$menu["board"]->addChildMenu("board", "게시판관리", G5_ADMIN_URL . "/board_list.php", true, 100, "\F463", 0);
$menu["board"]->getLastAddedMenu()->addSubURL("/board_list_update.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/board_form.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/board_form_update.php");
@ -12,7 +27,7 @@ $menu["board"]->getLastAddedMenu()->addSubURL("/board_delete.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/board_copy.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/board_copy_update.php");
$menu["board"]->addChildMenu("board", "게시판그룹관리", G5_ADMIN_URL . "/boardgroup_list.php", true, 2, "\F2EE", 0);
$menu["board"]->addChildMenu("board", "게시판그룹관리", G5_ADMIN_URL . "/boardgroup_list.php", true, 200, "\F2EE", 0);
$menu["board"]->getLastAddedMenu()->addSubURL("/boardgroup_list_update.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/boardgroup_form.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/boardgroup_form_update.php");
@ -20,6 +35,10 @@ $menu["board"]->getLastAddedMenu()->addSubURL("/boardgroupmember_list.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/boardgroupmember_update.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/boardgroupmember_form.php");
$menu["board"]->addChildMenu("board", "내용관리", G5_ADMIN_URL . "/contentlist.php", true, 2, "\F620", 0);
$menu["board"]->addChildMenu("board", "내용관리", G5_ADMIN_URL . "/contentlist.php", true, 300, "\F620", 0);
$menu["board"]->getLastAddedMenu()->addSubURL("/contentform.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/contentformupdate.php");
$menu["board"]->addChildMenu("board", "이모티콘 관리", G5_ADMIN_URL . "/emoticon_list.php", true, 400, "\F329", 0);
$menu["board"]->getLastAddedMenu()->addSubURL("/emoticon_list_update.php");
$menu["board"]->getLastAddedMenu()->addSubURL("/emoticon_form_update.php");

View file

@ -0,0 +1,30 @@
<?php
if (!defined('_GNUBOARD_'))
exit;
/**
* 메뉴 추가가 필요한 경우 파일을 직접 수정하지 않고
* 파일 추가 변수 호출을 통해 사용하세요
if (!defined('_GNUBOARD_'))
exit;
if (!isset($menu["community"])) {
$menu["community"] = new MenuCategory("community", "community", "커뮤니티 호환기능", "", true, 4, "", 0);
}
$menu["community"]->addChildMenu("community", "커스텀메뉴", G5_ADMIN_URL . "/{your_file_name}.php", true, 1, "{bootstrap icon css code}", 0);
$menu["community"]->getLastAddedMenu()->addSubURL("/{your_subfile_name}.php");
*/
/*
!! TODO
if (!isset($menu["community"])) {
$menu["community"] = new MenuCategory("community", "community", "커뮤니티 호환기능", "", true, 4, "", 0);
}
$menu["community"]->addChildMenu("config", "커뮤니티 설정", G5_ADMIN_URL . "/community_form.php", true, 100, "\F3B3", 0);
$menu["community"]->addChildMenu("config", "캐릭터 관리", G5_ADMIN_URL . "/character_list.php", true, 200, "\F379", 0);
$menu["community"]->getLastAddedMenu()->addSubURL("/character_list_update.php");
$menu["community"]->getLastAddedMenu()->addSubURL("/character_form.php");
$menu["community"]->getLastAddedMenu()->addSubURL("/character_form_update.php");
*/

View file

@ -1,16 +1,31 @@
<?php
if (!defined('_GNUBOARD_'))
exit;
/**
* 메뉴 추가가 필요한 경우 파일을 직접 수정하지 않고
* 파일 추가 변수 호출을 통해 사용하세요
if (!defined('_GNUBOARD_'))
exit;
if (!isset($menu["member"])) {
$menu["member"] = new MenuCategory("member", "member", "회원관리", "/member_list.php", true, 1, "", 0);
}
$menu["member"]->addChildMenu("member", "회원관리", G5_ADMIN_URL . "/member_list.php", true, 1, "\F8A7", 0);
$menu["member"]->addChildMenu("member", "커스텀메뉴", G5_ADMIN_URL . "/{your_file_name}.php", true, 1, "{bootstrap icon css code}", 0);
$menu["member"]->getLastAddedMenu()->addSubURL("/{your_subfile_name}.php");
*/
if (!isset($menu["member"])) {
$menu["member"] = new MenuCategory("member", "member", "회원관리", "/member_list.php", true, 1, "", 0);
}
$menu["member"]->addChildMenu("member", "회원관리", G5_ADMIN_URL . "/member_list.php", true, 100, "\F8A7", 0);
$menu["member"]->getLastAddedMenu()->addSubURL("/member_form.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/member_delete.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/member_list_update.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/member_list_delete.php");
$menu["member"]->addChildMenu("member", "접속자집계", G5_ADMIN_URL . "/visit_list.php", true, 2, "\F3F2", 0);
$menu["member"]->addChildMenu("member", "접속자집계", G5_ADMIN_URL . "/visit_list.php", true, 200, "\F3F2", 0);
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_domain.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_browser.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_os.php");
@ -21,5 +36,5 @@ $menu["member"]->getLastAddedMenu()->addSubURL("/visit_week.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_month.php");
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_year.php");
$menu["member"]->addChildMenu("member", "접속자로그삭제", G5_ADMIN_URL . "/visit_delete.php", true, 3, "\F5DE", 0);
$menu["member"]->addChildMenu("member", "접속자로그삭제", G5_ADMIN_URL . "/visit_delete.php", true, 300, "\F5DE", 0);
$menu["member"]->getLastAddedMenu()->addSubURL("/visit_delete_update.php");

View file

@ -1,11 +1,26 @@
<?php
if (!defined('_GNUBOARD_'))
exit;
/**
* 메뉴 추가가 필요한 경우 파일을 직접 수정하지 않고
* 파일 추가 변수 호출을 통해 사용하세요
if (!defined('_GNUBOARD_'))
exit;
if (!isset($menu["other"])) {
$menu["other"] = new MenuCategory("other", "other", "기타관리", "/config_form.php", true, 99, "", 0);
}
$menu["other"]->addChildMenu("other", "홈페이지 상세관리", G5_ADMIN_URL . "/config_form.php", true, 1, "\F3E3", 0);
$menu["other"]->addChildMenu("other", "커스텀메뉴", G5_ADMIN_URL . "/{your_file_name}.php", true, 1, "{bootstrap icon css code}", 0);
$menu["other"]->getLastAddedMenu()->addSubURL("/{your_subfile_name}.php");
*/
if (!isset($menu["other"])) {
$menu["other"] = new MenuCategory("other", "other", "기타관리", "/config_form.php", true, 99, "", 0);
}
$menu["other"]->addChildMenu("other", "홈페이지 상세관리", G5_ADMIN_URL . "/config_form.php", true, 100, "\F3E3", 0);
$menu["other"]->getLastAddedMenu()->addSubURL("/config_form_update.php");
$menu["other"]->addChildMenu("other", "세션파일 일괄삭제", G5_ADMIN_URL . "/session_file_delete.php", true, 1, "\F8C3", 0);
$menu["other"]->addChildMenu("other", "캐시파일 일괄삭제", G5_ADMIN_URL . "/cache_file_delete.php", true, 1, "\F8C3", 0);
$menu["other"]->addChildMenu("other", "세션파일 일괄삭제", G5_ADMIN_URL . "/session_file_delete.php", true, 200, "\F8C3", 0);
$menu["other"]->addChildMenu("other", "캐시파일 일괄삭제", G5_ADMIN_URL . "/cache_file_delete.php", true, 300, "\F8C3", 0);

View file

@ -1,30 +1,45 @@
<?php
if (!defined('_GNUBOARD_'))
exit;
/**
* 메뉴 추가가 필요한 경우 파일을 직접 수정하지 않고
* 파일 추가 변수 호출을 통해 사용하세요
if (!defined('_GNUBOARD_'))
exit;
if (!isset($menu["config"])) {
$menu["config"] = new MenuCategory("config", "config", "사이트 설정", "/site_config_form.php", true, 0, "", 0);
}
$menu["config"]->addChildMenu("config", "환경설정", G5_ADMIN_URL . "/site_config_form.php", true, 1, "\F3E5", 0);
$menu["config"]->addChildMenu("config", "커스텀메뉴", G5_ADMIN_URL . "/{your_file_name}.php", true, 1, "{bootstrap icon css code}", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/{your_subfile_name}.php");
*/
if (!isset($menu["config"])) {
$menu["config"] = new MenuCategory("config", "config", "사이트 설정", "/site_config_form.php", true, 0, "", 0);
}
$menu["config"]->addChildMenu("config", "환경설정", G5_ADMIN_URL . "/site_config_form.php", true, 100, "\F3E5", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/site_config_form_update.php");
$menu["config"]->addChildMenu("config", "테마 설정", G5_ADMIN_URL . "/theme.php", true, 2, "\F4B2", 0);
$menu["config"]->addChildMenu("config", "테마 설정", G5_ADMIN_URL . "/theme.php", true, 200, "\F4B2", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/theme_config_load.php");
$menu["config"]->getLastAddedMenu()->addSubURL("/theme_detail.php");
$menu["config"]->getLastAddedMenu()->addSubURL("/theme_update.php");
$menu["config"]->getLastAddedMenu()->addSubURL("/theme_preview.php");
$menu["config"]->addChildMenu("config", "디자인 설정", G5_ADMIN_URL . "/design_form.php", true, 3, "\F1D8", 0);
$menu["config"]->addChildMenu("config", "디자인 설정", G5_ADMIN_URL . "/design_form.php", true, 300, "\F1D8", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/design_form_update.php");
$menu["config"]->addChildMenu("config", "메인 편집", G5_ADMIN_URL . "/viewer_form.php", true, 4, "\F891", 0);
$menu["config"]->addChildMenu("config", "메인 편집", G5_ADMIN_URL . "/viewer_form.php", true, 400, "\F891", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/viewer_form_update.php");
$menu["config"]->addChildMenu("config", "홈페이지 폰트 설정", G5_ADMIN_URL . "/editor_font.php", true, 5, "\F5CB", 0);
$menu["config"]->addChildMenu("config", "홈페이지 폰트 설정", G5_ADMIN_URL . "/editor_font.php", true, 500, "\F5CB", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/editor_font_update.php");
$menu["config"]->addChildMenu("config", "메뉴 설정", G5_ADMIN_URL . "/menu_list.php", true, 6, "\F478", 0);
$menu["config"]->addChildMenu("config", "메뉴 설정", G5_ADMIN_URL . "/menu_list.php", true, 600, "\F478", 0);
$menu["config"]->getLastAddedMenu()->addSubURL("/menu_list_update.php");
$menu["config"]->getLastAddedMenu()->addSubURL("/menu_form.php");
$menu["config"]->getLastAddedMenu()->addSubURL("/menu_form_search.php");
$menu["config"]->addChildMenu("config", "애드온 설정", G5_ADMIN_URL . "/addon_config.php", true, 7, "\F4CA", 0);
$menu["config"]->addChildMenu("config", "애드온 설정", G5_ADMIN_URL . "/addon_config.php", true, 700, "\F4CA", 0);

View file

@ -585,7 +585,7 @@ table {
}
.tbl_head01 tbody td a {
color: var(--theme-color-a);
color: var(--theme-color-d);
}

View file

@ -358,7 +358,7 @@ body {
.new_win_desc {
padding: 10px;
margin: 20px 0;
background: var(--theme-color-a);
background: var(--theme-color-0);
color: #fff;
}

View file

@ -0,0 +1,29 @@
<?php
include_once './_common.php';
/**
* @var string $me_text
*/
auth_check($auth[$sub_menu], 'w');
check_token();
@mkdir(G5_DATA_PATH . '/emoticon', G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH . '/emoticon', G5_DIR_PERMISSION);
if ($img = $_FILES['me_img']['name']) {
if (!preg_match("/\.(gif|jpg|png)$/i", $img)) {
alert("이모티콘 이미지가 gif, jpg, png 파일이 아닙니다.");
} else {
$emoticon_path = G5_DATA_PATH . '/emoticon';
$emoticon_image_code = time();
$emoticon_image_path = "$emoticon_path/$emoticon_image_code";
$emoticon_image_url = "/data/emoticon/$emoticon_image_code";
move_uploaded_file($_FILES['me_img']['tmp_name'], $emoticon_image_path);
chmod($emoticon_image_path, 0606);
$sql_common = " , me_img = '{$emoticon_image_url}' ";
}
}
sql_query(" insert into {$g5['emoticon_table']} set me_text = '{$me_text}'" . $sql_common);
goto_url('./emoticon_list.php?' . $qstr);

View file

@ -0,0 +1,201 @@
<?php
include_once './_common.php';
auth_check($auth[$sub_menu], 'r');
$token = get_token();
$sql_common = " from {$g5['emoticon_table']} ";
$sql_search = " where (1) ";
if (!$sst) {
$sst = "me_id";
$sod = "desc";
}
$sql_order = " order by {$sst} {$sod} ";
$sql = " select count(*) as cnt
{$sql_common}
{$sql_search}
{$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = 18;
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1)
$page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select *
{$sql_common}
{$sql_search}
{$sql_order}
limit {$from_record}, {$rows} ";
$result = sql_query($sql);
$listall = '<a href="' . $_SERVER['PHP_SELF'] . '" class="ov_listall">전체목록</a>';
$g5['title'] = '이모티콘 관리';
include_once './admin.head.php';
$colspan = 9;
$po_expire_term = '';
if ($config['cf_point_term'] > 0) {
$po_expire_term = $config['cf_point_term'];
}
?>
<h2 class="h2_frm">이모티콘 목록</h2>
<div class="local_ov01 local_ov">
<?php echo $listall ?>
전체 <?php echo number_format($total_count) ?>
</div>
<form name="fpointlist" id="fpointlist" method="post" action="./emoticon_list_update.php"
onsubmit="return fpointlist_submit(this);">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="token" value="<?php echo $token ?>">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<colgroup>
<col style="width: 50px;" />
<col style="width: 120px;" />
<col />
<col style="width: 50px;" />
<col style="width: 120px;" />
<col />
<col style="width: 50px;" />
<col style="width: 120px;" />
<col />
</colgroup>
<thead>
<tr>
<th scope="col">
<label for="chkall" class="sound_only">이모티콘 내역 전체</label>
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
</th>
<th scope="col">이미지</th>
<th scope="col">명령어</th>
<th scope="col">&nbsp;</th>
<th scope="col">이미지</th>
<th scope="col">명령어</th>
<th scope="col">&nbsp;</th>
<th scope="col">이미지</th>
<th scope="col">명령어</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$bg = 'bg' . ($i % 2);
?>
<?php if ($i % 3 == 0) {
if ($i == 0) {
echo "</tr>";
}
?>
<tr class="<?php echo $bg; ?>">
<?php } ?>
<td style="text-align: center">
<input type="hidden" name="me_id[<?php echo $i ?>]" value="<?php echo $row['me_id'] ?>"
id="me_id_<?php echo $i ?>">
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td style="text-align: center"><?php echo "<img src='" . G5_URL . "{$row['me_img']}' alt='{$row['me_text']}'>"; ?>
</td>
<td class="txt-left"><?php echo $row['me_text']; ?></td>
<?php
}
if ($i == 0)
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
if ($i % 3) {
for ($j = 0; $j < 3 - ($i % 3); $j++) {
echo "<td></td><td></td><td></td>";
}
}
if ($i > 0) {
echo "</tr>";
}
?>
</tbody>
</table>
</div>
<div class="btn_list01 btn_list">
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
</div>
</form>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&amp;page="); ?>
<section id="point_mng">
<h2 class="h2_frm">이모티콘 등록</h2>
<form name="fpointlist2" method="post" id="fpointlist2" action="./emoticon_form_update.php" autocomplete="off"
enctype="multipart/form-data">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="token" value="<?php echo $token ?>">
<div class="tbl_frm01 tbl_wrap">
<table>
<colgroup>
<col style="width: 120px;">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="me_text">이모티콘 명령어<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="me_text" id="me_text" class="required frm_input" required></td>
</tr>
<tr>
<th scope="row"><label for="me_img">이미지<strong class="sound_only">필수</strong></label></th>
<td><input type="file" name="me_img" id="me_img"></td>
</tr>
</tbody>
</table>
</div>
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="확인" class="btn_submit">
</div>
</form>
</section>
<script>
function fpointlist_submit(f) {
if (!is_checked("chk[]")) {
alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");
return false;
}
if (document.pressed == "선택삭제") {
if (!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
</script><?php
include_once './admin.tail.php';

View file

@ -0,0 +1,34 @@
<?php
$sub_menu = '300300';
include_once './_common.php';
check_demo();
auth_check($auth[$sub_menu], 'd');
check_token();
$count = count($_POST['chk']);
if (!$count)
alert($_POST['act_button'] . ' 하실 항목을 하나 이상 체크하세요.');
for ($i = 0; $i < $count; $i++) {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
// 이모티콘 등록 내역
$sql = " select * from {$g5['emoticon_table']} where me_id = '{$_POST['me_id'][$k]}' ";
$row = sql_fetch($sql);
if (!$row['me_id'])
continue;
// 이모티콘 내역삭제
$sql = " delete from {$g5['emoticon_table']} where me_id = '{$_POST['me_id'][$k]}' ";
sql_query($sql);
// 이모티콘 이미지 삭제
@unlink(G5_PATH . $row['me_img']);
}
goto_url('./emoticon_list.php?' . $qstr);

View file

@ -904,6 +904,18 @@ CREATE TABLE IF NOT EXISTS `avo_content` (
-- --------------------------------------------------------
--
-- Table structure for table `avo_emoticon`
--
DROP TABLE IF EXISTS `avo_emoticon`;
CREATE TABLE IF NOT EXISTS `avo_emoticon` (
`me_id` int(11) NOT NULL AUTO_INCREMENT,
`me_text` varchar(255) NOT NULL DEFAULT '',
`me_img` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`me_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `avo_faq`
--
@ -980,24 +992,10 @@ CREATE TABLE IF NOT EXISTS `avo_menu` (
PRIMARY KEY (`me_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 테이블 구조 `avo_emoticon`
--
DROP TABLE IF EXISTS `avo_emoticon`;
CREATE TABLE IF NOT EXISTS `avo_emoticon` (
`me_id` int(11) NOT NULL AUTO_INCREMENT,
`me_text` varchar(255) NOT NULL DEFAULT '',
`me_img` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`me_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 테이블 구조 `avo_css_config`
-- Table structure for table `avo_css_config`
--
DROP TABLE IF EXISTS `avo_css_config`;
CREATE TABLE IF NOT EXISTS `avo_css_config` (