Initial import of slot-ss.com (gnuboard5 + Eyoom + YoungCart) for migration

Original PHP source rsync'd from production server (slot-ss.com) on 2026-04-27.
Excluded from import:
  - data/editor (74GB user uploads), data/file (8.5GB attachments)
  - data/member_image, vendor/, db100up/, caches/sessions/logs/tmp

Includes:
  - 11,636 files, ~206MB source code (gnuboard5 v5.6.6, Eyoom builder, YoungCart 4)
  - 28 plugins (bacara, chatbot, cron, swiunApi, sns, sms5, ...)
  - Active theme: eb4_maga_005 (Eyoom magazine layout)
  - Local Docker dev stack (PHP 7.4 + Apache + Redis + MariaDB) under docker/
  - PostgreSQL migration setup (pgloader configs) under db/
  - Architecture/migration docs under docs/

Single non-source patch: src/config.php now reads G5_DOMAIN_OVERRIDE env var
so the local Docker stack can serve at http://localhost:8088 without touching
the production constant. Falls back to https://slot-ss.com when unset.
This commit is contained in:
chpark
2026-04-27 18:23:16 +09:00
commit 0e549cad46
11636 changed files with 1089802 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
# DB dumps and migration logs (large, regenerable, may contain PII)
db/*.sql.gz
db/*.sql
db/*.log
db/*.dump
# Local data uploads (not copied from prod)
src/data/cache/
src/data/session/
src/data/log/
src/data/tmp/
src/data/file/
src/data/editor/
src/data/member_image/
src/data/parsing/
src/data/eblatest/
# Composer dependencies (regenerated by entrypoint.sh)
src/vendor/
# PHP runtime
src/tmp/
*.log
# OS / editor
.DS_Store
Thumbs.db
.idea/
.vscode/
*.swp
*~
# Node.js (will exist after Next.js scaffolding)
node_modules/
.next/
.turbo/
dist/
build/
.env
.env.local
.env.production
# Docker
docker/data/
+67
View File
@@ -0,0 +1,67 @@
# slot — 슬롯 커뮤니티 마이그레이션 워크스페이스
원본 사이트(`slot-ss.com`, 그누보드5 + 이윰빌더 + 영카트)를
**Next.js + Node.js + PostgreSQL** 스택으로 재구축하기 위한 작업 공간.
## 디렉토리
| 경로 | 내용 |
|------|------|
| `src/` | 원본 PHP 소스 사본 (서버 `/var/www/slot-ss.com` 에서 rsync, 206MB / 11,652개 파일). 사용자 업로드(`data/editor`, `data/file``vendor/`·`db100up/`·캐시·세션·로그는 제외 |
| `db/` | MariaDB → PostgreSQL 마이그레이션 산출물. dump 파일과 pgloader 설정 |
| `docker/` | 원본 사이트를 로컬에서 그대로 띄우기 위한 PHP+Apache 도커 스택 |
| `docs/` | 마이그레이션 분석·계획·설계 문서 (MD) |
| `samples/` | 업로드 파일 샘플 (필요 시 추가) |
## 진행 상태 (2026-04-27)
- ✅ 서버 소스 → 로컬 (206MB / 11,652 파일)
- ✅ MariaDB 두 DB(`inspection`, `inspection2`) → 서버에서 dump → 로컬
- ✅ 임시 MariaDB 10.5 (Docker) 에 dump 복원
- ✅ pgloader 로 PostgreSQL 마이그레이션 (`slot`, `slot_legacy` DB, 165 테이블 / 1,820만 행 / 2.3GB)
- 🔄 PHP 컨테이너로 원본 사이트 로컬 실행 (port 8088)
- ⏳ 로그인 검증 → git push (`git.junggomoa.com/chpark/slot.git`)
- ⏳ Next.js + Node.js + PostgreSQL 신규 시스템 설계
- ⏳ 4종 테마 (기본 / 이윰빌더 / 아미나빌더 / 영카드) 빌트인 아키텍처
## 빠른 사용
### 원본 사이트 로컬 띄우기
```bash
# (사전조건) Docker Desktop 실행 중
cd docker && docker compose up -d
open http://localhost:8088/ # 그누보드 사이트
open http://localhost:8088/adm/ # 관리자
```
### PostgreSQL 접속
```bash
psql -h localhost -d slot # main DB (운영 = inspection2)
psql -h localhost -d slot_legacy # legacy = inspection
# 데이터는 schema "inspection2" / "inspection" 안에 있음
psql -h localhost -d slot -c "SELECT count(*) FROM inspection2.g5_member;"
```
### MariaDB 임시 인스턴스 (분석/검증용)
```bash
docker exec -it slot-mariadb mariadb -uroot -prootpass inspection2
# host: localhost, port: 33306
```
## 문서
| 파일 | 내용 |
|------|------|
| [docs/01-source-inventory.md](docs/01-source-inventory.md) | 원본 그누보드/이윰/플러그인 구조 |
| [docs/02-database-schema.md](docs/02-database-schema.md) | DB 테이블 분류, 핵심 스키마 |
| [docs/03-migration-plan.md](docs/03-migration-plan.md) | Next.js + Node.js + PostgreSQL 마이그레이션 전략 |
| [docs/04-theme-architecture.md](docs/04-theme-architecture.md) | 4종 테마 빌트인 아키텍처 (기본/이윰/아미나/영카드) |
| [docs/05-local-dev-setup.md](docs/05-local-dev-setup.md) | 로컬 개발 환경 셋업 가이드 |
| [docs/06-feature-inventory.md](docs/06-feature-inventory.md) | 슬롯/카지노 도메인 기능 인벤토리 |
## 보안 참고
- 이 저장소에는 운영 DB 패스워드(`data/dbconfig.php``iiOii5*^^*`)와
토큰 키(`G5_TOKEN_ENCRYPTION_KEY = ac57f676fe741f0ab3471d81dbee3bf1`)가
원본 그대로 들어 있습니다. 신규 시스템으로 이전 후에는 **반드시 회전**하세요.
- 운영 서버 SSH 패스워드(`eoqkrskwk!@!@`)는 이 저장소에 저장하지 않았습니다.
+37
View File
@@ -0,0 +1,37 @@
LOAD DATABASE
FROM mysql://root:rootpass@127.0.0.1:33306/inspection
INTO postgresql:///slot_legacy
WITH include drop, create tables, create indexes, reset sequences,
workers = 4, concurrency = 1,
multiple readers per thread, rows per range = 50000,
preserve index names
SET MySQL PARAMETERS
net_read_timeout = '600',
net_write_timeout = '600'
SET PostgreSQL PARAMETERS
maintenance_work_mem to '512MB',
work_mem to '64MB'
CAST type tinyint to smallint drop typemod,
type smallint to smallint drop typemod,
type mediumint to integer drop typemod,
type integer to integer drop typemod,
type int to integer drop typemod,
type bigint to bigint drop typemod,
type tinyint when unsigned to smallint drop typemod,
type smallint when unsigned to integer drop typemod,
type mediumint when unsigned to integer drop typemod,
type int when unsigned to bigint drop typemod,
type bigint when unsigned to bigint drop typemod,
type float to real drop typemod,
type double to float8 drop typemod,
type year to integer drop typemod,
type set to text drop typemod,
type enum to text drop typemod,
type datetime to timestamptz drop default drop not null using zero-dates-to-null,
type timestamp to timestamptz drop default drop not null using zero-dates-to-null,
type date to date drop default drop not null using zero-dates-to-null
;
+40
View File
@@ -0,0 +1,40 @@
LOAD DATABASE
FROM mysql://root:rootpass@127.0.0.1:33306/inspection2
INTO postgresql:///slot
WITH include drop, create tables, create indexes, reset sequences,
workers = 4, concurrency = 1,
multiple readers per thread, rows per range = 50000,
preserve index names
SET MySQL PARAMETERS
net_read_timeout = '600',
net_write_timeout = '600'
SET PostgreSQL PARAMETERS
maintenance_work_mem to '512MB',
work_mem to '64MB'
CAST type tinyint to smallint drop typemod,
type smallint to smallint drop typemod,
type mediumint to integer drop typemod,
type integer to integer drop typemod,
type int to integer drop typemod,
type bigint to bigint drop typemod,
type tinyint when unsigned to smallint drop typemod,
type smallint when unsigned to integer drop typemod,
type mediumint when unsigned to integer drop typemod,
type int when unsigned to bigint drop typemod,
type bigint when unsigned to bigint drop typemod,
type float to real drop typemod,
type double to float8 drop typemod,
type year to integer drop typemod,
type set to text drop typemod,
type enum to text drop typemod,
type datetime to timestamptz drop default drop not null using zero-dates-to-null,
type timestamp to timestamptz drop default drop not null using zero-dates-to-null,
type date to date drop default drop not null using zero-dates-to-null
BEFORE LOAD DO
$$ CREATE EXTENSION IF NOT EXISTS pg_trgm; $$,
$$ CREATE EXTENSION IF NOT EXISTS unaccent; $$;
+13
View File
@@ -0,0 +1,13 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
+77
View File
@@ -0,0 +1,77 @@
<?php
// Local override for /var/www/html/data/dbconfig.php
// Mounted read-only by docker-compose. Original (production) dbconfig stays
// in /Users/chpark/slot/src/data/dbconfig.php; this file is only used inside
// the Docker stack.
if (!defined('_GNUBOARD_')) exit;
define('G5_MYSQL_HOST', getenv('DB_HOST') ?: 'mariadb');
define('G5_MYSQL_USER', getenv('DB_USER') ?: 'root');
define('G5_MYSQL_PASSWORD', getenv('DB_PASS') ?: 'rootpass');
define('G5_MYSQL_DB', getenv('DB_NAME') ?: 'inspection2');
define('G5_MYSQL_SET_MODE', true);
define('G5_TABLE_PREFIX', 'g5_');
define('G5_TOKEN_ENCRYPTION_KEY', 'ac57f676fe741f0ab3471d81dbee3bf1');
$g5['write_prefix'] = G5_TABLE_PREFIX.'write_';
$g5['auth_table'] = G5_TABLE_PREFIX.'auth';
$g5['config_table'] = G5_TABLE_PREFIX.'config';
$g5['group_table'] = G5_TABLE_PREFIX.'group';
$g5['group_member_table'] = G5_TABLE_PREFIX.'group_member';
$g5['board_table'] = G5_TABLE_PREFIX.'board';
$g5['board_file_table'] = G5_TABLE_PREFIX.'board_file';
$g5['board_good_table'] = G5_TABLE_PREFIX.'board_good';
$g5['board_new_table'] = G5_TABLE_PREFIX.'board_new';
$g5['login_table'] = G5_TABLE_PREFIX.'login';
$g5['mail_table'] = G5_TABLE_PREFIX.'mail';
$g5['member_table'] = G5_TABLE_PREFIX.'member';
$g5['memo_table'] = G5_TABLE_PREFIX.'memo';
$g5['poll_table'] = G5_TABLE_PREFIX.'poll';
$g5['poll_etc_table'] = G5_TABLE_PREFIX.'poll_etc';
$g5['point_table'] = G5_TABLE_PREFIX.'point';
$g5['popular_table'] = G5_TABLE_PREFIX.'popular';
$g5['scrap_table'] = G5_TABLE_PREFIX.'scrap';
$g5['visit_table'] = G5_TABLE_PREFIX.'visit';
$g5['visit_sum_table'] = G5_TABLE_PREFIX.'visit_sum';
$g5['uniqid_table'] = G5_TABLE_PREFIX.'uniqid';
$g5['autosave_table'] = G5_TABLE_PREFIX.'autosave';
$g5['cert_history_table'] = G5_TABLE_PREFIX.'cert_history';
$g5['cert_config_table'] = @include_once($G5_CERT_CONFIG);
$g5['qa_config_table'] = G5_TABLE_PREFIX.'qa_config';
$g5['qa_content_table'] = G5_TABLE_PREFIX.'qa_content';
$g5['content_table'] = G5_TABLE_PREFIX.'content';
$g5['faq_table'] = G5_TABLE_PREFIX.'faq';
$g5['faq_master_table'] = G5_TABLE_PREFIX.'faq_master';
$g5['new_win_table'] = G5_TABLE_PREFIX.'new_win';
$g5['menu_table'] = G5_TABLE_PREFIX.'menu';
$g5['social_profile_table'] = G5_TABLE_PREFIX.'member_social_profiles';
$g5['member_cert_history_table'] = G5_TABLE_PREFIX.'member_cert_history';
define('G5_USE_SHOP', true);
define('G5_SHOP_TABLE_PREFIX', 'g5_shop_');
$g5['g5_shop_default_table'] = G5_SHOP_TABLE_PREFIX.'default';
$g5['g5_shop_banner_table'] = G5_SHOP_TABLE_PREFIX.'banner';
$g5['g5_shop_cart_table'] = G5_SHOP_TABLE_PREFIX.'cart';
$g5['g5_shop_category_table'] = G5_SHOP_TABLE_PREFIX.'category';
$g5['g5_shop_event_table'] = G5_SHOP_TABLE_PREFIX.'event';
$g5['g5_shop_event_item_table'] = G5_SHOP_TABLE_PREFIX.'event_item';
$g5['g5_shop_item_table'] = G5_SHOP_TABLE_PREFIX.'item';
$g5['g5_shop_item_option_table'] = G5_SHOP_TABLE_PREFIX.'item_option';
$g5['g5_shop_item_use_table'] = G5_SHOP_TABLE_PREFIX.'item_use';
$g5['g5_shop_item_qa_table'] = G5_SHOP_TABLE_PREFIX.'item_qa';
$g5['g5_shop_item_relation_table'] = G5_SHOP_TABLE_PREFIX.'item_relation';
$g5['g5_shop_order_table'] = G5_SHOP_TABLE_PREFIX.'order';
$g5['g5_shop_order_delete_table'] = G5_SHOP_TABLE_PREFIX.'order_delete';
$g5['g5_shop_wish_table'] = G5_SHOP_TABLE_PREFIX.'wish';
$g5['g5_shop_coupon_table'] = G5_SHOP_TABLE_PREFIX.'coupon';
$g5['g5_shop_coupon_zone_table'] = G5_SHOP_TABLE_PREFIX.'coupon_zone';
$g5['g5_shop_coupon_log_table'] = G5_SHOP_TABLE_PREFIX.'coupon_log';
$g5['g5_shop_sendcost_table'] = G5_SHOP_TABLE_PREFIX.'sendcost';
$g5['g5_shop_personalpay_table'] = G5_SHOP_TABLE_PREFIX.'personalpay';
$g5['g5_shop_order_address_table'] = G5_SHOP_TABLE_PREFIX.'order_address';
$g5['g5_shop_item_stocksms_table'] = G5_SHOP_TABLE_PREFIX.'item_stocksms';
$g5['g5_shop_post_log_table'] = G5_SHOP_TABLE_PREFIX.'order_post_log';
$g5['g5_shop_order_data_table'] = G5_SHOP_TABLE_PREFIX.'order_data';
$g5['g5_shop_inicis_log_table'] = G5_SHOP_TABLE_PREFIX.'inicis_log';
+41
View File
@@ -0,0 +1,41 @@
version: '3.8'
# Local replica of slot-ss.com for analysis & login verification.
# Uses the standalone `slot-mariadb` container (started by the migration script)
# at host port 33306. Visit http://localhost:8088 after `docker-compose up`.
services:
php:
image: php:7.4-apache
container_name: slot-php
ports:
- "8088:80"
volumes:
- ../src:/var/www/html
- ./dbconfig.local.php:/var/www/html/data/dbconfig.php:ro
- ./php.ini:/usr/local/etc/php/conf.d/zz-custom.ini:ro
- ./apache-vhost.conf:/etc/apache2/sites-available/000-default.conf:ro
- ./entrypoint.sh:/usr/local/bin/slot-entrypoint.sh:ro
entrypoint: ["/bin/bash", "/usr/local/bin/slot-entrypoint.sh"]
environment:
DB_HOST: slot-mariadb
DB_USER: root
DB_PASS: rootpass
DB_NAME: inspection2
G5_DOMAIN_OVERRIDE: "http://localhost:8088"
networks:
- slot-net
restart: unless-stopped
depends_on:
- redis
redis:
image: redis:7-alpine
container_name: slot-redis
networks:
- slot-net
restart: unless-stopped
networks:
slot-net:
external: true
+49
View File
@@ -0,0 +1,49 @@
#!/bin/bash
set -e
# Install required PHP extensions for gnuboard5
if [ ! -f /tmp/.deps_installed ]; then
echo "[entrypoint] Installing system deps + PHP extensions..."
apt-get update -qq
apt-get install -y -qq --no-install-recommends \
libonig-dev libzip-dev libpng-dev libjpeg-dev libfreetype6-dev \
libxml2-dev libcurl4-openssl-dev libicu-dev unzip git \
libxslt1-dev libssl-dev > /dev/null
docker-php-ext-configure gd --with-jpeg --with-freetype > /dev/null
docker-php-ext-install -j$(nproc) \
mysqli pdo pdo_mysql gd mbstring zip xml curl intl xsl bcmath > /dev/null
# Install Redis PHP extension (used by lib/RedisCache.class.php)
pecl install -f redis 2>&1 | tail -3 || true
docker-php-ext-enable redis 2>&1 | tail -3 || true
a2enmod rewrite headers > /dev/null
# composer for vendor/ install (gnuboard requires monolog, google/apiclient, firebase/jwt)
if [ ! -f /usr/local/bin/composer ]; then
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer > /dev/null
fi
touch /tmp/.deps_installed
echo "[entrypoint] Deps installed."
fi
# Ensure data/ directories that are normally writable exist & are writable
cd /var/www/html
for d in data data/cache data/session data/tmp data/log data/file data/editor data/member_image data/common; do
[ -d "$d" ] || mkdir -p "$d"
done
chown -R www-data:www-data data tmp 2>/dev/null || true
chmod -R 0777 data 2>/dev/null || true
# Install composer dependencies if vendor/ is missing (it was excluded from rsync)
if [ ! -d /var/www/html/vendor ]; then
echo "[entrypoint] Running composer install..."
cd /var/www/html
composer install --no-dev --no-interaction --no-progress 2>&1 | tail -20 || \
echo "[entrypoint] composer install failed; site may still partially load"
fi
echo "[entrypoint] Starting Apache. Visit http://localhost:8080/"
exec docker-php-entrypoint apache2-foreground
+16
View File
@@ -0,0 +1,16 @@
; PHP overrides for slot-ss.com local replica
date.timezone = "Asia/Seoul"
default_charset = "UTF-8"
short_open_tag = On
upload_max_filesize = 100M
post_max_size = 100M
memory_limit = 512M
max_execution_time = 120
display_errors = Off
display_startup_errors = Off
error_reporting = E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR
log_errors = On
error_log = /var/log/apache2/php_errors.log
session.cookie_httponly = 1
mbstring.internal_encoding = UTF-8
mbstring.http_output = UTF-8
+86
View File
@@ -0,0 +1,86 @@
# Source Code Inventory — slot-ss.com
원본 서버: `103.31.14.207:/var/www/slot-ss.com`
로컬 사본: `/Users/chpark/slot/src/` (206MB, 11,652개 파일)
사용자 업로드(`data/editor` 74GB, `data/file` 8.5GB), `vendor/`, `db100up/`, 캐시/세션/로그는 제외
## 0. 베이스 스택
- **그누보드5 v5.6.6** + **이윰빌더(Eyoom)** + **영카트(YoungCart) v5.4.5.5.1**
- PHP + MariaDB 10.5.25, Apache mod_rewrite
- 한글 슬롯/카지노 커뮤니티 (게시판 + 쇼핑몰 + 게임 + 챗봇)
## 1. 진입점
| 파일 | 역할 |
|------|------|
| `index.php` | 메인 디스패처. 활성 테마의 `index.php`를 include, 없으면 모바일/기본으로 폴백. 게시판(free, qa, notice, gallery) 최신글 표시 |
| `config.php` | 도메인, 경로(G5_PATH, G5_SHOP_PATH 등), 테마 선택, charset |
| `common.php` | ~900줄 부트스트랩. DB 함수, 세션/인증, SQL/XSS 필터, GB5/Eyoom 초기화 |
| `_common.php` | common.php include + 커뮤니티/쇼핑 활성화 체크 |
| `head.php` / `tail.sub.php` | 테마별 헤더/푸터 디스패치 |
| `version.php` | GB5 v5.6.6, YC4 v5.4.5.5.1 |
## 2. 라우팅 (`.htaccess`, mod_rewrite)
- `^shop/brand-([0-9a-z]+)$``shop/brand.php?br_cd=$1`
- `^shop/list-([0-9a-z]+)$``shop/list.php?ca_id=$1`
- `^shop/([0-9a-zA-Z_\-]+)$``shop/item.php?it_id=$1`
- `^group/([0-9a-zA-Z_]+)$``bbs/group.php?gr_id=$1`
- `^page/([0-9a-zA-Z_]+)$``page/?pid=$1`
- `^mypage/([0-9a-zA-Z_]+)$``mypage/?t=$1`
- `^content/([0-9a-zA-Z_]+)$``bbs/content.php?co_id=$1`
- `^([0-9a-zA-Z_]+)$``bbs/board.php?bo_table=$1`
- `^([0-9a-zA-Z_]+)/([0-9]+)$` → 게시판 + 글번호
## 3. 디렉토리 맵
| 디렉토리 | 크기 | 설명 |
|----------|------|------|
| `adm/` | 40M | 관리자: 인증, 게시판/쇼핑/회원/포인트 관리, betting_list, roulette/lottery 어드민 |
| `bbs/` | 2.6M | 게시판 코어: 글/댓글/Q&A. 12개 랭크 모듈, blacklist inspection, 바카라 프레임 |
| `shop/` | 3.8M | 쇼핑몰: 상품, 장바구니, 주문, 이니시스 결제 |
| `eyoom/` | 2.0M | Eyoom 빌더 코어 (CMS 템플릿 시스템). class/, core/, lib/, theme/ |
| `theme/` | 70M | **활성: eb4_maga_005** (매거진 레이아웃), 폴백: basic, eb4_basic |
| `plugin/` | 22M | 28개 플러그인 (아래 §6) |
| `lib/` | 5.7M | 코어 라이브러리: cache, hook, redis, sphinx, lottery, parsing 등 |
| `skin/` | 1.5M | 게시판/쇼핑 레거시 그누보드 스킨 |
| `mobile/` | 2.1M | 모바일 전용 템플릿 |
| `lottery/` | 104K | 복권 게임 (`index.php`, `bok.php`) |
| `roulette/` | 896K | 룰렛 게임 (`index.php`, 휠 이미지) |
| `extend/` | 116K | 확장 훅, SMS/OTP/소셜 설정 |
| `data/` | 45M | 런타임: 설정 캐시, eyoom 설정 (`eyoom.config.php`, `eyoom.eb4_maga_005.config.php`) |
| `mypage/` | 52K | 회원 마이페이지 |
| `page/` | 16K | CMS 정적 페이지 |
| `app/`, `public/` | 작음 | jwt_helper.php 토큰 처리 |
## 4. Eyoom 테마 시스템
- 활성 테마: **`theme/eb4_maga_005/`**
- 구조: `head.html.php`, `index.html.php`, `tail.html.php`, `side.html.php`, `skin/`(보드/숍 스킨), `shop/`, `page/`, `plugins/`, `css/`, `js/`, `image/`, `emoticon/`, `meta_config.php`, `seo.map.php`
- 폴백: `theme/basic/`, `theme/eb4_basic/`
## 5. 슬롯/카지노 커스텀 기능
| 기능 | 위치 |
|------|------|
| **바카라** | `plugin/bacara/` (betting, get_game_result, get_betting_list, get_game_data), `bbs/bacara.php`, `bbs/bacararank.php`, `css/bacara*.css` |
| **룰렛** | `roulette/index.php`, `adm/roulette/` (roulettelist, rouletteform, rewardlist 등) |
| **복권** | `lottery/index.php`, `lottery/bok.php`, `lib/lottery.lib.php`, `adm/roulette/lotterywinninglist.php` |
| **Swiun 슬롯 API** | `plugin/swiunApi/` (trans_point, game, get_betlist) — 외부 슬롯사 포인트 브릿지 |
| **게임 포인트/랭크** | `plugin/cron/auto.{slot,bacara,marilyn,...}rankup.php` (27개), `fake_game_points.php` |
| **블랙리스트 검수** | `bbs/inspection.php`, `bbs/inspection.list.update.php`, `bbs/inspection.update.php`, `adm/eyoom_admin/core/board/blacklist_search.php` |
| **베팅 관리자** | `adm/betting_list.php`, `adm/betting_list_update.php` |
## 6. 플러그인 (28개)
PHPMailer, ask-otp, **bacara**, browscap, **chatbot**(api_proxy/feedback), cron(42 파일, 27개 랭크업 작업), debugbar, editor, games, htmlpurifier, inicert, jqplot, jquery-ui, kcaptcha, kcpcert, lgxpay, notifier, **okname**(KO 본인인증), recaptcha/recaptcha_inv, **roulette**, slack, **sms5**(Aligo), **sns**(Naver/Kakao/Facebook 로그인), sns_share, social, **swiunApi**, syndi(Naver)
## 7. 프론트엔드 라이브러리
- `js/`: jQuery 1.12.4 + 1.8.3 + migrate-1.4.1, swiper, owlcarousel, remodal, tooltipster, font-awesome, jqplot, modernizr, html5.js, md5.js, common.js, shop.js, certify.js, autosave.js
- `css/`: default, mobile, default_shop, mobile_shop, bacara/bacara-button/bacara-frame, slotindex
## 8. 마이그레이션 난이도
**높음**. 다음을 재구현해야 함:
1. 28개 플러그인 + 훅 시스템 → Next.js 미들웨어/라우트 핸들러
2. Eyoom 테마/레이아웃 시스템 → Next.js 컴포넌트 라이브러리 + 헤드리스 CMS 패턴
3. Swiun 슬롯 API 브릿지 → Node.js API 프록시
4. 27개 게임 랭크 cron → Node.js 스케줄러 (BullMQ 등)
5. GB5 + Eyoom 이중 인증 → Next.js 통합 auth (NextAuth.js)
6. 바카라/룰렛 게임 → WebSocket 실시간 엔진
+160
View File
@@ -0,0 +1,160 @@
# Database Schema — slot-ss.com
## 1. 두 개의 DB
| 이름 | 위치 (PG) | 크기 (MariaDB) | 테이블 | 용도 |
|------|-----------|----------------|--------|------|
| `inspection2` | `slot.inspection2.*` | 4 GB | 165 | **현재 운영 DB** |
| `inspection` | `slot_legacy.inspection.*` | 397 MB | 107 | **구버전 (레거시)** — 일부 데이터 포함 |
| `DomainCheck` | (마이그레이션 안 함) | 4 KB | — | 거의 빈 테이블, 무시 |
> 모든 테이블은 PostgreSQL 의 `inspection2` schema 안에 있다 (pgloader 가 MySQL DB 이름을 schema 이름으로 사용). 접근: `psql -h localhost -d slot -c "SET search_path TO inspection2; ..."`
## 2. 카테고리별 분포 (운영 DB 기준)
| 카테고리 | 테이블 수 | 사이즈 | 행 수 |
|----------|-----------|--------|------|
| 그누보드 코어 (`g5_*`) | 36 | 2.39 GB | 11.07M |
| 커스텀 (slot/casino/chatbot/sms/등) | 27 | 713 MB | 6.07M |
| 게시판 데이터 (`g5_write_*`) | 37 | 416 MB | 764K |
| 이윰 빌더 (`g5_eyoom_*`) | 38 | 222 MB | 914K |
| 영카트 쇼핑몰 (`g5_shop_*`) | 24 | 1.16 MB | 1.7K |
| 플러그인 (`g5_plugin_*`) | 3 | 4.7 MB | 10K |
## 3. 가장 큰 테이블 Top 20
| 테이블 | 행 수 | 사이즈 | 설명 |
|--------|-------|--------|------|
| `g5_point` | 5,950,013 | 1380 MB | 회원 포인트 적립/사용 내역 |
| `g5_visit` | 4,566,650 | 929 MB | 방문자 로그 (전체 페이지뷰) |
| `game_point` | 4,383,542 | 515 MB | **게임 포인트** (슬롯/바카라/룰렛 베팅 결과) |
| `g5_write_free` | 442,272 | 228 MB | 자유게시판 글+댓글 |
| `g5_eyoom_attendance` | 425,540 | 116 MB | 출석체크 |
| `g5_eyoom_activity` | 418,236 | 91 MB | 회원 활동 로그 |
| `games_table` | 303,238 | 53 MB | **슬롯 게임 마스터 테이블** |
| `g5_write_pick` | 17,189 | 44 MB | 픽게시판 |
| `g5_write_review` | 120,870 | 43 MB | 슬롯 후기게시판 |
| `g5_board_new` | 191,817 | 42 MB | 신규 게시글 인덱스 (캐시) |
| `blacklist_table` | 193,190 | 42 MB | **먹튀 블랙리스트 검색** |
| `writing_activity_bak` | 610,146 | 39 MB | 게시 활동 로그 백업 |
| `writing_activity` | 184,376 | 31 MB | 게시 활동 로그 (현재) |
| `check_table` | 359,644 | 26 MB | 검수/검증 로그 |
| `g5_uniqid` | 322,862 | 23 MB | 그누보드 unique ID 생성기 |
| `g5_write_humor` | 20,303 | 20 MB | 유머/이슈 게시판 |
| `g5_write_rear` | 18,022 | 20 MB | 후방게시판 |
| `g5_write_mukti` | 37,325 | 15 MB | 먹튀사이트 게시판 |
| `g5_write_lottery_ticket` | 45,724 | 13 MB | 슬생복권 응모 |
| `g5_write_fakesite` | 33,126 | 10 MB | 가품사이트 게시판 |
## 4. 운영 게시판 전체 (g5_board → 36개 + 게시판별 g5_write_* 테이블)
| bo_table | 제목 | 글 수 | 댓글 수 |
|----------|------|------|---------|
| free | 자유게시판 | 90,591 | 351,685 |
| lottery_ticket | 슬생복권 | 45,724 | 0 |
| humor | 유머/이슈 | 19,209 | 1,094 |
| rear | 후방게시판 | 17,650 | 374 |
| pick | 픽게시판 | 17,171 | 23 |
| review | 후기게시판 | 8,399 | 112,462 |
| gift_coupons | 기프티콘교환 | 4,693 | 0 |
| webtoon | (19금)번역망가 | 1,987 | 0 |
| mukti | 먹튀사이트 | 1,824 | 35,501 |
| fakesite | 가품사이트 | 1,517 | 31,609 |
| gift_exchanges | 기프티콘현황 | 1,404 | 1,398 |
| news | 카지노뉴스 | 1,055 | 3 |
| complaint | 먹튀신고 | 1,052 | 17 |
| ai | (19금)AI 사진 | 984 | 0 |
| slotche2 | 프라그마틱 | 614 | 0 |
| slotreview | 슬롯 리뷰 | 544 | 1 |
| slotche4 | 플레이엔고 | 394 | 0 |
| slotche6 | 하바네로 | 176 | 0 |
| slotche5 | 릴랙스게이밍 | 151 | 0 |
| slotche7 | CQ9 | 146 | 0 |
| slotche3,8,9,10,11,12 | (기타 슬롯제작사) | < 100 each | — |
| dividend, guarantee, event, notice, qa, column, reservation, inspection, guide | (각종 보조게시판) | — | — |
## 5. 회원 (g5_member) 핵심 컬럼
| 컬럼 | 타입 | 설명 |
|------|------|------|
| `mb_no` | bigint PK | 회원 일련번호 |
| `mb_id` | varchar | 로그인 ID |
| `mb_password` | varchar | bcrypt + (gnuboard 전용) salt 해시 |
| `mb_password2` | varchar | (구버전 호환) |
| `mb_nick` | varchar | 닉네임 |
| `mb_email` | varchar | 이메일 |
| `mb_level` | smallint | 권한 레벨 (1-12). **12 = 최고관리자** |
| `mb_point` | int | 보유 포인트 |
| `mb_today_login`, `mb_login_start`, `mb_login_ip` | — | 로그인 기록 |
| `mb_certify`, `mb_adult`, `mb_dupinfo` | — | 본인인증 (KCP / okname) |
| `mb_signature` | text | 회원 서명 |
| `mb_open` | smallint | 정보공개 여부 |
**현재 회원 수**: 3,064 명 / 관리자 4명 (`admin`, `admin2`(먹튀판사), `admin3`(슬생검증팀), `admin4`(슬생운영팀))
## 6. 핵심 테이블 카테고리 별 정리
### 6.1 그누보드 코어 (`g5_*`)
- `g5_member`, `g5_member_social_profiles`, `g5_member_cert_history`
- `g5_board`, `g5_board_file`, `g5_board_good`, `g5_board_new`
- `g5_group`, `g5_group_member`
- `g5_point` (포인트 원장), `g5_login` (현재 로그인), `g5_visit` / `g5_visit_sum` (방문통계)
- `g5_qa_config`, `g5_qa_content` (1:1문의)
- `g5_content`, `g5_faq`, `g5_faq_master`, `g5_menu`, `g5_new_win`, `g5_poll`, `g5_poll_etc`, `g5_popular`, `g5_scrap`, `g5_memo`, `g5_mail`, `g5_autosave`, `g5_uniqid`, `g5_auth`, `g5_config`, `g5_cert_history`
### 6.2 게시판 데이터 (`g5_write_*`)
한 게시판당 한 테이블 — 위 §4 표의 36개 게시판 × 각 `g5_write_<bo_table>`
### 6.3 이윰 빌더 (`g5_eyoom_*`)
대표:
- `g5_eyoom_member` (확장 회원정보), `g5_eyoom_attendance` (출석), `g5_eyoom_activity` (활동), `g5_eyoom_respond` (반응/공감)
- `g5_eyoom_banner`, `g5_eyoom_banner_item`, `g5_eyoom_banner_hit`
- `g5_eyoom_slider`, `g5_eyoom_slider_ytitem`
- `g5_eyoom_yellowcard` (경고/제재), `g5_eyoom_manager` (운영진)
- `g5_eyoom_tag`, `g5_eyoom_tag_write` (태그)
- `g5_eyoom_bbspoll`, `g5_eyoom_counsel`, `g5_eyoom_goods`, `g5_eyoom_rating`, `g5_eyoom_mbmemo`, `g5_eyoom_yellowcard`
### 6.4 영카트 쇼핑몰 (`g5_shop_*`)
- 거의 비어있음 (운영 미가동) — 현재 데이터 1.7K 행, 1MB
- `g5_shop_default`(설정), `g5_shop_item`(상품), `g5_shop_item_option`, `g5_shop_cart`(1559건), `g5_shop_order`, `g5_shop_order_data`, `g5_shop_coupon*`, `g5_shop_event*`, `g5_shop_personalpay`, `g5_shop_inicis_log`
### 6.5 커스텀 — 슬롯/카지노 도메인
| 테이블 | 용도 |
|--------|------|
| `game_point` | 게임 포인트 (슬롯/바카라/룰렛 베팅 결과 적립) |
| `games_table` | 슬롯 게임 마스터 (303K 게임 회차 추정) |
| `bacara_betting` | 바카라 베팅 로그 (7.9K건) |
| `swiun_betting` | Swiun 슬롯 API 베팅 로그 |
| `lottery_history` | 복권 응모/당첨 이력 |
| `event_point_exchange`, `point_exchange` | 포인트 환전/이벤트 |
| `slotbuff`, `slotbuff-category` | "슬롯버프" 기능 |
| `blacklist_table`, `blacklist_search` | 먹튀 블랙리스트 |
| `check_table`, `writing_activity*`, `writing_today` | 검증/활동 로그 |
| `chatbot_conversations`, `chatbot_feedback` | 챗봇 (AI 대화) |
| `officecon_products` | 기프티콘 |
| `ask_seo`, `ask_seo_url` | SEO 메타 |
| `sms5_book`, `sms5_book_group`, `sms5_config`, `sms5_form`, `sms5_form_group`, `sms5_history`, `sms5_write` | SMS 발송 시스템 |
## 7. 마이그레이션 시 주의사항
### 7.1 인덱스 손실
- pgloader 의 `preserve index names` 옵션과 **MySQL 의 동일-인덱스명 across-table 허용** 차이로 211개 인덱스 생성 실패 (PostgreSQL 은 schema 내 인덱스 이름 unique 필수).
- 다음 단계로 인덱스 이름을 `<table>_<index>` 형태로 자동 rename 후 재생성 필요. → `db/regen_indexes.sql` 스크립트로 작성 예정.
### 7.2 비밀번호 해시
- 그누보드5 `mb_password` 는 PHP `password_hash($pw, PASSWORD_BCRYPT)` 형식
- Node.js 신규 시스템에서 `bcrypt.compare()` 호환 가능 (즉, 회원 비밀번호 그대로 사용 가능)
### 7.3 한글 인덱스 이름 / 특수 컬럼
- `lottery_history` 테이블의 `복권 게시판 주키` 같이 한글 이름의 인덱스가 있음 — pgloader 가 quoting 실패. 신규 스키마에서는 영어로 rename.
### 7.4 BLOB / 첨부 메타
- 본문 첨부파일 메타는 `g5_board_file` 에 있고 실파일은 서버의 `/var/www/slot-ss.com/data/file/<bo_table>/<wr_id>/<file>` 에 저장
- 에디터 이미지: `data/editor/<YYMM>/<file>` — 74GB
- 신규 시스템에서는 S3 호환 오브젝트 스토리지로 이전 권장 (Cloudflare R2 / AWS S3 / MinIO)
### 7.5 ENUM/SET
- pgloader 는 `enum`/`set``text` 로 변환. 검증 로직은 신규 스키마에서 CHECK 제약 또는 PostgreSQL native enum 으로 재정의 권장
### 7.6 datetime/zerodate
- MySQL 의 `'0000-00-00 00:00:00'``using zero-dates-to-null` 로 NULL 변환됨. NOT NULL 제약은 모두 제거된 채로 들어왔음. 비즈니스 로직에서 NULL 허용을 검토할 것.
+27
View File
@@ -0,0 +1,27 @@
#### 그누보드5 rewrite BEGIN #####
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^shop/brand-([0-9a-z]+)$ shop/brand.php?br_cd=$1&rewrite=1 [QSA,L]
RewriteRule ^shop/list-([0-9a-z]+)$ shop/list.php?ca_id=$1&rewrite=1 [QSA,L]
RewriteRule ^shop/type-([0-9a-z]+)$ shop/listtype.php?type=$1&rewrite=1 [QSA,L]
RewriteRule ^shop/([0-9a-zA-Z_\-]+)$ shop/item.php?it_id=$1&rewrite=1 [QSA,L]
RewriteRule ^shop/([^/]+)/$ shop/item.php?it_seo_title=$1&rewrite=1 [QSA,L]
RewriteRule ^group/([0-9a-zA-Z_]+)$ bbs/group.php?gr_id=$1&rewrite=1 [QSA,L]
RewriteRule ^page/([0-9a-zA-Z_]+)$ page/?pid=$1&rewrite=1 [QSA,L]
RewriteRule ^mypage/([0-9a-zA-Z_]+)$ mypage/?t=$1&rewrite=1 [QSA,L]
RewriteRule ^content/([0-9a-zA-Z_]+)$ bbs/content.php?co_id=$1&rewrite=1 [QSA,L]
RewriteRule ^content/([^/]+)/$ bbs/content.php?co_seo_title=$1&rewrite=1 [QSA,L]
RewriteRule ^rss/([0-9a-zA-Z_]+)$ bbs/rss.php?bo_table=$1 [QSA,L]
RewriteRule ^([0-9a-zA-Z_]+)$ bbs/board.php?bo_table=$1&rewrite=1 [QSA,L]
RewriteRule ^([0-9a-zA-Z_]+)/([^/]+)/$ bbs/board.php?bo_table=$1&wr_seo_title=$2&rewrite=1 [QSA,L]
RewriteRule ^([0-9a-zA-Z_]+)/write$ bbs/write.php?bo_table=$1&rewrite=1 [QSA,L]
RewriteRule ^([0-9a-zA-Z_]+)/([0-9]+)$ bbs/board.php?bo_table=$1&wr_id=$2&rewrite=1 [QSA,L]
#RewriteRule ^robots.txt$ /robots.php [L]
</IfModule>
#### 그누보드5 rewrite END #####
#php_value max_input_vars 2000
+242
View File
@@ -0,0 +1,242 @@
소프트웨어 제품은 저작권법 및 국제저작권 협약을 비롯하여, 기타 지적재산권법 및 협약의 보호를 받습니다.
프로그램 명칭 : 그누보드5 ( GNU Board 5 )
저작자 : (주)에스아이알소프트 http://sir.kr
라이센스 (License)
번역문 아래에 원문이 있습니다.
주의 )
1. 번역문과 원문의 내용상 차이가 있는 경우 원문의 내용을 우선으로 따릅니다.
2. 법적인 분쟁이 발생한 경우 저작자의 회사 소재지를 관할하는 관할법원에서 분쟁을 해결합니다.
3. 이 라이센스 파일 및 내용은 저작자를 제외한 어느 누구도 추가, 수정, 삭제할 수 없습니다.
----- LGPL 번역문 --------------------------------------------------------
GNU 약소 일반 공중 사용 허가서
2.1판, 1999년 2월
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
누구든지 본 사용 허가서를 있는 그대로 복제하고 배포할 수 있습니다.
그러나 본문에 대한 수정은 허용되지 않습니다.
[이 문서는 GNU 약소 일반 공중 사용 허가서의 이름으로 공표된 최초의 판본입니다.
본 사용 허가서는 GNU 라이브러리 일반 공중 사용 허가서 2판의 후속판으로
간주되기 때문에 2.1의 판번호를 갖고 있습니다.]
전 문
소프트웨어에 적용되는 대부분의 사용 허가서들은 소프트웨어에 대한 수정과 공유의 자유를 제한하려는 것을 그 목적으로 합니다. 그러나 GNU 일반 공중 사용 허가서들은 자유 소프트웨어에 대한 수정과 공유의 자유를 모든 사용자들에게 보장하기 위해서 성립된 것입니다.
본 사용 허가서인 GNU 약소 일반 공중 사용 허가서(이하, ``LGPL''이라고 칭합니다.)는 자유 소프트웨어 재단과 그밖의 저작자들이 이를 채택하기로 결정한, 주로 라이브러리와 같은 일부 특정한 소프트웨어 꾸러미에 적용됩니다. 누구든지 자신의 프로그램에 LGPL을 적용할 수 있지만, 어떤 상황에서 어떤 사용 허가서를 선택하는 것이 보다 나은 전략인지에 대해서 다음의 설명을 기준으로 먼저 신중히 고려해 보시기 바랍니다.
자유 소프트웨어라는 말에서 사용된 ``자유''라는 단어는 무료를 의미하는 금전적인 측면의 자유가 아니라 구속되지 않는다는 관점에서의 자유를 의미하며, GNU 일반 공중 사용 허가서들은 자유 소프트웨어를 이용한 복제와 개작 및 배포와 수익 사업 등의 가능한 모든 형태의 자유를 실질적으로 보장하고 있습니다. 여기에는 원시 코드의 일부 또는 전부를 원용해서 보다 개선된 프로그램을 만들거나 새로운 프로그램을 창작할 수 있는 자유가 보장되어 있으며, 자신에게 양도된 이러한 자유와 권리를 보다 명확하게 인식할 수 있도록 하기 위한 규정도 포함되어 있습니다.
소프트웨어를 양도받은 사람의 권리를 보호하기 위해서 우리는 배포자들이 이러한 권리를 부정하거나 포기하도록 피양도자에게 요구하는 행위를 금지시킬 필요가 있습니다. 이러한 금지 사항은 라이브러리를 개작하거나 배포하는 모든 사람들이 예외없이 지켜야 할 의무와 같습니다.
예를 들어, LGPL 라이브러리를 배포할 경우에는 이를 유료로 판매하거나 무료로 배포하는 것에 관계없이 자신이 해당 라이브러리에 대해서 가질 수 있었던 모든 권리를 피양도자에게 그대로 양도해 주어야 하고, 라이브러리의 원시 코드를 함께 제공하거나 원시 코드를 구할 수 있는 방법을 확실히 알려주어야 합니다. 또한 라이브러리에 다른 코드를 링크시켰다면, 라이브러리를 수정한 뒤에도 정상적으로 컴파일을 진행할 수 있도록 링크 되었던 코드에 해당하는 완전한 목적 파일 전체를 함께 제공해야 합니다. 또한 피양도자에게 이러한 모든 사항들을 분명히 알 수 있도록 해 주어야 합니다.
자유 소프트웨어 재단은 다음과 같은 두 가지 단계를 통해서 사용자들의 권리를 보호합니다. (1) 라이브러리에 저작권을 설정합니다. (2) 저작권의 양도에 관한 실정법에 의해서 유효한 법률적 효력을 갖는 LGPL을 통해서 소프트웨어를 복제하거나 개작 및 배포할 수 있는 권리를 사용자에게 부여합니다.
모든 배포자들을 보호하기 위해서 우리는 자유 라이브러리에 대한 어떠한 보증도 제공하지 않는다는 점을 명확히 밝혀둡니다. 라이브러리를 사용하는 사람들은 반복적인 재배포 과정을 통해 라이브러리 자체에 수정과 변형이 일어날 수도 있으며, 이는 최초의 저작자가 만든 라이브러리가 갖고 있는 문제가 아닐 수 있다는 개연성을 인식하고 있어야 합니다. 우리는 개작과 재배포 과정에서 다른 사람에 의해 발생된 문제로 인해 라이브러리의 원저작자의 신망이 실추되는 것을 원하지 않습니다.
특허 제도는 자유 소프트웨어의 존재를 위협하는 요소일 수밖에 없습니다. 우리는 특허권자로부터 기업이 제한적인 사용 허가를 얻은 뒤에 이를 통해 자유 프로그램의 사용자들을 규제할 수 없게 되기를 희망합니다. 따라서 우리는 특정한 버전의 라이브러리에 대한 어떠한 특허 사용 허가의 취득도 LGPL에 규정된 자유를 완전히 만족시키는 범위 내에서 이루어 져야 할 것을 요구합니다.
몇몇 라이브러리를 포함한 대부분의 GNU 소프트웨어에는 GPL이 적용됩니다. 본 사용 허가서인 LGPL은 특정한 라이브러리에만 적용되며 GPL과는 상당히 다른 면을 갖고 있습니다. LGPL은 특정한 라이브러리가 자유 소프트웨어가 아닌 프로그램과 함께 링크되는 것을 허용하려는 목적으로 사용됩니다.
어떤 프로그램이 라이브러리와 함께 링크된다면, 라이브러리가 정적으로 링크되든지 공유 라이브러리로 사용되든지 간에 이 두개의 조합은 법적으로 말할 때 결합 저작물, 즉 최초의 라이브러리로부터 파생된 2차적 저작물로 간주됩니다. GPL은 이러한 형태의 링크가 일어날 경우에 결합된 전체 저작물이 GPL을 만족할 때에 한해서만 링크를 허용합니다. 그러나 LGPL은 보다 유연한 링크 조건을 허용하고 있습니다.
우리가 본 사용 허가서를 ``약소'' 일반 공중 사용 허가서라고 부르는 이유는 사용자들의 자유를 보호하는 강도를 GPL보다 경감시켰기 때문입니다. 또한 LGPL은 자유 소프트웨어가 아닌 프로그램과 경쟁하는데 있어서 자유 소프트웨어 개발자들에게 GPL보다 이점을 덜 제공합니다. 우리가 많은 종류의 라이브러리에 LGPL이 아닌 일반적인 GPL을 사용하는 것은 이러한 이유 때문입니다. 그러나 특수한 상황에서는 오히려 LGPL을 사용하는 것이 유리할 수 있습니다.
극히 드문 예이긴 하지만, 어떤 라이브러리의 사용 폭을 가능한 넓게 유도해서 그것을 사실상의 표준으로 만들어야 할 특별한 필요가 있다고 생각해 봅시다. 이것을 가능하게 만들기 위해서는 자유 소프트웨어가 아닌 프로그램도 이러한 라이브러리를 사용할 수 있도록 허용해야 합니다. 이보다 흔한 또 한가지 예로 자유 소프트웨어가 아닌 라이브러리가 폭넓게 사용되고 있을 때 이와 동일한 기능을 제공하는 자유 라이브러리가 만들어진 경우를 생각해 볼 수 있습니다. 이러한 상황에서는 자유 라이브러리의 사용을 자유 소프트웨어에만 한정함으로써 얻을 수 있는 이익이 거의 없습니다. 이런 경우에 우리는 LGPL을 사용합니다.
또 하나의 예는 자유 소프트웨어가 아닌 프로그램에 특정한 라이브러리의 사용을 허용함으로써 보다 많은 사람들이 자유 소프트웨어를 사용할 수 있게 만드는 경우입니다. 예를 들면, 자유 소프트웨어가 아닌 프로그램들이 GNU C 라이브러리를 사용할 수 있도록 허용해서 사람들이 GNU 운영체제와 GNU/리눅스 운영체제를 사용하도록 유도할 수 있습니다.
LGPL이 사용자의 자유를 보다 약소적으로 보호하고 있음에도 불구하고, LGPL로 설정된 라이브러리와 링크된 프로그램을 사용하는 사용자는 라이브러리가 개작되더라도 개작된 버전을 사용해서 프로그램을 실행할 수 있는 확실한 자유와 이에 필요한 수단을 갖고 있습니다.
복제와 개작 및 배포에 관련된 구체적인 조건과 규정은 다음과 같습니다. ``라이브러리에 기반한 저작물''과 ``라이브러리를 사용하는 저작물''의 차이에 특별한 주의를 기울이기 바랍니다. 전자는 라이브러리로부터 파생된 코드를 담고 있는 저작물을 의미하는데 반해서 후자는 실행되기 위해서 라이브러리와 결합되어야 하는 저작물을 말합니다.
복제와 개작 및 배포에 관한 조건과 규정
제 0 조. 본 사용 허가 계약은 GNU 약소 일반 공중 사용 허가서(이하, ``LGPL''이라고 칭합니다.)의 규정에 따라 배포될 수 있다는 사항이 저작권자 또는 그에 준하는 정당한 권리을 갖고 있는 자에 의해서 명시된 모든 종류의 소프트웨어 라이브러리와 컴퓨터 프로그램 저작물(이하, ``프로그램''이라고 칭합니다.)에 대해서 동일하게 적용됩니다. ``피양도자''란 LGPL의 규정에 따라 프로그램을 양도받은 사람을 의미합니다.
``라이브러리''란 소프트웨어 함수와 데이터를 함께 또는 개별적으로 수집해 놓은 것으로 이들 중 일부를 사용하는 응용 프로그램과 링크되어 실행물을 생성하는데 편리하도록 미리 준비된 것을 의미합니다.
이하로 언급되는 ``라이브러리''는 본 사용 허가서에 의해서 배포되고 있는 모든 소프트웨어 라이브러리와 저작물을 의미합니다. ``라이브러리에 기반한 저작물''은 라이브러리 또는 저작권법에 따른 라이브러리의 2차적 저작물을 모두 의미합니다. 다시 말하면, 전술한 라이브러리 자신 또는 저작권법의 규정에 따라 라이브러리의 전부 또는 상당 부분을 원용하거나 다른 언어로의 번역을 포함할 수 있는 개작 과정을 통해서 창작된 새로운 라이브러리와 이와 관련된 저작물입니다. (이후로 다른 언어로의 번역은 별다른 제한없이 개작의 범위에 포함되는 것으로 간주합니다.)
저작물에 대한 ``원시 코드''란 해당 저작물을 개작하기에 적절한 형식을 의미합니다. 라이브러리에 대한 완전한 원시 코드란 라이브러리에 포함된 모든 모듈들의 원시 코드와 이와 관련된 인터페이스 정의 파일 모두, 그리고 라이브러리의 컴파일과 설치를 제어하는데 사용된 스크립트 전부를 의미합니다.
본 허가서는 복제와 개작 및 배포 행위에 대해서만 적용됩니다. 따라서 라이브러리를 사용하는 프로그램을 실행시키는 행위에 대한 제한은 없습니다. 이러한 프로그램의 결과물에는, 결과물을 생성하기 위한 도구로 라이브러리가 사용되었는지 아닌지의 여부에 관계없이 결과물이 라이브러리에 기반한 2차적 저작물을 구성했을 때에 한해서 본 허가서의 규정들이 적용됩니다. 2차적 저작물의 구성 여부는 2차적 저작물 안에서의 라이브러리의 역할과 라이브러리를 사용한 프로그램의 역할을 토대로 판단합니다.
제 1 조. 적절한 저작권 표시와 라이브러리에 대한 보증이 제공되지 않는다는 사실을 각각의 복제물에 명시하는 한, 피양도자는 라이브러리의 원시 코드를 자신이 양도받은 상태 그대로 어떠한 매체를 통해서도 복제하고 배포할 수 있습니다. 복제와 배포가 이루어 질 때는 본 허가서와 라이브러리에 대한 보증이 제공되지 않는다는 사실에 대해서 언급되었던 모든 내용들을 그대로 유지시켜야 하며, 영문판 LGPL을 함께 제공해야 합니다.
배포자는 복제물을 물리적으로 인도하는데 소요된 비용을 청구할 수 있으며, 선택 사항으로 독자적인 유료 보증을 설정할 수 있습니다.
제 2 조. 피양도자는 자신이 양도받은 라이브러리의 전부나 일부를 개작할 수 있으며, 이를 통해 라이브러리에 기반한 2차적 저작물을 창작할 수 있습니다. 개작된 라이브러리나 창작된 2차적 저작물은 다음의 사항들을 모두 만족시키는 조건에 한해서, 제1조의 규정에 따라 또다시 복제되고 배포될 수 있습니다.
제 1 항. 개작된 저작물은 반드시 소프트웨어 라이브러리여야 합니다.
제 2 항. 파일을 개작할 때는 파일을 개작한 사실과 그 날짜를 파일 안에 명시해야 합니다.
제 3 항. 저작물 전체에 대한 사용 권리를 본 허가서의 규정에 따라 공중에게 무상으로 허용해야 합니다.
제 4 항. 개작된 라이브러리에 포함된 기능이 그 기능을 사용하는 응용 프로그램으로부터 제공되는 함수나 데이터 테이블을 참조하는 경우에는, 이러한 기능이 호출되었을 때 매개 인수를 전달하는 경우를 제외하고는 응용 프로그램이 그러한 함수나 테이블을 제공하지 않는 경우에도 기능이 독립적으로 수행되고 목적하는 모든 부분이 확실하게 유효할 수 있도록 최대의 노력을 기울여야만 합니다
(예를 들면, 라이브러리에 포함된 제곱근 연산 함수는 응용 프로그램으로부터 명확하고 완전하게 독립적인 형태로 만들어져야 합니다. 따라서 제2조 4항은 제곱근 연산 함수가 어떠한 응용 프로그램이 제공하는 함수나 테이블도 필수적으로 사용되는 않는 형태로 만들어져야 한다는 것을 규정합니다. 즉, 응용 프로그램이 제공하는 기능 없이도 제곱근 연산 함수가 제곱근을 구할 수 있어야 합니다.)
위의 조항들은 개작된 라이브러리 전체에 적용됩니다. 만약, 개작된 라이브러리에 포함된 특정 부분이 라이브러리부터 파생된 것이 아닌 별도의 독립 저작물로 인정될 만한 상당한 이유가 있을 경우에는 해당 저작물의 개별적인 배포에는 본 허가서의 규정들이 적용되지 않습니다. 그러나 이러한 저작물이 라이브러리에 기반한 2차적 저작물의 일부로서 함께 배포된다면 개별적인 저작권과 배포 기준에 상관없이 저작물 모두가 본 허가서에 의해서 관리되어야 하며, 전체 저작물에 대한 사용 권리는 공중에게 무상으로 양도됩니다.
이러한 규정은 개별적인 저작물에 대한 저작자들의 권리를 침해하거나 인정하지 않으려는 것이 아니라, 라이브러리로부터 파생된 2차적 저작물이나 수집 저작물의 배포를 일관적으로 규제할 수 있는 권리를 행사하기 위한 것입니다.
라이브러리나 라이브러리로부터 파생된 2차적 저작물을 이들로부터 파생되지 않은 다른 저작물과 함께 단순히 저장하거나 배포하기 위한 목적으로 동일한 매체에 모아 놓은 집합물의 경우에는, 라이브러리로부터 파생되지 않은 다른 저작물에는 본 허가서의 규정들이 적용되지 않습니다.
제 3 조. 피양도자는 자신이 양도받은 라이브러리의 복제물에 LGPL 대신 GPL의 규정을 적용할 수 있습니다. 이것이 가능하기 위해서는 LGPL에 대해서 언급되었던 모든 사항을 GPL 2판으로 대체시켜야 합니다. (GPL 2판보다 신판이 공표되었을 경우에는 원한다면 신판의 판번호를 사용할 수 있습니다.) 그 이외에 다른 사항들은 변경할 수 없습니다.
복제물에 대해서 이러한 수정이 이루어 졌을 경우에는 GPL로 변경된 사용권 허가를 다시 변경할 수 없으며, 이에 따라서 해당 복제물을 기반으로 만들어진 모든 저작물과 복제물에는 GPL이 적용되어야만 합니다.
이러한 선택 사항은 라이브러리의 코드 일부분을 라이브러리가 아닌 일반 프로그램에 포함시키고자 할 경우에 유용합니다.
제 4 조. 피양도자는 제1조와 제2조의 규정에 따라 라이브러리(또는 제2조에 의한 라이브러리의 일부나 라이브러리에 기반한 2차적 저작물)를 목적 코드나 실행물의 형태로 복제하고 배포할 수 있습니다. 이 때 목적 코드나 실행물에 상응하는 컴퓨터가 인식할 수 있는 완전한 원시 코드를 제1조와 제2조의 규정에 따라 소프트웨어의 교환을 위해서 일반적으로 사용되는 매체를 통해 함께 제공해야 합니다.
목적 코드를 지정한 장소로부터 복제해 갈 수 있게 하는 방식으로 배포할 경우, 동일한 장소로부터 원시 코드를 복제할 수 있는 동등한 접근 방법을 제공한다면 이는 원시 코드가 목적 코드와 함께 복제되도록 설정되지 않았다 하더라도 원시 코드를 배포하는 것으로 간주됩니다.
제 5 조. 라이브러리의 어떠한 부분으로부터의 파생물도 포함하지 않지만, 컴파일 또는 링크를 통해서 라이브러리와 함께 작동하도록 설계된 프로그램은 ``라이브러리를 사용하는 저작물''이 됩니다. 이러한 저작물이 별도로 분리되어 있을 때는 라이브러리에 대한 파생물이 아니므로 본 사용 허가서가 적용되지 않습니다.
그러나 ``라이브러리를 사용하는 저작물''이 라이브러리와 링크된 결과로 생성된 실행물은, 실행물 안에 라이브러리의 일부를 포함하고 있기 때문에 라이브러리에 기반한 2차적 저작물을 구성하게 됩니다. 따라서 이러한 방식으로 생성된 실행물은 본 사용 허가서의 적용을 받습니다. 제6조는 이러한 종류의 실행물의 배포를 위한 규정을 담고 있습니다.
``라이브러리를 사용하는 저작물''이 라이브러리의 일부인 헤더 파일의 자료를 사용한 경우에는 그러한 저작물의 원시 코드가 라이브러리에 기반한 2차적 저작물이 아니었다 하더라도 목적 코드는 라이브러리에 기반한 2차적 저작물이 될 수 있습니다. 이러한 구분이 성립될 수 있는지의 여부는 그러한 저작물 자체가 라이브러리이거나 저작물에 사용된 라이브러리 없이도 링크될 수 있는 경우에 있어서 매우 중요한 차이를 갖습니다. 그러나 이러한 구분이 성립될 수 있는 명확한 판단 기준은 법률적으로 정의되어 있지 않습니다.
만약 이와같은 형태의 목적 파일이 단지 숫자 매개 변수와 자료 구조의 설계 형태 및 이에 대한 접근 도구 그리고 10행 미만으로 이루어진 작은 인라인 함수와 매크로만을 사용하는 것이라면 법적 기준에 의한 2차적 저작물의 성립 여부에 관계없이 그 사용이 제한되지 않습니다. (그러나 이러한 목적 코드와 라이브러리의 일부가 함께 포함된 실행물은 여전히 제6조의 적용을 받습니다.)
저작물이 라이브러리에 기반한 2차적 저작물이라면 해당 저작물에 대한 목적 코드는 제6조에 따라 배포될 수 있습니다. 또한 그러한 저작물을 포함한 실행물들은 기반이 된 라이브러리에 직접 링크되는지 아닌지의 여부에 관계없이 모두 제6조의 적용을 받습니다.
제 6 조. 위의 조항들에 대한 예외의 하나로, 라이브러리와 ``라이브러리를 사용하는 저작물''을 함께 결합하거나 링크시켜서 라이브러리의 일부분이 포함된 저작물을 만들었다면, 이를 자신이 선택한 규정에 따라 배포할 수 있습니다. 이 경우 배포 규정에는 피양도자들이 자신의 필요에 따라 저작물을 개작할 수 있으며 개작에 따른 디버깅을 위해 코드역분석(reverse regineering)을 허용한다는 사항이 포함되어야 합니다.
라이브러리와 라이브러리의 사용에는 본 사용 허가서가 적용된다는 것과 저작물 안에 이러한 라이브러리가 사용되고 있다는 사실을 담고 있는 안내 문구를 모든 복제물에 분명하게 명시해야 합니다. 또한 영문판 LGLP 사본을 함께 제공해야 합니다. 저작물이 실행될 때 저작권 사항이 표시되는 형태를 취하고 있다면 라이브러리에 대한 저작권 사항도 함께 포함시켜야 하며 LGPL 사본을 참고할 수 있는 방법을 명시해야 합니다. 또한 다음 중 하나의 사항을 반드시 만족시켜야 합니다.
제 1 항. 저작물에 포함된 라이브러리에 어떠한 수정이 가해졌다 하더라도 해당 라이브러리에 대한 컴퓨터가 인식할 수 있는 완전한 형태의 원시 코드를 저작물과 함께 제공해야 합니다. 이 원시 코드는 제1조와 제2조의 규정에 따라 배포될 수 있어야 합니다. 만약 저작물이 라이브러리와 링크되는 실행물이었을 경우에는 피양도자가 실행물과 링크되는 라이브러리를 개작한 뒤에도 링크를 통해 새로운 실행물을 만들 수 있도록 하기 위해서 ``라이브러리를 사용한 저작물''로서 배포된 저작물에 해당하는 컴퓨터가 인식할 수 있는 완전한 형태의 원시 코드와 목적 코드 중 하나 또는 둘 모두를 제공해야 합니다. (라이브러리에 포함된 정의 파일의 내용을 수정한 경우에는 변경된 정의 부분을 사용하기 위해서 응용 프로그램을 반드시 다시 컴파일할 필요는 없다는 점은 인정됩니다.)
제 2 항. 라이브러리는 적절한 공유 라이브러리 방식을 사용해서 링크되어야 합니다. 적절한 방식이란, (1) 라이브러리의 함수를 실행물 속으로 직접 복제하는 것이 아니라 실행 시점에서 볼 때 이미 사용자의 컴퓨터 시스템 상에 존재하고 있는 라이브러리의 복제물이 사용되는 것입니다. 또한 (2) 사용자가 개작된 라이브러리를 설치한 경우에도 개작된 라이브러리가 저작물을 만들 때 사용된 라이브러리의 버전과 인터페이스상으로 호환되는 한, 적절하게 동작할 수 있어야 합니다.
제 3 항. 배포에 필요한 최소한의 비용만을 받고 피양도자에게 제6조 1항에 규정된 자료를 배포하겠다는, 최소한 3년간 유효한 약정서를 저작물과 함께 제공해야 합니다.
제 4 항. 저작물을 지정한 장소로부터 복제해 갈 수 있게 하는 방식으로 배포하는 경우, 동일한 장소로부터 제6조 1항에 규정된 자료를 복제할 수 있는 동등한 접근 방법을 제공하는 것은 저작물에 대한 배포 조건을 충족하는 것으로 간주됩니다.
제 5 항. 피양도자가 제6조 1항에 규정된 자료의 복제물을 이미 수령했는지를 확인하거나 자신이 피양도자에게 그러한 자료를 이미 송부했는지를 확인해야 합니다.
실행물이 ``라이브러리를 사용하는 저작물''의 형태로 배포된다면 여기에는 실행물을 재생산하기 위해서 필요한 유틸리티 프로그램과 데이터들이 모두 포함되어야 합니다. 그러나 특별한 예외의 하나로서, 실행물이 실행될 운영체제의 주요 부분(컴파일러나 커널 등)과 함께 (원시 코드나 바이너리의 형태로) 일반적으로 배포되는 구성 요소들은 이러한 구성 요소 자체가 실행물에 수반되지 않는한 배포 대상에서 제외되어도 무방합니다.
이러한 규정이 일반적으로 운영체제에 함께 수반되지 않는 독점 라이브러리들의 사용 허가서와 충돌하게 될 경우에는 배포하고자 하는 실행물 안에 본 사용 허가서가 적용되는 라이브러리와 독점 라이브러리를 함께 사용할 수 없습니다.
제 7 조. 라이브러리에 기반한 저작물로서의 라이브러리의 일부를 본 사용 허가서가 적용되지 않는 다른 라이브러리의 일부와 하나의 라이브러리 안에 병존시킬 수 있습니다. 이러한 결합 라이브러리를 배포할 경우에는 라이브러리에 기반한 저작물과 그렇지 않은 라이브러리가 별도로 배포될 수 있음을 명시해야 하며 다음의 두가지 사항을 준수해야 합니다.
제 1 항. 결합 라이브러리를 구성하고 있는 ``라이브러리에 기반한 저작물''의 복제물을 결합되지 않은 독립된 상태로 함께 제공해야 합니다. 이 복제물의 배포에는 위의 조항들이 적용됩니다.
제 2 항. 라이브러리에 기반한 저작물의 일부가 결합 라이브러리 안에 포함하고 있다는 사실을 명시해야 하며, 제7조 1항에 의해서 제공된 결합되지 않은 상태의 ``라이브러리에 기반한 저작물''의 위치 정보를 명기해야 합니다.
제 8 조. 본 허가서에 의해서 명시적으로 이루어 지지 않는 한 라이브러리에 대한 복제와 개작, 하위 허가권 설정과 링크 및 배포가 이루어 질 수 없습니다. 이와 관련된 어떠한 행위도 무효이며 본 허가서가 보장한 권리는 자동으로 소멸됩니다. 그러나 본 허가서의 규정에 따라 라이브러리의 복제물이나 권리를 양도받았던 제3자는 본 허가서의 규정들을 준수하는 한, 배포자의 권리 소멸에 관계없이 사용상의 권리를 계속해서 유지할 수 있습니다.
제 9 조. 본 허가서는 서명이나 날인이 수반되는 형식을 갖고 있지 않기 때문에 피양도자가 본 허가서의 내용을 반드시 받아들여야 할 필요는 없습니다. 그러나 라이브러리나 라이브러리에 기반한 2차적 저작물에 대한 개작 및 배포를 허용하는 것은 본 허가서에 의해서만 가능합니다. 만약 본 허가서에 동의하지 않을 경우에는 이러한 행위들이 법률적으로 금지됩니다. 따라서 라이브러리(또는 라이브러리에 기반한 2차적 저작물)을 개작하거나 배포하는 행위는 이에 따른 본 허가서의 내용에 동의한다는 것을 의미하며, 복제와 개작 및 배포에 관한 본 허가서의 조건과 규정들을 모두 받아들이겠다는 의미로 간주됩니다.
제 10 조. 피양도자에 의해서 라이브러리(또는 라이브러리에 기반한 2차적 저작물)이 반복적으로 재배포될 경우, 각 단계에서의 피양도자는 본 허가서의 규정에 따른 라이브러리의 복제와 개작, 링크, 배포에 대한 권리를 최초의 양도자로부터 양도받은 것으로 자동적으로 간주됩니다. 라이브러리(또는 라이브러리에 기반한 2차적 저작물)을 배포할 때는 피양도자의 권리의 행사를 제한할 수 있는 어떠한 사항도 추가할 수 없습니다. 그러나 피양도자에게 재배포가 일어날 시점에서의 제3의 피양도자에게 본 허가서를 준수하도록 강제할 책임은 부과되지 않습니다.
제 11 조. 법원의 판결이나 특허권 침해에 대한 주장 또는 특허 문제에 국한되지 않은 그밖의 이유들로 인해서 본 허가서의 규정에 배치되는 사항이 발생한다 하더라도 그러한 사항이 선행하거나 본 허가서의 조건과 규정들이 면제되는 것은 아닙니다. 따라서 법원의 명령이나 합의 등에 의해서 본 허가서에 위배되는 사항들이 발생한 상황이라도 양측 모두를 만족시킬 수 없다면 라이브러리는 배포될 수 없습니다. 예를 들면, 특정한 특허 관련 허가가 라이브러리의 복제물을 직접 또는 간접적인 방법으로 양도받은 임의의 제3자에게 해당 라이브러리를 무상으로 재배포할 수 있게 허용하지 않는다면, 그러한 허가와 본 사용 허가를 동시에 만족시키면서 라이브러리를 배포할 수 있는 방법은 없습니다.
본 조항은 특정한 상황에서 본 조항의 일부가 유효하지 않거나 적용될 수 없을 경우에도 본 조항의 나머지 부분들을 적용하기 위한 의도로 만들어 졌습니다. 따라서 그 이외의 상황에서는 본 조항을 전체적으로 적용하면 됩니다.
본 조항의 목적은 특허나 저작권 침해 등의 행위를 조장하거나 해당 권리를 인정하지 않으려는 것이 아니라, 공중 사용 허가서들을 통해서 구현되어 있는 자유 소프트웨어의 배포 체계를 통합적으로 보호하기 위한 것입니다. 많은 사람들이 배포 체계에 대한 신뢰있는 지원을 계속해 줌으로써 소프트웨어의 다양한 분야에 많은 공헌을 해 주었습니다. 소프트웨어를 어떠한 배포 체계를 통해 배포할 것인가를 결정하는 것은 전적으로 저작자와 기증자들의 의지에 달려있는 것이지, 일반 사용자들이 강요할 수 있는 문제는 아닙니다.
본 조항은 본 허가서의 다른 조항들에서 무엇이 중요하게 고려되어야 하는 지를 명확하게 설명하기 위한 목적으로 만들어진 것입니다
제 12 조. 특허나 저작권이 설정된 인터페이스로 인해서 특정 국가에서 라이브러리의 배포와 사용이 함께 또는 개별적으로 제한되어 있는 경우, 본 사용 허가서를 라이브러리에 적용한 최초의 저작권자는 문제가 발생하지 않는 국가에 한해서 라이브러리를 배포한다는 배포상의 지역적 제한 조건을 명시적으로 설정할 수 있으며, 이러한 사항은 본 허가서의 일부로 간주됩니다.
제 13 조. 자유 소프트웨어 재단은 때때로 본 사용 허가서의 개정판이나 신판을 공표할 수 있습니다. 새롭게 공표될 판은 당면한 문제나 현안을 처리하기 위해서 세부적인 내용에 차이가 발생할 수 있지만, 그 근본 정신에는 변함이 없을 것입니다.
각각의 판들은 판번호를 사용해서 구별됩니다. 특정한 판번호와 그 이후 판을 따른다는 사항이 명시된 라이브러리에는 해당 판이나 그 이후에 발행된 어떠한 판을 선택해서 적용해도 무방하고, 판번호를 명시하고 있지 않은 경우에는 자유 소프트웨어 재단이 공표한 어떠한 판번호의 판을 적용해도 무방합니다.
제 14 조. 라이브러리의 일부를 본 허가서와 배포 기준이 다른 자유 프로그램과 함께 결합하고자 할 경우에는 해당 프로그램의 저작자로부터 서면 승인을 받아야 합니다. 자유 소프트웨어 재단이 저작권을 갖고 있는 소프트웨어의 경우에는 자유 소프트웨어 재단의 승인을 얻어야 합니다. 우리는 이러한 요청을 수락하기 위해서 때때로 예외 기준을 만들기도 합니다. 자유 소프트웨어 재단은 일반적으로 자유 소프트웨어의 2차적 저작물들을 모두 자유로운 상태로 유지시키려는 목적과 소프트웨어의 공유와 재활용을 증진시키려는 두가지 목적을 기준으로 승인 여부를 결정할 것입니다.
보증의 결여 (제15조, 제16조)
제 15 조. 본 허가서를 따르는 라이브러리는 무상으로 양도되기 때문에 관련 법률이 허용하는 한도 내에서 어떠한 형태의 보증도 제공되지 않습니다. 라이브러리의 저작권자와 배포자가 공동 또는 개별적으로 별도의 보증을 서면으로 제공할 때를 제외하면, 특정한 목적에 대한 라이브러리의 적합성이나 상업성 여부에 대한 보증을 포함한 어떠한 형태의 보증도 명시적이나 묵시적으로 설정되지 않은 ``있는 그대로의'' 상태로 이 라이브러리를 배포합니다. 라이브러리와 라이브러리의 실행에 따라 발생할 수 있는 모든 위험은 피양도자에게 인수되며 이에 따른 보수 및 복구를 위한 제반 경비 또한 피양도자가 모두 부담해야 합니다.
제 16 조. 저작권자나 배포자가 라이브러리의 손상 가능성을 사전에 알고 있었다 하더라도 발생된 손실이 관련 법규에 의해 보호되고 있거나 이에 대한 별도의 서면 보증이 설정된 경우가 아니라면, 저작권자나 라이브러리를 원래의 상태 또는 개작한 상태로 제공한 배포자는 라이브러리의 사용이나 비작동으로 인해 발생된 손실이나 라이브러리 자체의 손실에 대해 책임지지 않습니다. 이러한 면책 조건은 사용자나 제3자가 라이브러리를 조작함으로써 발생된 손실이나 다른 소프트웨어와 라이브러리를 함께 동작시키는 것으로 인해서 발생된 데이터의 상실 및 부정확한 산출 결과에만 국한되는 것이 아닙니다. 발생된 손실의 일반성이나 특수성 뿐 아니라 원인의 우발성 및 필연성도 전혀 고려되지 않습니다.
복제와 개작 및 배포에 관한 조건과 규정의 끝.
새로운 라이브러리에 LGPL을 적용하는 방법
새로운 라이브러리를 개발하고 그 라이브러리가 보다 많은 사람들에게 최대한 유용하게 사용되기를 원한다면, 본 허가서나 GNU 일반 공중 사용 허가서를 선택적으로 적용해서 누구나 자유롭게 개작하고 재배포할 수 있는 자유 소프트웨어로 만드는 것이 최선의 방법입니다.
라이브러리를 자유 소프트웨어로 만들기 위해서는 다음과 같은 사항을 라이브러리에 추가하면 됩니다. 라이브러리에 대한 보증이 제공되지 않는다는 사실을 가장 효과적으로 전달할 수 있는 방법은 원시 코드 파일의 시작 부분에 이러한 사항을 추가하는 것입니다. 각각의 파일에는 최소한 저작권을 명시한 행과 본 사용 허가서의 전체 내용을 참고할 수 있는 위치 정보를 명시해야 합니다.
라이브러리의 이름과 용도를 한 줄 정도로 설명합니다.
Copyright (C) 20yy년 <프로그램 저작자의 이름>
이 라이브러리는 자유 소프트웨어입니다. 소프트웨어의 피양도자는 자유 소프트웨어 재단이 공표한 GNU 약소 일반 공중 사용 허가서 2.1판 또는 그 이후 판을 임의로 선택해서, 그 규정에 따라 라이브러리를 개작하거나 재배포할 수 있습니다.
이 라이브러리는 유용하게 사용될 수 있으리라는 희망에서 배포되고 있지만, 특정한 목적에 맞는 적합성 여부나 판매용으로 사용할 수 있으리라는 묵시적인 보증을 포함한 어떠한 형태의 보증도 제공하지 않습니다. 보다 자세한 사항에 대해서는 GNU 약소 일반 공중 사용 허가서를 참고하시기 바랍니다.
GNU 약소 일반 공중 사용 허가서는 이 라이브러리와 함께 제공됩니다. 만약, 이 문서가 누락되어 있다면 자유 소프트웨어 재단으로 문의하시기 바랍니다. (자유 소프트웨어 재단: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA)
또한, 사용자들이 라이브러리를 배포한 사람에게 전자 메일과 서면으로 연락할 수 있는 정보를 추가해야 합니다.
만약, 라이브러리의 저작자가 학교나 기업과 같은 단체나 기관에 프로그래머로 고용되어 있다면 라이브러리의 자유로운 배포를 위해서 고용주나 해당 기관장으로부터 라이브러리에 대한 저작권 포기 각서를 받아야 합니다. 예를 들면 다음과 같은 형식이 될 수 있다. (아래의 문구를 실제로 사용할 경우에는 예로 사용된 이름들을 실제 이름으로 대체하면 됩니다.)
본사는 제임스 해커가 만든 (설정 옵션을 조정하기 위한) `Frob' 라이브러리에 관련된 모든 저작권을 포기합니다.
1990년 4월 1일
Yoyodye, Inc., 부사장: Ty Coon
서명: Ty Coon의 서명
----- LGPL 원문 --------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
----- 끝 --------------------------------------------------------
+57
View File
@@ -0,0 +1,57 @@
# 알리고 문자 플러그인
그누보드에서 알리고 API 를 이용해 문자를 보내는 프로그램입니다.
본 프로그램은 `<그누보드>/adm/sms_admin/` 디렉토리의 일부 파일을 교체하는 식으로 구현되었으며, 그누보드 5.4.29 에서 테스트되었습니다.
## 특징
- SMS, LMS, MMS 는 자동전환됩니다.
- 문자보내기 페이지의 보낼내용 하단에 "사진첨부" 버튼이 있습니다.
- 문자에 받는사람이름을 치환하는 치환자가 %고객명% 입니다.
## 설치하기
- 압축파일을 해제한다.
- 그누보드가 설치된 디렉토리에 업로드한다.
- adm/config_form.php 하단에 다음 코드를 추가한다.
```
<script>
$(function() {
$('#cf_sms_use').append('<option value="aligo"<?php echo get_selected($config['cf_sms_use'], 'aligo'); ?>>알리고</option>');
})
</script>
```
- 그누보드 관리자 > 기본환경설정 > SMS 에서 "SMS 사용"을 "알리고"로 설정한다.
- 그누보드 관리자 > SMS 기본설정에 라이센스 등록 이메일과 알리고 회원 아이디, API Key 를 입력한다.
## 영카트의 문자보내기 기능 사용을 위한 추가 설정
다음링크 참조 : https://byfun.com/bbs/board.php?bo_table=tech&wr_id=2
## 알리고 문자보내기 함수 사용 예제
관리자페이지 뿐 아니라 임의의 페이지에서 문자발송 코드를 사용하고자 할 때 사용할 수 있는 예제 코드입니다. `aligo_send()` 의 정의 및 파라미터는 extend/aligo.sms.php 파일을 참고하시기 바랍니다.
[code]
$sender_hp = '010-1234-5678'; // 회신 휴대폰 번호
$receiver_hp = '010-6789-1023'; // 수신자 휴대폰 번호 (배열로 사용 가능)
$receiver_name = '수신자명'; // 수신자명 (배열로 사용 가능)
$title = '제목'; // LMS 또는 MMS 인 경우에만 사용
$content = '문자내용';
$rdate = ''; // 예약일, YYYYMMDD 형식으로
$rtime = ''; // 예약시간, HHMM 형식으로
$img_path = G5_DATA_PATH.'/test.jpg'; // 첨부할 이미지 절대경로
$delete_img = false; // 문자발송 후 이미지 삭제할지
$is_test = false; // 테스트 전송인지
$res = aligo_send($sender_hp, $receiver_hp, $receiver_name, $content, $img_path, $rdate, $rtime, $title, $delete_img, $is_test);
/*
$res = Array
(
[result_code] => 1
[message] => success
[msg_id] => 124567890
[success_cnt] => 1
[error_cnt] => 0
[msg_type] => MMS
)
*/
[/code]
+3
View File
@@ -0,0 +1,3 @@
# Gnuboard5 Security Policy
Please ask [https://sir.kr/security/.](https://sir.kr/co_qa)
+10
View File
@@ -0,0 +1,10 @@
<?php
include_once('./common.php');
// 커뮤니티 사용여부
if(defined('G5_COMMUNITY_USE') && G5_COMMUNITY_USE === false) {
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
}
+4
View File
@@ -0,0 +1,4 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_PATH.'/head.php');
+4
View File
@@ -0,0 +1,4 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_PATH.'/tail.php');
+10
View File
@@ -0,0 +1,10 @@
<?php
define('G5_IS_ADMIN', true);
require_once '../common.php';
require_once G5_ADMIN_PATH . '/admin.lib.php';
if (isset($token)) {
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);
}
run_event('admin_common');
+122
View File
@@ -0,0 +1,122 @@
<?php
if (!defined('_GNUBOARD_')) {
exit;
}
$is_use_apache = (stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false);
$is_use_nginx = (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false);
$is_use_iis = !$is_use_apache && (stripos($_SERVER['SERVER_SOFTWARE'], 'microsoft-iis') !== false);
$is_write_file = false;
$is_apache_need_rules = false;
$is_apache_rewrite = false;
if (!($is_use_apache || $is_use_nginx || $is_use_iis)) { // 셋다 아니면 다 출력시킨다.
$is_use_apache = true;
$is_use_nginx = true;
}
if ($is_use_nginx) {
$is_write_file = false;
}
if ($is_use_apache) {
$is_write_file = (is_writable(G5_PATH) || (file_exists(G5_PATH . '/.htaccess') && is_writable(G5_PATH . '/.htaccess'))) ? true : false;
$is_apache_need_rules = check_need_rewrite_rules();
$is_apache_rewrite = function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules());
}
$get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'] . '/' : '/';
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . G5_JS_URL . '/remodal/remodal.css">', 11);
add_stylesheet('<link rel="stylesheet" href="' . G5_JS_URL . '/remodal/remodal-default-theme.css">', 12);
add_javascript('<script src="' . G5_JS_URL . '/remodal/remodal.js"></script>', 10);
?>
<section id="anc_cf_url">
<h2 class="h2_frm">짧은 주소 설정</h2>
<?php echo $pg_anchor ?>
<div class="local_desc02 local_desc">
<p>
게시판과 컨텐츠 페이지에 짧은 URL 을 사용합니다. <a href="https://sir.kr/manual/g5/286" class="btn btn_03" target="_blank" style="margin-left:10px">설정 관련 메뉴얼 보기</a>
<?php if ($is_use_apache && !$is_use_nginx) { ?>
<?php if (!$is_apache_rewrite) { ?>
<br><strong>Apache 서버인 경우 rewrite_module 이 비활성화 되어 있으면 짧은 주소를 사용할수 없습니다.</strong>
<?php } elseif (!$is_write_file && $is_apache_need_rules) { // apache인 경우 ?>
<br><strong>짧은 주소 사용시 아래 Apache 설정 코드를 참고하여 설정해 주세요.</strong>
<?php } ?>
<?php } ?>
</p>
</div>
<div class="server_config_views">
<?php if ($is_use_apache) { ?>
<button type="button" data-remodal-target="modal_apache" class="btn btn_03">Apache 설정 코드 보기</button>
<?php } ?>
<?php if ($is_use_nginx) { ?>
<button type="button" data-remodal-target="modal_nginx" class="btn btn_03">Nginx 설정 코드 보기</button>
<?php } ?>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>짧은주소 설정</caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<?php
$short_url_arrs = array(
'0' => array('label' => '사용안함', 'url' => G5_URL . '/board.php?bo_table=free&wr_id=123'),
'1' => array('label' => '숫자', 'url' => G5_URL . '/free/123'),
'2' => array('label' => '글 이름', 'url' => G5_URL . '/free/안녕하세요/'),
);
foreach ($short_url_arrs as $k => $v) {
$checked = ((int) $config['cf_bbs_rewrite'] === (int) $k) ? 'checked' : '';
?>
<tr>
<td><input name="cf_bbs_rewrite" id="cf_bbs_rewrite_<?php echo $k; ?>" type="radio" value="<?php echo $k; ?>" <?php echo $checked; ?>><label for="cf_bbs_rewrite_<?php echo $k; ?>" class="rules_label"><?php echo $v['label']; ?></label></td>
<td><?php echo $v['url']; ?></td>
</tr>
<?php } //end foreach ?>
</tbody>
</table>
</div>
<div class="server_rewrite_info">
<div class="is_rewrite remodal" data-remodal-id="modal_apache" role="dialog" aria-labelledby="modalApache" aria-describedby="modal1Desc">
<button type="button" class="connect-close" data-remodal-action="close">
<i class="fa fa-close"></i>
<span class="txt">닫기</span>
</button>
<h4 class="copy_title">.htaccess 파일에 적용할 코드입니다.
<?php if (!$is_apache_rewrite) { ?>
<br><span class="info-warning">Apache 서버인 경우 rewrite_module 이 비활성화 되어 있으면 짧은 주소를 사용할수 없습니다.</span>
<?php } elseif (!$is_write_file && $is_apache_need_rules) { ?>
<br><span class="info-warning">자동으로 .htaccess 파일을 수정 할수 있는 권한이 없습니다.<br>.htaccess 파일이 없다면 생성 후에, 아래 코드가 없으면 코드를 복사하여 붙여넣기 해 주세요.</span>
<?php } elseif (!$is_apache_need_rules) { ?>
<br><span class="info-success">정상적으로 적용된 상태입니다.</span>
<?php } ?>
</h4>
<textarea readonly="readonly" rows="10"><?php echo get_mod_rewrite_rules(true); ?></textarea>
</div>
<div class="is_rewrite remodal" data-remodal-id="modal_nginx" role="dialog" aria-labelledby="modalNginx" aria-describedby="modal2Desc">
<button type="button" class="connect-close" data-remodal-action="close">
<i class="fa fa-close"></i>
<span class="txt">닫기</span>
</button>
<h4 class="copy_title">아래 코드를 복사하여 nginx 설정 파일에 적용해 주세요.</h4>
<textarea readonly="readonly" rows="10"><?php echo get_nginx_conf_rules(true); ?></textarea>
</div>
</div>
</section>
+222
View File
@@ -0,0 +1,222 @@
<?php
if (!defined('_GNUBOARD_')) {
exit;
}
$g5_debug['php']['begin_time'] = $begin_time = get_microtime();
$files = glob(G5_ADMIN_PATH . '/css/admin_extend_*');
if (is_array($files)) {
foreach ((array) $files as $k => $css_file) {
$fileinfo = pathinfo($css_file);
$ext = $fileinfo['extension'];
if ($ext !== 'css') {
continue;
}
$css_file = str_replace(G5_ADMIN_PATH, G5_ADMIN_URL, $css_file);
add_stylesheet('<link rel="stylesheet" href="' . $css_file . '">', $k);
}
}
require_once G5_PATH . '/head.sub.php';
function print_menu1($key, $no = '')
{
global $menu;
$str = print_menu2($key, $no);
return $str;
}
function print_menu2($key, $no = '')
{
global $menu, $auth_menu, $is_admin, $auth, $g5, $sub_menu;
$str = "<ul>";
for ($i = 1; $i < count($menu[$key]); $i++) {
if (!isset($menu[$key][$i])) {
continue;
}
if ($is_admin != 'super' && (!array_key_exists($menu[$key][$i][0], $auth) || !strstr($auth[$menu[$key][$i][0]], 'r'))) {
continue;
}
$gnb_grp_div = $gnb_grp_style = '';
if (isset($menu[$key][$i][4])) {
if (($menu[$key][$i][4] == 1 && $gnb_grp_style == false) || ($menu[$key][$i][4] != 1 && $gnb_grp_style == true)) {
$gnb_grp_div = 'gnb_grp_div';
}
if ($menu[$key][$i][4] == 1) {
$gnb_grp_style = 'gnb_grp_style';
}
}
$current_class = '';
if ($menu[$key][$i][0] == $sub_menu) {
$current_class = ' on';
}
$str .= '<li data-menu="' . $menu[$key][$i][0] . '"><a href="' . $menu[$key][$i][2] . '" class="gnb_2da ' . $gnb_grp_style . ' ' . $gnb_grp_div . $current_class . '">' . $menu[$key][$i][1] . '</a></li>';
$auth_menu[$menu[$key][$i][0]] = $menu[$key][$i][1];
}
$str .= "</ul>";
return $str;
}
$adm_menu_cookie = array(
'container' => '',
'gnb' => '',
'btn_gnb' => '',
);
if (!empty($_COOKIE['g5_admin_btn_gnb'])) {
$adm_menu_cookie['container'] = 'container-small';
$adm_menu_cookie['gnb'] = 'gnb_small';
$adm_menu_cookie['btn_gnb'] = 'btn_gnb_open';
}
?>
<script>
var g5_admin_csrf_token_key = "<?php echo (function_exists('admin_csrf_token_key')) ? admin_csrf_token_key() : ''; ?>";
var tempX = 0;
var tempY = 0;
function imageview(id, w, h) {
menu(id);
var el_id = document.getElementById(id);
//submenu = eval(name+".style");
submenu = el_id.style;
submenu.left = tempX - (w + 11);
submenu.top = tempY - (h / 2);
selectBoxVisible();
if (el_id.style.display != 'none')
selectBoxHidden(id);
}
</script>
<?php if (isset($use_eyoom_builder) && $use_eyoom_builder) { ?>
<style>
.admin-eyoom {position:absolute; top:11px; right:260px; border-radius: 3px; background:#4e5eb7}
</style>
<?php } ?>
<div id="to_content"><a href="#container">본문 바로가기</a></div>
<header id="hd">
<h1><?php echo $config['cf_title'] ?></h1>
<div id="hd_top">
<button type="button" id="btn_gnb" class="btn_gnb_close <?php echo $adm_menu_cookie['btn_gnb']; ?>">메뉴</button>
<div id="logo"><a href="<?php echo correct_goto_url(G5_ADMIN_URL); ?>"><img src="<?php echo G5_ADMIN_URL ?>/img/logo.png" alt="<?php echo get_text($config['cf_title']); ?> 관리자"></a></div>
<div id="tnb">
<?php if (isset($use_eyoom_builder) && $use_eyoom_builder) { ?>
<a href="<?php echo G5_ADMIN_URL; ?>/admin.mode.php?to=eyoom" class="admin-eyoom">이윰관리자 바로가기</a>
<?php } ?>
<ul>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<li class="tnb_li"><a href="<?php echo G5_SHOP_URL ?>/" class="tnb_shop" target="_blank" title="쇼핑몰 바로가기">쇼핑몰 바로가기</a></li>
<?php } ?>
<li class="tnb_li"><a href="<?php echo G5_URL ?>/" class="tnb_community" target="_blank" title="커뮤니티 바로가기">커뮤니티 바로가기</a></li>
<li class="tnb_li"><a href="<?php echo G5_ADMIN_URL ?>/service.php" class="tnb_service">부가서비스</a></li>
<li class="tnb_li"><button type="button" class="tnb_mb_btn">관리자<span class="./img/btn_gnb.png">메뉴열기</span></button>
<ul class="tnb_mb_area">
<li><a href="<?php echo G5_ADMIN_URL ?>/member_form.php?w=u&amp;mb_id=<?php echo $member['mb_id'] ?>">관리자정보</a></li>
<li id="tnb_logout"><a href="<?php echo G5_BBS_URL ?>/logout.php">로그아웃</a></li>
</ul>
</li>
</ul>
</div>
</div>
<nav id="gnb" class="gnb_large <?php echo $adm_menu_cookie['gnb']; ?>">
<h2>관리자 주메뉴</h2>
<ul class="gnb_ul">
<?php
$jj = 1;
foreach ($amenu as $key => $value) {
$href1 = $href2 = '';
if (isset($menu['menu' . $key][0][2]) && $menu['menu' . $key][0][2]) {
$href1 = '<a href="' . $menu['menu' . $key][0][2] . '" class="gnb_1da">';
$href2 = '</a>';
} else {
continue;
}
$current_class = "";
if (isset($sub_menu) && (substr($sub_menu, 0, 3) == substr($menu['menu' . $key][0][0], 0, 3))) {
$current_class = " on";
}
$button_title = $menu['menu' . $key][0][1];
?>
<li class="gnb_li<?php echo $current_class; ?>">
<button type="button" class="btn_op menu-<?php echo $key; ?> menu-order-<?php echo $jj; ?>" title="<?php echo $button_title; ?>"><?php echo $button_title; ?></button>
<div class="gnb_oparea_wr">
<div class="gnb_oparea">
<h3><?php echo $menu['menu' . $key][0][1]; ?></h3>
<?php echo print_menu1('menu' . $key, 1); ?>
</div>
</div>
</li>
<?php
$jj++;
} //end foreach
?>
</ul>
</nav>
</header>
<script>
jQuery(function($) {
var menu_cookie_key = 'g5_admin_btn_gnb';
$(".tnb_mb_btn").click(function() {
$(".tnb_mb_area").toggle();
});
$("#btn_gnb").click(function() {
var $this = $(this);
try {
if (!$this.hasClass("btn_gnb_open")) {
set_cookie(menu_cookie_key, 1, 60 * 60 * 24 * 365);
} else {
delete_cookie(menu_cookie_key);
}
} catch (err) {}
$("#container").toggleClass("container-small");
$("#gnb").toggleClass("gnb_small");
$this.toggleClass("btn_gnb_open");
});
$(".gnb_ul li .btn_op").click(function() {
$(this).parent().addClass("on").siblings().removeClass("on");
});
});
</script>
<div id="wrapper">
<div id="container" class="<?php echo $adm_menu_cookie['container']; ?>">
<h1 id="container_title"><?php echo $g5['title'] ?></h1>
<div class="container_wr">
+95
View File
@@ -0,0 +1,95 @@
<?php
// 이 파일은 새로운 파일 생성시 반드시 포함되어야 함
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 관리자쪽 체크...
if(!defined('_RESPONSIVE_')) {
define('_RESPONSIVE_', true);
}
$begin_time = get_microtime();
if (isset($g5['title']) && $g5['title']) {
$g5_head_title = $g5['title'].' > '.$config['cf_title'];
} else { // 상태바에 표시될 제목
$g5['title'] = $config['cf_title'];
$g5_head_title = $g5['title'];
}
$g5_head_title = apms_get_text($g5_head_title);
// 현재 접속자
// 게시판 제목에 ' 포함되면 오류 발생
$g5['lo_location'] = addslashes($g5['title']);
if (!$g5['lo_location'])
$g5['lo_location'] = addslashes(clean_xss_tags($_SERVER['REQUEST_URI']));
$g5['lo_url'] = addslashes(clean_xss_tags($_SERVER['REQUEST_URI']));
if (strstr($g5['lo_url'], '/'.G5_ADMIN_DIR.'/') || $is_admin == 'super') $g5['lo_url'] = '';
/*
// 만료된 페이지로 사용하시는 경우
header("Cache-Control: no-cache"); // HTTP/1.1
header("Expires: 0"); // rfc2616 - Section 14.21
header("Pragma: no-cache"); // HTTP/1.0
*/
?>
<!doctype html>
<html lang="<?php echo $aslang['html_lang']; //ko ?>">
<head>
<meta charset="utf-8">
<?php
$body_mode = 'is-pc';
if (G5_IS_MOBILE) {
$body_mode = 'is-mobile';
echo '<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10">'.PHP_EOL;
echo '<meta name="HandheldFriendly" content="true">'.PHP_EOL;
echo '<meta name="format-detection" content="telephone=no">'.PHP_EOL;
}
echo '<meta http-equiv="imagetoolbar" content="no">'.PHP_EOL;
echo '<meta http-equiv="X-UA-Compatible" content="IE=Edge">'.PHP_EOL;
if(APMS_PRINT){ //프린트 상태일 때는 검색엔진에서 제외합니다.
echo '<meta name="robots" content="noindex, nofollow">'.PHP_EOL;
}
?>
<title><?php echo $g5_head_title; ?></title>
<link rel="stylesheet" href="<?php echo G5_ADMIN_URL;?>/css/admin.sub.css">
<link rel="stylesheet" href="<?php echo G5_CSS_URL;?>/apms.css?ver=<?php echo APMS_SVER;?>">
<?php if($xp['xp_icon'] == 'txt') { ?>
<link rel="stylesheet" href="<?php echo G5_CSS_URL;?>/level/<?php echo $xp['xp_icon_css'];?>.css?ver=<?php echo APMS_SVER;?>">
<?php } ?>
<!--[if lte IE 8]>
<script src="<?php echo G5_JS_URL ?>/html5.js"></script>
<![endif]-->
<script>
// 자바스크립트에서 사용하는 전역변수 선언
var g5_url = "<?php echo G5_URL ?>";
var g5_bbs_url = "<?php echo G5_BBS_URL ?>";
var g5_is_member = "<?php echo isset($is_member)?$is_member:''; ?>";
var g5_is_admin = "<?php echo isset($is_admin)?$is_admin:''; ?>";
var g5_is_mobile = "<?php echo G5_IS_MOBILE ?>";
var g5_bo_table = "<?php echo isset($bo_table)?$bo_table:''; ?>";
var g5_sca = "<?php echo isset($sca)?$sca:''; ?>";
var g5_pim = "<?php echo APMS_PIM ?>";
var g5_editor = "<?php echo ($config['cf_editor'] && $board['bo_use_dhtml_editor'])?$config['cf_editor']:''; ?>";
var g5_responsive = "<?php echo (_RESPONSIVE_) ? 1 : '';?>";
var g5_cookie_domain = "<?php echo G5_COOKIE_DOMAIN ?>";
<?php if($is_admin || defined('G5_IS_ADMIN')) { ?>
var g5_admin_url = "<?php echo G5_ADMIN_URL; ?>";
var g5_admin_csrf_token_key = "<?php echo (function_exists('admin_csrf_token_key')) ? admin_csrf_token_key() : ''; ?>";
<?php } ?>
</script>
<script src="<?php echo G5_JS_URL ?>/jquery-1.11.3.min.js"></script>
<script src="<?php echo G5_JS_URL ?>/jquery-migrate-1.2.1.min.js"></script>
<script src="<?php echo APMS_LANG_URL ?>/lang.js?ver=<?php echo APMS_SVER; ?>"></script>
<script src="<?php echo G5_JS_URL ?>/common.js?ver=<?php echo APMS_SVER; ?>"></script>
<script src="<?php echo G5_JS_URL ?>/wrest.js?ver=<?php echo APMS_SVER; ?>"></script>
<script src="<?php echo G5_JS_URL ?>/placeholders.min.js"></script>
<script src="<?php echo G5_JS_URL ?>/apms.js?ver=<?php echo APMS_SVER; ?>"></script>
<link rel="stylesheet" href="<?php echo G5_JS_URL ?>/font-awesome/css/font-awesome.min.css">
</head>
<body class="<?php echo (_RESPONSIVE_) ? '' : 'no-';?>responsive <?php echo $body_mode;?>">
<?php
if(APMS_PRINT) {
@include_once($print_skin_path.'/print.head.php');
}
?>
+131
View File
@@ -0,0 +1,131 @@
function check_all(f)
{
var chk = document.getElementsByName("chk[]");
for (i=0; i<chk.length; i++)
chk[i].checked = f.chkall.checked;
}
function btn_check(f, act)
{
if (act == "update") // 선택수정
{
f.action = list_update_php;
str = "수정";
}
else if (act == "delete") // 선택삭제
{
f.action = list_delete_php;
str = "삭제";
}
else
return;
var chk = document.getElementsByName("chk[]");
var bchk = false;
for (i=0; i<chk.length; i++)
{
if (chk[i].checked)
bchk = true;
}
if (!bchk)
{
alert(str + "할 자료를 하나 이상 선택하세요.");
return;
}
if (act == "delete")
{
if (!confirm("선택한 자료를 정말 삭제 하시겠습니까?"))
return;
}
f.submit();
}
function is_checked(elements_name)
{
var checked = false;
var chk = document.getElementsByName(elements_name);
for (var i=0; i<chk.length; i++) {
if (chk[i].checked) {
checked = true;
}
}
return checked;
}
function delete_confirm(el)
{
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
var token = get_ajax_token();
var href = el.href.replace(/&token=.+$/g, "");
if(!token) {
alert("토큰 정보가 올바르지 않습니다.");
return false;
}
el.href = href+"&token="+token;
return true;
} else {
return false;
}
}
function delete_confirm2(msg)
{
if(confirm(msg))
return true;
else
return false;
}
function get_ajax_token()
{
var token = "",
admin_csrf_token_key = (typeof g5_admin_csrf_token_key !== "undefined") ? g5_admin_csrf_token_key : "";
$.ajax({
type: "POST",
url: g5_admin_url+"/ajax.token.php",
data : {admin_csrf_token_key:admin_csrf_token_key},
cache: false,
async: false,
dataType: "json",
success: function(data) {
if(data.error) {
alert(data.error);
if(data.url)
document.location.href = data.url;
return false;
}
token = data.token;
}
});
return token;
}
$(function() {
$(document).on("click", "form input:submit, form button:submit", function() {
var f = this.form;
var token = get_ajax_token();
if(!token) {
alert("토큰 정보가 올바르지 않습니다.");
return false;
}
var $f = $(f);
if(typeof f.token === "undefined")
$f.prepend('<input type="hidden" name="token" value="">');
$f.find("input[name=token]").val(token);
return true;
});
});
+692
View File
@@ -0,0 +1,692 @@
<?php
if (!defined('_GNUBOARD_')) {
exit;
}
/*
// 081022 : CSRF 방지를 위해 코드를 작성했으나 효과가 없어 주석처리 함
if (!get_session('ss_admin')) {
set_session('ss_admin', true);
goto_url('.');
}
*/
// 스킨디렉토리를 SELECT 형식으로 얻음
function get_skin_select($skin_gubun, $id, $name, $selected = '', $event = '')
{
global $config;
$skins = array();
if (defined('G5_THEME_PATH') && $config['cf_theme']) {
$dirs = get_skin_dir($skin_gubun, G5_THEME_PATH . '/' . G5_SKIN_DIR);
if (!empty($dirs)) {
foreach ($dirs as $dir) {
$skins[] = 'theme/' . $dir;
}
}
}
$skins = array_merge($skins, get_skin_dir($skin_gubun));
$str = "<select id=\"$id\" name=\"$name\" $event>\n";
for ($i = 0; $i < count($skins); $i++) {
if ($i == 0) {
$str .= "<option value=\"\">선택</option>";
}
if (preg_match('#^theme/(.+)$#', $skins[$i], $match)) {
$text = '(테마) ' . $match[1];
} else {
$text = $skins[$i];
}
$str .= option_selected($skins[$i], $selected, $text);
}
$str .= "</select>";
return $str;
}
// 모바일 스킨디렉토리를 SELECT 형식으로 얻음
function get_mobile_skin_select($skin_gubun, $id, $name, $selected = '', $event = '')
{
global $config;
$skins = array();
if (defined('G5_THEME_PATH') && $config['cf_theme']) {
$dirs = get_skin_dir($skin_gubun, G5_THEME_MOBILE_PATH . '/' . G5_SKIN_DIR);
if (!empty($dirs)) {
foreach ($dirs as $dir) {
$skins[] = 'theme/' . $dir;
}
}
}
$skins = array_merge($skins, get_skin_dir($skin_gubun, G5_MOBILE_PATH . '/' . G5_SKIN_DIR));
$str = "<select id=\"$id\" name=\"$name\" $event>\n";
for ($i = 0; $i < count($skins); $i++) {
if ($i == 0) {
$str .= "<option value=\"\">선택</option>";
}
if (preg_match('#^theme/(.+)$#', $skins[$i], $match)) {
$text = '(테마) ' . $match[1];
} else {
$text = $skins[$i];
}
$str .= option_selected($skins[$i], $selected, $text);
}
$str .= "</select>";
return $str;
}
// 스킨경로를 얻는다
function get_skin_dir($skin, $skin_path = G5_SKIN_PATH)
{
global $g5;
$result_array = array();
$dirname = $skin_path . '/' . $skin . '/';
if (!is_dir($dirname)) {
return array();
}
$handle = opendir($dirname);
while ($file = readdir($handle)) {
if ($file == '.' || $file == '..') {
continue;
}
if (is_dir($dirname . $file)) {
$result_array[] = $file;
}
}
closedir($handle);
sort($result_array);
return $result_array;
}
// 테마
function get_theme_dir()
{
$result_array = array();
$dirname = G5_PATH . '/' . G5_THEME_DIR . '/';
$handle = opendir($dirname);
while ($file = readdir($handle)) {
if ($file == '.' || $file == '..') {
continue;
}
if (is_dir($dirname . $file)) {
$theme_path = $dirname . $file;
if (is_file($theme_path . '/index.php') && is_file($theme_path . '/head.php') && is_file($theme_path . '/tail.php')) {
$result_array[] = $file;
}
}
}
closedir($handle);
natsort($result_array);
return $result_array;
}
// 테마정보
function get_theme_info($dir)
{
$info = array();
$path = G5_PATH . '/' . G5_THEME_DIR . '/' . $dir;
if (is_dir($path)) {
$screenshot = $path . '/screenshot.png';
$screenshot_url = '';
if (is_file($screenshot)) {
$size = @getimagesize($screenshot);
if ($size[2] == 3) {
$screenshot_url = str_replace(G5_PATH, G5_URL, $screenshot);
}
}
$info['screenshot'] = $screenshot_url;
$text = $path . '/readme.txt';
if (is_file($text)) {
$content = file($text, false);
$content = array_map('trim', $content);
preg_match('#^Theme Name:(.+)$#i', $content[0], $m0);
preg_match('#^Theme URI:(.+)$#i', $content[1], $m1);
preg_match('#^Maker:(.+)$#i', $content[2], $m2);
preg_match('#^Maker URI:(.+)$#i', $content[3], $m3);
preg_match('#^Version:(.+)$#i', $content[4], $m4);
preg_match('#^Detail:(.+)$#i', $content[5], $m5);
preg_match('#^License:(.+)$#i', $content[6], $m6);
preg_match('#^License URI:(.+)$#i', $content[7], $m7);
$info['theme_name'] = trim($m0[1]);
$info['theme_uri'] = trim($m1[1]);
$info['maker'] = trim($m2[1]);
$info['maker_uri'] = trim($m3[1]);
$info['version'] = trim($m4[1]);
$info['detail'] = trim($m5[1]);
$info['license'] = trim($m6[1]);
$info['license_uri'] = trim($m7[1]);
}
if (!$info['theme_name']) {
$info['theme_name'] = $dir;
}
}
return $info;
}
// 테마설정 정보
function get_theme_config_value($dir, $key = '*')
{
$tconfig = array();
$theme_config_file = G5_PATH . '/' . G5_THEME_DIR . '/' . $dir . '/theme.config.php';
if (is_file($theme_config_file)) {
include $theme_config_file;
// 22.05.26 Undefined Variable $theme_config;
if ($key == '*') {
$tconfig = $theme_config;
} else {
$keys = array_map('trim', explode(',', $key));
foreach ($keys as $v) {
$tconfig[$v] = isset($theme_config[$v]) ? trim($theme_config[$v]) : '';
}
}
}
return $tconfig;
}
// 회원권한을 SELECT 형식으로 얻음
function get_member_level_select($name, $start_id = 0, $end_id = 10, $selected = "", $event = "")
{
global $g5;
$str = "\n<select id=\"{$name}\" name=\"{$name}\"";
if ($event) {
$str .= " $event";
}
$str .= ">\n";
for ($i = $start_id; $i <= $end_id; $i++) {
$str .= '<option value="' . $i . '"';
if ($i == $selected) {
$str .= ' selected="selected"';
}
$str .= ">{$i}</option>\n";
}
$str .= "</select>\n";
return $str;
}
// 회원아이디를 SELECT 형식으로 얻음
function get_member_id_select($name, $level, $selected = "", $event = "")
{
global $g5;
$sql = " select mb_id from {$g5['member_table']} where mb_level >= '{$level}' ";
$result = sql_query($sql);
$str = '<select id="' . $name . '" name="' . $name . '" ' . $event . '><option value="">선택안함</option>';
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$str .= '<option value="' . $row['mb_id'] . '"';
if ($row['mb_id'] == $selected) {
$str .= ' selected';
}
$str .= '>' . $row['mb_id'] . '</option>';
}
$str .= '</select>';
return $str;
}
// php8 버전 호환 권한 검사 함수
function auth_check_menu($auth, $sub_menu, $attr, $return = false)
{
$check_auth = isset($auth[$sub_menu]) ? $auth[$sub_menu] : '';
return auth_check($check_auth, $attr, $return);
}
// 권한 검사
function auth_check($auth, $attr, $return = false)
{
global $is_admin;
if ($is_admin == 'super') {
return;
}
if (!trim($auth)) {
$msg = '이 메뉴에는 접근 권한이 없습니다.\\n\\n접근 권한은 최고관리자만 부여할 수 있습니다.';
if ($return) {
return $msg;
} else {
alert($msg);
}
}
$attr = strtolower($attr);
if (!strstr($auth, $attr)) {
if ($attr == 'r') {
$msg = '읽을 권한이 없습니다.';
if ($return) {
return $msg;
} else {
alert($msg);
}
} else if ($attr == 'w') {
$msg = '입력, 추가, 생성, 수정 권한이 없습니다.';
if ($return) {
return $msg;
} else {
alert($msg);
}
} else if ($attr == 'd') {
$msg = '삭제 권한이 없습니다.';
if ($return) {
return $msg;
} else {
alert($msg);
}
} else {
$msg = '속성이 잘못 되었습니다.';
if ($return) {
return $msg;
} else {
alert($msg);
}
}
}
}
// 작업아이콘 출력
function icon($act, $link = '', $target = '_parent')
{
global $g5;
$img = array('입력' => 'insert', '추가' => 'insert', '생성' => 'insert', '수정' => 'modify', '삭제' => 'delete', '이동' => 'move', '그룹' => 'move', '보기' => 'view', '미리보기' => 'view', '복사' => 'copy');
$icon = '<img src="' . G5_ADMIN_PATH . '/img/icon_' . $img[$act] . '.gif" title="' . $act . '">';
if ($link) {
$s = '<a href="' . $link . '">' . $icon . '</a>';
} else {
$s = $icon;
}
return $s;
}
// rm -rf 옵션 : exec(), system() 함수를 사용할 수 없는 서버 또는 win32용 대체
// www.php.net 참고 : pal at degerstrom dot com
function rm_rf($file)
{
if (file_exists($file)) {
if (is_dir($file)) {
$handle = opendir($file);
while ($filename = readdir($handle)) {
if ($filename != '.' && $filename != '..') {
rm_rf($file . '/' . $filename);
}
}
closedir($handle);
@chmod($file, G5_DIR_PERMISSION);
@rmdir($file);
} else {
@chmod($file, G5_FILE_PERMISSION);
@unlink($file);
}
}
}
// 입력 폼 안내문
function help($help = "")
{
global $g5;
$str = '<span class="frm_info">' . str_replace("\n", "<br>", $help) . '</span>';
return $str;
}
// 출력순서
function order_select($fld, $sel = '')
{
$s = '<select name="' . $fld . '" id="' . $fld . '">';
for ($i = 1; $i <= 100; $i++) {
$s .= '<option value="' . $i . '" ';
if ($sel) {
if ($i == $sel) {
$s .= 'selected';
}
} else {
if ($i == 50) {
$s .= 'selected';
}
}
$s .= '>' . $i . '</option>';
}
$s .= '</select>';
return $s;
}
// 불법접근을 막도록 토큰을 생성하면서 토큰값을 리턴
function get_admin_token()
{
$token = md5(uniqid(rand(), true));
set_session('ss_admin_token', $token);
return $token;
}
// 관리자가 자동등록방지를 사용해야 할 경우
function get_admin_captcha_by($type = 'get')
{
$captcha_name = 'ss_admin_use_captcha';
if ($type === 'remove') {
set_session($captcha_name, '');
}
return get_session($captcha_name);
}
//input value 에서 xss 공격 filter 역할을 함 ( 반드시 input value='' 타입에만 사용할것 )
function get_sanitize_input($s, $is_html = false)
{
if (!$is_html) {
$s = strip_tags($s);
}
$s = htmlspecialchars($s, ENT_QUOTES, 'utf-8');
return $s;
}
function domain_mail_host($is_at=true){
list($domain_host,) = explode(':', $_SERVER['HTTP_HOST']);
if ('www.' === substr($domain_host, 0, 4)) {
$domain_host = substr($domain_host, 4);
}
return $is_at ? '@'.$domain_host : $domain_host;
}
function check_log_folder($log_path, $is_delete = true)
{
if (is_writable($log_path)) {
// 아파치 서버인 경우 웹에서 해당 폴더 접근 막기
$htaccess_file = $log_path . '/.htaccess';
if (!file_exists($htaccess_file)) {
if ($handle = @fopen($htaccess_file, 'w')) {
fwrite($handle, 'Order deny,allow' . "\n");
fwrite($handle, 'Deny from all' . "\n");
fclose($handle);
}
}
// 아파치 서버인 경우 해당 디렉토리 파일 목록 안보이게 하기
$index_file = $log_path . '/index.php';
if (!file_exists($index_file)) {
if ($handle = @fopen($index_file, 'w')) {
fwrite($handle, '');
fclose($handle);
}
}
}
if ($is_delete) {
try {
// txt 파일과 log 파일을 조회하여 30일이 지난 파일은 삭제합니다.
$txt_files = glob($log_path . '/*.txt');
$log_files = glob($log_path . '/*.log');
$del_files = array_merge($txt_files, $log_files);
if ($del_files && is_array($del_files)) {
foreach ($del_files as $del_file) {
$filetime = filemtime($del_file);
// 30일이 지난 파일을 삭제
if ($filetime && $filetime < (G5_SERVER_TIME - 2592000)) {
@unlink($del_file);
}
}
}
} catch (Exception $e) {
}
}
}
// POST로 넘어온 토큰과 세션에 저장된 토큰 비교
function check_admin_token()
{
$token = get_session('ss_admin_token');
set_session('ss_admin_token', '');
if (!$token || !$_REQUEST['token'] || $token != $_REQUEST['token']) {
alert('올바른 방법으로 이용해 주십시오.', G5_URL);
}
return true;
}
function admin_csrf_token_key($is_must=0){
global $member;
$key = '';
if($is_must || !((isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'))){
$key = md5((isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '').(defined('G5_TOKEN_ENCRYPTION_KEY') ? G5_TOKEN_ENCRYPTION_KEY : '').$member['mb_id'].$_SERVER['DOCUMENT_ROOT']);
}
return run_replace('admin_csrf_token_key', $key, $is_must);
}
// 관리자 페이지 referer 체크
function admin_referer_check($return = false)
{
$referer = isset($_SERVER['HTTP_REFERER']) ? trim($_SERVER['HTTP_REFERER']) : '';
if (!$referer) {
$msg = '정보가 올바르지 않습니다.';
if ($return) {
return $msg;
} else {
alert($msg, G5_URL);
}
}
$p = @parse_url($referer);
$host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);
$msg = '';
if ($host != $p['host']) {
$msg = '올바른 방법으로 이용해 주십시오.';
}
if ($p['path'] && !preg_match('/\/' . preg_quote(G5_ADMIN_DIR) . '\//i', $p['path'])) {
$msg = '올바른 방법으로 이용해 주십시오';
}
if ($msg) {
if ($return) {
return $msg;
} else {
alert($msg, G5_URL);
}
}
}
function admin_check_xss_params($params)
{
if (!$params) {
return;
}
foreach ($params as $key => $value) {
if (empty($value)) {
continue;
}
if (is_array($value)) {
admin_check_xss_params($value);
} else if ((preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && (preg_match('/script.*?\/script/ius', $value) || preg_match('/(onload|onerror)=.*/ius', $value))) || preg_match('/^(?=.*token\()(?=.*xmlhttprequest\()(?=.*send\().*$/im', $value) || (preg_match('/(onload|onerror|focus)=.*/ius', $value) && preg_match('/(eval|expression|exec|prompt)(\s*)\((.*)\)/ius', $value))) {
alert('요청 쿼리에 잘못된 스크립트문장이 있습니다.\\nXSS 공격일수도 있습니다.', G5_URL);
die();
}
}
return;
}
function admin_menu_find_by($call, $search_key)
{
global $menu;
static $cache_menu = array();
if (empty($cache_menu)) {
foreach ($menu as $k1 => $arr1) {
if (empty($arr1)) {
continue;
}
foreach ($arr1 as $k2 => $arr2) {
if (empty($arr2)) {
continue;
}
$menu_key = isset($arr2[3]) ? $arr2[3] : '';
if (empty($menu_key)) {
continue;
}
$cache_menu[$menu_key] = array(
'sub_menu' => $arr2[0],
'title' => $arr2[1],
'link' => $arr2[2],
);
}
}
}
if (isset($cache_menu[$call]) && isset($cache_menu[$call][$search_key])) {
return $cache_menu[$call][$search_key];
}
return '';
}
// 접근 권한 검사
if (!$member['mb_id']) {
alert('로그인 하십시오.', G5_BBS_URL . '/login.php?url=' . urlencode(correct_goto_url(G5_ADMIN_URL)));
} else if ($is_admin != 'super') {
$auth = array();
$sql = " select au_menu, au_auth from {$g5['auth_table']} where mb_id = '{$member['mb_id']}' ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$auth[$row['au_menu']] = $row['au_auth'];
}
if (!$i) {
alert('최고관리자 또는 관리권한이 있는 회원만 접근 가능합니다.', G5_URL);
}
}
// 관리자의 클라이언트를 검증하여 일치하지 않으면 세션을 끊고 관리자에게 메일을 보낸다.
if (!verify_mb_key($member)) {
session_destroy();
include_once G5_LIB_PATH . '/mailer.lib.php';
// 메일 알림
mailer($member['mb_nick'], $member['mb_email'], $member['mb_email'], 'XSS 공격 알림', $_SERVER['REMOTE_ADDR'] . ' 아이피로 XSS 공격이 있었습니다.<br><br>관리자 권한을 탈취하려는 접근이므로 주의하시기 바랍니다.<br><br>해당 아이피는 차단하시고 의심되는 게시물이 있는지 확인하시기 바랍니다.' . G5_URL, 0);
alert_close('정상적으로 로그인하여 접근하시기 바랍니다.');
}
if (isset($auth) && is_array($auth)) {
@ksort($auth);
} else {
$auth = array();
}
// 가변 메뉴
unset($auth_menu);
unset($menu);
unset($amenu);
$tmp = dir(G5_ADMIN_PATH);
$menu_files = array();
while ($entry = $tmp->read()) {
if (!preg_match('/^admin.menu([0-9]{3}).*\.php$/', $entry, $m)) {
continue; // 파일명이 menu 으로 시작하지 않으면 무시한다.
}
$amenu[$m[1]] = $entry;
$menu_files[] = G5_ADMIN_PATH . '/' . $entry;
}
@asort($menu_files);
foreach ($menu_files as $file) {
include_once $file;
}
@ksort($amenu);
$amenu = run_replace('admin_amenu', $amenu);
if (isset($menu) && $menu) {
$menu = run_replace('admin_menu', $menu);
}
$arr_query = array();
if (isset($sst)) {
$arr_query[] = 'sst=' . $sst;
}
if (isset($sod)) {
$arr_query[] = 'sod=' . $sod;
}
if (isset($sfl)) {
$arr_query[] = 'sfl=' . $sfl;
}
if (isset($stx)) {
$arr_query[] = 'stx=' . $stx;
}
if (isset($page)) {
$arr_query[] = 'page=' . $page;
}
$qstr = implode("&amp;", $arr_query);
if (isset($_REQUEST) && $_REQUEST) {
if (admin_referer_check(true)) {
admin_check_xss_params($_REQUEST);
}
}
// 관리자에서는 추가 스크립트와 추가 매타태그, 방문자분석 스크립트가 실행되지 않게 빈값으로 합니다.
if (run_replace('safe_admin_add_script_boolean', false) === false) {
$config['cf_analytics'] = '';
$config['cf_add_script'] = '';
$config['cf_add_meta'] = '';
}
+25
View File
@@ -0,0 +1,25 @@
<?php
$menu['menu100'] = array(
array('100000', '환경설정', G5_ADMIN_URL . '/config_form.php', 'config'),
array('100100', '기본환경설정', G5_ADMIN_URL . '/config_form.php', 'cf_basic'),
array('100200', '관리권한설정', G5_ADMIN_URL . '/auth_list.php', 'cf_auth'),
array('100280', '테마설정', G5_ADMIN_URL . '/theme.php', 'cf_theme', 1),
array('100290', '메뉴설정', G5_ADMIN_URL . '/menu_list.php', 'cf_menu', 1),
array('100300', '메일 테스트', G5_ADMIN_URL . '/sendmail_test.php', 'cf_mailtest'),
array('100310', '팝업레이어관리', G5_ADMIN_URL . '/newwinlist.php', 'scf_poplayer'),
array('100800', '세션파일 일괄삭제', G5_ADMIN_URL . '/session_file_delete.php', 'cf_session', 1),
array('100900', '캐시파일 일괄삭제', G5_ADMIN_URL . '/cache_file_delete.php', 'cf_cache', 1),
array('100910', '캡챠파일 일괄삭제', G5_ADMIN_URL . '/captcha_file_delete.php', 'cf_captcha', 1),
array('100920', '썸네일파일 일괄삭제', G5_ADMIN_URL . '/thumbnail_file_delete.php', 'cf_thumbnail', 1),
array('100500', 'phpinfo()', G5_ADMIN_URL . '/phpinfo.php', 'cf_phpinfo')
);
if (version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE) {
$menu['menu100'][] = array('100510', 'Browscap 업데이트', G5_ADMIN_URL . '/browscap.php', 'cf_browscap');
$menu['menu100'][] = array('100520', '접속로그 변환', G5_ADMIN_URL . '/browscap_convert.php', 'cf_visit_cnvrt');
}
$menu['menu100'][] = array('100410', 'DB업그레이드', G5_ADMIN_URL . '/dbupgrade.php', 'db_upgrade');
$menu['menu100'][] = array('100400', '부가서비스', G5_ADMIN_URL . '/service.php', 'cf_service');
$menu['menu100'][] = array('100991', '&nbsp; <i class="fa fa-caret-right" aria-hidden="true"></i> ASK-OTP', G5_ADMIN_URL.'/otp-login/otp-config.php', 'cf_otp');
+12
View File
@@ -0,0 +1,12 @@
<?php
$menu['menu200'] = array(
array('200000', '회원관리', G5_ADMIN_URL . '/member_list.php', 'member'),
array('200100', '회원관리', G5_ADMIN_URL . '/member_list.php', 'mb_list'),
array('200105', '가입경로', G5_ADMIN_URL.'/member_funnels.php', 'mb_funnels'),
array('200300', '회원메일발송', G5_ADMIN_URL . '/mail_list.php', 'mb_mail'),
array('200800', '접속자집계', G5_ADMIN_URL . '/visit_list.php', 'mb_visit', 1),
array('200810', '접속자검색', G5_ADMIN_URL . '/visit_search.php', 'mb_search', 1),
array('200820', '접속자로그삭제', G5_ADMIN_URL . '/visit_delete.php', 'mb_delete', 1),
array('200200', '포인트관리', G5_ADMIN_URL . '/point_list.php', 'mb_point'),
array('200900', '투표관리', G5_ADMIN_URL . '/poll_list.php', 'mb_poll')
);
+14
View File
@@ -0,0 +1,14 @@
<?php
$menu['menu300'] = array(
array('300000', '게시판관리', '' . G5_ADMIN_URL . '/board_list.php', 'board'),
array('300100', '게시판관리', '' . G5_ADMIN_URL . '/board_list.php', 'bbs_board'),
array('300200', '게시판그룹관리', '' . G5_ADMIN_URL . '/boardgroup_list.php', 'bbs_group'),
array('300300', '인기검색어관리', '' . G5_ADMIN_URL . '/popular_list.php', 'bbs_poplist', 1),
array('300400', '인기검색어순위', '' . G5_ADMIN_URL . '/popular_rank.php', 'bbs_poprank', 1),
array('300500', '1:1문의설정', '' . G5_ADMIN_URL . '/qa_config.php', 'qa'),
array('300600', '내용관리', G5_ADMIN_URL . '/contentlist.php', 'scf_contents', 1),
array('300700', 'FAQ관리', G5_ADMIN_URL . '/faqmasterlist.php', 'scf_faq', 1),
array('300710', '컨텐츠수집(파싱)', G5_ADMIN_URL.'/parsing.php', 'scf_parsing', 1),
array('300820', '글,댓글 현황', G5_ADMIN_URL . '/write_count.php', 'scf_write_count'),
array('300900', '베팅참여현황', G5_ADMIN_URL.'/betting_list.php', 'betting_list'),
);
+8
View File
@@ -0,0 +1,8 @@
<?php
$menu['menu330'] = array(
array('330000', '검색엔진최적화', G5_ADMIN_URL . '/meta_seo.php', 'seo_meta'),
array('330100', '메타태그관리', G5_ADMIN_URL . '/meta_seo.php', 'seo_meta'),
// array('330200', 'Sitemap.xml', G5_ADMIN_URL.'/sitemap.php', 'seo_sitemap'),
// array('330300', 'RSS피드', G5_ADMIN_URL . '/rss_feed.php', 'seo_ress'),
// array('330400', '웹마스터도구메뉴얼', G5_ADMIN_URL . '/webmaster.php', 'seo_webmaster'),
);
+8
View File
@@ -0,0 +1,8 @@
<?php
$menu['menu350'] = array (
array('350000', '소모임 관리', ''.G5_ADMIN_URL.'/config_form.php', 'somoim'),
array('350100', '소모임 기본설정', ''.G5_ADMIN_URL.'/config_form.php', 'somo_config'),
array('350200', '정식 소모임 리스트', ''.G5_ADMIN_URL.'/somo_list.php', 'somo_list'),
array('350300', '미개설 신청 리스트', ''.G5_ADMIN_URL.'/somo_apply.php', 'somo_apply'),
);
?>
+25
View File
@@ -0,0 +1,25 @@
<?php
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) {
return;
}
$menu['menu400'] = array(
array('400000', '포인트몰관리', G5_ADMIN_URL . '/shop_admin/', 'shop_config'),
//array('400010', '포인트몰현황', G5_ADMIN_URL . '/shop_admin/', 'shop_index'),
//array('400100', '포인트몰설정', G5_ADMIN_URL . '/shop_admin/configform.php', 'scf_config'),
//array('400440', '개인결제관리', G5_ADMIN_URL . '/shop_admin/personalpaylist.php', 'scf_personalpay', 1),
//array('400200', '분류관리', G5_ADMIN_URL . '/shop_admin/categorylist.php', 'scf_cate'),
//array('400300', '쿠폰관리', G5_ADMIN_URL . '/shop_admin/itemlist.php', 'scf_item'),
//array('400400', '신청내역', G5_ADMIN_URL . '/shop_admin/orderlist.php', 'scf_order', 1),
array('400450', '쿠폰구매내역생성', G5_ADMIN_URL . '/shop_admin/examount.php', 'ex_amount', 1),
array('400460', '포인트교환내역생성', G5_ADMIN_URL . '/shop_admin/expoint.php', 'ex_point', 1),
//array('400660', '쿠폰문의', G5_ADMIN_URL . '/shop_admin/itemqalist.php', 'scf_item_qna'),
//array('400650', '사용후기', G5_ADMIN_URL . '/shop_admin/itemuselist.php', 'scf_ps'),
//array('400620', '쿠폰재고관리', G5_ADMIN_URL . '/shop_admin/itemstocklist.php', 'scf_item_stock'),
//array('400610', '쿠폰유형관리', G5_ADMIN_URL . '/shop_admin/itemtypelist.php', 'scf_item_type'),
//array('400500', '쿠폰옵션재고관리', G5_ADMIN_URL . '/shop_admin/optionstocklist.php', 'scf_item_option'),
//array('400800', '쿠폰관리', G5_ADMIN_URL . '/shop_admin/couponlist.php', 'scf_coupon'),
//array('400810', '쿠폰존관리', G5_ADMIN_URL . '/shop_admin/couponzonelist.php', 'scf_coupon_zone'),
//array('400750', '추가배송비관리', G5_ADMIN_URL . '/shop_admin/sendcostlist.php', 'scf_sendcost', 1),
//array('400410', '미완료주문', G5_ADMIN_URL . '/shop_admin/inorderlist.php', 'scf_inorder', 1),
);
+5
View File
@@ -0,0 +1,5 @@
<?php
$menu['menu600'] = array(
array('600000', '플러그인', G5_ADMIN_URL . '/gnuwiz_admin/board_manage_list.php', 'gnuwiz'),
array('600400', '게시글 날짜&조회수', G5_ADMIN_URL . '/gnuwiz_admin/board_manage_list.php', 'gnuwiz'),
);
+14
View File
@@ -0,0 +1,14 @@
<?php
$menu["menu900"] = array(
array('900000', 'SMS 관리', '' . G5_SMS5_ADMIN_URL . '/config.php', 'sms5'),
array('900100', 'SMS 기본설정', '' . G5_SMS5_ADMIN_URL . '/config.php', 'sms5_config'),
array('900200', '회원정보업데이트', '' . G5_SMS5_ADMIN_URL . '/member_update.php', 'sms5_mb_update'),
array('900300', '문자 보내기', '' . G5_SMS5_ADMIN_URL . '/sms_write.php', 'sms_write'),
array('900400', '전송내역-건별', '' . G5_SMS5_ADMIN_URL . '/history_list.php', 'sms_history', 1),
array('900410', '전송내역-번호별', '' . G5_SMS5_ADMIN_URL . '/history_num.php', 'sms_history_num', 1),
array('900500', '이모티콘 그룹', '' . G5_SMS5_ADMIN_URL . '/form_group.php', 'emoticon_group'),
array('900600', '이모티콘 관리', '' . G5_SMS5_ADMIN_URL . '/form_list.php', 'emoticon_list'),
array('900700', '휴대폰번호 그룹', '' . G5_SMS5_ADMIN_URL . '/num_group.php', 'hp_group', 1),
array('900800', '휴대폰번호 관리', '' . G5_SMS5_ADMIN_URL . '/num_book.php', 'hp_manage', 1),
array('900900', '휴대폰번호 파일', '' . G5_SMS5_ADMIN_URL . '/num_book_file.php', 'hp_file', 1)
);
+9
View File
@@ -0,0 +1,9 @@
<?php
$menu["menu990"] = array (
array('990000', '룰렛관리', G5_ADMIN_URL.'/roulette/roulettelist.php', 'ETC'),
array('990100', '룰렛리스트', G5_ADMIN_URL.'/roulette/roulettelist.php', 'roulettelist'),
array('990200', '룰렛당첨내역', G5_ADMIN_URL.'/roulette/rouletterewardlist.php', 'rouletterewardlist'),
array('990300', '룰렛기회내역', G5_ADMIN_URL.'/roulette/roulettechancelist.php', 'roulettechancelist'),
array('990400', '복권당첨내역', G5_ADMIN_URL.'/roulette/lotterywinninglist.php', 'lotterywinninglist'),
);
?>
+83
View File
@@ -0,0 +1,83 @@
<?php
/**
* 이윰빌더를 사용하지 않는다면
*/
if ($use_eyoom_builder === false) return;
/**
* 이윰테마관리 메뉴
*/
if ((!isset($config['cf_eyoom_admin']) || $config['cf_eyoom_admin'] == 'y')) {
/**
* 최고관리자 메뉴
*/
if ($is_admin == 'super' || $is_auth) {
$menu['menu999'] = array (
array('999000', '테마설정관리', G5_ADMIN_URL.'/eyoom_admin/theme_list.php', 'eyoom_theme'),
array('999100', '테마관리', G5_ADMIN_URL.'/eyoom_admin/theme_list.php', 'eyb_theme'),
array('999110', '기본정보', G5_ADMIN_URL.'/eyoom_admin/biz_info.php', 'eyb_bizinfo'),
array('999120', '테마환경설정', G5_ADMIN_URL.'/eyoom_admin/config_form.php', 'eyb_config'),
array('999200', '게시판 추가설정', G5_ADMIN_URL.'/eyoom_admin/board_list.php', 'eyb_board'),
array('999300', '홈페이지메뉴설정', G5_ADMIN_URL.'/eyoom_admin/menu_list.php', 'eyb_menu'),
array('999400', '쇼핑몰메뉴설정', G5_ADMIN_URL.'/eyoom_admin/shopmenu_list.php', 'eyb_shopmenu'),
array('999500', 'EB상품추출관리', G5_ADMIN_URL.'/eyoom_admin/ebgoods_list.php', 'eyb_ebgoods'),
array('999600', 'EB슬라이더관리', G5_ADMIN_URL.'/eyoom_admin/ebslider_list.php', 'eyb_ebslider'),
array('999610', 'EB콘텐츠관리', G5_ADMIN_URL.'/eyoom_admin/ebcontents.php', 'eyb_ebcontents'),
array('999620', 'EB최신글관리', G5_ADMIN_URL.'/eyoom_admin/eblatest_list.php', 'eyb_eblatest'),
array('999630', 'EB배너관리', G5_ADMIN_URL.'/eyoom_admin/ebbanner_list.php', 'eyb_ebbanner'),
array('999700', '태그관리', G5_ADMIN_URL.'/eyoom_admin/tag_list.php', 'eyb_tag'),
array('999800', '이윰레벨 환경설정', G5_ADMIN_URL.'/eyoom_admin/level_config.php', 'eyb_level')
);
/**
* 환경설정 추가메뉴
*/
array_push ($menu['menu100'],
array('100990', '공사중 설정', G5_ADMIN_URL.'/countdown.php', 'cf_countdown')
);
/**
* 회원관리 추가메뉴
*/
array_push ($menu['menu200'],
array('200990', '포인트 압축하기', G5_ADMIN_URL.'/point_compress.php', 'mb_point_compress')
);
/**
* 상단고정 게시물 추가메뉴
*/
array_push ($menu['menu300'],
array('300900', '상단고정 게시물 관리', G5_ADMIN_URL.'/wrfixed_list.php', 'wrfixed_list')
);
/**
* 쇼핑몰 브랜드관리
*/
if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
array_push ($menu['menu400'],
array('400350', '브랜드관리', G5_ADMIN_URL.'/brandlist.php', 'brandlist')
);
}
} else {
/**
* 그외 고객관리자 메뉴
*/
unset($menu); // 메뉴재설정을 위해 기존 메뉴 리셋
}
} else {
/**
* 최고관리자가 아니라면 이윰관리자로 자동전환
*/
if ($member['mb_id'] != $config['cf_admin'] && $is_admin == 'super') {
$sql = "update `{$g5['config_table']}` set cf_eyoom_admin = 'y' ";
sql_query($sql, false);
goto_url(G5_ADMIN_URL, false);
} else {
$menu['menu999'] = array (
array('999000', '이윰관리자모드', G5_ADMIN_URL.'/admin.mode.php?to=eyoom', 'eyoom_admin'),
array('999100', '이윰관리자 바로가기', G5_ADMIN_URL.'/admin.mode.php?to=eyoom', 'eyoom_admin')
);
}
}
+23
View File
@@ -0,0 +1,23 @@
<?php
$sub_menu = "100000";
include_once('./_common.php');
if (!$is_admin) alert('관리자만 접근 가능합니다.');
$cf_eyoom_admin = '';
$permit_to = array('gnu', 'eyoom');
$to = trim($_GET['to']);
if (!in_array($to, $permit_to)) {
alert('잘못된 접근입니다.');
} else {
switch ($to) {
case 'gnu': $cf_eyoom_admin = 'n'; break;
case 'eyoom': $cf_eyoom_admin = 'y'; break;
}
$sql = "update `{$g5['config_table']}` set cf_eyoom_admin = '{$cf_eyoom_admin}' ";
sql_query($sql, false);
goto_url(G5_ADMIN_URL, false);
}
+618
View File
@@ -0,0 +1,618 @@
html, body{margin:0; height:100%}
body, td, p, input, button, textarea, select, .c1 {
font-family: '돋움',Dotum,Tahoma,Arial;
font-size: 12px;
}
img { border:0px; }
.admin_layout {
background-color:#00c4ff;
border:1px solid #01225f;
}
.top_right {
text-align:right;
line-height:21px;
}
.top_right a {display:inline-block;color:#fff;text-decoration:none;letter-spacing:-0.1em}
.top_right a:focus, #navi a:hover {color:#fff}
.menu_area {
border:1px solid #01225f;
}
.menu_on {
font-size:12px;
background-color:#fff;
width:120px;
height:30px;
line-height:30px;
font-weight:bold;
text-align:center;
color:#404040;
border-right:1px solid #01225f;
}
.menu_on a {display:inline-block;color:#404040;text-decoration:none;letter-spacing:-0.1em}
.menu_on a:focus, #navi a:hover {color:#404040}
.menu {
font-size:12px;
background-color:#404040;
width:120px;
height:30px;
line-height:30px;
font-weight:bold;
text-align:center;
color:#fff;
border-right:1px solid #01225f;
border-bottom:1px solid #01225f;
}
.menu a {display:inline-block;color:#fff;text-decoration:none;letter-spacing:-0.1em}
.menu a:focus, #navi a:hover {color:#fff}
.navi_area {
border-left:1px solid #01225f;
border-top:1px solid #01225f;
}
.navi_on {
font-size:12px;
background-color:#fff;
width:110px;
height:30px;
line-height:30px;
font-weight:bold;
text-align:center;
color:#404040;
border-right:1px solid #01225f;
}
.navi_on a {display:inline-block;color:#404040;text-decoration:none;letter-spacing:-0.1em}
.navi_on a:focus, #navi a:hover {color:#404040}
.navi {
font-size:12px;
background-color:#404040;
width:110px;
height:30px;
line-height:30px;
font-weight:bold;
text-align:center;
color:#fff;
border-right:1px solid #01225f;
border-bottom:1px solid #01225f;
}
.navi a {display:inline-block;color:#fff;text-decoration:none;letter-spacing:-0.1em}
.navi a:focus, #navi a:hover {color:#fff}
.content_area {
background-color:#fff;
border-right:1px solid #01225f;
border-bottom:1px solid #01225f;
padding:10px;
}
.content_sub {
background-color:#f0efef;
}
.td_title {
width:125px;
font-weight:bold;
color:#01225f;
}
.bold {
font-weight:bold;
}
.td_title_sub {
font-weight:none;
}
.td_tit {
font-weight:bold;
color:#01225f;
}
.center {
text-align:center;
}
.right {
text-align:right;
}
.txt_red {
color:#E20074;
}
.td_dot_right {
border-right:1px dotted #01225f;
}
.td_top_line {
border-top:1px dotted #01225f;
}
.td_dot_line {
border-bottom:1px dotted #01225f;
}
table .tr_bg0 {background:#fff}
table .tr_bg1 {background:#E8E8E8}
table .tr_bgs {background:#0046E2}
table .tr_bge {background:#F39797}
table a {display:inline-block;color:#000;text-decoration:none;font-family: '돋움',Dotum,Tahoma,Arial;}
table a:focus, table a:hover {color:#000;font-family: '돋움',Dotum,Tahoma,Arial;}
.enddate {
color: #350202;
}
.lh16 { line-height:16px; }
/* 리스트 */
.list_head_left {
border-left:1px solid #01225f;
}
.list_head_top {
border-top:1px solid #01225f;
}
.list_head {
font-size:12px;
background-color:#404040;
height:30px;
line-height:30px;
font-weight:bold;
text-align:center;
color:#fff;
border-right:1px solid #01225f;
border-bottom:1px solid #01225f;
}
.list_head_right {
padding-right:5px;
font-size:12px;
background-color:#404040;
height:30px;
line-height:30px;
font-weight:bold;
text-align:right;
color:#fff;
border-right:1px solid #01225f;
border-bottom:1px solid #01225f;
}
.result_r {
font-size:12px;
background-color:#0050E2;
line-height:16px;
color:#fff;
}
.result_s {
font-size:12px;
background-color:#DFE852;
line-height:16px;
color:#000;
}
.result_f {
font-size:12px;
background-color:#ff4a52;
line-height:16px;
color:#fff;
}
/* 패딩 */
.pd5 {
padding:5px;
}
.pdtb5 {
padding:5px 0;
}
.pd5L6 {
padding:5px 0 5px 6px;
}
.pd10 {
padding:10px;
}
.pd20 {
padding:20px;
}
/* width */
.wd30 {
width:30px;
}
.wd50 {
width:50px;
}
.wd70 {
width:70px;
}
.wd80 {
width:80px;
}
.wd100 {
width:100px;
}
.wd140 {
width:140px;
}
.wd150 {
width:150px;
}
.wd160 {
width:160px;
}
.wd200 {
width:200px;
}
.wd300 {
width:300px;
}
.wd400 {
width:400px;
}
.wd20p {
width:20%;
}
.wd25p {
width:25%;
}
.wd50p {
width:50%;
}
.wd75p {
width:75%;
}
/* 폼 */
.frm_input {
padding:3px;
border:2px solid #01225f;
background:#fff;
vertical-align:middle
height:16px;
line-height:16px;
}
.frm_textarea {
padding:3px;
border:2px solid #01225f;
background:#fff;
line-height:16px;
}
.required2 {background:url('/img/wrest.gif') #f6f9fa top right no-repeat !important}
/* 하단 */
.tail_copy {
text-align:center;
color:#fff;
height:30px;
line-height:30px;
}
.tail_copy a {
display: inline-block;
color: #fff;
text-decoration: none;
font-family: '돋움',Dotum,Tahoma,Arial;
}
/* 버튼 */
.config_btn_submit {
width:98%;
height:30px;
margin:10px;
padding:10px;
background-color:#00c4ff;
border:1px solid #01225f;
color:#fff;
font-size:12px;
line-height:12px;
cursor:pointer
}
.config_btn_submit2 {
width:98%;
height:130px;
padding:10px;
background-color:#00c4ff;
border:1px solid #01225f;
color:#fff;
font-size:12px;
line-height:12px;
cursor:pointer
}
.config_btn_disabled {
width:98%;
height:30px;
margin:10px;
padding:10px;
background-color:#464646;
border:1px solid #01225f;
color:#fff;
font-size:12px;
line-height:12px;
cursor:pointer
}
.board_btn_submit {
width:98%;
height:30px;
padding:10px;
background-color:#00c4ff;
border:1px solid #01225f;
color:#fff;
font-size:12px;
line-height:12px;
cursor:pointer
}
.login_btn {
width:60px;
padding:3px;
background-color:#00c4ff;
border:2px solid #01225f;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.reg_btn {
width:40px;
padding:3px;
background-color:#00c4ff;
border:2px solid #01225f;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.add_btn {
width:128px;
padding:3px;
background-color:#00c4ff;
border:2px solid #01225f;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.cfg_btn {
width:128px;
padding:3px;
background-color:#0088b1;
border:2px solid #01225f;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.mod_btn {
width:40px;
padding:3px;
background-color:#f9e344;
border:2px solid #af9a00;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.del_btn {
width:40px;
padding:3px;
background-color:#212121;
border:2px solid #0C0C0C;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.bl_btn {
width:40px;
padding:3px;
background-color:#8be200;
border:2px solid #568c01;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.select_del_btn {
padding:3px;
background-color:#212121;
border:2px solid #0C0C0C;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.select_mod_btn {
padding:3px;
background-color:#8BE200;
border:2px solid #568C01;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.select_exp_btn {
padding:3px;
background-color:#355758;
border:2px solid #263131;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.all_exp_btn {
padding:3px;
background-color:#DFE200;
border:2px solid #8C7B01;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.select_enddate_btn {
padding:3px;
background-color:#34621F;
border:2px solid #183A09;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.select_where_btn {
padding:3px;
background-color:#D2C41F;
border:2px solid #A09727;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.search_btn {
width:40px;
padding:3px;
background-color:#ff3061;
border:2px solid #82001F;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.down_btn {
width:40px;
padding:3px;
background-color:#1F3762;
border:2px solid #111D33;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.down_btn2 {
padding:3px;
background-color:#1F3762;
border:2px solid #111D33;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.txt_down_btn {
width:100px;
padding:3px;
background-color:#1F3762;
border:2px solid #111D33;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer;
margin-top:3px;
}
.xls_down_btn {
width:70px;
padding:3px;
background-color:#339222;
border:2px solid #194611;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer;
margin-top:3px;
}
.parsing_btn {
width:150px;
height:50px;
padding:3px;
background-color:#E6BC21;
border:2px solid #5A4A0C;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
#Progress_Loading
{
position: absolute;
left: 50%;
top: 40%;
text-align:center;
z-index: 1001;
}
#Progress_Background
{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #fff;
filter: alpha(opacity=75);
-moz-opacity: 0.75;
-khtml-opacity: 0.75;
opacity: 0.75;
z-index: 1000;
}
/* 접속자집계 목록 */
.tbl_visit_list td {text-align:center}
.visit_bar {position:relative}
.visit_bar span {position:absolute;top:-8px;left:0;height:15px;background:#E20074}
+157
View File
@@ -0,0 +1,157 @@
<?php
if (!defined('_GNUBOARD_')) {
exit;
}
// 그누보드5.4.5.5 버전과 영카트5.4.5.5.1 버전이 통합됨에 따라 그누보드 버전만 표시
// $print_version = defined('G5_YOUNGCART_VER') ? 'YoungCart Version '.G5_YOUNGCART_VER : 'Version '.G5_GNUBOARD_VER;
$print_version = ($is_admin == 'super') ? 'Version ' . G5_GNUBOARD_VER : '';
?>
<noscript>
<p>
귀하께서 사용하시는 브라우저는 현재 <strong>자바스크립트를 사용하지 않음</strong>으로 설정되어 있습니다.<br>
<strong>자바스크립트를 사용하지 않음</strong>으로 설정하신 경우는 수정이나 삭제시 별도의 경고창이 나오지 않으므로 이점 주의하시기 바랍니다.
</p>
</noscript>
</div>
<footer id="ft">
<p>
Copyright &copy; <?php echo $_SERVER['HTTP_HOST']; ?>. All rights reserved. <?php echo $print_version; ?><br>
<button type="button" class="scroll_top"><span class="top_img"></span><span class="top_txt">TOP</span></button>
</p>
</footer>
</div>
</div>
<script>
$(".scroll_top").click(function() {
$("body,html").animate({
scrollTop: 0
}, 400);
})
</script>
<!-- <p>실행시간 : <?php echo get_microtime() - $begin_time; ?> -->
<script src="<?php echo G5_ADMIN_URL ?>/admin.js?ver=<?php echo G5_JS_VER; ?>"></script>
<script src="<?php echo G5_JS_URL ?>/jquery.anchorScroll.js?ver=<?php echo G5_JS_VER; ?>"></script>
<script>
$(function() {
var admin_head_height = $("#hd_top").height() + $("#container_title").height() + 5;
$("a[href^='#']").anchorScroll({
scrollSpeed: 0, // scroll speed
offsetTop: admin_head_height, // offset for fixed top bars (defaults to 0)
onScroll: function() {
// callback on scroll start
},
scrollEnd: function() {
// callback on scroll end
}
});
var hide_menu = false;
var mouse_event = false;
var oldX = oldY = 0;
$(document).mousemove(function(e) {
if (oldX == 0) {
oldX = e.pageX;
oldY = e.pageY;
}
if (oldX != e.pageX || oldY != e.pageY) {
mouse_event = true;
}
});
// 주메뉴
var $gnb = $(".gnb_1dli > a");
$gnb.mouseover(function() {
if (mouse_event) {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
$(this).parent().addClass("gnb_1dli_over gnb_1dli_on");
menu_rearrange($(this).parent());
hide_menu = false;
}
});
$gnb.mouseout(function() {
hide_menu = true;
});
$(".gnb_2dli").mouseover(function() {
hide_menu = false;
});
$(".gnb_2dli").mouseout(function() {
hide_menu = true;
});
$gnb.focusin(function() {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
$(this).parent().addClass("gnb_1dli_over gnb_1dli_on");
menu_rearrange($(this).parent());
hide_menu = false;
});
$gnb.focusout(function() {
hide_menu = true;
});
$(".gnb_2da").focusin(function() {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
var $gnb_li = $(this).closest(".gnb_1dli").addClass("gnb_1dli_over gnb_1dli_on");
menu_rearrange($(this).closest(".gnb_1dli"));
hide_menu = false;
});
$(".gnb_2da").focusout(function() {
hide_menu = true;
});
$('#gnb_1dul>li').bind('mouseleave', function() {
submenu_hide();
});
$(document).bind('click focusin', function() {
if (hide_menu) {
submenu_hide();
}
});
// 폰트 리사이즈 쿠키있으면 실행
var font_resize_act = get_cookie("ck_font_resize_act");
if (font_resize_act != "") {
font_resize("container", font_resize_act);
}
});
function submenu_hide() {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
}
function menu_rearrange(el) {
var width = $("#gnb_1dul").width();
var left = w1 = w2 = 0;
var idx = $(".gnb_1dli").index(el);
for (i = 0; i <= idx; i++) {
w1 = $(".gnb_1dli:eq(" + i + ")").outerWidth();
w2 = $(".gnb_2dli > a:eq(" + i + ")").outerWidth(true);
if ((left + w2) > width) {
el.removeClass("gnb_1dli_over").addClass("gnb_1dli_over2");
}
left += w1;
}
}
</script>
<?php
require_once G5_PATH . '/tail.sub.php';
+19
View File
@@ -0,0 +1,19 @@
<?php
require_once './_common.php';
set_session('ss_admin_token', '');
$admin_csrf_token_key = isset($_POST['admin_csrf_token_key']) ? $_POST['admin_csrf_token_key'] : '';
if(function_exists('admin_csrf_token_key') && $admin_csrf_token_key !== admin_csrf_token_key(1)){
die(json_encode(array('error' => '토큰키 에러!', 'url' => G5_URL)));
}
$error = admin_referer_check(true);
if ($error) {
die(json_encode(array('error' => $error, 'url' => G5_URL)));
}
$token = get_admin_token();
die(json_encode(array('error' => '', 'token' => $token, 'url' => '')));
+6
View File
@@ -0,0 +1,6 @@
<?php
require_once './_common.php';
if (isset($_POST['admin_use_captcha'])) {
set_session('ss_admin_use_captcha', true);
}
+272
View File
@@ -0,0 +1,272 @@
<?php
$sub_menu = "100200";
require_once './_common.php';
if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.');
}
$sql_common = " from {$g5['auth_table']} a left join {$g5['member_table']} b on (a.mb_id=b.mb_id) ";
$sql_search = " where (1) ";
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
default:
$sql_search .= " ({$sfl} like '%{$stx}%') ";
break;
}
$sql_search .= " ) ";
}
if (!$sst) {
$sst = "a.mb_id, au_menu";
$sod = "";
}
$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 = $config['cf_page_rows'];
$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['SCRIPT_NAME'] . '" class="ov_listall btn_ov02">전체목록</a>';
$g5['title'] = "관리권한설정";
require_once './admin.head.php';
$colspan = 5;
?>
<div class="local_ov01 local_ov">
<?php echo $listall ?>
<span class="btn_ov01"><span class="ov_txt">설정된 관리권한</span><span class="ov_num"><?php echo number_format($total_count) ?>건</span></span>
</div>
<form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get">
<input type="hidden" name="sfl" value="a.mb_id" id="sfl">
<label for="stx" class="sound_only">회원아이디<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
<input type="submit" value="검색" id="fsearch_submit" class="btn_submit">
</form>
<form name="fauthlist" id="fauthlist" method="post" action="./auth_list_delete.php" onsubmit="return fauthlist_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="">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<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"><?php echo subject_sort_link('a.mb_id') ?>회원아이디</a></th>
<th scope="col"><?php echo subject_sort_link('mb_nick') ?>닉네임</a></th>
<th scope="col">메뉴</th>
<th scope="col">권한</th>
</tr>
</thead>
<tbody>
<?php
$count = 0;
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$is_continue = false;
// 회원아이디가 없는 메뉴는 삭제함
if ($row['mb_id'] == '' && $row['mb_nick'] == '') {
sql_query(" delete from {$g5['auth_table']} where au_menu = '{$row['au_menu']}' ");
$is_continue = true;
}
// 메뉴번호가 바뀌는 경우에 현재 없는 저장된 메뉴는 삭제함
if (!isset($auth_menu[$row['au_menu']])) {
sql_query(" delete from {$g5['auth_table']} where au_menu = '{$row['au_menu']}' ");
$is_continue = true;
}
if ($is_continue) {
continue;
}
$mb_nick = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);
$bg = 'bg' . ($i % 2);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_chk">
<input type="hidden" name="au_menu[<?php echo $i ?>]" value="<?php echo $row['au_menu'] ?>">
<input type="hidden" name="mb_id[<?php echo $i ?>]" value="<?php echo $row['mb_id'] ?>">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo $row['mb_nick'] ?>님 권한</label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td class="td_mbid"><a href="?sfl=a.mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo $row['mb_id'] ?></a></td>
<td class="td_auth_mbnick"><?php echo $mb_nick ?></td>
<td class="td_menu">
<?php echo $row['au_menu'] ?>
<?php echo $auth_menu[$row['au_menu']] ?>
</td>
<td class="td_auth"><?php echo $row['au_auth'] ?></td>
</tr>
<?php
$count++;
}
if ($count == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<div class="btn_list01 btn_list">
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value" class="btn btn_02">
</div>
<?php
//if (isset($stx))
// echo '<script>document.fsearch.sfl.value = "'.$sfl.'";</script>'."\n";
if (strstr($sfl, 'mb_id')) {
$mb_id = $stx;
} else {
$mb_id = '';
}
?>
</form>
<?php
$pagelist = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'] . '?' . $qstr . '&amp;page=');
echo $pagelist;
?>
<form name="fauthlist2" id="fauthlist2" action="./auth_update.php" method="post" autocomplete="off" onsubmit="return fauth_add_submit(this);">
<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="">
<section id="add_admin">
<h2 class="h2_frm">관리권한 추가</h2>
<div class="local_desc01 local_desc">
<p>
다음 양식에서 회원에게 관리권한을 부여하실 수 있습니다.<br>
권한 <strong>r</strong>은 읽기권한, <strong>w</strong>는 쓰기권한, <strong>d</strong>는 삭제권한입니다.
</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="mb_id">회원아이디<strong class="sound_only">필수</strong></label></th>
<td>
<strong id="msg_mb_id" class="msg_sound_only"></strong>
<input type="text" name="mb_id" value="<?php echo $mb_id ?>" id="mb_id" required class="required frm_input">
</td>
</tr>
<tr>
<th scope="row"><label for="au_menu">접근가능메뉴<strong class="sound_only">필수</strong></label></th>
<td>
<select id="au_menu" name="au_menu" required class="required">
<option value=''>선택하세요</option>
<?php
foreach ($auth_menu as $key => $value) {
if (!(substr($key, -3) == '000' || $key == '-' || !$key)) {
echo '<option value="' . $key . '">' . $key . ' ' . $value . '</option>';
}
}
?>
</select>
</td>
</tr>
<tr>
<th scope="row">권한지정</th>
<td>
<input type="checkbox" name="r" value="r" id="r" checked>
<label for="r">r (읽기)</label>
<input type="checkbox" name="w" value="w" id="w">
<label for="w">w (쓰기)</label>
<input type="checkbox" name="d" value="d" id="d">
<label for="d">d (삭제)</label>
</td>
</tr>
<tr>
<th scope="row">자동등록방지</th>
<td>
<?php
require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
$captcha_html = captcha_html();
$captcha_js = chk_captcha_js();
echo $captcha_html;
?>
</td>
</tr>
</tbody>
</table>
</div>
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="추가" class="btn_submit btn">
</div>
</section>
</form>
<script>
function fauth_add_submit(f) {
<?php echo $captcha_js; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
return true;
}
function fauthlist_submit(f) {
if (!is_checked("chk[]")) {
alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");
return false;
}
if (document.pressed == "선택삭제") {
if (!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
</script>
<?php
require_once './admin.tail.php';
+37
View File
@@ -0,0 +1,37 @@
<?php
$sub_menu = "100200";
require_once './_common.php';
check_demo();
if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.');
}
check_admin_token();
$count = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
$post_act_button = isset($_POST['act_button']) ? clean_xss_tags($_POST['act_button'], 1, 1) : '';
if (!$count) {
alert($_POST['act_button'] . " 하실 항목을 하나 이상 체크하세요.");
}
if ((isset($_POST['mb_id']) && !is_array($_POST['mb_id'])) || (isset($_POST['au_menu']) && !is_array($_POST['au_menu']))) {
alert("잘못된 요청입니다.");
}
for ($i = 0; $i < $count; $i++) {
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$mb_id = isset($_POST['mb_id'][$k]) ? preg_replace('/[^a-zA-Z0-9_]/', '', $_POST['mb_id'][$k]) : '';
$au_menu = isset($_POST['au_menu'][$k]) ? preg_replace('/[^a-zA-Z0-9_]/', '', $_POST['au_menu'][$k]) : '';
$sql = " delete from {$g5['auth_table']} where mb_id = '" . $mb_id . "' and au_menu = '" . $au_menu . "' ";
sql_query($sql);
run_event('adm_auth_delete_member', $mb_id, $au_menu);
}
goto_url('./auth_list.php?' . $qstr);
+55
View File
@@ -0,0 +1,55 @@
<?php
$sub_menu = "100200";
require_once './_common.php';
require_once G5_LIB_PATH . '/mailer.lib.php';
$au_menu = isset($_POST['au_menu']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['au_menu']) : '';
$post_r = isset($_POST['r']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['r']) : '';
$post_w = isset($_POST['w']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['w']) : '';
$post_d = isset($_POST['d']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['d']) : '';
if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.');
}
$mb = get_member($mb_id);
if (!$mb['mb_id']) {
alert('존재하는 회원아이디가 아닙니다.');
}
check_admin_token();
require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
if (!chk_captcha()) {
alert('자동등록방지 숫자가 틀렸습니다.');
}
$sql = " insert into {$g5['auth_table']}
set mb_id = '$mb_id',
au_menu = '$au_menu',
au_auth = '{$post_r},{$post_w},{$post_d}' ";
$result = sql_query($sql, false);
if (!$result) {
$sql = " update {$g5['auth_table']}
set au_auth = '{$post_r},{$post_w},{$post_d}'
where mb_id = '$mb_id'
and au_menu = '$au_menu' ";
sql_query($sql);
}
//sql_query(" OPTIMIZE TABLE `$g5['auth_table']` ");
// 세션을 체크하여 하루에 한번만 메일알림이 가게 합니다.
if (str_replace('-', '', G5_TIME_YMD) !== get_session('adm_auth_update')) {
$site_url = preg_replace('/^www\./', '', strtolower($_SERVER['SERVER_NAME']));
$to_email = 'gnuboard@' . $site_url;
mailer($config['cf_admin_email_name'], $to_email, $config['cf_admin_email'], '[' . $config['cf_title'] . '] 관리권한설정 알림', '<p><b>[' . $config['cf_title'] . '] 관리권한설정 변경 안내</b></p><p style="padding-top:1em">회원 아이디 ' . $mb['mb_id'] . ' 에 관리권한이 추가 되었습니다.</p><p style="padding-top:1em">' . G5_TIME_YMDHIS . '</p><p style="padding-top:1em"><a href="' . G5_URL . '" target="_blank">' . $config['cf_title'] . '</a></p>', 1);
set_session('adm_auth_update', str_replace('-', '', G5_TIME_YMD));
}
run_event('adm_auth_update', $mb);
goto_url('./auth_list.php?' . $qstr);
+484
View File
@@ -0,0 +1,484 @@
<?php
$sub_menu = "300900";
require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r');
$_gameList=["mix"=>"크로스","special"=>"스페셜","powerball1"=>"파워볼1분","powerball3"=>"파워볼3분",
"powerball5"=>"파워볼5분","ladder1"=>"사다리1분","ladder2"=>"사다리2분","dice1"=>"주사위1분","dice2"=>"주사위2분",
"card1"=>"카드홀짝1분","card2"=>"카드홀짝2분","roulette1"=>"룰렛1분","roulette2"=>"룰렛2분","slots1"=>"슬롯1분",
"slots2"=>"슬롯2분","horse3"=>"경마3분","horse5"=>"경마5분","hammer1"=>"망치1분","hammer2"=>"망치2분"];
$_jongmok =["Soccer"=>"축구","Baseball"=>"야구","Basketball"=>"농구","Volleyball"=>"배구","Ice Hockey"=>"아이스하키","American football"=>"미식축구"];
$timeArray = array();
for ($hour = 0; $hour < 24; $hour++) {
$timeArray[] = sprintf("%02d:00:00", $hour);
}
if($bt=='') $bt = '1';
$sql_common = "from swiun_betting";
if($bt=='2'){
$sql_search = " where bt_group_result='Y'";
}else if($bt=='3'){
$sql_search = " where bt_group_result='N'";
}else{
$sql_search = " where (1=1) ";
}
if ($gamelist) {
$sql_search .= " and bt_game_type = '$gamelist' ";
}
if ($jongmok) {
$sql_search .= " and bt_sub_game_gubun = '$gamelist' ";
}
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "bt_mem_nick" :
$sql_search .= " ($sfl like '%$stx%') ";
break;
case "bt_mem_id" :
$sql_search .= " ($sfl = '$stx') ";
break;
default :
$sql_search .= " ($sfl = '$stx') ";
break;
}
$sql_search .= " ) ";
}
$s_date = $sdate." ".$stime;
$e_date = $edate." ".$etime;
if ($sdate) {
$sql_search .= " and ('".$s_date."' <= bt_bet_datetime and bt_bet_datetime <= '".$e_date."')";
}
if (!$sst) {
$sst = "bt_idx";
$sod = "desc";
}
$sql_order = " group by bt_group_code order by $sst $sod ";
$countsql = " select count(c.bt_group_code) as cnt from (select bt_group_code {$sql_common} {$sql_search} group by bt_group_code) as c";
$rlt = sql_fetch($countsql);
$total_count = $rlt['cnt'];
$rows = $config['cf_page_rows'];
$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);
$g5['title'] = '베팅참여현황';
require_once './admin.head.php';
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
$colspan = 10;
?>
<style>
.home_ {float: left;padding: 0 5px;}
.home_r {float: right;padding: 0 5px;}
.home_r img {margin-right: 5px;}
.away_ {float: right;padding: 0 5px;}
.away_r {float: left;padding: 0 5px;}
.away_r img {margin-left: 5px;}
.active {background: #fff !important;}
.tbl_head01 tbody tr:nth-child(even) {background:#fff;}
.detail_head {background:#d1d7e1;}
table th {font-weight: 500;background: #6e6e6e;}
.tbl_input._score {width: 30px !important;text-align: center;}
.loader_cover {
display: none;
position: fixed;
top: 0;
left: 0;
width:100%;
height: 100%;
background: rgb(33 33 33 / 50%);
z-index: 1;
}
.loader_txt {position: relative;top: 35%;z-index: 1;margin:0 auto;text-align: center;font-size: 15px;color: #fff;}
.loader {
position: relative;
left: 50%;
top: 40%;
z-index: 1;
margin: -35px 0 0 -35px;
border-radius: 50%;
border: 4px solid rgb(73 235 255);
border-bottom: 4px solid #79797900;
width: 70px;
height: 70px;
animation: spin1 1s cubic-bezier(0.44, 0.13, 1, 1) infinite;
}
.loader2 {
position: absolute;
left: 50%;
top: 50%;
z-index: 1;
margin: -28px 0 0 -28px;
border-radius: 50%;
border: 4px solid #8bc34a;
border-left: 4px solid #79797900;
border-right: 4px solid #79797900;
width: 56px;
height: 56px;
animation: spin2 1.5s cubic-bezier(0, 0, 0.67, 1.02) infinite;
}
.loader3 {
position: relative;
left: 50%;
top: 50%;
z-index: 1;
margin: -20px 0 0 -20px;
border: 3px solid #79797900;
border-radius: 50%;
border-top: 3px solid #ffffff;
border-bottom: 3px solid #ffffff;
width: 40px;
height: 40px;
animation: spin3 2.5s cubic-bezier(0, 0, 0.76, 1.12) infinite;
}
@keyframes spin1 {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes spin2 {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes spin3 {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
<script>
$(function(){
$("#sdate, #edate, #bt_sdate, #bt_edate").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99", maxDate: "+0d" });
});
</script>
<div style="display:flex;">
<ul class="anchor" style="width: 30%;">
<li><a class="<? if($bt=='1') echo 'active';?>" href="?bt=1">베팅내역</a></li>
<li><a class="<? if($bt=='2') echo 'active';?>" href="?bt=2">적중내역</a></li>
<li><a class="<? if($bt=='3') echo 'active';?>" href="?bt=3">미적중내역</a></li>
</ul>
<div style="width:70%;text-align: right;">
<span style="margin-right:5px ;">* 최근 3일이내, 12시간 이내 최대 5000개, 요청간격 최소 1분</span>
시작 : <input type="text" name="bt_sdate" id="bt_sdate" class="frm_input" value="" readonly>
<select name="bt_stime" id="bt_stime">
<option value="">시간선택</option>
<?php foreach ($timeArray as $time) { ?>
<option value="<?php echo $time?>"<?php if($stime==$time) echo 'selected';?>>
<?php echo $time;?>
</option>
<?php }?>
</select>
종료 : <input type="text" name="bt_edate" id="bt_edate" class="frm_input" value="" readonly>
<select name="bt_etime" id="bt_etime">
<option value="">시간선택</option>
<?php foreach ($timeArray as $time) { ?>
<option value="<?php echo $time?>"<?php if($etime==$time) echo 'selected';?>>
<?php echo $time;?>
</option>
<?php }?>
</select>
<input type="submit" name="act_button" value="베팅데이터가져오기" class="btn_submit btn" onclick="getBetdata()">
</div>
</div>
</br>
<table width="100%" cellpadding="4" cellspacing="0">
<tbody>
<tr>
<td class="td_searh_bg" height="28">
<div id="search_left" style="float:left;padding-top: 3px;">
<span style="">&nbsp;총 : <span class="num_style b" style="color:red"><?php echo number_format($total_count) ?></span>건&nbsp;
&nbsp;현재 : <span class="num_style b" style="color:red"><?php echo $page ?></span>페이지&nbsp;</span>
</div>
<div id="search_right" style="float:right;padding-top: 3px;">
<form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get">
<select name="gamelist">
<option value="">게임선택</option>
<?php foreach ($_gameList as $e_name => $kr_name) { ?>
<option value="<?php echo $e_name?>"<?php if($gameList==$e_name) echo 'selected';?> >
<?php echo $kr_name;?>
</option>
<?php }?>
</select>
<select name="jongmok">
<option value="">종목선택</option>
<?php foreach ($_jongmok as $jongmok_e_name => $jongmok_kr_name) { ?>
<option value="<?php echo $jongmok_e_name?>"<?php if($jongmok==$jongmok_e_name) echo 'selected';?> >
<?php echo $jongmok_kr_name;?>
</option>
<?php }?>
</select>
시작날짜 : <input type="text" name="sdate" class="frm_input" value='<?php echo $sdate?>' align="absmiddle" id="sdate" readonly>
<select name="stime">
<option value="">시간선택</option>
<?php foreach ($timeArray as $time) { ?>
<option value="<?php echo $time?>"<?php if($stime==$time) echo 'selected';?>>
<?php echo $time;?>
</option>
<?php }?>
</select>
종료날짜 : <input type="text" name="edate" class="frm_input" value='<?php echo $edate?>' align="absmiddle" id="edate" readonly>
<select name="etime">
<option value="">시간선택</option>
<?php foreach ($timeArray as $time) { ?>
<option value="<?php echo $time?>"<?php if($etime==$time) echo 'selected';?>>
<?php echo $time;?>
</option>
<?php }?>
</select>
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl">
<option value="bt_mem_nick"<?php echo get_selected($_GET['sfl'], "bt_mem_nick"); ?>>별 명</option>
<option value="bt_mem_id"<?php echo get_selected($_GET['sfl'], "bt_mem_id"); ?>>아이디</option>
</select>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="hidden" name="gametype" value="<?php echo $gametype ?>" id="gametype">
<input type="hidden" name="bt" value="<?php echo $bt ?>" id="bt">
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" class="frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
</div>
</td>
</tr>
</tbody>
</table>
<form name="fboardlist" id="fboardlist" action="./betting_list_update.php" onsubmit="return fbetting_list_submit(this);" method="post">
<input type="hidden" name="bt" value="<?php echo $bt ?>">
<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>
<thead>
<tr>
<th height="28" style="width:30px">
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
</th>
<th style="width:15%">닉네임[아이디]</th>
<th style="width:12%">베팅일시</th>
<th style="width:12%">게임명</th>
<th style="width:10%">종목/회차</th>
<th style="width:15%">베팅타입</th>
<th style="width:10%">포인트</th>
<th style="width:6%">총배당률</th>
<th style="width:10%">지급포인트</th>
<th style="width:8%">상세</th>
</tr>
</thead>
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) {
$game_name= $row['bt_game_type']=='mix'? "크로스" : ($row['bt_game_type']=='special' ? "스페셜" :$row['bt_league_name']);
$end_game= $row['bt_group_result']=='Y' ? $row['bt_bt_total'] : "";
?>
<tbody>
<tr>
<td height="28">
<label for="chk_<?php echo $i; ?>" class="sound_only"></label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
<input type="hidden" name="bt_group_code[<?php echo $i ?>]" value="<?php echo $row['bt_group_code'] ?>">
</td>
<td><?php echo $row['bt_mem_nick'] ?> [ <?php echo $row['bt_mem_id']?> ]</td>
<td><span style="color:#2196F3"><?php echo $date = $row['bt_bet_datetime'];?></span></td>
<td><?php echo $game_name?></td>
<td><?php echo $row['bt_sub_game_gubun']?></td>
<td><?php echo $row['bt_game_gubun']?></td>
<td><?php echo number_format($row['bt_bet_point'])?></td>
<td><?php echo $row['bt_sp_bets']?></td>
<td><?php echo $end_game ?></td>
<td class="td_mng">
<button type="button" href="#" class="plus plusIcon btn_add_submenu btn_03">상세보기</button>
<button type="button" href="#" class="plusIcon btn_del_menu btn_02" style="display:none;" >닫 기</button>
</td>
</tr>
<tr style="display: none;">
<td colspan="11" style="border:0;padding:3px 0 5px 0;">
<table style="border: 1px solid #F90000">
<tr class="detail_head">
<td align="center" width="10%">경기시간</td>
<td align="center" width="5%">게임명</td>
<td align="center" width="5%">종목/회차</td>
<td align="center" width="5%">리그</td>
<td align="center" width="5%">타입</td>
<td align="center" width="17%">승/오버(홈)</td>
<td align="center" width="7%">무/기준</td>
<td align="center" width="17%">패/언더(원정)</td>
<td align="center" width="7%">결과</td>
<td align="center" width="4%">상태</td>
</tr>
<tr>
<?php
$insql = "select * {$sql_common} where bt_group_code = '{$row['bt_group_code']}'";
$inresult = sql_query($insql);
$gcount = sql_num_rows($inresult);
while ($ret=sql_fetch_array($inresult)) {
$underimg="/plugin/swiunApi/img/icon_under.gif";
$overimg="/plugin/swiunApi/img/icon_over.gif";
$handimg="/plugin/swiunApi/img/icon_handi.gif";
$home_img_url='';$away_img_url='';$hand_img_url='';
if(strpos($ret['bt_game_gubun'], '언더오버') !== false) {
$home_img_url ="<img src='{$underimg}'>";
$away_img_url ="<img src='{$overimg}'>";
}else if(strpos($ret['bt_game_gubun'], '핸디캡') !== false) {
$hand_img_url ="<img src='{$handimg}'>";
}
$color= "#ffeb3b";
$hcolor=$ret['bt_bet_team']=='home' ? $color : "";
$mcolor=$ret['bt_bet_team']=='mu' ? $color : "";
$acolor=$ret['bt_bet_team']=='away' ? $color : "";
$g_result = $ret['bt_bet_result']=='Y' ? "적중" : ($ret['bt_bet_result']=='N' ?"미적중" : "");
$bt_draw = $ret['bt_draw']=='Y' ? "적특" : "";
$sub_game_name= $ret['bt_game_type']=='mix'? "크로스" : ($ret['bt_game_type']=='special' ? "스페셜" :$ret['bt_league_name']);
$bt_league_name =($ret['bt_game_type']=='mix' || $ret['bt_game_type']=='special') ? $ret['bt_league_name'] : "미니게임";
?>
<tr>
<td align="center"><?php echo $ret['bt_game_datetime']?></td>
<td align="center" ><?php echo $sub_game_name?></td>
<td align="center" ><?php echo $ret['bt_sub_game_gubun']?></td>
<td align="left" ><?php echo $bt_league_name?></td>
<td align="center"><?php echo $ret['bt_game_gubun']?></td>
<td align="left" style="background-color:<?php echo $hcolor?>">
<span class="home_"><?php echo $ret['bt_home_team']?></span>
<span class="home_r"><?php echo $home_img_url ?><?php echo $ret['bt_home_ratio']?></span>
</td>
<td align="center" style="background-color:<?php echo $mcolor?>;"><?php echo $ret['bt_mu_ratio']?></td>
<td align="right" style="background-color:<?php echo $acolor?>">
<span class="away_r"><?php echo $ret['bt_home_ratio']?><?php echo $away_img_url; ?></span>
<span class="away_"><?php echo $ret['bt_away_team']?></span>
</td>
<td align="center">
<?php echo $ret['bt_home_score']; ?> : <?php echo $ret['bt_away_score']; ?> <?php echo $bt_draw; ?>
</td>
<td align="center"><?php echo $g_result; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</td>
</tr>
<?php } if ($i == 0) { echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>'; } ?>
</tbody>
</table>
<br/>
<input type="submit" name="act_button" class="btn_submit btn" value="내역삭제">
</div>
</form>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$qstr.'&bt='.$bt.'&gametype='.$gametype.'&amp;page='); ?>
<div class="loader_cover">
<div class="loader_txt">
가져오는 중...<br/>
다소 지연될수 있습니다!!
</div>
<div class="loader"><div class="loader2"><div class="loader3"></div></div></div>
</div>
<script>
$(".plusIcon").on("click",function(){
var obj = $(this);
if( obj.hasClass("plus") ){
obj.hide();
obj.next().show();
obj.parent().parent().next().show();
}else{
obj.hide();
obj.prev().show();
obj.parent().parent().next().hide();
}
});
function fbetting_list_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
return true;
}
function getBetdata(){
var sdata = $("#bt_sdate").val();
if (!sdata) {
alert("시작일을 선택하세요");
}
var stime = $("#bt_stime").val();
if (!stime) {
alert("시작시간을 선택하세요");
}
var edata = $("#bt_edate").val();
if (!edata) {
alert("종료일을 선택하세요");
}
var etime = $("#bt_etime").val();
if (!etime) {
alert("종료시간을 선택하세요");
}
var startDatetime = new Date(sdata + ' ' + stime);
var endDatetime = new Date(edata + ' ' + etime);
var diffInMs = endDatetime - startDatetime;
var diffInHours = diffInMs / (1000 * 60 * 60);
if (diffInHours <= 6) { //임의로 시간을 늘리지 마십시요 서버의 부하가 발생할 수 있습니다.
var result = confirm("진행하시겠습니까?\n\n최대 5천개 내역만 수신됩니다\n완료 이전 재호출 금지입니다");
if (result) {
var start = sdata + " " + stime;
var end = edata + " " + etime;
var data={"start":start,"end":end}
ajax_get_betresult(data);
} else {
return;
}
} else {
alert("시작 시간과 종료 시간의 차이가 6시간을 초과합니다!!");
}
}
function ajax_get_betresult(data){
var loaderCover = $(".loader_cover");
loaderCover.show();
$.ajax({
url: "/plugin/swiunApi/get_betlist.php",
data: data,
type: "POST",
dataType: "json",
success: function(response) {
loaderCover.hide();
if (response.status === 0) {
alert(response.msg);
location.reload();
} else {
alert(response.msg);
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.log("AJAX 오류 발생:");
console.log("jqXHR:", jqXHR);
console.log("textStatus:", textStatus);
console.log("errorThrown:", errorThrown);
}
});
}
</script>
<?php
include_once('./admin.tail.php');
?>
+23
View File
@@ -0,0 +1,23 @@
<?php
$sub_menu = "300900";
include_once('./_common.php');
auth_check_menu($auth, $sub_menu, 'w');
if (!count($_POST['chk'])) {
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
}
if ($_POST['act_button'] == "내역삭제") {
$cnt=0;
for ($i=0; $i<count($_POST['chk']); $i++) {
$k = $_POST['chk'][$i];
$delsql="delete from swiun_betting where bt_group_code='{$_POST['bt_group_code'][$k]}'";
$rit=sql_query($delsql);
if($rit) $cnt++;
}
alert( $cnt."건 삭제완료", "./betting_list.php?bt=".$_POST['bt']."&page=".$_POST['page']);
}
?>
+91
View File
@@ -0,0 +1,91 @@
<?php
$sub_menu = "300100";
require_once "./_common.php";
auth_check_menu($auth, $sub_menu, 'w');
$g5['title'] = '게시판 복사';
require_once G5_PATH . '/head.sub.php';
if (empty($bo_table)) {
alert_close("정상적인 방법으로 이용해주세요.");
}
?>
<script>
var g5_admin_csrf_token_key = "<?php echo (function_exists('admin_csrf_token_key')) ? admin_csrf_token_key() : ''; ?>";
</script>
<script src="<?php echo G5_ADMIN_URL ?>/admin.js?ver=<?php echo G5_JS_VER; ?>"></script>
<div class="new_win">
<h1><?php echo $g5['title']; ?></h1>
<form name="fboardcopy" id="fboardcopy" action="./board_copy_update.php" onsubmit="return fboardcopy_check(this);" method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>" id="bo_table">
<input type="hidden" name="token" value="">
<div class=" new_win_con">
<div class="tbl_frm01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?></caption>
<tbody>
<tr>
<th scope="col">원본 테이블명</th>
<td><?php echo $bo_table ?></td>
</tr>
<tr>
<th scope="col"><label for="target_table">복사 테이블명<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="target_table" id="target_table" required class="required alnum_ frm_input" maxlength="20">영문자, 숫자, _ 만 가능 (공백없이)</td>
</tr>
<tr>
<th scope="col"><label for="target_subject">게시판 제목<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="target_subject" value="[복사본] <?php echo get_sanitize_input($board['bo_subject']); ?>" id="target_subject" required class="required frm_input" maxlength="120"></td>
</tr>
<tr>
<th scope="col">복사 유형</th>
<td>
<input type="radio" name="copy_case" value="schema_only" id="copy_case" checked>
<label for="copy_case">구조만</label>
<input type="radio" name="copy_case" value="schema_data_both" id="copy_case2">
<label for="copy_case2">구조와 데이터</label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="win_btn ">
<input type="submit" class="btn_submit btn" value="복사">
<input type="button" class="btn_close btn" value="창닫기" onclick="window.close();">
</div>
</form>
</div>
<script>
function fboardcopy_check(f) {
<?php
if (!$w) {
$js_array = get_bo_table_banned_word();
echo "var banned_array = " . json_encode($js_array) . ";\n";
}
?>
// 게시판명이 금지된 단어로 되어 있으면
if ((typeof banned_array != 'undefined') && jQuery.inArray(f.target_table.value, banned_array) !== -1) {
alert("입력한 게시판 TABLE명을 사용할수 없습니다. 다른 이름으로 입력해 주세요.");
return false;
}
if (f.bo_table.value == f.target_table.value) {
alert("원본 테이블명과 복사할 테이블명이 달라야 합니다.");
return false;
}
return true;
}
</script>
<?php
require_once G5_PATH . '/tail.sub.php';
+233
View File
@@ -0,0 +1,233 @@
<?php
$sub_menu = '300100';
require_once './_common.php';
check_demo();
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$bo_table = isset($_POST['bo_table']) ? substr(preg_replace('/[^a-z0-9_]/i', '', $_POST['bo_table']), 0, 20) : null;
$target_table = isset($_POST['target_table']) ? trim($_POST['target_table']) : '';
$target_subject = isset($_POST['target_subject']) ? trim($_POST['target_subject']) : '';
$target_subject = strip_tags(clean_xss_attributes($target_subject));
$file_copy = array();
if (empty($bo_table)) {
alert("원본 테이블 정보가 없습니다.");
}
if (!preg_match('/[A-Za-z0-9_]{1,20}/', $target_table)) {
alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)');
}
$target_table = substr(preg_replace('/[^a-z0-9_]/i', '', $target_table), 0, 20);
// 게시판명이 금지된 단어로 되어 있으면
if ($w == '' && in_array($target_table, get_bo_table_banned_word())) {
alert('입력한 게시판 TABLE명을 사용할수 없습니다. 다른 이름으로 입력해 주세요.');
}
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where bo_table = '$target_table' ");
if ($row['cnt']) {
alert($target_table . '은(는) 이미 존재하는 게시판 테이블명 입니다.\\n복사할 테이블명으로 사용할 수 없습니다.');
}
// 게시판 테이블 생성
$sql = get_table_define($g5['write_prefix'] . $bo_table);
$sql = str_replace($g5['write_prefix'] . $bo_table, $g5['write_prefix'] . $target_table, $sql);
sql_query($sql, false);
// 구조만 복사시에는 공지사항 번호는 복사하지 않는다.
if ($copy_case == 'schema_only') {
$board['bo_notice'] = '';
}
// 게시판 정보
$sql = " insert into {$g5['board_table']}
set bo_table = '$target_table',
gr_id = '{$board['gr_id']}',
bo_subject = '$target_subject',
bo_device = '{$board['bo_device']}',
bo_admin = '{$board['bo_admin']}',
bo_list_level = '{$board['bo_list_level']}',
bo_read_level = '{$board['bo_read_level']}',
bo_write_level = '{$board['bo_write_level']}',
bo_reply_level = '{$board['bo_reply_level']}',
bo_comment_level = '{$board['bo_comment_level']}',
bo_upload_level = '{$board['bo_upload_level']}',
bo_download_level = '{$board['bo_download_level']}',
bo_html_level = '{$board['bo_html_level']}',
bo_link_level = '{$board['bo_link_level']}',
bo_count_modify = '{$board['bo_count_modify']}',
bo_count_delete = '{$board['bo_count_delete']}',
bo_read_point = '{$board['bo_read_point']}',
bo_write_point = '{$board['bo_write_point']}',
bo_comment_point = '{$board['bo_comment_point']}',
bo_download_point = '{$board['bo_download_point']}',
bo_use_category = '{$board['bo_use_category']}',
bo_category_list = '{$board['bo_category_list']}',
bo_use_sideview = '{$board['bo_use_sideview']}',
bo_use_file_content = '{$board['bo_use_file_content']}',
bo_use_secret = '{$board['bo_use_secret']}',
bo_use_dhtml_editor = '{$board['bo_use_dhtml_editor']}',
bo_use_rss_view = '{$board['bo_use_rss_view']}',
bo_use_good = '{$board['bo_use_good']}',
bo_use_nogood = '{$board['bo_use_nogood']}',
bo_use_name = '{$board['bo_use_name']}',
bo_use_signature = '{$board['bo_use_signature']}',
bo_use_ip_view = '{$board['bo_use_ip_view']}',
bo_use_list_view = '{$board['bo_use_list_view']}',
bo_use_list_content = '{$board['bo_use_list_content']}',
bo_use_list_file = '{$board['bo_use_list_file']}',
bo_table_width = '{$board['bo_table_width']}',
bo_subject_len = '{$board['bo_subject_len']}',
bo_mobile_subject_len = '{$board['bo_mobile_subject_len']}',
bo_page_rows = '{$board['bo_page_rows']}',
bo_mobile_page_rows = '{$board['bo_mobile_page_rows']}',
bo_new = '{$board['bo_new']}',
bo_hot = '{$board['bo_hot']}',
bo_image_width = '{$board['bo_image_width']}',
bo_skin = '" . sql_real_escape_string($board['bo_skin']). "',
bo_mobile_skin = '" . sql_real_escape_string($board['bo_mobile_skin']). "',
bo_include_head = '" . sql_real_escape_string($board['bo_include_head']). "',
bo_include_tail = '" . sql_real_escape_string($board['bo_include_tail']). "',
bo_content_head = '" . addslashes($board['bo_content_head']) . "',
bo_content_tail = '" . addslashes($board['bo_content_tail']) . "',
bo_mobile_content_head = '" . addslashes($board['bo_mobile_content_head']) . "',
bo_mobile_content_tail = '" . addslashes($board['bo_mobile_content_tail']) . "',
bo_insert_content = '" . addslashes($board['bo_insert_content']) . "',
bo_gallery_cols = '{$board['bo_gallery_cols']}',
bo_gallery_width = '{$board['bo_gallery_width']}',
bo_gallery_height = '{$board['bo_gallery_height']}',
bo_mobile_gallery_width = '{$board['bo_mobile_gallery_width']}',
bo_mobile_gallery_height = '{$board['bo_mobile_gallery_height']}',
bo_upload_size = '{$board['bo_upload_size']}',
bo_reply_order = '{$board['bo_reply_order']}',
bo_use_search = '{$board['bo_use_search']}',
bo_order = '{$board['bo_order']}',
bo_notice = '{$board['bo_notice']}',
bo_upload_count = '{$board['bo_upload_count']}',
bo_use_email = '{$board['bo_use_email']}',
bo_use_cert = '{$board['bo_use_cert']}',
bo_use_sns = '{$board['bo_use_sns']}',
bo_use_captcha = '{$board['bo_use_captcha']}',
bo_sort_field = '{$board['bo_sort_field']}',
bo_1_subj = '" . addslashes($board['bo_1_subj']) . "',
bo_2_subj = '" . addslashes($board['bo_2_subj']) . "',
bo_3_subj = '" . addslashes($board['bo_3_subj']) . "',
bo_4_subj = '" . addslashes($board['bo_4_subj']) . "',
bo_5_subj = '" . addslashes($board['bo_5_subj']) . "',
bo_6_subj = '" . addslashes($board['bo_6_subj']) . "',
bo_7_subj = '" . addslashes($board['bo_7_subj']) . "',
bo_8_subj = '" . addslashes($board['bo_8_subj']) . "',
bo_9_subj = '" . addslashes($board['bo_9_subj']) . "',
bo_10_subj = '" . addslashes($board['bo_10_subj']) . "',
bo_1 = '" . addslashes($board['bo_1']) . "',
bo_2 = '" . addslashes($board['bo_2']) . "',
bo_3 = '" . addslashes($board['bo_3']) . "',
bo_4 = '" . addslashes($board['bo_4']) . "',
bo_5 = '" . addslashes($board['bo_5']) . "',
bo_6 = '" . addslashes($board['bo_6']) . "',
bo_7 = '" . addslashes($board['bo_7']) . "',
bo_8 = '" . addslashes($board['bo_8']) . "',
bo_9 = '" . addslashes($board['bo_9']) . "',
bo_10 = '" . addslashes($board['bo_10']) . "' ";
sql_query($sql, false);
// 게시판 폴더 생성
@mkdir(G5_DATA_PATH . '/file/' . $target_table, G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH . '/file/' . $target_table, G5_DIR_PERMISSION);
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$board_path = G5_DATA_PATH . '/file/' . $target_table;
$file = $board_path . '/index.php';
$f = @fopen($file, 'w');
@fwrite($f, '');
@fclose($f);
@chmod($file, G5_FILE_PERMISSION);
$copy_file = 0;
if ($copy_case == 'schema_data_both') {
$d = dir(G5_DATA_PATH . '/file/' . $bo_table);
while ($entry = $d->read()) {
if ($entry == '.' || $entry == '..') {
continue;
}
// 김선용 201007 :
if (is_dir(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry)) {
$dd = dir(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry);
@mkdir(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry, G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry, G5_DIR_PERMISSION);
while ($entry2 = $dd->read()) {
if ($entry2 == '.' || $entry2 == '..') {
continue;
}
@copy(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry . '/' . $entry2, G5_DATA_PATH . '/file/' . $target_table . '/' . $entry . '/' . $entry2);
@chmod(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry . '/' . $entry2, G5_DIR_PERMISSION);
$copy_file++;
}
$dd->close();
} else {
@copy(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry, G5_DATA_PATH . '/file/' . $target_table . '/' . $entry);
@chmod(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry, G5_DIR_PERMISSION);
$copy_file++;
}
}
$d->close();
run_event('admin_board_copy_file', $bo_table, $target_table);
// 글복사
$sql = " insert into {$g5['write_prefix']}$target_table select * from {$g5['write_prefix']}$bo_table ";
sql_query($sql, false);
// 게시글수 저장
$sql = " select bo_count_write, bo_count_comment from {$g5['board_table']} where bo_table = '$bo_table' ";
$row = sql_fetch($sql);
$sql = " update {$g5['board_table']} set bo_count_write = '{$row['bo_count_write']}', bo_count_comment = '{$row['bo_count_comment']}' where bo_table = '$target_table' ";
sql_query($sql, false);
// 4.00.01
$sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' ";
$result = sql_query($sql, false);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$file_copy[$i] = $row;
}
}
if (count($file_copy)) {
for ($i = 0; $i < count($file_copy); $i++) {
$file_copy[$i] = run_replace('admin_copy_update_file', $file_copy[$i], $file_copy[$i]['bf_file'], $bo_table, $target_table);
$sql = " insert into {$g5['board_file_table']}
set bo_table = '$target_table',
wr_id = '{$file_copy[$i]['wr_id']}',
bf_no = '{$file_copy[$i]['bf_no']}',
bf_source = '" . addslashes($file_copy[$i]['bf_source']) . "',
bf_file = '{$file_copy[$i]['bf_file']}',
bf_download = '{$file_copy[$i]['bf_download']}',
bf_content = '" . addslashes($file_copy[$i]['bf_content']) . "',
bf_fileurl = '" . addslashes($file_copy[$i]['bf_fileurl']) . "',
bf_thumburl = '" . addslashes($file_copy[$i]['bf_thumburl']) . "',
bf_storage = '" . addslashes($file_copy[$i]['bf_storage']) . "',
bf_filesize = '{$file_copy[$i]['bf_filesize']}',
bf_width = '{$file_copy[$i]['bf_width']}',
bf_height = '{$file_copy[$i]['bf_height']}',
bf_type = '{$file_copy[$i]['bf_type']}',
bf_datetime = '{$file_copy[$i]['bf_datetime']}' ";
sql_query($sql, false);
}
}
delete_cache_latest($bo_table);
delete_cache_latest($target_table);
echo "<script>opener.document.location.reload();</script>";
alert("복사에 성공 했습니다.", './board_copy.php?bo_table=' . $bo_table . '&amp;' . $qstr);
+42
View File
@@ -0,0 +1,42 @@
<?php
// board_delete.php , boardgroup_delete.php 에서 include 하는 파일
// 개별 페이지 접근 불가
if (!defined('_GNUBOARD_')) {
exit;
}
if (!defined('_BOARD_DELETE_')) {
exit;
}
// $tmp_bo_table 에는 $bo_table 값을 넘겨주어야 함
if (!$tmp_bo_table) {
return;
}
// 게시판 1개는 삭제 불가 (게시판 복사를 위해서)
//$row = sql_fetch(" select count(*) as cnt from $g5['board_table'] ");
//if ($row['cnt'] <= 1) { return; }
// 게시판 설정 삭제
sql_query(" delete from {$g5['board_table']} where bo_table = '{$tmp_bo_table}' ");
// 최신글 삭제
sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$tmp_bo_table}' ");
// 스크랩 삭제
sql_query(" delete from {$g5['scrap_table']} where bo_table = '{$tmp_bo_table}' ");
// 파일 삭제
sql_query(" delete from {$g5['board_file_table']} where bo_table = '{$tmp_bo_table}' ");
// 게시판 테이블 DROP
sql_query(" drop table {$g5['write_prefix']}{$tmp_bo_table} ", false);
// 좋아요 테이블에서 기록 삭제
sql_query(" delete from {$g5['board_good_table']} where bo_table = '{$tmp_bo_table}' ");
delete_cache_latest($tmp_bo_table);
// 게시판 폴더 전체 삭제
rm_rf(G5_DATA_PATH . '/file/' . $tmp_bo_table);
File diff suppressed because it is too large Load Diff
+545
View File
@@ -0,0 +1,545 @@
<?php
$sub_menu = "300100";
include_once('./_common.php');
if ($w == 'u') {
check_demo();
}
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$gr_id = isset($_POST['gr_id']) ? preg_replace('/[^a-z0-9_]/i', '', (string)$_POST['gr_id']) : '';
$bo_admin = isset($_POST['bo_admin']) ? preg_replace('/[^a-z0-9_\, \|\#]/i', '', $_POST['bo_admin']) : '';
$bo_subject = isset($_POST['bo_subject']) ? strip_tags(clean_xss_attributes($_POST['bo_subject'])) : '';
$bo_mobile_subject = isset($_POST['bo_mobile_subject']) ? strip_tags(clean_xss_attributes($_POST['bo_mobile_subject'])) : '';
if (!$gr_id) {
alert('그룹 ID는 반드시 선택하세요.');
}
if (!$bo_table) {
alert('게시판 TABLE명은 반드시 입력하세요.');
}
if (!preg_match("/^([A-Za-z0-9_]{1,20})$/", $bo_table)) {
alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)');
}
if (!$bo_subject) {
alert('게시판 제목을 입력하세요.');
}
// 게시판명이 금지된 단어로 되어 있으면
if ($w == '' && in_array($bo_table, get_bo_table_banned_word())) {
alert('입력한 게시판 TABLE명을 사용할수 없습니다. 다른 이름으로 입력해 주세요.');
}
$bo_include_head = isset($_POST['bo_include_head']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['bo_include_head'], 0, 255)) : '';
$bo_include_tail = isset($_POST['bo_include_tail']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['bo_include_tail'], 0, 255)) : '';
// 관리자가 자동등록방지를 사용해야 할 경우
if ($board && (isset($board['bo_include_head']) && $board['bo_include_head'] !== $bo_include_head || $board['bo_include_tail'] !== $bo_include_tail) && function_exists('get_admin_captcha_by') && get_admin_captcha_by()) {
include_once(G5_CAPTCHA_PATH . '/captcha.lib.php');
if (!chk_captcha()) {
alert('자동등록방지 숫자가 틀렸습니다.');
}
}
if ($file = $bo_include_head) {
$file_ext = pathinfo($file, PATHINFO_EXTENSION);
if (!$file_ext || !in_array($file_ext, array('php', 'htm', 'html')) || !preg_match('/^.*\.(php|htm|html)$/i', $file)) {
alert('상단 파일 경로의 확장자는 php, htm, html 만 허용합니다.');
}
}
if ($file = $bo_include_tail) {
$file_ext = pathinfo($file, PATHINFO_EXTENSION);
if (!$file_ext || !in_array($file_ext, array('php', 'htm', 'html')) || !preg_match('/^.*\.(php|htm|html)$/i', $file)) {
alert('하단 파일 경로의 확장자는 php, htm, html 만 허용합니다.');
}
}
if (!is_include_path_check($bo_include_head, 1)) {
alert('상단 파일 경로에 포함시킬수 없는 문자열이 있습니다.');
}
if (!is_include_path_check($bo_include_tail, 1)) {
alert('하단 파일 경로에 포함시킬수 없는 문자열이 있습니다.');
}
if (function_exists('filter_input_include_path')) {
$bo_include_head = filter_input_include_path($bo_include_head);
$bo_include_tail = filter_input_include_path($bo_include_tail);
}
$board_path = G5_DATA_PATH . '/file/' . $bo_table;
// 게시판 디렉토리 생성
@mkdir($board_path, G5_DIR_PERMISSION);
@chmod($board_path, G5_DIR_PERMISSION);
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$file = $board_path . '/index.php';
if ($f = @fopen($file, 'w')) {
@fwrite($f, '');
@fclose($f);
@chmod($file, G5_FILE_PERMISSION);
}
// 분류에 & 나 = 는 사용이 불가하므로 2바이트로 바꾼다.
$src_char = array('&', '=');
$dst_char = array('', '〓');
$bo_category_list = isset($_POST['bo_category_list']) ? str_replace($src_char, $dst_char, $_POST['bo_category_list']) : '';
//https://github.com/gnuboard/gnuboard5/commit/f5f4925d4eb28ba1af728e1065fc2bdd9ce1da58 에 따른 조치
$str_bo_category_list = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\/\^\*]/", "", (string)$bo_category_list);
$bo_use_category = isset($_POST['bo_use_category']) ? (int) $_POST['bo_use_category'] : 0;
$bo_use_sideview = isset($_POST['bo_use_sideview']) ? (int) $_POST['bo_use_sideview'] : 0;
$bo_use_dhtml_editor = isset($_POST['bo_use_dhtml_editor']) ? (int) $_POST['bo_use_dhtml_editor'] : 0;
$bo_use_good = isset($_POST['bo_use_good']) ? (int) $_POST['bo_use_good'] : 0;
$bo_use_nogood = isset($_POST['bo_use_nogood']) ? (int) $_POST['bo_use_nogood'] : 0;
$bo_use_name = isset($_POST['bo_use_name']) ? (int) $_POST['bo_use_name'] : 0;
$bo_use_signature = isset($_POST['bo_use_signature']) ? (int) $_POST['bo_use_signature'] : 0;
$bo_use_ip_view = isset($_POST['bo_use_ip_view']) ? (int) $_POST['bo_use_ip_view'] : 0;
$bo_use_list_view = isset($_POST['bo_use_list_view']) ? (int) $_POST['bo_use_list_view'] : 0;
$bo_use_list_file = isset($_POST['bo_use_list_file']) ? (int) $_POST['bo_use_list_file'] : 0;
$bo_use_list_content = isset($_POST['bo_use_list_content']) ? (int) $_POST['bo_use_list_content'] : 0;
$bo_use_email = isset($_POST['bo_use_email']) ? (int) $_POST['bo_use_email'] : 0;
$bo_use_sns = isset($_POST['bo_use_sns']) ? (int) $_POST['bo_use_sns'] : 0;
$bo_use_captcha = isset($_POST['bo_use_captcha']) ? (int) $_POST['bo_use_captcha'] : 0;
$bo_table_width = isset($_POST['bo_table_width']) ? (int) $_POST['bo_table_width'] : 0;
$bo_subject_len = isset($_POST['bo_subject_len']) ? (int) $_POST['bo_subject_len'] : 0;
$bo_mobile_subject_len = isset($_POST['bo_mobile_subject_len']) ? (int) $_POST['bo_mobile_subject_len'] : 0;
$bo_page_rows = isset($_POST['bo_page_rows']) ? (int) $_POST['bo_page_rows'] : 0;
$bo_mobile_page_rows = isset($_POST['bo_mobile_page_rows']) ? (int) $_POST['bo_mobile_page_rows'] : 0;
$bo_use_rss_view = isset($_POST['bo_use_rss_view']) ? (int) $_POST['bo_use_rss_view'] : 0;
$bo_use_secret = isset($_POST['bo_use_secret']) ? (int) $_POST['bo_use_secret'] : 0;
$bo_use_file_content = isset($_POST['bo_use_file_content']) ? (int) $_POST['bo_use_file_content'] : 0;
$bo_new = isset($_POST['bo_new']) ? (int) $_POST['bo_new'] : 0;
$bo_hot = isset($_POST['bo_hot']) ? (int) $_POST['bo_hot'] : 0;
$bo_image_width = isset($_POST['bo_image_width']) ? (int) $_POST['bo_image_width'] : 0;
$bo_use_search = isset($_POST['bo_use_search']) ? (int) $_POST['bo_use_search'] : 0;
$bo_use_cert = isset($_POST['bo_use_cert']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['bo_use_cert']) : '';
$bo_device = isset($_POST['bo_device']) ? clean_xss_tags($_POST['bo_device'], 1, 1) : '';
$bo_list_level = isset($_POST['bo_list_level']) ? (int) $_POST['bo_list_level'] : 0;
$bo_read_level = isset($_POST['bo_read_level']) ? (int) $_POST['bo_read_level'] : 0;
$bo_write_level = isset($_POST['bo_write_level']) ? (int) $_POST['bo_write_level'] : 0;
$bo_reply_level = isset($_POST['bo_reply_level']) ? (int) $_POST['bo_reply_level'] : 0;
$bo_comment_level = isset($_POST['bo_comment_level']) ? (int) $_POST['bo_comment_level'] : 0;
$bo_html_level = isset($_POST['bo_html_level']) ? (int) $_POST['bo_html_level'] : 0;
$bo_link_level = isset($_POST['bo_link_level']) ? (int) $_POST['bo_link_level'] : 0;
$bo_count_modify = isset($_POST['bo_count_modify']) ? (int) $_POST['bo_count_modify'] : 0;
$bo_count_delete = isset($_POST['bo_count_delete']) ? (int) $_POST['bo_count_delete'] : 0;
$bo_upload_level = isset($_POST['bo_upload_level']) ? (int) $_POST['bo_upload_level'] : 0;
$bo_download_level = isset($_POST['bo_download_level']) ? (int) $_POST['bo_download_level'] : 0;
$bo_read_point = isset($_POST['bo_read_point']) ? (int) $_POST['bo_read_point'] : 0;
$bo_write_point = isset($_POST['bo_write_point']) ? (int) $_POST['bo_write_point'] : 0;
$bo_comment_point = isset($_POST['bo_comment_point']) ? (int) $_POST['bo_comment_point'] : 0;
$bo_download_point = isset($_POST['bo_download_point']) ? (int) $_POST['bo_download_point'] : 0;
$bo_select_editor = isset($_POST['bo_select_editor']) ? clean_xss_tags($_POST['bo_select_editor'], 1, 1) : '';
$bo_skin = isset($_POST['bo_skin']) ? clean_xss_tags($_POST['bo_skin'], 1, 1) : '';
$bo_mobile_skin = isset($_POST['bo_mobile_skin']) ? clean_xss_tags($_POST['bo_mobile_skin'], 1, 1) : '';
$bo_content_head = isset($_POST['bo_content_head']) ? $_POST['bo_content_head'] : '';
$bo_content_tail = isset($_POST['bo_content_tail']) ? $_POST['bo_content_tail'] : '';
$bo_mobile_content_head = isset($_POST['bo_mobile_content_head']) ? $_POST['bo_mobile_content_head'] : '';
$bo_mobile_content_tail = isset($_POST['bo_mobile_content_tail']) ? $_POST['bo_mobile_content_tail'] : '';
$bo_insert_content = isset($_POST['bo_insert_content']) ? $_POST['bo_insert_content'] : '';
$bo_gallery_cols = isset($_POST['bo_gallery_cols']) ? (int) $_POST['bo_gallery_cols'] : 0;
$bo_gallery_width = isset($_POST['bo_gallery_width']) ? (int) $_POST['bo_gallery_width'] : 0;
$bo_gallery_height = isset($_POST['bo_gallery_height']) ? (int) $_POST['bo_gallery_height'] : 0;
$bo_mobile_gallery_width = isset($_POST['bo_mobile_gallery_width']) ? (int) $_POST['bo_mobile_gallery_width'] : 0;
$bo_mobile_gallery_height = isset($_POST['bo_mobile_gallery_height']) ? (int) $_POST['bo_mobile_gallery_height'] : 0;
$bo_upload_count = isset($_POST['bo_upload_count']) ? (int) $_POST['bo_upload_count'] : 0;
$bo_upload_size = isset($_POST['bo_upload_size']) ? (int) $_POST['bo_upload_size'] : 0;
$bo_reply_order = isset($_POST['bo_reply_order']) ? (int) $_POST['bo_reply_order'] : 0;
$bo_order = isset($_POST['bo_order']) ? (int) $_POST['bo_order'] : 0;
$bo_write_min = isset($_POST['bo_write_min']) ? (int) $_POST['bo_write_min'] : 0;
$bo_write_max = isset($_POST['bo_write_max']) ? (int) $_POST['bo_write_max'] : 0;
$bo_comment_min = isset($_POST['bo_comment_min']) ? (int) $_POST['bo_comment_min'] : 0;
$bo_comment_max = isset($_POST['bo_comment_max']) ? (int) $_POST['bo_comment_max'] : 0;
$bo_sort_field = isset($_POST['bo_sort_field']) ? clean_xss_tags($_POST['bo_sort_field'], 1, 1) : '';
if (strpbrk($bo_skin.$bo_mobile_skin, "?%*:|\"<>") !== false) {
alert('스킨 디렉토리명 오류!');
}
$etcs = array();
for ($i = 1; $i <= 10; $i++) {
$etcs['bo_' . $i . '_subj'] = ${'bo_' . $i . '_subj'} = isset($_POST['bo_' . $i . '_subj']) ? $_POST['bo_' . $i . '_subj'] : '';
$etcs['bo_' . $i] = ${'bo_' . $i} = isset($_POST['bo_' . $i]) ? $_POST['bo_' . $i] : '';
}
$sql_common = " gr_id = '{$gr_id}',
bo_subject = '{$bo_subject}',
bo_mobile_subject = '{$bo_mobile_subject}',
bo_device = '{$bo_device}',
bo_admin = '{$bo_admin}',
bo_list_level = '{$bo_list_level}',
bo_read_level = '{$bo_read_level}',
bo_write_level = '{$bo_write_level}',
bo_reply_level = '{$bo_reply_level}',
bo_comment_level = '{$bo_comment_level}',
bo_html_level = '{$bo_html_level}',
bo_link_level = '{$bo_link_level}',
bo_count_modify = '{$bo_count_modify}',
bo_count_delete = '{$bo_count_delete}',
bo_upload_level = '{$bo_upload_level}',
bo_download_level = '{$bo_download_level}',
bo_read_point = '{$bo_read_point}',
bo_write_point = '{$bo_write_point}',
bo_comment_point = '{$bo_comment_point}',
bo_download_point = '{$bo_download_point}',
bo_use_category = '{$bo_use_category}',
bo_category_list = '{$str_bo_category_list}',
bo_use_sideview = '{$bo_use_sideview}',
bo_use_file_content = '{$bo_use_file_content}',
bo_use_secret = '{$bo_use_secret}',
bo_use_dhtml_editor = '{$bo_use_dhtml_editor}',
bo_select_editor = '{$bo_select_editor}',
bo_use_rss_view = '{$bo_use_rss_view}',
bo_use_good = '{$bo_use_good}',
bo_use_nogood = '{$bo_use_nogood}',
bo_use_name = '{$bo_use_name}',
bo_use_signature = '{$bo_use_signature}',
bo_use_ip_view = '{$bo_use_ip_view}',
bo_use_list_view = '{$bo_use_list_view}',
bo_use_list_file = '{$bo_use_list_file}',
bo_use_list_content = '{$bo_use_list_content}',
bo_use_email = '{$bo_use_email}',
bo_use_cert = '{$bo_use_cert}',
bo_use_sns = '{$bo_use_sns}',
bo_use_captcha = '{$bo_use_captcha}',
bo_table_width = '{$bo_table_width}',
bo_subject_len = '{$bo_subject_len}',
bo_mobile_subject_len = '{$bo_mobile_subject_len}',
bo_page_rows = '{$bo_page_rows}',
bo_mobile_page_rows = '{$bo_mobile_page_rows}',
bo_new = '{$bo_new}',
bo_hot = '{$bo_hot}',
bo_image_width = '{$bo_image_width}',
bo_skin = '{$bo_skin}',
bo_mobile_skin = '{$bo_mobile_skin}',
";
// 최고 관리자인 경우에만 수정가능
if ($is_admin === 'super') {
$sql_common .= " bo_include_head = '" . $bo_include_head . "',
bo_include_tail = '" . $bo_include_tail . "',
bo_content_head = '{$bo_content_head}',
bo_content_tail = '{$bo_content_tail}',
bo_mobile_content_head = '{$bo_mobile_content_head}',
bo_mobile_content_tail = '{$bo_mobile_content_tail}',
";
}
$sql_common .= " bo_insert_content = '{$bo_insert_content}',
bo_gallery_cols = '{$bo_gallery_cols}',
bo_gallery_width = '{$bo_gallery_width}',
bo_gallery_height = '{$bo_gallery_height}',
bo_mobile_gallery_width = '{$bo_mobile_gallery_width}',
bo_mobile_gallery_height= '{$bo_mobile_gallery_height}',
bo_upload_count = '{$bo_upload_count}',
bo_upload_size = '{$bo_upload_size}',
bo_reply_order = '{$bo_reply_order}',
bo_use_search = '{$bo_use_search}',
bo_order = '{$bo_order}',
bo_write_min = '{$bo_write_min}',
bo_write_max = '{$bo_write_max}',
bo_comment_min = '{$bo_comment_min}',
bo_comment_max = '{$bo_comment_max}',
bo_sort_field = '{$bo_sort_field}',
bo_1_subj = '{$bo_1_subj}',
bo_2_subj = '{$bo_2_subj}',
bo_3_subj = '{$bo_3_subj}',
bo_4_subj = '{$bo_4_subj}',
bo_5_subj = '{$bo_5_subj}',
bo_6_subj = '{$bo_6_subj}',
bo_7_subj = '{$bo_7_subj}',
bo_8_subj = '{$bo_8_subj}',
bo_9_subj = '{$bo_9_subj}',
bo_10_subj = '{$bo_10_subj}',
bo_1 = '{$bo_1}',
bo_2 = '{$bo_2}',
bo_3 = '{$bo_3}',
bo_4 = '{$bo_4}',
bo_5 = '{$bo_5}',
bo_6 = '{$bo_6}',
bo_7 = '{$bo_7}',
bo_8 = '{$bo_8}',
bo_9 = '{$bo_9}',
bo_10 = '{$bo_10}' ";
if ($w == '') {
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where bo_table = '{$bo_table}' ");
if ($row['cnt']) {
alert($bo_table . ' 은(는) 이미 존재하는 TABLE 입니다.');
}
$sql = " insert into {$g5['board_table']}
set bo_table = '{$bo_table}',
bo_count_write = '0',
bo_count_comment = '0',
$sql_common ";
sql_query($sql);
// 게시판 테이블 생성
$file = file('./sql_write.sql');
$file = get_db_create_replace($file);
$sql = implode("\n", $file);
$create_table = $g5['write_prefix'] . $bo_table;
// sql_board.sql 파일의 테이블명을 변환
$source = array('/__TABLE_NAME__/', '/;/');
$target = array($create_table, '');
$sql = preg_replace($source, $target, $sql);
sql_query($sql, false);
} elseif ($w == 'u') {
// 게시판의 글 수
$sql = " select count(*) as cnt from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 0 ";
$row = sql_fetch($sql);
$bo_count_write = $row['cnt'];
// 게시판의 코멘트 수
$sql = " select count(*) as cnt from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 1 ";
$row = sql_fetch($sql);
$bo_count_comment = $row['cnt'];
// 글수 조정
/*
엔피씨님의 팁으로 교체합니다. 130308
http://sir.kr/g5_tiptech/27207
*/
if (isset($_POST['proc_count'])) {
// 원글을 얻습니다.
//$sql = " select wr_id from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 0 ";
$sql = " select a.wr_id, (count(b.wr_parent) - 1) as cnt from {$g5['write_prefix']}{$bo_table} a, {$g5['write_prefix']}{$bo_table} b where a.wr_id=b.wr_parent and a.wr_is_comment=0 group by a.wr_id ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
/*
// 코멘트수를 얻습니다.
$sql2 = " select count(*) as cnt from {$g5['write_prefix']}$bo_table where wr_parent = '{$row['wr_id']}' and wr_is_comment = 1 ";
$row2 = sql_fetch($sql2);
*/
sql_query(" update {$g5['write_prefix']}{$bo_table} set wr_comment = '{$row['cnt']}' where wr_id = '{$row['wr_id']}' ");
}
}
// 공지사항에는 등록되어 있지만 실제 존재하지 않는 글 아이디는 삭제합니다.
$bo_notice = "";
$lf = "";
if ($board['bo_notice']) {
$tmp_array = explode(",", $board['bo_notice']);
for ($i = 0; $i < count($tmp_array); $i++) {
$tmp_wr_id = trim($tmp_array[$i]);
$row = sql_fetch(" select count(*) as cnt from {$g5['write_prefix']}{$bo_table} where wr_id = '{$tmp_wr_id}' ");
if ($row['cnt']) {
$bo_notice .= $lf . $tmp_wr_id;
$lf = ",";
}
}
}
$sql = " update {$g5['board_table']}
set bo_notice = '{$bo_notice}',
bo_count_write = '{$bo_count_write}',
bo_count_comment = '{$bo_count_comment}',
{$sql_common}
where bo_table = '{$bo_table}' ";
sql_query($sql);
}
// 같은 그룹내 게시판 동일 옵션 적용
$grp_fields = '';
if (is_checked('chk_grp_device')) $grp_fields .= " , bo_device = '{$bo_device}' ";
if (is_checked('chk_grp_admin')) $grp_fields .= " , bo_admin = '{$bo_admin}' ";
if (is_checked('chk_grp_list_level')) $grp_fields .= " , bo_list_level = '{$bo_list_level}' ";
if (is_checked('chk_grp_read_level')) $grp_fields .= " , bo_read_level = '{$bo_read_level}' ";
if (is_checked('chk_grp_write_level')) $grp_fields .= " , bo_write_level = '{$bo_write_level}' ";
if (is_checked('chk_grp_reply_level')) $grp_fields .= " , bo_reply_level = '{$bo_reply_level}' ";
if (is_checked('chk_grp_comment_level')) $grp_fields .= " , bo_comment_level = '{$bo_comment_level}' ";
if (is_checked('chk_grp_link_level')) $grp_fields .= " , bo_link_level = '{$bo_link_level}' ";
if (is_checked('chk_grp_upload_level')) $grp_fields .= " , bo_upload_level = '{$bo_upload_level}' ";
if (is_checked('chk_grp_download_level')) $grp_fields .= " , bo_download_level = '{$bo_download_level}' ";
if (is_checked('chk_grp_html_level')) $grp_fields .= " , bo_html_level = '{$bo_html_level}' ";
if (is_checked('chk_grp_count_modify')) $grp_fields .= " , bo_count_modify = '{$bo_count_modify}' ";
if (is_checked('chk_grp_count_delete')) $grp_fields .= " , bo_count_delete = '{$bo_count_delete}' ";
if (is_checked('chk_grp_read_point')) $grp_fields .= " , bo_read_point = '{$bo_read_point}' ";
if (is_checked('chk_grp_write_point')) $grp_fields .= " , bo_write_point = '{$bo_write_point}' ";
if (is_checked('chk_grp_comment_point')) $grp_fields .= " , bo_comment_point = '{$bo_comment_point}' ";
if (is_checked('chk_grp_download_point')) $grp_fields .= " , bo_download_point = '{$bo_download_point}' ";
if (is_checked('chk_grp_category_list')) {
$grp_fields .= " , bo_category_list = '{$str_bo_category_list}' ";
$grp_fields .= " , bo_use_category = '{$bo_use_category}' ";
}
if (is_checked('chk_grp_use_sideview')) $grp_fields .= " , bo_use_sideview = '{$bo_use_sideview}' ";
if (is_checked('chk_grp_use_file_content')) $grp_fields .= " , bo_use_file_content = '{$bo_use_file_content}' ";
if (is_checked('chk_grp_use_secret')) $grp_fields .= " , bo_use_secret = '{$bo_use_secret}' ";
if (is_checked('chk_grp_use_dhtml_editor')) $grp_fields .= " , bo_use_dhtml_editor = '{$bo_use_dhtml_editor}' ";
if (is_checked('chk_grp_select_editor')) $grp_fields .= " , bo_select_editor = '{$bo_select_editor}' ";
if (is_checked('chk_grp_use_rss_view')) $grp_fields .= " , bo_use_rss_view = '{$bo_use_rss_view}' ";
if (is_checked('chk_grp_use_good')) $grp_fields .= " , bo_use_good = '{$bo_use_good}' ";
if (is_checked('chk_grp_use_nogood')) $grp_fields .= " , bo_use_nogood = '{$bo_use_nogood}' ";
if (is_checked('chk_grp_use_name')) $grp_fields .= " , bo_use_name = '{$bo_use_name}' ";
if (is_checked('chk_grp_use_signature')) $grp_fields .= " , bo_use_signature = '{$bo_use_signature}' ";
if (is_checked('chk_grp_use_ip_view')) $grp_fields .= " , bo_use_ip_view = '{$bo_use_ip_view}' ";
if (is_checked('chk_grp_use_list_view')) $grp_fields .= " , bo_use_list_view = '{$bo_use_list_view}' ";
if (is_checked('chk_grp_use_list_file')) $grp_fields .= " , bo_use_list_file = '{$bo_use_list_file}' ";
if (is_checked('chk_grp_use_list_content')) $grp_fields .= " , bo_use_list_content = '{$bo_use_list_content}' ";
if (is_checked('chk_grp_use_email')) $grp_fields .= " , bo_use_email = '{$bo_use_email}' ";
if (is_checked('chk_grp_use_cert')) $grp_fields .= " , bo_use_cert = '{$bo_use_cert}' ";
if (is_checked('chk_grp_use_sns')) $grp_fields .= " , bo_use_sns = '{$bo_use_sns}' ";
if (is_checked('chk_grp_use_captcha')) $grp_fields .= " , bo_use_captcha = '{$bo_use_captcha}' ";
if (is_checked('chk_grp_skin')) $grp_fields .= " , bo_skin = '{$bo_skin}' ";
if (is_checked('chk_grp_mobile_skin')) $grp_fields .= " , bo_mobile_skin = '{$bo_mobile_skin}' ";
if (is_checked('chk_grp_gallery_cols')) $grp_fields .= " , bo_gallery_cols = '{$bo_gallery_cols}' ";
if (is_checked('chk_grp_gallery_width')) $grp_fields .= " , bo_gallery_width = '{$bo_gallery_width}' ";
if (is_checked('chk_grp_gallery_height')) $grp_fields .= " , bo_gallery_height = '{$bo_gallery_height}' ";
if (is_checked('chk_grp_mobile_gallery_width')) $grp_fields .= " , bo_mobile_gallery_width = '{$bo_mobile_gallery_width}' ";
if (is_checked('chk_grp_mobile_gallery_height'))$grp_fields .= " , bo_mobile_gallery_height = '{$bo_mobile_gallery_height}' ";
if (is_checked('chk_grp_table_width')) $grp_fields .= " , bo_table_width = '{$bo_table_width}' ";
if (is_checked('chk_grp_page_rows')) $grp_fields .= " , bo_page_rows = '{$bo_page_rows}' ";
if (is_checked('chk_grp_mobile_page_rows')) $grp_fields .= " , bo_mobile_page_rows = '{$bo_mobile_page_rows}' ";
if (is_checked('chk_grp_subject_len')) $grp_fields .= " , bo_subject_len = '{$bo_subject_len}' ";
if (is_checked('chk_grp_mobile_subject_len')) $grp_fields .= " , bo_mobile_subject_len = '{$bo_mobile_subject_len}' ";
if (is_checked('chk_grp_new')) $grp_fields .= " , bo_new = '{$bo_new}' ";
if (is_checked('chk_grp_hot')) $grp_fields .= " , bo_hot = '{$bo_hot}' ";
if (is_checked('chk_grp_image_width')) $grp_fields .= " , bo_image_width = '{$bo_image_width}' ";
if (is_checked('chk_grp_reply_order')) $grp_fields .= " , bo_reply_order = '{$bo_reply_order}' ";
if (is_checked('chk_grp_sort_field')) $grp_fields .= " , bo_sort_field = '{$bo_sort_field}' ";
if (is_checked('chk_grp_write_min')) $grp_fields .= " , bo_write_min = '{$bo_write_min}' ";
if (is_checked('chk_grp_write_max')) $grp_fields .= " , bo_write_max = '{$bo_write_max}' ";
if (is_checked('chk_grp_comment_min')) $grp_fields .= " , bo_comment_min = '{$bo_comment_min}' ";
if (is_checked('chk_grp_comment_max')) $grp_fields .= " , bo_comment_max = '{$bo_comment_max}' ";
if (is_checked('chk_grp_upload_count')) $grp_fields .= " , bo_upload_count = '{$bo_upload_count}' ";
if (is_checked('chk_grp_upload_size')) $grp_fields .= " , bo_upload_size = '{$bo_upload_size}' ";
//최고관리자만 수정가능
if ($is_admin === 'super') {
if (is_checked('chk_grp_include_head')) $grp_fields .= " , bo_include_head = '{$bo_include_head}' ";
if (is_checked('chk_grp_include_tail')) $grp_fields .= " , bo_include_tail = '{$bo_include_tail}' ";
if (is_checked('chk_grp_content_head')) $grp_fields .= " , bo_content_head = '{$bo_content_head}' ";
if (is_checked('chk_grp_content_tail')) $grp_fields .= " , bo_content_tail = '{$bo_content_tail}' ";
if (is_checked('chk_grp_mobile_content_head')) $grp_fields .= " , bo_mobile_content_head = '{$bo_mobile_content_head}' ";
if (is_checked('chk_grp_mobile_content_tail')) $grp_fields .= " , bo_mobile_content_tail = '{$bo_mobile_content_tail}' ";
}
if (is_checked('chk_grp_insert_content')) $grp_fields .= " , bo_insert_content = '{$bo_insert_content}' ";
if (is_checked('chk_grp_use_search')) $grp_fields .= " , bo_use_search = '{$bo_use_search}' ";
if (is_checked('chk_grp_order')) $grp_fields .= " , bo_order = '{$bo_order}' ";
for ($i = 1; $i <= 10; $i++) {
if (is_checked('chk_grp_' . $i)) {
$grp_fields .= " , bo_{$i}_subj = '" . $etcs['bo_' . $i . '_subj'] . "' ";
$grp_fields .= " , bo_{$i} = '" . $etcs['bo_' . $i] . "' ";
}
}
if ($grp_fields) {
sql_query(" update {$g5['board_table']} set bo_table = bo_table {$grp_fields} where gr_id = '$gr_id' ");
}
// 모든 게시판 동일 옵션 적용
$all_fields = '';
if (is_checked('chk_all_device')) $all_fields .= " , bo_device = '{$bo_device}' ";
if (is_checked('chk_all_admin')) $all_fields .= " , bo_admin = '{$bo_admin}' ";
if (is_checked('chk_all_list_level')) $all_fields .= " , bo_list_level = '{$bo_list_level}' ";
if (is_checked('chk_all_read_level')) $all_fields .= " , bo_read_level = '{$bo_read_level}' ";
if (is_checked('chk_all_write_level')) $all_fields .= " , bo_write_level = '{$bo_write_level}' ";
if (is_checked('chk_all_reply_level')) $all_fields .= " , bo_reply_level = '{$bo_reply_level}' ";
if (is_checked('chk_all_comment_level')) $all_fields .= " , bo_comment_level = '{$bo_comment_level}' ";
if (is_checked('chk_all_link_level')) $all_fields .= " , bo_link_level = '{$bo_link_level}' ";
if (is_checked('chk_all_upload_level')) $all_fields .= " , bo_upload_level = '{$bo_upload_level}' ";
if (is_checked('chk_all_download_level')) $all_fields .= " , bo_download_level = '{$bo_download_level}' ";
if (is_checked('chk_all_html_level')) $all_fields .= " , bo_html_level = '{$bo_html_level}' ";
if (is_checked('chk_all_count_modify')) $all_fields .= " , bo_count_modify = '{$bo_count_modify}' ";
if (is_checked('chk_all_count_delete')) $all_fields .= " , bo_count_delete = '{$bo_count_delete}' ";
if (is_checked('chk_all_read_point')) $all_fields .= " , bo_read_point = '{$bo_read_point}' ";
if (is_checked('chk_all_write_point')) $all_fields .= " , bo_write_point = '{$bo_write_point}' ";
if (is_checked('chk_all_comment_point')) $all_fields .= " , bo_comment_point = '{$bo_comment_point}' ";
if (is_checked('chk_all_download_point')) $all_fields .= " , bo_download_point = '{$bo_download_point}' ";
if (is_checked('chk_all_category_list')) {
$all_fields .= " , bo_category_list = '{$str_bo_category_list}' ";
$all_fields .= " , bo_use_category = '{$bo_use_category}' ";
}
if (is_checked('chk_all_use_sideview')) $all_fields .= " , bo_use_sideview = '{$bo_use_sideview}' ";
if (is_checked('chk_all_use_file_content')) $all_fields .= " , bo_use_file_content = '{$bo_use_file_content}' ";
if (is_checked('chk_all_use_secret')) $all_fields .= " , bo_use_secret = '{$bo_use_secret}' ";
if (is_checked('chk_all_use_dhtml_editor')) $all_fields .= " , bo_use_dhtml_editor = '{$bo_use_dhtml_editor}' ";
if (is_checked('chk_all_select_editor')) $all_fields .= " , bo_select_editor = '{$bo_select_editor}' ";
if (is_checked('chk_all_use_rss_view')) $all_fields .= " , bo_use_rss_view = '{$bo_use_rss_view}' ";
if (is_checked('chk_all_use_good')) $all_fields .= " , bo_use_good = '{$bo_use_good}' ";
if (is_checked('chk_all_use_nogood')) $all_fields .= " , bo_use_nogood = '{$bo_use_nogood}' ";
if (is_checked('chk_all_use_name')) $all_fields .= " , bo_use_name = '{$bo_use_name}' ";
if (is_checked('chk_all_use_signature')) $all_fields .= " , bo_use_signature = '{$bo_use_signature}' ";
if (is_checked('chk_all_use_ip_view')) $all_fields .= " , bo_use_ip_view = '{$bo_use_ip_view}' ";
if (is_checked('chk_all_use_list_view')) $all_fields .= " , bo_use_list_view = '{$bo_use_list_view}' ";
if (is_checked('chk_all_use_list_file')) $all_fields .= " , bo_use_list_file = '{$bo_use_list_file}' ";
if (is_checked('chk_all_use_list_content')) $all_fields .= " , bo_use_list_content = '{$bo_use_list_content}' ";
if (is_checked('chk_all_use_email')) $all_fields .= " , bo_use_email = '{$bo_use_email}' ";
if (is_checked('chk_all_use_cert')) $all_fields .= " , bo_use_cert = '{$bo_use_cert}' ";
if (is_checked('chk_all_use_sns')) $all_fields .= " , bo_use_sns = '{$bo_use_sns}' ";
if (is_checked('chk_all_use_captcha')) $all_fields .= " , bo_use_captcha = '{$bo_use_captcha}' ";
if (is_checked('chk_all_skin')) $all_fields .= " , bo_skin = '{$bo_skin}' ";
if (is_checked('chk_all_mobile_skin')) $all_fields .= " , bo_mobile_skin = '{$bo_mobile_skin}' ";
if (is_checked('chk_all_gallery_cols')) $all_fields .= " , bo_gallery_cols = '{$bo_gallery_cols}' ";
if (is_checked('chk_all_gallery_width')) $all_fields .= " , bo_gallery_width = '{$bo_gallery_width}' ";
if (is_checked('chk_all_gallery_height')) $all_fields .= " , bo_gallery_height = '{$bo_gallery_height}' ";
if (is_checked('chk_all_mobile_gallery_width')) $all_fields .= " , bo_mobile_gallery_width = '{$bo_mobile_gallery_width}' ";
if (is_checked('chk_all_mobile_gallery_height')) $all_fields .= " , bo_mobile_gallery_height = '{$bo_mobile_gallery_height}' ";
if (is_checked('chk_all_table_width')) $all_fields .= " , bo_table_width = '{$bo_table_width}' ";
if (is_checked('chk_all_page_rows')) $all_fields .= " , bo_page_rows = '{$bo_page_rows}' ";
if (is_checked('chk_all_mobile_page_rows')) $all_fields .= " , bo_mobile_page_rows = '{$bo_mobile_page_rows}' ";
if (is_checked('chk_all_subject_len')) $all_fields .= " , bo_subject_len = '{$bo_subject_len}' ";
if (is_checked('chk_all_mobile_subject_len')) $all_fields .= " , bo_mobile_subject_len = '{$bo_mobile_subject_len}' ";
if (is_checked('chk_all_new')) $all_fields .= " , bo_new = '{$bo_new}' ";
if (is_checked('chk_all_hot')) $all_fields .= " , bo_hot = '{$bo_hot}' ";
if (is_checked('chk_all_image_width')) $all_fields .= " , bo_image_width = '{$bo_image_width}' ";
if (is_checked('chk_all_reply_order')) $all_fields .= " , bo_reply_order = '{$bo_reply_order}' ";
if (is_checked('chk_all_sort_field')) $all_fields .= " , bo_sort_field = '{$bo_sort_field}' ";
if (is_checked('chk_all_write_min')) $all_fields .= " , bo_write_min = '{$bo_write_min}' ";
if (is_checked('chk_all_write_max')) $all_fields .= " , bo_write_max = '{$bo_write_max}' ";
if (is_checked('chk_all_comment_min')) $all_fields .= " , bo_comment_min = '{$bo_comment_min}' ";
if (is_checked('chk_all_comment_max')) $all_fields .= " , bo_comment_max = '{$bo_comment_max}' ";
if (is_checked('chk_all_upload_count')) $all_fields .= " , bo_upload_count = '{$bo_upload_count}' ";
if (is_checked('chk_all_upload_size')) $all_fields .= " , bo_upload_size = '{$bo_upload_size}' ";
//최고관리자만 수정가능
if ($is_admin === 'super') {
if (is_checked('chk_all_include_head')) $all_fields .= " , bo_include_head = '{$bo_include_head}' ";
if (is_checked('chk_all_include_tail')) $all_fields .= " , bo_include_tail = '{$bo_include_tail}' ";
if (is_checked('chk_all_content_head')) $all_fields .= " , bo_content_head = '{$bo_content_head}' ";
if (is_checked('chk_all_content_tail')) $all_fields .= " , bo_content_tail = '{$bo_content_tail}' ";
if (is_checked('chk_all_mobile_content_head')) $all_fields .= " , bo_mobile_content_head = '{$bo_mobile_content_head}' ";
if (is_checked('chk_all_mobile_content_tail')) $all_fields .= " , bo_mobile_content_tail = '{$bo_mobile_content_tail}' ";
}
if (is_checked('chk_all_insert_content')) $all_fields .= " , bo_insert_content = '{$bo_insert_content}' ";
if (is_checked('chk_all_use_search')) $all_fields .= " , bo_use_search = '{$bo_use_search}' ";
if (is_checked('chk_all_order')) $all_fields .= " , bo_order = '{$bo_order}' ";
for ($i = 1; $i <= 10; $i++) {
if (is_checked('chk_all_' . $i)) {
$all_fields .= " , bo_{$i}_subj = '" . $etcs['bo_' . $i . '_subj'] . "' ";
$all_fields .= " , bo_{$i} = '" . $etcs['bo_' . $i] . "' ";
}
}
if ($all_fields) {
sql_query(" update {$g5['board_table']} set bo_table = bo_table {$all_fields} ");
}
delete_cache_latest($bo_table);
if (function_exists('get_admin_captcha_by')) {
get_admin_captcha_by('remove');
}
run_event('admin_board_form_update', $bo_table, $w);
goto_url("./board_form.php?w=u&bo_table={$bo_table}&amp;{$qstr}");
+234
View File
@@ -0,0 +1,234 @@
<?php
$sub_menu = "300100";
require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r');
$sql_common = " from {$g5['board_table']} a ";
$sql_search = " where (1) ";
if ($is_admin != "super") {
$sql_common .= " , {$g5['group_table']} b ";
$sql_search .= " and (a.gr_id = b.gr_id and b.gr_admin = '{$member['mb_id']}') ";
}
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "bo_table":
$sql_search .= " ($sfl like '$stx%') ";
break;
case "a.gr_id":
$sql_search .= " ($sfl = '$stx') ";
break;
default:
$sql_search .= " ($sfl like '%$stx%') ";
break;
}
$sql_search .= " ) ";
}
if (!$sst) {
$sst = "a.gr_id, a.bo_table";
$sod = "asc";
}
$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 = $config['cf_page_rows'];
$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['SCRIPT_NAME'] . '" class="ov_listall">전체목록</a>';
$g5['title'] = '게시판관리';
require_once './admin.head.php';
$colspan = 15;
?>
<div class="local_ov01 local_ov">
<?php echo $listall ?>
<span class="btn_ov01"><span class="ov_txt">생성된 게시판수</span><span class="ov_num"> <?php echo number_format($total_count) ?>개</span></span>
</div>
<form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get">
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl">
<option value="bo_table" <?php echo get_selected($sfl, "bo_table", true); ?>>TABLE</option>
<option value="bo_subject" <?php echo get_selected($sfl, "bo_subject"); ?>>제목</option>
<option value="a.gr_id" <?php echo get_selected($sfl, "a.gr_id"); ?>>그룹ID</option>
</select>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
<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 isset($token) ? $token : ''; ?>">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<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"><?php echo subject_sort_link('a.gr_id') ?>그룹</a></th>
<th scope="col"><?php echo subject_sort_link('bo_table') ?>TABLE</a></th>
<th scope="col"><?php echo subject_sort_link('bo_skin', '', 'desc') ?>스킨</a></th>
<th scope="col"><?php echo subject_sort_link('bo_mobile_skin', '', 'desc') ?>모바일<br>스킨</a></th>
<th scope="col"><?php echo subject_sort_link('bo_subject') ?>제목</a></th>
<th scope="col">읽기P<span class="sound_only">포인트</span></th>
<th scope="col">쓰기P<span class="sound_only">포인트</span></th>
<th scope="col">댓글P<span class="sound_only">포인트</span></th>
<th scope="col">다운P<span class="sound_only">포인트</span></th>
<th scope="col"><?php echo subject_sort_link('bo_use_sns') ?>SNS<br>사용</a></th>
<th scope="col"><?php echo subject_sort_link('bo_use_search') ?>검색<br>사용</a></th>
<th scope="col"><?php echo subject_sort_link('bo_order') ?>출력<br>순서</a></th>
<th scope="col">접속기기</th>
<th scope="col">관리</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$one_update = '<a href="./board_form.php?w=u&amp;bo_table=' . $row['bo_table'] . '&amp;' . $qstr . '" class="btn btn_03">수정</a>';
$one_copy = '<a href="./board_copy.php?bo_table=' . $row['bo_table'] . '" class="board_copy btn btn_02" target="win_board_copy">복사</a>';
$bg = 'bg' . ($i % 2);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_chk">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['bo_subject']) ?></label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td>
<?php if ($is_admin == 'super') { ?>
<?php echo get_group_select("gr_id[$i]", $row['gr_id']) ?>
<?php } else { ?>
<input type="hidden" name="gr_id[<?php echo $i ?>]" value="<?php echo $row['gr_id'] ?>"><?php echo $row['gr_subject'] ?>
<?php } ?>
</td>
<td>
<input type="hidden" name="board_table[<?php echo $i ?>]" value="<?php echo $row['bo_table'] ?>">
<a href="<?php echo get_pretty_url($row['bo_table']) ?>"><?php echo $row['bo_table'] ?></a>
</td>
<td>
<label for="bo_skin_<?php echo $i; ?>" class="sound_only">스킨</label>
<?php echo get_skin_select('board', 'bo_skin_' . $i, "bo_skin[$i]", $row['bo_skin']); ?>
</td>
<td>
<label for="bo_mobile_skin_<?php echo $i; ?>" class="sound_only">모바일 스킨</label>
<?php echo get_mobile_skin_select('board', 'bo_mobile_skin_' . $i, "bo_mobile_skin[$i]", $row['bo_mobile_skin']); ?>
</td>
<td>
<label for="bo_subject_<?php echo $i; ?>" class="sound_only">게시판 제목<strong class="sound_only"> 필수</strong></label>
<input type="text" name="bo_subject[<?php echo $i ?>]" value="<?php echo get_text($row['bo_subject']) ?>" id="bo_subject_<?php echo $i ?>" required class="required tbl_input bo_subject full_input" size="10">
</td>
<td class="td_numsmall">
<label for="bo_read_point_<?php echo $i; ?>" class="sound_only">읽기 포인트</label>
<input type="text" name="bo_read_point[<?php echo $i ?>]" value="<?php echo $row['bo_read_point'] ?>" id="bo_read_point_<?php echo $i; ?>" class="tbl_input" size="2">
</td>
<td class="td_numsmall">
<label for="bo_write_point_<?php echo $i; ?>" class="sound_only">쓰기 포인트</label>
<input type="text" name="bo_write_point[<?php echo $i ?>]" value="<?php echo $row['bo_write_point'] ?>" id="bo_write_point_<?php echo $i; ?>" class="tbl_input" size="2">
</td>
<td class="td_numsmall">
<label for="bo_comment_point_<?php echo $i; ?>" class="sound_only">댓글 포인트</label>
<input type="text" name="bo_comment_point[<?php echo $i ?>]" value="<?php echo $row['bo_comment_point'] ?>" id="bo_comment_point_<?php echo $i; ?>" class="tbl_input" size="2">
</td>
<td class="td_numsmall">
<label for="bo_download_point_<?php echo $i; ?>" class="sound_only">다운<br>포인트</label>
<input type="text" name="bo_download_point[<?php echo $i ?>]" value="<?php echo $row['bo_download_point'] ?>" id="bo_download_point_<?php echo $i; ?>" class="tbl_input" size="2">
</td>
<td class="td_numsmall">
<label for="bo_use_sns_<?php echo $i; ?>" class="sound_only">SNS<br>사용</label>
<input type="checkbox" name="bo_use_sns[<?php echo $i ?>]" value="1" id="bo_use_sns_<?php echo $i ?>" <?php echo $row['bo_use_sns'] ? "checked" : "" ?>>
</td>
<td class="td_numsmall">
<label for="bo_use_search_<?php echo $i; ?>" class="sound_only">검색<br>사용</label>
<input type="checkbox" name="bo_use_search[<?php echo $i ?>]" value="1" id="bo_use_search_<?php echo $i ?>" <?php echo $row['bo_use_search'] ? "checked" : "" ?>>
</td>
<td class="td_numsmall">
<label for="bo_order_<?php echo $i; ?>" class="sound_only">출력<br>순서</label>
<input type="text" name="bo_order[<?php echo $i ?>]" value="<?php echo $row['bo_order'] ?>" id="bo_order_<?php echo $i ?>" class="tbl_input" size="2">
</td>
<td class="td_mngsmall">
<label for="bo_device_<?php echo $i; ?>" class="sound_only">접속기기</label>
<select name="bo_device[<?php echo $i ?>]" id="bo_device_<?php echo $i ?>">
<option value="both" <?php echo get_selected($row['bo_device'], 'both', true); ?>>모두</option>
<option value="pc" <?php echo get_selected($row['bo_device'], 'pc'); ?>>PC</option>
<option value="mobile" <?php echo get_selected($row['bo_device'], 'mobile'); ?>>모바일</option>
</select>
</td>
<td class="td_mng td_mng_m">
<?php echo $one_update ?>
<?php echo $one_copy ?>
</td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<div class="btn_fixed_top">
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value" class="btn_02 btn">
<?php if ($is_admin == 'super') { ?>
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value" class="btn_02 btn">
<a href="./board_form.php" id="bo_add" class="btn_01 btn">게시판 추가</a>
<?php } ?>
</div>
</form>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'] . '?' . $qstr . '&amp;page='); ?>
<script>
function fboardlist_submit(f) {
if (!is_checked("chk[]")) {
alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");
return false;
}
if (document.pressed == "선택삭제") {
if (!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
$(function() {
$(".board_copy").click(function() {
window.open(this.href, "win_board_copy", "left=100,top=100,width=550,height=450");
return false;
});
});
</script>
<?php
require_once './admin.tail.php';
+96
View File
@@ -0,0 +1,96 @@
<?php
$sub_menu = "300100";
require_once './_common.php';
check_demo();
$post_count_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
$chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? $_POST['chk'] : array();
$act_button = isset($_POST['act_button']) ? strip_tags($_POST['act_button']) : '';
$board_table = (isset($_POST['board_table']) && is_array($_POST['board_table'])) ? $_POST['board_table'] : array();
if (!$post_count_chk) {
alert($act_button . " 하실 항목을 하나 이상 체크하세요.");
}
check_admin_token();
if ($act_button === "선택수정") {
auth_check_menu($auth, $sub_menu, 'w');
for ($i = 0; $i < $post_count_chk; $i++) {
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$post_gr_id = isset($_POST['gr_id'][$k]) ? clean_xss_tags($_POST['gr_id'][$k], 1, 1) : '';
$post_bo_device = isset($_POST['bo_device'][$k]) ? clean_xss_tags($_POST['bo_device'][$k], 1, 1) : '';
$post_bo_skin = isset($_POST['bo_skin'][$k]) ? clean_xss_tags($_POST['bo_skin'][$k], 1, 1) : '';
$post_bo_mobile_skin = isset($_POST['bo_mobile_skin'][$k]) ? clean_xss_tags($_POST['bo_mobile_skin'][$k], 1, 1) : '';
$post_bo_read_point = isset($_POST['bo_read_point'][$k]) ? clean_xss_tags($_POST['bo_read_point'][$k], 1, 1) : '';
$post_bo_write_point = isset($_POST['bo_write_point'][$k]) ? clean_xss_tags($_POST['bo_write_point'][$k], 1, 1) : '';
$post_bo_comment_point = isset($_POST['bo_comment_point'][$k]) ? clean_xss_tags($_POST['bo_comment_point'][$k], 1, 1) : '';
$post_bo_download_point = isset($_POST['bo_download_point'][$k]) ? clean_xss_tags($_POST['bo_download_point'][$k], 1, 1) : '';
$post_bo_use_search = isset($_POST['bo_use_search'][$k]) ? clean_xss_tags($_POST['bo_use_search'][$k], 1, 1) : '';
$post_bo_use_sns = isset($_POST['bo_use_sns'][$k]) ? clean_xss_tags($_POST['bo_use_sns'][$k], 1, 1) : '';
$post_bo_order = isset($_POST['bo_order'][$k]) ? clean_xss_tags($_POST['bo_order'][$k], 1, 1) : '';
$post_board_table = isset($_POST['board_table'][$k]) ? clean_xss_tags($_POST['board_table'][$k], 1, 1) : '';
if ($is_admin != 'super') {
$sql = " select count(*) as cnt from {$g5['board_table']} a, {$g5['group_table']} b
where a.gr_id = '" . sql_real_escape_string($post_gr_id) . "'
and a.gr_id = b.gr_id
and b.gr_admin = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if (!$row['cnt']) {
alert('최고관리자가 아닌 경우 다른 관리자의 게시판(' . $board_table[$k] . ')은 수정이 불가합니다.');
}
}
$p_bo_subject = is_array($_POST['bo_subject']) ? strip_tags(clean_xss_attributes($_POST['bo_subject'][$k])) : '';
$sql = " update {$g5['board_table']}
set gr_id = '" . sql_real_escape_string($post_gr_id) . "',
bo_subject = '" . $p_bo_subject . "',
bo_device = '" . sql_real_escape_string($post_bo_device) . "',
bo_skin = '" . sql_real_escape_string($post_bo_skin) . "',
bo_mobile_skin = '" . sql_real_escape_string($post_bo_mobile_skin) . "',
bo_read_point = '" . sql_real_escape_string($post_bo_read_point) . "',
bo_write_point = '" . sql_real_escape_string($post_bo_write_point) . "',
bo_comment_point = '" . sql_real_escape_string($post_bo_comment_point) . "',
bo_download_point = '" . sql_real_escape_string($post_bo_download_point) . "',
bo_use_search = '" . sql_real_escape_string($post_bo_use_search) . "',
bo_use_sns = '" . sql_real_escape_string($post_bo_use_sns) . "',
bo_order = '" . sql_real_escape_string($post_bo_order) . "'
where bo_table = '" . sql_real_escape_string($post_board_table) . "' ";
sql_query($sql);
}
} elseif ($act_button === "선택삭제") {
if ($is_admin != 'super') {
alert('게시판 삭제는 최고관리자만 가능합니다.');
}
auth_check_menu($auth, $sub_menu, 'd');
// _BOARD_DELETE_ 상수를 선언해야 board_delete.inc.php 가 정상 작동함
/* 확인필요 22.05.27
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects,
or it should execute logic with side effects, but should not do both.*/
define('_BOARD_DELETE_', true);
for ($i = 0; $i < $post_count_chk; $i++) {
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
// include 전에 $bo_table 값을 반드시 넘겨야 함
$tmp_bo_table = isset($_POST['board_table'][$k]) ? trim(clean_xss_tags($_POST['board_table'][$k], 1, 1)) : '';
if (preg_match("/^[A-Za-z0-9_]+$/", $tmp_bo_table)) {
include './board_delete.inc.php';
}
}
}
run_event('admin_board_list_update', $act_button, $chk, $board_table, $qstr);
goto_url('./board_list.php?' . $qstr);
+53
View File
@@ -0,0 +1,53 @@
<?php
$sub_menu = '300100';
require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'w');
if (!$board['bo_table']) {
alert('존재하지 않는 게시판입니다.');
}
$g5['title'] = $board['bo_subject'] . ' 게시판 썸네일 삭제';
require_once './admin.head.php';
?>
<div class="local_desc02 local_desc">
<p>
완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
</p>
</div>
<?php
$dir = G5_DATA_PATH . '/file/' . $bo_table;
$cnt = 0;
if (is_dir($dir)) {
echo '<ul>';
$files = glob($dir . '/thumb-*');
if (is_array($files)) {
foreach ($files as $thumbnail) {
$cnt++;
@unlink($thumbnail);
echo '<li>' . $thumbnail . '</li>' . PHP_EOL;
flush();
if (($cnt % 10) == 0) {
echo PHP_EOL;
}
}
}
echo '<li>완료됨</li></ul>' . PHP_EOL;
echo '<div class="local_desc01 local_desc"><p><strong>썸네일 ' . $cnt . '건의 삭제 완료됐습니다.</strong></p></div>' . PHP_EOL;
} else {
echo '<p>첨부파일 디렉토리가 존재하지 않습니다.</p>';
}
?>
<div class="btn_confirm01 btn_confirm"><a href="./board_form.php?w=u&amp;bo_table=<?php echo $bo_table; ?>&amp;<?php echo $qstr; ?>">게시판 수정으로 돌아가기</a></div>
<?php
require_once './admin.tail.php';
+171
View File
@@ -0,0 +1,171 @@
<?php
$sub_menu = "300200";
require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'w');
if ($is_admin != 'super' && $w == '') {
alert('최고관리자만 접근 가능합니다.');
}
$html_title = '게시판그룹';
$gr_id_attr = '';
$sound_only = '';
if (!isset($group['gr_id'])) {
$group['gr_id'] = '';
$group['gr_subject'] = '';
$group['gr_device'] = '';
}
$gr = array('gr_use_access' => 0, 'gr_admin' => '');
if ($w == '') {
$gr_id_attr = 'required';
$sound_only = '<strong class="sound_only"> 필수</strong>';
$html_title .= ' 생성';
} elseif ($w == 'u') {
$gr_id_attr = 'readonly';
$gr = sql_fetch(" select * from {$g5['group_table']} where gr_id = '$gr_id' ");
$html_title .= ' 수정';
} else {
alert('제대로 된 값이 넘어오지 않았습니다.');
}
if (!isset($group['gr_device'])) {
sql_query(" ALTER TABLE `{$g5['group_table']}` ADD `gr_device` ENUM('both','pc','mobile') NOT NULL DEFAULT 'both' AFTER `gr_subject` ", false);
}
// 접근회원수
$sql1 = " select count(*) as cnt from {$g5['group_member_table']} where gr_id = '{$gr_id}' ";
$row1 = sql_fetch($sql1);
$group_member_count = $row1['cnt'];
$g5['title'] = $html_title;
require_once './admin.head.php';
?>
<form name="fboardgroup" id="fboardgroup" action="./boardgroup_form_update.php" onsubmit="return fboardgroup_check(this);" method="post" autocomplete="off">
<input type="hidden" name="w" value="<?php echo $w ?>">
<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="">
<div class="tbl_frm01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?></caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="gr_id">그룹 ID<?php echo $sound_only ?></label></th>
<td><input type="text" name="gr_id" value="<?php echo $group['gr_id'] ?>" id="gr_id" <?php echo $gr_id_attr; ?> class="<?php echo $gr_id_attr; ?> alnum_ frm_input" maxlength="10">
<?php
if ($w == '') {
echo '영문자, 숫자, _ 만 가능 (공백없이)';
} else {
echo '<a href="' . G5_BBS_URL . '/group.php?gr_id=' . $group['gr_id'] . '" class="btn_frmline">게시판그룹 바로가기</a>';
}
?>
</td>
</tr>
<tr>
<th scope="row"><label for="gr_subject">그룹 제목<strong class="sound_only"> 필수</strong></label></th>
<td>
<input type="text" name="gr_subject" value="<?php echo get_text($group['gr_subject']) ?>" id="gr_subject" required class="required frm_input" size="80">
<?php
if ($w == 'u') {
echo '<a href="./board_form.php?gr_id=' . $gr_id . '" class="btn_frmline">게시판생성</a>';
}
?>
</td>
</tr>
<tr>
<th scope="row"><label for="gr_device">접속기기</label></th>
<td>
<?php echo help("PC 와 모바일 사용을 구분합니다.") ?>
<select id="gr_device" name="gr_device">
<option value="both" <?php echo get_selected($group['gr_device'], 'both', true); ?>>PC와 모바일에서 모두 사용</option>
<option value="pc" <?php echo get_selected($group['gr_device'], 'pc'); ?>>PC 전용</option>
<option value="mobile" <?php echo get_selected($group['gr_device'], 'mobile'); ?>>모바일 전용</option>
</select>
</td>
</tr>
<tr>
<th scope="row">
<?php
if ($is_admin == 'super') {
echo '<label for="gr_admin">그룹 관리자</label>';
} else {
echo '그룹 관리자';
}
?>
</th>
<td>
<?php
if ($is_admin == 'super') {
echo '<input type="text" id="gr_admin" name="gr_admin" class="frm_input" value="' . $gr['gr_admin'] . '" maxlength="20">';
} else {
echo '<input type="hidden" id="gr_admin" name="gr_admin" value="' . $gr['gr_admin'] . '">' . $gr['gr_admin'];
}
?>
</td>
</tr>
<tr>
<th scope="row"><label for="gr_use_access">접근회원사용</label></th>
<td>
<?php echo help("사용에 체크하시면 이 그룹에 속한 게시판은 접근가능한 회원만 접근이 가능합니다.") ?>
<input type="checkbox" name="gr_use_access" value="1" id="gr_use_access" <?php echo $gr['gr_use_access'] ? 'checked' : ''; ?>>
사용
</td>
</tr>
<tr>
<th scope="row">접근회원수</th>
<td>
<?php
echo '<a href="./boardgroupmember_list.php?gr_id=' . $gr_id . '">' . $group_member_count . '</a>';
?>
</td>
</tr>
<?php for ($i = 1; $i <= 10; $i++) { ?>
<tr>
<th scope="row">여분필드<?php echo $i ?></th>
<td class="td_extra">
<label for="gr_<?php echo $i ?>_subj">여분필드 <?php echo $i ?> 제목</label>
<input type="text" name="gr_<?php echo $i ?>_subj" value="<?php echo isset($group['gr_' . $i . '_subj']) ? get_text($group['gr_' . $i . '_subj']) : ''; ?>" id="gr_<?php echo $i ?>_subj" class="frm_input">
<label for="gr_<?php echo $i ?>">여분필드 <?php echo $i ?> 내용</label>
<input type="text" name="gr_<?php echo $i ?>" value="<?php echo isset($gr['gr_' . $i]) ? get_sanitize_input($gr['gr_' . $i]) : ''; ?>" id="gr_<?php echo $i ?>" class="frm_input">
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="btn_fixed_top">
<a href="./boardgroup_list.php?<?php echo $qstr ?>" class="btn btn_02">목록</a>
<input type="submit" class="btn_submit btn" accesskey="s" value="확인">
</div>
</form>
<div class="local_desc01 local_desc">
<p>
게시판을 생성하시려면 1개 이상의 게시판그룹이 필요합니다.<br>
게시판그룹을 이용하시면 더 효과적으로 게시판을 관리할 수 있습니다.
</p>
</div>
<script>
function fboardgroup_check(f) {
f.action = './boardgroup_form_update.php';
return true;
}
</script>
<?php
require_once './admin.tail.php';
+99
View File
@@ -0,0 +1,99 @@
<?php
$sub_menu = "300200";
require_once './_common.php';
if ($w == 'u') {
check_demo();
}
auth_check_menu($auth, $sub_menu, 'w');
if ($is_admin != 'super' && $w == '') {
alert('최고관리자만 접근 가능합니다.');
}
check_admin_token();
$gr_id = isset($_POST['gr_id']) ? $_POST['gr_id'] : '';
if (!preg_match("/^([A-Za-z0-9_]{1,10})$/", $gr_id)) {
alert('그룹 ID는 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (10자 이내)');
}
if (empty($gr_subject)) {
alert('그룹 제목을 입력하세요.');
}
$posts = array();
$check_keys = array(
'gr_subject' => '',
'gr_device' => '',
'gr_admin' => '',
);
for ($i = 1; $i <= 10; $i++) {
$check_keys['gr_' . $i . '_subj'] = isset($_POST['gr_' . $i . '_subj']) ? $_POST['gr_' . $i . '_subj'] : '';
$check_keys['gr_' . $i] = isset($_POST['gr_' . $i]) ? $_POST['gr_' . $i] : '';
}
foreach ($check_keys as $key => $value) {
if ($key === 'gr_subject') {
$posts[$key] = isset($_POST[$key]) ? strip_tags(clean_xss_attributes($_POST[$key])) : '';
} else {
$posts[$key] = isset($_POST[$key]) ? $_POST[$key] : '';
}
}
$sql_common = " gr_subject = '{$posts['gr_subject']}',
gr_device = '{$posts['gr_device']}',
gr_admin = '{$posts['gr_admin']}',
gr_1_subj = '{$posts['gr_1_subj']}',
gr_2_subj = '{$posts['gr_2_subj']}',
gr_3_subj = '{$posts['gr_3_subj']}',
gr_4_subj = '{$posts['gr_4_subj']}',
gr_5_subj = '{$posts['gr_5_subj']}',
gr_6_subj = '{$posts['gr_6_subj']}',
gr_7_subj = '{$posts['gr_7_subj']}',
gr_8_subj = '{$posts['gr_8_subj']}',
gr_9_subj = '{$posts['gr_9_subj']}',
gr_10_subj = '{$posts['gr_10_subj']}',
gr_1 = '{$posts['gr_1']}',
gr_2 = '{$posts['gr_2']}',
gr_3 = '{$posts['gr_3']}',
gr_4 = '{$posts['gr_4']}',
gr_5 = '{$posts['gr_5']}',
gr_6 = '{$posts['gr_6']}',
gr_7 = '{$posts['gr_7']}',
gr_8 = '{$posts['gr_8']}',
gr_9 = '{$posts['gr_9']}',
gr_10 = '{$posts['gr_10']}' ";
if (isset($_POST['gr_use_access'])) {
$sql_common .= ", gr_use_access = '{$_POST['gr_use_access']}' ";
} else {
$sql_common .= ", gr_use_access = '' ";
}
if ($w == '') {
$sql = " select count(*) as cnt from {$g5['group_table']} where gr_id = '{$gr_id}' ";
$row = sql_fetch($sql);
if ($row['cnt']) {
alert('이미 존재하는 그룹 ID 입니다.');
}
$sql = " insert into {$g5['group_table']}
set gr_id = '{$gr_id}',
{$sql_common} ";
sql_query($sql);
} elseif ($w == "u") {
$sql = " update {$g5['group_table']}
set {$sql_common}
where gr_id = '{$gr_id}' ";
sql_query($sql);
} else {
alert('제대로 된 값이 넘어오지 않았습니다.');
}
run_event('admin_boardgroup_form_update', $gr_id, $w);
goto_url('./boardgroup_form.php?w=u&amp;gr_id=' . $gr_id . '&amp;' . $qstr);
+212
View File
@@ -0,0 +1,212 @@
<?php
$sub_menu = "300200";
require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r');
if (!isset($group['gr_device'])) {
// 게시판 그룹 사용 필드 추가
// both : pc, mobile 둘다 사용
// pc : pc 전용 사용
// mobile : mobile 전용 사용
// none : 사용 안함
sql_query(" ALTER TABLE `{$g5['group_table']}` ADD `gr_device` ENUM( 'both', 'pc', 'mobile' ) NOT NULL DEFAULT 'both' AFTER `gr_subject` ", false);
}
$sql_common = " from {$g5['group_table']} ";
$sql_search = " where (1) ";
if ($is_admin != 'super') {
$sql_search .= " and (gr_admin = '{$member['mb_id']}') ";
}
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "gr_id":
case "gr_admin":
$sql_search .= " ({$sfl} = '{$stx}') ";
break;
default:
$sql_search .= " ({$sfl} like '%{$stx}%') ";
break;
}
$sql_search .= " ) ";
}
if ($sst) {
$sql_order = " order by {$sst} {$sod} ";
} else {
$sql_order = " order by gr_id asc ";
}
$sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
$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['SCRIPT_NAME'] . '" class="ov_listall">처음</a>';
$g5['title'] = '게시판그룹설정';
require_once './admin.head.php';
$colspan = 10;
?>
<div class="local_ov01 local_ov">
<?php echo $listall ?>
<span class="btn_ov01"><span class="ov_txt">전체그룹</span><span class="ov_num"> <?php echo number_format($total_count) ?>개</span></span>
</div>
<form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get">
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl">
<option value="gr_subject" <?php echo get_selected($sfl, "gr_subject"); ?>>제목</option>
<option value="gr_id" <?php echo get_selected($sfl, "gr_id"); ?>>ID</option>
<option value="gr_admin" <?php echo get_selected($sfl, "gr_admin"); ?>>그룹관리자</option>
</select>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" id="stx" value="<?php echo $stx ?>" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<form name="fboardgrouplist" id="fboardgrouplist" action="./boardgroup_list_update.php" onsubmit="return fboardgrouplist_submit(this);" method="post">
<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="">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<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"><?php echo subject_sort_link('gr_id') ?>그룹아이디</a></th>
<th scope="col"><?php echo subject_sort_link('gr_subject') ?>제목</a></th>
<th scope="col"><?php echo subject_sort_link('gr_admin') ?>그룹관리자</a></th>
<th scope="col">게시판</th>
<th scope="col">접근<br>사용</th>
<th scope="col">접근<br>회원수</th>
<th scope="col"><?php echo subject_sort_link('gr_order') ?>출력<br>순서</a></th>
<th scope="col">접속기기</th>
<th scope="col">관리</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 접근회원수
$sql1 = " select count(*) as cnt from {$g5['group_member_table']} where gr_id = '{$row['gr_id']}' ";
$row1 = sql_fetch($sql1);
// 게시판수
$sql2 = " select count(*) as cnt from {$g5['board_table']} where gr_id = '{$row['gr_id']}' ";
$row2 = sql_fetch($sql2);
$s_upd = '<a href="./boardgroup_form.php?' . $qstr . '&amp;w=u&amp;gr_id=' . $row['gr_id'] . '" class="btn_03 btn">수정</a>';
$bg = 'bg' . ($i % 2);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_chk">
<input type="hidden" name="group_id[<?php echo $i ?>]" value="<?php echo $row['gr_id'] ?>">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['gr_subject']); ?> 그룹</label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td class="td_left"><a href="<?php echo G5_BBS_URL ?>/group.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo $row['gr_id'] ?></a></td>
<td class="td_input">
<label for="gr_subject_<?php echo $i; ?>" class="sound_only">그룹제목</label>
<input type="text" name="gr_subject[<?php echo $i ?>]" value="<?php echo get_text($row['gr_subject']) ?>" id="gr_subject_<?php echo $i ?>" class="tbl_input">
</td>
<td class="td_mng td_input">
<?php if ($is_admin == 'super') { ?>
<label for="gr_admin_<?php echo $i; ?>" class="sound_only">그룹관리자</label>
<input type="text" name="gr_admin[<?php echo $i ?>]" value="<?php echo get_sanitize_input($row['gr_admin']); ?>" id="gr_admin_<?php echo $i ?>" class="tbl_input" size="10" maxlength="20">
<?php } else { ?>
<input type="hidden" name="gr_admin[<?php echo $i ?>]" value="<?php echo get_sanitize_input($row['gr_admin']); ?>"><?php echo get_text($row['gr_admin']); ?>
<?php } ?>
</td>
<td class="td_num"><a href="./board_list.php?sfl=a.gr_id&amp;stx=<?php echo $row['gr_id'] ?>"><?php echo $row2['cnt'] ?></a></td>
<td class="td_numsmall">
<label for="gr_use_access_<?php echo $i; ?>" class="sound_only">접근회원 사용</label>
<input type="checkbox" name="gr_use_access[<?php echo $i ?>]" <?php echo $row['gr_use_access'] ? 'checked' : '' ?> value="1" id="gr_use_access_<?php echo $i ?>">
</td>
<td class="td_num"><a href="./boardgroupmember_list.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo $row1['cnt'] ?></a></td>
<td class="td_numsmall">
<label for="gr_order_<?php echo $i; ?>" class="sound_only">메인메뉴 출력순서</label>
<input type="text" name="gr_order[<?php echo $i ?>]" value="<?php echo $row['gr_order'] ?>" id="gr_order_<?php echo $i ?>" class="tbl_input" size="2">
</td>
<td class="td_mng">
<label for="gr_device_<?php echo $i; ?>" class="sound_only">접속기기</label>
<select name="gr_device[<?php echo $i ?>]" id="gr_device_<?php echo $i ?>">
<option value="both" <?php echo get_selected($row['gr_device'], 'both'); ?>>모두</option>
<option value="pc" <?php echo get_selected($row['gr_device'], 'pc'); ?>>PC</option>
<option value="mobile" <?php echo get_selected($row['gr_device'], 'mobile'); ?>>모바일</option>
</select>
</td>
<td class="td_mng td_mng_s"><?php echo $s_upd ?></td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</table>
</div>
<div class="btn_fixed_top">
<input type="submit" name="act_button" onclick="document.pressed=this.value" value="선택수정" class="btn btn_02">
<input type="submit" name="act_button" onclick="document.pressed=this.value" value="선택삭제" class="btn btn_02">
<a href="./boardgroup_form.php" class="btn btn_01">게시판그룹 추가</a>
</div>
</form>
<div class="local_desc01 local_desc">
<p>
접근사용 옵션을 설정하시면 관리자가 지정한 회원만 해당 그룹에 접근할 수 있습니다.<br>
접근사용 옵션은 해당 그룹에 속한 모든 게시판에 적용됩니다.
</p>
</div>
<?php
$pagelist = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'] . '?' . $qstr . '&amp;page=');
echo $pagelist;
?>
<script>
function fboardgrouplist_submit(f) {
if (!is_checked("chk[]")) {
alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");
return false;
}
if (document.pressed == "선택삭제") {
if (!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
</script>
<?php
require_once './admin.tail.php';
+58
View File
@@ -0,0 +1,58 @@
<?php
$sub_menu = "300200";
require_once './_common.php';
check_demo();
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$post_chk = isset($_POST['chk']) ? (array) $_POST['chk'] : array();
$post_group_id = isset($_POST['group_id']) ? (array) $_POST['group_id'] : array();
$act_button = isset($_POST['act_button']) ? $_POST['act_button'] : '';
$chk_count = count($post_chk);
if (!$chk_count) {
alert($act_button . '할 게시판그룹을 1개이상 선택해 주세요.');
}
for ($i = 0; $i < $chk_count; $i++) {
$k = isset($post_chk[$i]) ? (int) $post_chk[$i] : 0;
$gr_id = preg_replace('/[^a-z0-9_]/i', '', $post_group_id[$k]);
$gr_subject = isset($_POST['gr_subject'][$k]) ? strip_tags(clean_xss_attributes($_POST['gr_subject'][$k])) : '';
$gr_admin = isset($_POST['gr_admin'][$k]) ? strip_tags(clean_xss_attributes($_POST['gr_admin'][$k])) : '';
$gr_device = isset($_POST['gr_device'][$k]) ? clean_xss_tags($_POST['gr_device'][$k], 1, 1, 10) : '';
$gr_use_access = isset($_POST['gr_use_access'][$k]) ? (int) $_POST['gr_use_access'][$k] : 0;
$gr_order = isset($_POST['gr_order'][$k]) ? (int) $_POST['gr_order'][$k] : 0;
if ($act_button == '선택수정') {
$sql = " update {$g5['group_table']}
set gr_subject = '{$gr_subject}',
gr_device = '" . sql_real_escape_string($gr_device) . "',
gr_admin = '" . sql_real_escape_string($gr_admin) . "',
gr_use_access = '" . $gr_use_access . "',
gr_order = '" . $gr_order . "'
where gr_id = '{$gr_id}' ";
if ($is_admin != 'super') {
$sql .= " and gr_admin = '{$gr_admin}' ";
}
sql_query($sql);
} elseif ($act_button == '선택삭제') {
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where gr_id = '$gr_id' ");
if ($row['cnt']) {
alert("이 그룹에 속한 게시판이 존재하여 게시판 그룹을 삭제할 수 없습니다.\\n\\n이 그룹에 속한 게시판을 먼저 삭제하여 주십시오.", './board_list.php?sfl=gr_id&amp;stx=' . $gr_id);
}
// 그룹 삭제
sql_query(" delete from {$g5['group_table']} where gr_id = '$gr_id' ");
// 그룹접근 회원 삭제
sql_query(" delete from {$g5['group_member_table']} where gr_id = '$gr_id' ");
}
}
run_event('admin_boardgroup_list_update', $act_button, $post_chk, $post_group_id, $qstr);
goto_url('./boardgroup_list.php?' . $qstr);
+134
View File
@@ -0,0 +1,134 @@
<?php
$sub_menu = "300200";
require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'w');
$mb = get_member($mb_id);
$token = isset($token) ? $token : '';
if (!(isset($mb['mb_id']) && $mb['mb_id'])) {
alert('존재하지 않는 회원입니다.');
}
$g5['title'] = '접근가능그룹';
require_once './admin.head.php';
$colspan = 4;
?>
<form name="fboardgroupmember_form" id="fboardgroupmember_form" action="./boardgroupmember_update.php" onsubmit="return boardgroupmember_form_check(this)" method="post">
<input type="hidden" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id">
<input type="hidden" name="token" value="" id="token">
<div class="local_ov01 local_ov">
<span class="btn_ov01"><span class="ov_txt"> 아이디</span><span class="ov_num"><?php echo $mb['mb_id'] ?></span></span>
<span class="btn_ov01"><span class="ov_txt"> 이름</span><span class="ov_num"><?php echo get_text($mb['mb_name']); ?></span></span>
<span class="btn_ov01"><span class="ov_txt"> 닉네임</span><span class="ov_num"><?php echo $mb['mb_nick'] ?></span></span>
</div>
<div class="local_cmd01 local_cmd">
<label for="gr_id">그룹지정</label>
<select name="gr_id" id="gr_id">
<option value="">접근가능 그룹을 선택하세요.</option>
<?php
$sql = " select *
from {$g5['group_table']}
where gr_use_access = 1 ";
if ($is_admin != 'super') {
$sql .= " and gr_admin = '{$member['mb_id']}' ";
}
$sql .= " order by gr_id ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
echo "<option value=\"" . $row['gr_id'] . "\">" . $row['gr_subject'] . "</option>";
}
?>
</select>
<input type="submit" value="선택" class="btn_submit btn" accesskey="s">
</div>
</form>
<form name="fboardgroupmember" id="fboardgroupmember" action="./boardgroupmember_update.php" onsubmit="return fboardgroupmember_submit(this);" method="post">
<input type="hidden" name="sst" value="<?php echo $sst ?>" id="sst">
<input type="hidden" name="sod" value="<?php echo $sod ?>" id="sod">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>" id="sfl">
<input type="hidden" name="stx" value="<?php echo $stx ?>" id="stx">
<input type="hidden" name="page" value="<?php echo $page ?>" id="page">
<input type="hidden" name="token" value="<?php echo get_sanitize_input($token); ?>" id="token">
<input type="hidden" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id">
<input type="hidden" name="w" value="d" id="w">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<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">처리일시</th>
</tr>
</thead>
<tbody>
<?php
$sql = " select * from {$g5['group_member_table']} a, {$g5['group_table']} b
where a.mb_id = '{$mb['mb_id']}'
and a.gr_id = b.gr_id ";
if ($is_admin != 'super') {
$sql .= " and b.gr_admin = '{$member['mb_id']}' ";
}
$sql .= " order by a.gr_id desc ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
?>
<tr>
<td class="td_chk">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo $row['gr_subject'] ?> 그룹</label>
<input type="checkbox" name="chk[]" value="<?php echo $row['gm_id'] ?>" id="chk_<?php echo $i ?>">
</td>
<td class="td_grid"><a href="<?php echo G5_BBS_URL; ?>/group.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo $row['gr_id'] ?></a></td>
<td class="td_category"><?php echo $row['gr_subject'] ?></td>
<td class="td_datetime"><?php echo $row['gm_datetime'] ?></td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">접근가능한 그룹이 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<div class="btn_list01 btn_list">
<input type="submit" name="" value="선택삭제" class="btn btn_02">
</div>
</form>
<script>
function fboardgroupmember_submit(f) {
if (!is_checked("chk[]")) {
alert("선택삭제 하실 항목을 하나 이상 선택하세요.");
return false;
}
return true;
}
function boardgroupmember_form_check(f) {
if (f.gr_id.value == '') {
alert('접근가능 그룹을 선택하세요.');
return false;
}
return true;
}
</script>
<?php
require_once './admin.tail.php';
+157
View File
@@ -0,0 +1,157 @@
<?php
$sub_menu = "300200";
require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r');
$gr = get_group($gr_id);
if (!$gr['gr_id']) {
alert('존재하지 않는 그룹입니다.');
}
$sql_common = " from {$g5['group_member_table']} a
left outer join {$g5['member_table']} b on (a.mb_id = b.mb_id) ";
$sql_search = " where gr_id = '{$gr_id}' ";
// 회원아이디로 검색되지 않던 오류를 수정
if (isset($stx) && $stx) {
$sql_search .= " and ( ";
switch ($sfl) {
default:
$sql_search .= " ($sfl like '%$stx%') ";
break;
}
$sql_search .= " ) ";
}
if (!$sst) {
$sst = "gm_datetime";
$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 = $config['cf_page_rows'];
$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);
$g5['title'] = $gr['gr_subject'] . ' 그룹 접근가능회원 (그룹아이디:' . $gr['gr_id'] . ')';
require_once './admin.head.php';
$colspan = 7;
?>
<form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get">
<input type="hidden" name="gr_id" value="<?php echo $gr_id ?>">
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl">
<option value="a.mb_id" <?php echo get_selected($sfl, "a.mb_id") ?>>회원아이디</option>
</select>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<form name="fboardgroupmember" id="fboardgroupmember" action="./boardgroupmember_update.php" onsubmit="return fboardgroupmember_submit(this);" method="post">
<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 ?>">
<input type="hidden" name="gr_id" value="<?php echo $gr_id ?>">
<input type="hidden" name="w" value="ld">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<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"><?php echo subject_sort_link('b.mb_id', 'gr_id=' . $gr_id) ?>회원아이디</a></th>
<th scope="col"><?php echo subject_sort_link('b.mb_name', 'gr_id=' . $gr_id) ?>이름</a></th>
<th scope="col"><?php echo subject_sort_link('b.mb_nick', 'gr_id=' . $gr_id) ?>별명</a></th>
<th scope="col"><?php echo subject_sort_link('b.mb_today_login', 'gr_id=' . $gr_id) ?>최종접속</a></th>
<th scope="col"><?php echo subject_sort_link('a.gm_datetime', 'gr_id=' . $gr_id) ?>처리일시</a></th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 접근가능한 그룹수
$sql2 = " select count(*) as cnt from {$g5['group_member_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2);
$group = "";
if ($row2['cnt']) {
$group = '<a href="./boardgroupmember_form.php?mb_id=' . $row['mb_id'] . '">' . $row2['cnt'] . '</a>';
}
$mb_nick = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);
$bg = 'bg' . ($i % 2);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_chk">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo $row['mb_nick'] ?> 회원</label>
<input type="checkbox" name="chk[]" value="<?php echo $row['gm_id'] ?>" id="chk_<?php echo $i ?>">
</td>
<td class="td_grid"><?php echo $group ?></td>
<td class="td_mbid"><?php echo $row['mb_id'] ?></td>
<td class="td_mbname"><?php echo get_text($row['mb_name']); ?></td>
<td class="td_name sv_use"><?php echo $mb_nick ?></td>
<td class="td_datetime"><?php echo substr($row['mb_today_login'], 2, 8) ?></td>
<td class="td_datetime"><?php echo $row['gm_datetime'] ?></td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<div class="btn_list01 btn_list">
<input type="submit" name="" value="선택삭제">
</div>
</form>
<?php
echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;gr_id=$gr_id&page=");
?>
<script>
function fboardgroupmember_submit(f) {
if (!is_checked("chk[]")) {
alert("선택삭제 하실 항목을 하나 이상 선택하세요.");
return false;
}
return true;
}
</script>
<?php
require_once './admin.tail.php';
+67
View File
@@ -0,0 +1,67 @@
<?php
$sub_menu = "300200";
require_once './_common.php';
sql_query(" ALTER TABLE {$g5['group_member_table']} CHANGE `gm_id` `gm_id` INT( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ", false);
if ($w == '') {
auth_check_menu($auth, $sub_menu, 'w');
$mb = get_member($mb_id);
if (empty($mb['mb_id'])) {
alert('존재하지 않는 회원입니다.');
}
$gr = get_group($gr_id);
if (empty($gr['gr_id'])) {
alert('존재하지 않는 그룹입니다.');
}
$sql = " select count(*) as cnt
from {$g5['group_member_table']}
where gr_id = '{$gr_id}'
and mb_id = '{$mb_id}' ";
$row = sql_fetch($sql);
if ($row['cnt']) {
alert('이미 등록되어 있는 자료입니다.');
} else {
check_admin_token();
$sql = " insert into {$g5['group_member_table']}
set gr_id = '{$_POST['gr_id']}',
mb_id = '{$_POST['mb_id']}',
gm_datetime = '" . G5_TIME_YMDHIS . "' ";
sql_query($sql);
}
} elseif ($w == 'd' || $w == 'ld') {
auth_check_menu($auth, $sub_menu, 'd');
$count = count($_POST['chk']);
if (!$count) {
alert('삭제할 목록을 하나이상 선택해 주세요.');
}
check_admin_token();
for ($i = 0; $i < $count; $i++) {
$gm_id = (int) $_POST['chk'][$i];
$sql = " select * from {$g5['group_member_table']} where gm_id = '$gm_id' ";
$gm = sql_fetch($sql);
if (!$gm['gm_id']) {
if ($count == 1) {
alert('존재하지 않는 자료입니다.');
} else {
continue;
}
}
$sql = " delete from {$g5['group_member_table']} where gm_id = '$gm_id' ";
sql_query($sql);
}
}
if ($w == 'ld') {
goto_url('./boardgroupmember_list.php?gr_id=' . $gr_id);
} else {
goto_url('./boardgroupmember_form.php?mb_id=' . $mb_id);
}
+46
View File
@@ -0,0 +1,46 @@
<?php
$sub_menu = "100510";
require_once './_common.php';
if (!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE)) {
alert('사용할 수 없는 기능입니다.', correct_goto_url(G5_ADMIN_URL));
}
if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.');
}
$g5['title'] = 'Browscap 업데이트';
require_once './admin.head.php';
?>
<div id="processing">
<p>Browscap 정보를 업데이트하시려면 아래 업데이트 버튼을 클릭해 주세요.</p>
<button type="button" id="run_update">업데이트</button>
</div>
<script>
$(function() {
$("#run_update").on("click", function() {
$("#processing").html('<div class="update_processing"></div><p>Browscap 정보를 업데이트 중입니다.</p>');
$.ajax({
url: "./browscap_update.php",
async: true,
cache: false,
dataType: "html",
success: function(data) {
if (data != "") {
alert(data);
return false;
}
$("#processing").html("<div class='check_processing'></div><p>Browscap 정보를 업데이트 했습니다.</p>");
}
});
});
});
</script>
<?php
require_once './admin.tail.php';
+50
View File
@@ -0,0 +1,50 @@
<?php
$sub_menu = "100520";
require_once './_common.php';
if (!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE)) {
alert('사용할 수 없는 기능입니다.', correct_goto_url(G5_ADMIN_URL));
}
if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.');
}
$rows = isset($_GET['rows']) ? preg_replace('#[^0-9]#', '', $_GET['rows']) : 0;
if (!$rows) {
$rows = 100;
}
$g5['title'] = '접속로그 변환';
require_once './admin.head.php';
?>
<div id="processing">
<p>접속로그 정보를 Browscap 정보로 변환하시려면 아래 업데이트 버튼을 클릭해 주세요.</p>
<button type="button" id="run_update">업데이트</button>
</div>
<script>
$(function() {
$(document).on("click", "#run_update", function() {
$("#processing").html('<div class="update_processing"></div><p>Browscap 정보로 변환 중입니다.</p>');
$.ajax({
method: "GET",
url: "./browscap_converter.php",
data: {
rows: "<?php echo strval($rows); ?>"
},
async: true,
cache: false,
dataType: "html",
success: function(data) {
$("#processing").html(data);
}
});
});
});
</script>
<?php
require_once './admin.tail.php';
+81
View File
@@ -0,0 +1,81 @@
<?php
ini_set('memory_limit', '-1');
require_once './_common.php';
// clean the output buffer
ob_end_clean();
if (!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE)) {
die('사용할 수 없는 기능입니다.');
}
if ($is_admin != 'super') {
die('최고관리자로 로그인 후 실행해 주세요.');
}
// browscap cache 파일 체크
if (!is_file(G5_DATA_PATH . '/cache/browscap_cache.php')) {
echo '<p>Browscap 정보가 없습니다. 아래 링크로 이동해 Browscap 정보를 업데이트 하세요.</p>' . PHP_EOL;
echo '<p><a href="' . G5_ADMIN_URL . '/browscap.php">Browscap 업데이트</a></p>' . PHP_EOL;
exit;
}
require_once G5_PLUGIN_PATH . '/browscap/Browscap.php';
$browscap = new phpbrowscap\Browscap(G5_DATA_PATH . '/cache');
$browscap->doAutoUpdate = false;
$browscap->cacheFilename = 'browscap_cache.php';
// 데이터 변환
$rows = isset($_GET['rows']) ? preg_replace('#[^0-9]#', '', $_GET['rows']) : 0;
if (!$rows) {
$rows = 100;
}
$sql_common = " from {$g5['visit_table']} where vi_agent <> '' and ( vi_browser = '' or vi_os = '' or vi_device = '' ) ";
$sql_order = " order by vi_id desc ";
$sql_limit = " limit 0, " . strval($rows) . " ";
$sql = " select count(vi_id) as cnt $sql_common ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$sql = " select vi_id, vi_agent, vi_browser, vi_os, vi_device
$sql_common
$sql_order
$sql_limit ";
$result = sql_query($sql);
$cnt = 0;
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$info = $browscap->getBrowser($row['vi_agent']);
$brow = $row['vi_browser'];
if (!$brow) {
$brow = $info->Comment;
}
$os = $row['vi_os'];
if (!$os) {
$os = $info->Platform;
}
$device = $row['vi_device'];
if (!$device) {
$device = $info->Device_Type;
}
$sql2 = " update {$g5['visit_table']}
set vi_browser = '$brow',
vi_os = '$os',
vi_device = '$device'
where vi_id = '{$row['vi_id']}' ";
sql_query($sql2);
$cnt++;
}
if (($total_count - $cnt) == 0 || $total_count == 0) {
echo '<div class="check_processing"></div><p>변환완료</p>';
} else {
echo '<p>총 ' . number_format($total_count) . '건 중 ' . number_format($cnt) . '건 변환완료<br><br>접속로그를 추가로 변환하시려면 아래 업데이트 버튼을 클릭해 주세요.</p><button type="button" id="run_update">업데이트</button>';
}
+25
View File
@@ -0,0 +1,25 @@
<?php
ini_set('memory_limit', '-1');
$sub_menu = "100510";
require_once './_common.php';
// clean the output buffer
ob_end_clean();
if (!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE)) {
die('사용할 수 없는 기능입니다.');
}
if ($is_admin != 'super') {
die('최고관리자만 접근 가능합니다.');
}
require_once G5_PLUGIN_PATH . '/browscap/Browscap.php';
$browscap = new phpbrowscap\Browscap(G5_DATA_PATH . '/cache');
$browscap->updateMethod = 'cURL';
$browscap->cacheFilename = 'browscap_cache.php';
$browscap->updateCache();
die('');
+61
View File
@@ -0,0 +1,61 @@
<?php
$sub_menu = '100900';
require_once './_common.php';
if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.', G5_URL);
}
@require_once './safe_check.php';
if (function_exists('social_log_file_delete')) {
social_log_file_delete();
}
run_event('adm_cache_file_delete_before');
$g5['title'] = '캐시파일 일괄삭제';
require_once './admin.head.php';
?>
<div class="local_desc02 local_desc">
<p>
완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
</p>
</div>
<?php
flush();
if (!$dir = @opendir(G5_DATA_PATH . '/cache')) {
echo '<p>캐시디렉토리를 열지못했습니다.</p>';
}
$cnt = 0;
echo '<ul class="session_del">' . PHP_EOL;
$files = glob(G5_DATA_PATH . '/cache/latest-*');
$content_files = glob(G5_DATA_PATH . '/cache/content-*');
$files = array_merge($files, $content_files);
if (is_array($files)) {
foreach ($files as $cache_file) {
$cnt++;
unlink($cache_file);
echo '<li>' . $cache_file . '</li>' . PHP_EOL;
flush();
if ($cnt % 10 == 0) {
echo PHP_EOL;
}
}
}
run_event('adm_cache_file_delete');
echo '<li>완료됨</li></ul>' . PHP_EOL;
echo '<div class="local_desc01 local_desc"><p><strong>최신글 캐시파일 ' . $cnt . '건 삭제 완료됐습니다.</strong><br>프로그램의 실행을 끝마치셔도 좋습니다.</p></div>' . PHP_EOL;
?>
<?php
require_once './admin.tail.php';
+56
View File
@@ -0,0 +1,56 @@
<?php
$sub_menu = '100910';
require_once './_common.php';
if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.', G5_URL);
}
$g5['title'] = '캡챠파일 일괄삭제';
require_once './admin.head.php';
?>
<div class="local_desc02 local_desc">
<p>
완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
</p>
</div>
<?php
flush();
if (!$dir = @opendir(G5_DATA_PATH . '/cache')) {
echo '<p>캐시디렉토리를 열지못했습니다.</p>';
}
$cnt = 0;
echo '<ul class="session_del">' . PHP_EOL;
$files = glob(G5_DATA_PATH . '/cache/?captcha-*');
if (is_array($files)) {
$before_time = G5_SERVER_TIME - 3600; // 한시간전
foreach ($files as $gcaptcha_file) {
$modification_time = filemtime($gcaptcha_file); // 파일접근시간
if ($modification_time > $before_time) {
continue;
}
$cnt++;
unlink($gcaptcha_file);
echo '<li>' . $gcaptcha_file . '</li>' . PHP_EOL;
flush();
if ($cnt % 10 == 0) {
echo PHP_EOL;
}
}
}
echo '<li>완료됨</li></ul>' . PHP_EOL;
echo '<div class="local_desc01 local_desc"><p><strong>캡챠파일 ' . $cnt . '건의 삭제 완료됐습니다.</strong><br>프로그램의 실행을 끝마치셔도 좋습니다.</p></div>' . PHP_EOL;
?>
<?php
require_once './admin.tail.php';
File diff suppressed because it is too large Load Diff
+352
View File
@@ -0,0 +1,352 @@
<?php
$sub_menu = "100100";
require_once './_common.php';
check_demo();
auth_check_menu($auth, $sub_menu, 'w');
if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.');
}
$cf_title = isset($_POST['cf_title']) ? strip_tags(clean_xss_attributes($_POST['cf_title'])) : '';
$cf_admin = isset($_POST['cf_admin']) ? clean_xss_tags($_POST['cf_admin'], 1, 1) : '';
$mb = get_member($cf_admin);
if (!(isset($mb['mb_id']) && $mb['mb_id'])) {
alert('최고관리자 회원아이디가 존재하지 않습니다.');
}
check_admin_token();
$cf_social_servicelist = !empty($_POST['cf_social_servicelist']) ? implode(',', $_POST['cf_social_servicelist']) : '';
$check_keys = array('cf_cert_kcb_cd', 'cf_cert_kcp_cd', 'cf_editor', 'cf_recaptcha_site_key', 'cf_recaptcha_secret_key', 'cf_naver_clientid', 'cf_naver_secret', 'cf_facebook_appid', 'cf_facebook_secret', 'cf_twitter_key', 'cf_twitter_secret', 'cf_google_clientid', 'cf_google_secret', 'cf_googl_shorturl_apikey', 'cf_kakao_rest_key', 'cf_kakao_client_secret', 'cf_kakao_js_apikey', 'cf_payco_clientid', 'cf_payco_secret', 'cf_cert_kg_cd', 'cf_cert_kg_mid');
foreach ($check_keys as $key) {
if (isset($_POST[$key]) && $_POST[$key]) {
$_POST[$key] = preg_replace('/[^a-z0-9_\-\.]/i', '', $_POST[$key]);
}
}
$_POST['cf_icode_server_port'] = isset($_POST['cf_icode_server_port']) ? preg_replace('/[^0-9]/', '', $_POST['cf_icode_server_port']) : '7295';
if (isset($_POST['cf_intercept_ip']) && $_POST['cf_intercept_ip']) {
$pattern = explode("\n", trim($_POST['cf_intercept_ip']));
for ($i = 0; $i < count($pattern); $i++) {
$pattern[$i] = trim($pattern[$i]);
if (empty($pattern[$i])) {
continue;
}
$pattern[$i] = str_replace(".", "\.", $pattern[$i]);
$pattern[$i] = str_replace("+", "[0-9\.]+", $pattern[$i]);
$pat = "/^{$pattern[$i]}$/";
if (preg_match($pat, $_SERVER['REMOTE_ADDR'])) {
alert("현재 접속 IP : " . $_SERVER['REMOTE_ADDR'] . " 가 차단될수 있기 때문에, 다른 IP를 입력해 주세요.");
}
}
}
$check_keys = array(
'cf_use_email_certify' => 'int',
'cf_use_homepage' => 'int',
'cf_req_homepage' => 'int',
'cf_use_tel' => 'int',
'cf_req_tel' => 'int',
'cf_use_hp' => 'int',
'cf_req_hp' => 'int',
'cf_use_addr' => 'int',
'cf_req_addr' => 'int',
'cf_use_signature' => 'int',
'cf_req_signature' => 'int',
'cf_use_profile' => 'int',
'cf_req_profile' => 'int',
'cf_register_level' => 'int',
'cf_register_point' => 'int',
'cf_icon_level' => 'int',
'cf_use_recommend' => 'int',
'cf_leave_day' => 'int',
'cf_search_part' => 'int',
'cf_email_use' => 'int',
'cf_email_wr_super_admin' => 'int',
'cf_email_wr_group_admin' => 'int',
'cf_email_wr_board_admin' => 'int',
'cf_email_wr_write' => 'int',
'cf_email_wr_comment_all' => 'int',
'cf_email_mb_super_admin' => 'int',
'cf_email_mb_member' => 'int',
'cf_email_po_super_admin' => 'int',
'cf_prohibit_id' => 'text',
'cf_prohibit_email' => 'text',
'cf_new_del' => 'int',
'cf_memo_del' => 'int',
'cf_visit_del' => 'int',
'cf_popular_del' => 'int',
'cf_use_member_icon' => 'int',
'cf_member_icon_size' => 'int',
'cf_member_icon_width' => 'int',
'cf_member_icon_height' => 'int',
'cf_member_img_size' => 'int',
'cf_member_img_width' => 'int',
'cf_member_img_height' => 'int',
'cf_login_minutes' => 'int',
'cf_formmail_is_member' => 'int',
'cf_page_rows' => 'int',
'cf_mobile_page_rows' => 'int',
'cf_social_login_use' => 'int',
'cf_cert_req' => 'int',
'cf_cert_use' => 'int',
'cf_cert_find' => 'int',
'cf_cert_ipin' => 'char',
'cf_cert_hp' => 'char',
'cf_cert_simple' => 'char',
'cf_cert_use_seed' => 'int',
'cf_admin_email' => 'char',
'cf_admin_email_name' => 'char',
'cf_add_script' => 'text',
'cf_use_point' => 'int',
'cf_point_term' => 'int',
'cf_use_copy_log' => 'int',
'cf_login_point' => 'int',
'cf_cut_name' => 'int',
'cf_nick_modify' => 'int',
'cf_new_skin' => 'char',
'cf_new_rows' => 'int',
'cf_search_skin' => 'char',
'cf_connect_skin' => 'char',
'cf_faq_skin' => 'char',
'cf_read_point' => 'int',
'cf_write_point' => 'int',
'cf_comment_point' => 'int',
'cf_download_point' => 'int',
'cf_write_pages' => 'int',
'cf_mobile_pages' => 'int',
'cf_link_target' => 'char',
'cf_delay_sec' => 'int',
'cf_filter' => 'text',
'cf_possible_ip' => 'text',
'cf_analytics' => 'text',
'cf_add_meta' => 'text',
'cf_member_skin' => 'char',
'cf_image_extension' => 'char',
'cf_flash_extension' => 'char',
'cf_movie_extension' => 'char',
'cf_visit' => 'char',
'cf_stipulation' => 'text',
'cf_privacy' => 'text',
'cf_open_modify' => 'int',
'cf_memo_send_point' => 'int',
'cf_mobile_new_skin' => 'char',
'cf_mobile_search_skin' => 'char',
'cf_mobile_connect_skin' => 'char',
'cf_mobile_faq_skin' => 'char',
'cf_mobile_member_skin' => 'char',
'cf_captcha_mp3' => 'char',
'cf_cert_limit' => 'int',
'cf_sms_use' => 'char',
'cf_sms_type' => 'char',
'cf_icode_id' => 'char',
'cf_icode_pw' => 'char',
'cf_icode_server_ip' => 'char',
'cf_captcha' => 'char',
'cf_syndi_token' => '',
'cf_syndi_except' => ''
);
for ($i = 1; $i <= 10; $i++) {
$check_keys['cf_' . $i . '_subj'] = isset($_POST['cf_' . $i . '_subj']) ? $_POST['cf_' . $i . '_subj'] : '';
$check_keys['cf_' . $i] = isset($_POST['cf_' . $i]) ? $_POST['cf_' . $i] : '';
}
foreach ($check_keys as $k => $v) {
if ($v === 'int') {
$_POST[$k] = isset($_POST[$k]) ? (int) $_POST[$k] : 0;
} else {
if (in_array($k, array('cf_analytics', 'cf_add_meta', 'cf_add_script', 'cf_stipulation', 'cf_privacy'))) {
$_POST[$k] = isset($_POST[$k]) ? $_POST[$k] : '';
} else {
$_POST[$k] = isset($_POST[$k]) ? strip_tags(clean_xss_attributes($_POST[$k])) : '';
}
}
}
// 본인확인을 사용할 경우 아이핀, 휴대폰인증 중 하나는 선택되어야 함
if ($_POST['cf_cert_use'] && !$_POST['cf_cert_ipin'] && !$_POST['cf_cert_hp'] && !$_POST['cf_cert_simple']) {
alert('본인확인을 위해 아이핀, 휴대폰 본인확인, KG이니시스 간편인증 서비스 중 하나 이상 선택해 주십시오.');
}
if (!$_POST['cf_cert_use']) {
$_POST['cf_cert_ipin'] = '';
$_POST['cf_cert_hp'] = '';
$_POST['cf_cert_simple'] = '';
}
$sql = " update {$g5['config_table']}
set cf_title = '{$cf_title}',
cf_admin = '{$cf_admin}',
cf_admin_email = '{$_POST['cf_admin_email']}',
cf_admin_email_name = '{$_POST['cf_admin_email_name']}',
cf_add_script = '{$_POST['cf_add_script']}',
cf_use_point = '{$_POST['cf_use_point']}',
cf_point_term = '{$_POST['cf_point_term']}',
cf_use_copy_log = '{$_POST['cf_use_copy_log']}',
cf_use_email_certify = '{$_POST['cf_use_email_certify']}',
cf_login_point = '{$_POST['cf_login_point']}',
cf_cut_name = '{$_POST['cf_cut_name']}',
cf_nick_modify = '{$_POST['cf_nick_modify']}',
cf_new_skin = '{$_POST['cf_new_skin']}',
cf_new_rows = '{$_POST['cf_new_rows']}',
cf_search_skin = '{$_POST['cf_search_skin']}',
cf_connect_skin = '{$_POST['cf_connect_skin']}',
cf_faq_skin = '{$_POST['cf_faq_skin']}',
cf_read_point = '{$_POST['cf_read_point']}',
cf_write_point = '{$_POST['cf_write_point']}',
cf_comment_point = '{$_POST['cf_comment_point']}',
cf_download_point = '{$_POST['cf_download_point']}',
cf_write_pages = '{$_POST['cf_write_pages']}',
cf_mobile_pages = '{$_POST['cf_mobile_pages']}',
cf_link_target = '{$_POST['cf_link_target']}',
cf_delay_sec = '{$_POST['cf_delay_sec']}',
cf_filter = '{$_POST['cf_filter']}',
cf_possible_ip = '" . trim($_POST['cf_possible_ip']) . "',
cf_intercept_ip = '" . trim($_POST['cf_intercept_ip']) . "',
cf_analytics = '{$_POST['cf_analytics']}',
cf_add_meta = '{$_POST['cf_add_meta']}',
cf_syndi_token = '{$_POST['cf_syndi_token']}',
cf_syndi_except = '{$_POST['cf_syndi_except']}',
cf_bbs_rewrite = '{$_POST['cf_bbs_rewrite']}',
cf_member_skin = '{$_POST['cf_member_skin']}',
cf_use_homepage = '{$_POST['cf_use_homepage']}',
cf_req_homepage = '{$_POST['cf_req_homepage']}',
cf_use_tel = '{$_POST['cf_use_tel']}',
cf_req_tel = '{$_POST['cf_req_tel']}',
cf_use_hp = '{$_POST['cf_use_hp']}',
cf_req_hp = '{$_POST['cf_req_hp']}',
cf_use_addr = '{$_POST['cf_use_addr']}',
cf_req_addr = '{$_POST['cf_req_addr']}',
cf_use_signature = '{$_POST['cf_use_signature']}',
cf_req_signature = '{$_POST['cf_req_signature']}',
cf_use_profile = '{$_POST['cf_use_profile']}',
cf_req_profile = '{$_POST['cf_req_profile']}',
cf_register_level = '{$_POST['cf_register_level']}',
cf_register_point = '{$_POST['cf_register_point']}',
cf_icon_level = '{$_POST['cf_icon_level']}',
cf_use_recommend = '{$_POST['cf_use_recommend']}',
cf_recommend_point = '{$_POST['cf_recommend_point']}',
cf_leave_day = '{$_POST['cf_leave_day']}',
cf_search_part = '{$_POST['cf_search_part']}',
cf_email_use = '{$_POST['cf_email_use']}',
cf_email_wr_super_admin = '{$_POST['cf_email_wr_super_admin']}',
cf_email_wr_group_admin = '{$_POST['cf_email_wr_group_admin']}',
cf_email_wr_board_admin = '{$_POST['cf_email_wr_board_admin']}',
cf_email_wr_write = '{$_POST['cf_email_wr_write']}',
cf_email_wr_comment_all = '{$_POST['cf_email_wr_comment_all']}',
cf_email_mb_super_admin = '{$_POST['cf_email_mb_super_admin']}',
cf_email_mb_member = '{$_POST['cf_email_mb_member']}',
cf_email_po_super_admin = '{$_POST['cf_email_po_super_admin']}',
cf_prohibit_id = '{$_POST['cf_prohibit_id']}',
cf_prohibit_email = '{$_POST['cf_prohibit_email']}',
cf_new_del = '{$_POST['cf_new_del']}',
cf_memo_del = '{$_POST['cf_memo_del']}',
cf_visit_del = '{$_POST['cf_visit_del']}',
cf_popular_del = '{$_POST['cf_popular_del']}',
cf_use_member_icon = '{$_POST['cf_use_member_icon']}',
cf_member_icon_size = '{$_POST['cf_member_icon_size']}',
cf_member_icon_width = '{$_POST['cf_member_icon_width']}',
cf_member_icon_height = '{$_POST['cf_member_icon_height']}',
cf_member_img_size = '{$_POST['cf_member_img_size']}',
cf_member_img_width = '{$_POST['cf_member_img_width']}',
cf_member_img_height = '{$_POST['cf_member_img_height']}',
cf_login_minutes = '{$_POST['cf_login_minutes']}',
cf_image_extension = '{$_POST['cf_image_extension']}',
cf_flash_extension = '{$_POST['cf_flash_extension']}',
cf_movie_extension = '{$_POST['cf_movie_extension']}',
cf_formmail_is_member = '{$_POST['cf_formmail_is_member']}',
cf_page_rows = '{$_POST['cf_page_rows']}',
cf_mobile_page_rows = '{$_POST['cf_mobile_page_rows']}',
cf_stipulation = '{$_POST['cf_stipulation']}',
cf_privacy = '{$_POST['cf_privacy']}',
cf_open_modify = '{$_POST['cf_open_modify']}',
cf_memo_send_point = '{$_POST['cf_memo_send_point']}',
cf_mobile_new_skin = '{$_POST['cf_mobile_new_skin']}',
cf_mobile_search_skin = '{$_POST['cf_mobile_search_skin']}',
cf_mobile_connect_skin = '{$_POST['cf_mobile_connect_skin']}',
cf_mobile_faq_skin = '{$_POST['cf_mobile_faq_skin']}',
cf_mobile_member_skin = '{$_POST['cf_mobile_member_skin']}',
cf_captcha_mp3 = '{$_POST['cf_captcha_mp3']}',
cf_editor = '{$_POST['cf_editor']}',
cf_cert_use = '{$_POST['cf_cert_use']}',
cf_cert_find = '{$_POST['cf_cert_find']}',
cf_cert_ipin = '{$_POST['cf_cert_ipin']}',
cf_cert_hp = '{$_POST['cf_cert_hp']}',
cf_cert_simple = '{$_POST['cf_cert_simple']}',
cf_cert_use_seed = '".(int)$_POST['cf_cert_use_seed']."',
cf_cert_kg_cd = '{$_POST['cf_cert_kg_cd']}',
cf_cert_kg_mid = '" . trim($_POST['cf_cert_kg_mid']) . "',
cf_cert_kcb_cd = '{$_POST['cf_cert_kcb_cd']}',
cf_cert_kcp_cd = '{$_POST['cf_cert_kcp_cd']}',
cf_cert_limit = '{$_POST['cf_cert_limit']}',
cf_cert_req = '{$_POST['cf_cert_req']}',
cf_sms_use = '{$_POST['cf_sms_use']}',
cf_sms_type = '{$_POST['cf_sms_type']}',
cf_icode_id = '{$_POST['cf_icode_id']}',
cf_icode_pw = '{$_POST['cf_icode_pw']}',
cf_icode_token_key = '{$_POST['cf_icode_token_key']}',
cf_icode_server_ip = '{$_POST['cf_icode_server_ip']}',
cf_icode_server_port = '{$_POST['cf_icode_server_port']}',
cf_googl_shorturl_apikey = '{$_POST['cf_googl_shorturl_apikey']}',
cf_kakao_js_apikey = '{$_POST['cf_kakao_js_apikey']}',
cf_facebook_appid = '{$_POST['cf_facebook_appid']}',
cf_facebook_secret = '{$_POST['cf_facebook_secret']}',
cf_twitter_key = '{$_POST['cf_twitter_key']}',
cf_twitter_secret = '{$_POST['cf_twitter_secret']}',
cf_social_login_use = '{$_POST['cf_social_login_use']}',
cf_naver_clientid = '{$_POST['cf_naver_clientid']}',
cf_naver_secret = '{$_POST['cf_naver_secret']}',
cf_google_clientid = '{$_POST['cf_google_clientid']}',
cf_google_secret = '{$_POST['cf_google_secret']}',
cf_kakao_rest_key = '{$_POST['cf_kakao_rest_key']}',
cf_kakao_client_secret = '{$_POST['cf_kakao_client_secret']}',
cf_social_servicelist = '{$cf_social_servicelist}',
cf_captcha = '{$_POST['cf_captcha']}',
cf_recaptcha_site_key = '{$_POST['cf_recaptcha_site_key']}',
cf_recaptcha_secret_key = '{$_POST['cf_recaptcha_secret_key']}',
cf_payco_clientid = '{$_POST['cf_payco_clientid']}',
cf_payco_secret = '{$_POST['cf_payco_secret']}',
cf_1_subj = '{$_POST['cf_1_subj']}',
cf_2_subj = '{$_POST['cf_2_subj']}',
cf_3_subj = '{$_POST['cf_3_subj']}',
cf_4_subj = '{$_POST['cf_4_subj']}',
cf_5_subj = '{$_POST['cf_5_subj']}',
cf_6_subj = '{$_POST['cf_6_subj']}',
cf_7_subj = '{$_POST['cf_7_subj']}',
cf_8_subj = '{$_POST['cf_8_subj']}',
cf_9_subj = '{$_POST['cf_9_subj']}',
cf_10_subj = '{$_POST['cf_10_subj']}',
cf_1 = '{$_POST['cf_1']}',
cf_2 = '{$_POST['cf_2']}',
cf_3 = '{$_POST['cf_3']}',
cf_4 = '{$_POST['cf_4']}',
cf_5 = '{$_POST['cf_5']}',
cf_6 = '{$_POST['cf_6']}',
cf_7 = '{$_POST['cf_7']}',
cf_8 = '{$_POST['cf_8']}',
cf_9 = '{$_POST['cf_9']}',
cf_10 = '{$_POST['cf_10']}' ";
sql_query($sql);
//sql_query(" OPTIMIZE TABLE `$g5[config_table]` ");
if (isset($_POST['cf_bbs_rewrite'])) {
g5_delete_all_cache();
}
run_event('admin_config_form_update');
update_rewrite_rules();
goto_url('./config_form.php', false);
+310
View File
@@ -0,0 +1,310 @@
<?php
$sub_menu = '300600';
require_once './_common.php';
require_once G5_EDITOR_LIB;
auth_check_menu($auth, $sub_menu, "w");
$co_id = isset($_REQUEST['co_id']) ? preg_replace('/[^a-z0-9_]/i', '', $_REQUEST['co_id']) : '';
// 상단, 하단 파일경로 필드 추가
if (!sql_query(" select co_include_head from {$g5['content_table']} limit 1 ", false)) {
$sql = " ALTER TABLE `{$g5['content_table']}` ADD `co_include_head` VARCHAR( 255 ) NOT NULL ,
ADD `co_include_tail` VARCHAR( 255 ) NOT NULL ";
sql_query($sql, false);
}
// html purifier 사용여부 필드
if (!sql_query(" select co_tag_filter_use from {$g5['content_table']} limit 1 ", false)) {
sql_query(
" ALTER TABLE `{$g5['content_table']}`
ADD `co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `co_content` ",
true
);
sql_query(" update {$g5['content_table']} set co_tag_filter_use = '1' ");
}
// 모바일 내용 추가
if (!sql_query(" select co_mobile_content from {$g5['content_table']} limit 1", false)) {
sql_query(
" ALTER TABLE `{$g5['content_table']}`
ADD `co_mobile_content` longtext NOT NULL AFTER `co_content` ",
true
);
}
// 스킨 설정 추가
if (!sql_query(" select co_skin from {$g5['content_table']} limit 1 ", false)) {
sql_query(
" ALTER TABLE `{$g5['content_table']}`
ADD `co_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_mobile_content`,
ADD `co_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_skin` ",
true
);
sql_query(" update {$g5['content_table']} set co_skin = 'basic', co_mobile_skin = 'basic' ");
}
$html_title = "내용";
$g5['title'] = $html_title . ' 관리';
$readonly = '';
if ($w == "u") {
$html_title .= " 수정";
$readonly = " readonly";
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql);
if (!$co['co_id']) {
alert('등록된 자료가 없습니다.');
}
if (function_exists('check_case_exist_title')) check_case_exist_title($co, G5_CONTENT_DIR, false);
} else {
$html_title .= ' 입력';
$co = array(
'co_id' => '',
'co_subject' => '',
'co_content' => '',
'co_mobile_content' => '',
'co_include_head' => '',
'co_include_tail' => '',
'co_tag_filter_use' => 1,
'co_html' => 2,
'co_skin' => 'basic',
'co_mobile_skin' => 'basic'
);
}
require_once G5_ADMIN_PATH . '/admin.head.php';
?>
<form name="frmcontentform" action="./contentformupdate.php" onsubmit="return frmcontentform_check(this);" method="post" enctype="MULTIPART/FORM-DATA">
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="co_html" value="1">
<input type="hidden" name="token" value="">
<div class="tbl_frm01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="co_id">ID</label></th>
<td>
<?php echo help('20자 이내의 영문자, 숫자, _ 만 가능합니다.'); ?>
<input type="text" value="<?php echo $co['co_id']; ?>" name="co_id" id="co_id" required <?php echo $readonly; ?> class="required <?php echo $readonly; ?> frm_input" size="20" maxlength="20">
<?php if ($w == 'u') { ?><a href="<?php echo get_pretty_url('content', $co_id); ?>" class="btn_frmline">내용확인</a><?php } ?>
</td>
</tr>
<tr>
<th scope="row"><label for="co_subject">제목</label></th>
<td><input type="text" name="co_subject" value="<?php echo htmlspecialchars2($co['co_subject']); ?>" id="co_subject" required class="frm_input required" size="90"></td>
</tr>
<tr>
<th scope="row">내용</th>
<td><?php echo editor_html('co_content', get_text(html_purifier($co['co_content']), 0)); ?></td>
</tr>
<tr>
<th scope="row">모바일 내용</th>
<td><?php echo editor_html('co_mobile_content', get_text(html_purifier($co['co_mobile_content']), 0)); ?></td>
</tr>
<tr>
<th scope="row"><label for="co_skin">스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
<td>
<?php echo get_skin_select('content', 'co_skin', 'co_skin', $co['co_skin'], 'required'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="co_mobile_skin">모바일스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
<td>
<?php echo get_mobile_skin_select('content', 'co_mobile_skin', 'co_mobile_skin', $co['co_mobile_skin'], 'required'); ?>
</td>
</tr>
<!--
<tr>
<th scope="row"><label for="co_tag_filter_use">태그 필터링 사용</label></th>
<td>
<?php echo help("내용에서 iframe 등의 태그를 사용하려면 사용안함으로 선택해 주십시오."); ?>
<select name="co_tag_filter_use" id="co_tag_filter_use">
<option value="1"<?php echo get_selected($co['co_tag_filter_use'], 1); ?>>사용함</option>
<option value="0"<?php echo get_selected($co['co_tag_filter_use'], 0); ?>>사용안함</option>
</select>
</td>
</tr>
-->
<tr>
<th scope="row"><label for="co_include_head">상단 파일 경로</label></th>
<td>
<?php echo help("설정값이 없으면 기본 상단 파일을 사용합니다."); ?>
<input type="text" name="co_include_head" value="<?php echo get_sanitize_input($co['co_include_head']); ?>" id="co_include_head" class="frm_input" size="60">
</td>
</tr>
<tr>
<th scope="row"><label for="co_include_tail">하단 파일 경로</label></th>
<td>
<?php echo help("설정값이 없으면 기본 하단 파일을 사용합니다."); ?>
<input type="text" name="co_include_tail" value="<?php echo get_sanitize_input($co['co_include_tail']); ?>" id="co_include_tail" class="frm_input" size="60">
</td>
</tr>
<tr id="admin_captcha_box" style="display:none;">
<th scope="row">자동등록방지</th>
<td>
<?php
echo help("파일 경로를 입력 또는 수정시 캡챠를 반드시 입력해야 합니다.");
require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
$captcha_html = captcha_html();
$captcha_js = chk_captcha_js();
echo $captcha_html;
?>
<script>
jQuery("#captcha_key").removeAttr("required").removeClass("required");
</script>
</td>
</tr>
<tr>
<th scope="row"><label for="co_himg">상단이미지</label></th>
<td>
<input type="file" name="co_himg" id="co_himg">
<?php
$himg = G5_DATA_PATH . '/content/' . $co['co_id'] . '_h';
$himg_str = '';
if (file_exists($himg)) {
$size = @getimagesize($himg);
if ($size[0] && $size[0] > 750) {
$width = 750;
} else {
$width = $size[0];
}
echo '<input type="checkbox" name="co_himg_del" value="1" id="co_himg_del"> <label for="co_himg_del">삭제</label>';
$himg_str = '<img src="' . G5_DATA_URL . '/content/' . $co['co_id'] . '_h" width="' . $width . '" alt="">';
}
if ($himg_str) {
echo '<div class="banner_or_img">';
echo $himg_str;
echo '</div>';
}
?>
</td>
</tr>
<tr>
<th scope="row"><label for="co_timg">하단이미지</label></th>
<td>
<input type="file" name="co_timg" id="co_timg">
<?php
$timg = G5_DATA_PATH . '/content/' . $co['co_id'] . '_t';
$timg_str = '';
if (file_exists($timg)) {
$size = @getimagesize($timg);
if ($size[0] && $size[0] > 750) {
$width = 750;
} else {
$width = $size[0];
}
echo '<input type="checkbox" name="co_timg_del" value="1" id="co_timg_del"> <label for="co_timg_del">삭제</label>';
$timg_str = '<img src="' . G5_DATA_URL . '/content/' . $co['co_id'] . '_t" width="' . $width . '" alt="">';
}
if ($timg_str) {
echo '<div class="banner_or_img">';
echo $timg_str;
echo '</div>';
}
?>
</td>
</tr>
</tbody>
</table>
</div>
<div class="btn_fixed_top">
<a href="./contentlist.php" class="btn btn_02">목록</a>
<input type="submit" value="확인" class="btn btn_submit" accesskey="s">
</div>
</form>
<?php
// [KVE-2018-2089] 취약점 으로 인해 파일 경로 수정시에만 자동등록방지 코드 사용
?>
<script>
var captcha_chk = false;
function use_captcha_check() {
$.ajax({
type: "POST",
url: g5_admin_url + "/ajax.use_captcha.php",
data: {
admin_use_captcha: "1"
},
cache: false,
async: false,
dataType: "json",
success: function(data) {}
});
}
function frm_check_file() {
var co_include_head = "<?php echo $co['co_include_head']; ?>";
var co_include_tail = "<?php echo $co['co_include_tail']; ?>";
var head = jQuery.trim(jQuery("#co_include_head").val());
var tail = jQuery.trim(jQuery("#co_include_tail").val());
if (co_include_head !== head || co_include_tail !== tail) {
// 캡챠를 사용합니다.
jQuery("#admin_captcha_box").show();
captcha_chk = true;
use_captcha_check();
return false;
} else {
jQuery("#admin_captcha_box").hide();
}
return true;
}
jQuery(function($) {
if (window.self !== window.top) { // frame 또는 iframe을 사용할 경우 체크
$("#co_include_head, #co_include_tail").on("change paste keyup", function(e) {
frm_check_file();
});
use_captcha_check();
}
});
function frmcontentform_check(f) {
errmsg = "";
errfld = "";
<?php echo get_editor_js('co_content'); ?>
<?php echo chk_editor_js('co_content'); ?>
<?php echo get_editor_js('co_mobile_content'); ?>
check_field(f.co_id, "ID를 입력하세요.");
check_field(f.co_subject, "제목을 입력하세요.");
check_field(f.co_content, "내용을 입력하세요.");
if (errmsg != "") {
alert(errmsg);
errfld.focus();
return false;
}
if (captcha_chk) {
<?php echo $captcha_js; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
}
return true;
}
</script>
<?php
require_once G5_ADMIN_PATH . '/admin.tail.php';
+157
View File
@@ -0,0 +1,157 @@
<?php
$sub_menu = '300600';
require_once './_common.php';
if ($w == "u" || $w == "d") {
check_demo();
}
if ($w == 'd') {
auth_check_menu($auth, $sub_menu, "d");
} else {
auth_check_menu($auth, $sub_menu, "w");
}
check_admin_token();
$co_row = array('co_id' => '', 'co_include_head' => '', 'co_include_tail' => '');
if ($w == "" || $w == "u") {
if (isset($_REQUEST['co_id']) && preg_match("/[^a-z0-9_]/i", $_REQUEST['co_id'])) {
alert("ID 는 영문자, 숫자, _ 만 가능합니다.");
}
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co_row = sql_fetch($sql);
}
$co_id = isset($_REQUEST['co_id']) ? preg_replace('/[^a-z0-9_]/i', '', $_REQUEST['co_id']) : '';
$co_subject = isset($_POST['co_subject']) ? strip_tags(clean_xss_attributes($_POST['co_subject'])) : '';
$co_include_head = isset($_POST['co_include_head']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['co_include_head'], 0, 255)) : '';
$co_include_tail = isset($_POST['co_include_tail']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['co_include_tail'], 0, 255)) : '';
$co_tag_filter_use = isset($_POST['co_tag_filter_use']) ? (int) $_POST['co_tag_filter_use'] : 1;
$co_himg_del = (isset($_POST['co_himg_del']) && $_POST['co_himg_del']) ? 1 : 0;
$co_timg_del = (isset($_POST['co_timg_del']) && $_POST['co_timg_del']) ? 1 : 0;
$co_html = isset($_POST['co_html']) ? (int) $_POST['co_html'] : 0;
$co_content = isset($_POST['co_content']) ? $_POST['co_content'] : '';
$co_mobile_content = isset($_POST['co_mobile_content']) ? $_POST['co_mobile_content'] : '';
$co_skin = isset($_POST['co_skin']) ? clean_xss_tags($_POST['co_skin'], 1, 1) : '';
$co_mobile_skin = isset($_POST['co_mobile_skin']) ? clean_xss_tags($_POST['co_mobile_skin'], 1, 1) : '';
// 관리자가 자동등록방지를 사용해야 할 경우
if (((isset($co_row['co_include_head']) && $co_row['co_include_head'] !== $co_include_head) || (isset($co_row['co_include_tail']) && $co_row['co_include_tail'] !== $co_include_tail)) && function_exists('get_admin_captcha_by') && get_admin_captcha_by()) {
include_once G5_CAPTCHA_PATH . '/captcha.lib.php';
if (!chk_captcha()) {
alert('자동등록방지 숫자가 틀렸습니다.');
}
}
@mkdir(G5_DATA_PATH . "/content", G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH . "/content", G5_DIR_PERMISSION);
if ($co_himg_del) {
@unlink(G5_DATA_PATH . "/content/{$co_id}_h");
}
if ($co_timg_del) {
@unlink(G5_DATA_PATH . "/content/{$co_id}_t");
}
$error_msg = '';
if ($co_include_head) {
$file_ext = pathinfo($co_include_head, PATHINFO_EXTENSION);
if (!$file_ext || !in_array($file_ext, array('php', 'htm', 'html')) || !preg_match('/^.*\.(php|htm|html)$/i', $co_include_head)) {
alert('상단 파일 경로의 확장자는 php, htm, html 만 허용합니다.');
}
}
if ($co_include_tail) {
$file_ext = pathinfo($co_include_tail, PATHINFO_EXTENSION);
if (!$file_ext || !in_array($file_ext, array('php', 'htm', 'html')) || !preg_match('/^.*\.(php|htm|html)$/i', $co_include_tail)) {
alert('하단 파일 경로의 확장자는 php, htm, html 만 허용합니다.');
}
}
if ($co_include_head && !is_include_path_check($co_include_head, 1)) {
$co_include_head = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
}
if ($co_include_tail && !is_include_path_check($co_include_tail, 1)) {
$co_include_tail = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
}
if (function_exists('filter_input_include_path')) {
$co_include_head = filter_input_include_path($co_include_head);
$co_include_tail = filter_input_include_path($co_include_tail);
}
$co_seo_title = exist_seo_title_recursive('content', generate_seo_title($co_subject), $g5['content_table'], $co_id);
$sql_common = " co_include_head = '$co_include_head',
co_include_tail = '$co_include_tail',
co_html = '$co_html',
co_tag_filter_use = '$co_tag_filter_use',
co_subject = '$co_subject',
co_content = '$co_content',
co_mobile_content = '$co_mobile_content',
co_seo_title = '$co_seo_title',
co_skin = '$co_skin',
co_mobile_skin = '$co_mobile_skin' ";
if ($w == "") {
$row = $co_row;
if (isset($row['co_id']) && $row['co_id']) {
alert("이미 같은 ID로 등록된 내용이 있습니다.");
}
$sql = " insert {$g5['content_table']}
set co_id = '$co_id',
$sql_common ";
sql_query($sql);
run_event('admin_content_created', $co_id);
} elseif ($w == "u") {
$sql = " update {$g5['content_table']}
set $sql_common
where co_id = '$co_id' ";
sql_query($sql);
run_event('admin_content_updated', $co_id);
} elseif ($w == "d") {
@unlink(G5_DATA_PATH . "/content/{$co_id}_h");
@unlink(G5_DATA_PATH . "/content/{$co_id}_t");
$sql = " delete from {$g5['content_table']} where co_id = '$co_id' ";
sql_query($sql);
run_event('admin_content_deleted', $co_id);
}
if (function_exists('get_admin_captcha_by')) {
get_admin_captcha_by('remove');
}
g5_delete_cache_by_prefix('content-' . $co_id . '-');
if ($w == "" || $w == "u") {
if ($_FILES['co_himg']['name']) {
$dest_path = G5_DATA_PATH . "/content/" . $co_id . "_h";
@move_uploaded_file($_FILES['co_himg']['tmp_name'], $dest_path);
@chmod($dest_path, G5_FILE_PERMISSION);
}
if ($_FILES['co_timg']['name']) {
$dest_path = G5_DATA_PATH . "/content/" . $co_id . "_t";
@move_uploaded_file($_FILES['co_timg']['tmp_name'], $dest_path);
@chmod($dest_path, G5_FILE_PERMISSION);
}
if ($error_msg) {
alert($error_msg, "./contentform.php?w=u&amp;co_id=$co_id");
} else {
goto_url("./contentform.php?w=u&amp;co_id=$co_id");
}
} else {
goto_url("./contentlist.php");
}
+102
View File
@@ -0,0 +1,102 @@
<?php
$sub_menu = '300600';
require_once './_common.php';
auth_check_menu($auth, $sub_menu, "r");
if (!isset($g5['content_table'])) {
die('<meta charset="utf-8">/data/dbconfig.php 파일에 <strong>$g5[\'content_table\'] = G5_TABLE_PREFIX.\'content\';</strong> 를 추가해 주세요.');
}
//내용(컨텐츠)정보 테이블이 있는지 검사한다.
if (!sql_query(" DESCRIBE {$g5['content_table']} ", false)) {
if (sql_query(" DESCRIBE {$g5['g5_shop_content_table']} ", false)) {
sql_query(" ALTER TABLE {$g5['g5_shop_content_table']} RENAME TO `{$g5['content_table']}` ;", false);
} else {
$query_cp = sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['content_table']}` (
`co_id` varchar(20) NOT NULL DEFAULT '',
`co_html` tinyint(4) NOT NULL DEFAULT '0',
`co_subject` varchar(255) NOT NULL DEFAULT '',
`co_content` longtext NOT NULL,
`co_hit` int(11) NOT NULL DEFAULT '0',
`co_include_head` varchar(255) NOT NULL,
`co_include_tail` varchar(255) NOT NULL,
PRIMARY KEY (`co_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
true
);
// 내용관리 생성
sql_query(" insert into `{$g5['content_table']}` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>' ", false);
sql_query(" insert into `{$g5['content_table']}` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '<p align=center><b>개인정보 처리방침에 대한 내용을 입력하십시오.</b></p>' ", false);
sql_query(" insert into `{$g5['content_table']}` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '<p align=center><b>서비스 이용약관에 대한 내용을 입력하십시오.</b></p>' ", false);
}
}
$g5['title'] = '내용관리';
require_once G5_ADMIN_PATH . '/admin.head.php';
$sql_common = " from {$g5['content_table']} ";
// 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) {
$page = 1;
} // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = "select * $sql_common order by co_id limit $from_record, {$config['cf_page_rows']} ";
$result = sql_query($sql);
?>
<div class="local_ov01 local_ov">
<?php if ($page > 1) { ?><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>">처음으로</a><?php } ?>
<span class="btn_ov01"><span class="ov_txt">전체 내용</span><span class="ov_num"> <?php echo $total_count; ?>건</span></span>
</div>
<div class="btn_fixed_top">
<a href="./contentform.php" class="btn btn_01">내용 추가</a>
</div>
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">ID</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);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_id"><?php echo $row['co_id']; ?></td>
<td class="td_left"><?php echo htmlspecialchars2($row['co_subject']); ?></td>
<td class="td_mng td_mng_l">
<a href="./contentform.php?w=u&amp;co_id=<?php echo $row['co_id']; ?>" class="btn btn_03"><span class="sound_only"><?php echo htmlspecialchars2($row['co_subject']); ?> </span>수정</a>
<a href="<?php echo get_pretty_url('content', $row['co_id']); ?>" class="btn btn_02"><span class="sound_only"><?php echo htmlspecialchars2($row['co_subject']); ?> </span> 보기</a>
<a href="./contentformupdate.php?w=d&amp;co_id=<?php echo $row['co_id']; ?>" onclick="return delete_confirm(this);" class="btn btn_02"><span class="sound_only"><?php echo htmlspecialchars2($row['co_subject']); ?> </span>삭제</a>
</td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="3" class="empty_table">자료가 한건도 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page="); ?>
<?php
require_once G5_ADMIN_PATH . '/admin.tail.php';
File diff suppressed because it is too large Load Diff
+3
View File
@@ -0,0 +1,3 @@
@charset "utf-8";
#gnb .gnb_li .btn_op.menu-990{background:url(../roulette/img/roulette.png) 50% 50% no-repeat #ebebeb }
#gnb .on .btn_op.menu-990{background:url(../roulette/img/roulette_on.png) 50% 50% no-repeat #fff}
+618
View File
@@ -0,0 +1,618 @@
html, body{margin:0; height:100%}
body, td, p, input, button, textarea, select, .c1 {
font-family: '돋움',Dotum,Tahoma,Arial;
font-size: 12px;
}
img { border:0px; }
.admin_layout {
background-color:#00c4ff;
border:1px solid #01225f;
}
.top_right {
text-align:right;
line-height:21px;
}
.top_right a {display:inline-block;color:#fff;text-decoration:none;letter-spacing:-0.1em}
.top_right a:focus, #navi a:hover {color:#fff}
.menu_area {
border:1px solid #01225f;
}
.menu_on {
font-size:12px;
background-color:#fff;
width:120px;
height:30px;
line-height:30px;
font-weight:bold;
text-align:center;
color:#404040;
border-right:1px solid #01225f;
}
.menu_on a {display:inline-block;color:#404040;text-decoration:none;letter-spacing:-0.1em}
.menu_on a:focus, #navi a:hover {color:#404040}
.menu {
font-size:12px;
background-color:#404040;
width:120px;
height:30px;
line-height:30px;
font-weight:bold;
text-align:center;
color:#fff;
border-right:1px solid #01225f;
border-bottom:1px solid #01225f;
}
.menu a {display:inline-block;color:#fff;text-decoration:none;letter-spacing:-0.1em}
.menu a:focus, #navi a:hover {color:#fff}
.navi_area {
border-left:1px solid #01225f;
border-top:1px solid #01225f;
}
.navi_on {
font-size:12px;
background-color:#fff;
width:110px;
height:30px;
line-height:30px;
font-weight:bold;
text-align:center;
color:#404040;
border-right:1px solid #01225f;
}
.navi_on a {display:inline-block;color:#404040;text-decoration:none;letter-spacing:-0.1em}
.navi_on a:focus, #navi a:hover {color:#404040}
.navi {
font-size:12px;
background-color:#404040;
width:110px;
height:30px;
line-height:30px;
font-weight:bold;
text-align:center;
color:#fff;
border-right:1px solid #01225f;
border-bottom:1px solid #01225f;
}
.navi a {display:inline-block;color:#fff;text-decoration:none;letter-spacing:-0.1em}
.navi a:focus, #navi a:hover {color:#fff}
.content_area {
background-color:#fff;
border-right:1px solid #01225f;
border-bottom:1px solid #01225f;
padding:10px;
}
.content_sub {
background-color:#f0efef;
}
.td_title {
width:125px;
font-weight:bold;
color:#01225f;
}
.bold {
font-weight:bold;
}
.td_title_sub {
font-weight:none;
}
.td_tit {
font-weight:bold;
color:#01225f;
}
.center {
text-align:center;
}
.right {
text-align:right;
}
.txt_red {
color:#E20074;
}
.td_dot_right {
border-right:1px dotted #01225f;
}
.td_top_line {
border-top:1px dotted #01225f;
}
.td_dot_line {
border-bottom:1px dotted #01225f;
}
table .tr_bg0 {background:#fff}
table .tr_bg1 {background:#E8E8E8}
table .tr_bgs {background:#0046E2}
table .tr_bge {background:#F39797}
table a {display:inline-block;color:#000;text-decoration:none;font-family: '돋움',Dotum,Tahoma,Arial;}
table a:focus, table a:hover {color:#000;font-family: '돋움',Dotum,Tahoma,Arial;}
.enddate {
color: #350202;
}
.lh16 { line-height:16px; }
/* 리스트 */
.list_head_left {
border-left:1px solid #01225f;
}
.list_head_top {
border-top:1px solid #01225f;
}
.list_head {
font-size:12px;
background-color:#404040;
height:30px;
line-height:30px;
font-weight:bold;
text-align:center;
color:#fff;
border-right:1px solid #01225f;
border-bottom:1px solid #01225f;
}
.list_head_right {
padding-right:5px;
font-size:12px;
background-color:#404040;
height:30px;
line-height:30px;
font-weight:bold;
text-align:right;
color:#fff;
border-right:1px solid #01225f;
border-bottom:1px solid #01225f;
}
.result_r {
font-size:12px;
background-color:#0050E2;
line-height:16px;
color:#fff;
}
.result_s {
font-size:12px;
background-color:#DFE852;
line-height:16px;
color:#000;
}
.result_f {
font-size:12px;
background-color:#ff4a52;
line-height:16px;
color:#fff;
}
/* 패딩 */
.pd5 {
padding:5px;
}
.pdtb5 {
padding:5px 0;
}
.pd5L6 {
padding:5px 0 5px 6px;
}
.pd10 {
padding:10px;
}
.pd20 {
padding:20px;
}
/* width */
.wd30 {
width:30px;
}
.wd50 {
width:50px;
}
.wd70 {
width:70px;
}
.wd80 {
width:80px;
}
.wd100 {
width:100px;
}
.wd140 {
width:140px;
}
.wd150 {
width:150px;
}
.wd160 {
width:160px;
}
.wd200 {
width:200px;
}
.wd300 {
width:300px;
}
.wd400 {
width:400px;
}
.wd20p {
width:20%;
}
.wd25p {
width:25%;
}
.wd50p {
width:50%;
}
.wd75p {
width:75%;
}
/* 폼 */
.frm_input {
padding:3px;
border:2px solid #01225f;
background:#fff;
vertical-align:middle
height:16px;
line-height:16px;
}
.frm_textarea {
padding:3px;
border:2px solid #01225f;
background:#fff;
line-height:16px;
}
.required2 {background:url('/img/wrest.gif') #f6f9fa top right no-repeat !important}
/* 하단 */
.tail_copy {
text-align:center;
color:#fff;
height:30px;
line-height:30px;
}
.tail_copy a {
display: inline-block;
color: #fff;
text-decoration: none;
font-family: '돋움',Dotum,Tahoma,Arial;
}
/* 버튼 */
.config_btn_submit {
width:98%;
height:30px;
margin:10px;
padding:10px;
background-color:#00c4ff;
border:1px solid #01225f;
color:#fff;
font-size:12px;
line-height:12px;
cursor:pointer
}
.config_btn_submit2 {
width:98%;
height:130px;
padding:10px;
background-color:#00c4ff;
border:1px solid #01225f;
color:#fff;
font-size:12px;
line-height:12px;
cursor:pointer
}
.config_btn_disabled {
width:98%;
height:30px;
margin:10px;
padding:10px;
background-color:#464646;
border:1px solid #01225f;
color:#fff;
font-size:12px;
line-height:12px;
cursor:pointer
}
.board_btn_submit {
width:98%;
height:30px;
padding:10px;
background-color:#00c4ff;
border:1px solid #01225f;
color:#fff;
font-size:12px;
line-height:12px;
cursor:pointer
}
.login_btn {
width:60px;
padding:3px;
background-color:#00c4ff;
border:2px solid #01225f;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.reg_btn {
width:40px;
padding:3px;
background-color:#00c4ff;
border:2px solid #01225f;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.add_btn {
width:128px;
padding:3px;
background-color:#00c4ff;
border:2px solid #01225f;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.cfg_btn {
width:128px;
padding:3px;
background-color:#0088b1;
border:2px solid #01225f;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.mod_btn {
width:40px;
padding:3px;
background-color:#f9e344;
border:2px solid #af9a00;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.del_btn {
width:40px;
padding:3px;
background-color:#212121;
border:2px solid #0C0C0C;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.bl_btn {
width:40px;
padding:3px;
background-color:#8be200;
border:2px solid #568c01;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.select_del_btn {
padding:3px;
background-color:#212121;
border:2px solid #0C0C0C;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.select_mod_btn {
padding:3px;
background-color:#8BE200;
border:2px solid #568C01;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.select_exp_btn {
padding:3px;
background-color:#355758;
border:2px solid #263131;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.all_exp_btn {
padding:3px;
background-color:#DFE200;
border:2px solid #8C7B01;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.select_enddate_btn {
padding:3px;
background-color:#34621F;
border:2px solid #183A09;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.select_where_btn {
padding:3px;
background-color:#D2C41F;
border:2px solid #A09727;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
.search_btn {
width:40px;
padding:3px;
background-color:#ff3061;
border:2px solid #82001F;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.down_btn {
width:40px;
padding:3px;
background-color:#1F3762;
border:2px solid #111D33;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.down_btn2 {
padding:3px;
background-color:#1F3762;
border:2px solid #111D33;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer
}
.txt_down_btn {
width:100px;
padding:3px;
background-color:#1F3762;
border:2px solid #111D33;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer;
margin-top:3px;
}
.xls_down_btn {
width:70px;
padding:3px;
background-color:#339222;
border:2px solid #194611;
color:#fff;
font-size:12px;
line-height:16px;
cursor:pointer;
margin-top:3px;
}
.parsing_btn {
width:150px;
height:50px;
padding:3px;
background-color:#E6BC21;
border:2px solid #5A4A0C;
color:#000;
font-size:12px;
line-height:16px;
cursor:pointer
}
#Progress_Loading
{
position: absolute;
left: 50%;
top: 40%;
text-align:center;
z-index: 1001;
}
#Progress_Background
{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #fff;
filter: alpha(opacity=75);
-moz-opacity: 0.75;
-khtml-opacity: 0.75;
opacity: 0.75;
z-index: 1000;
}
/* 접속자집계 목록 */
.tbl_visit_list td {text-align:center}
.visit_bar {position:relative}
.visit_bar span {position:absolute;top:-8px;left:0;height:15px;background:#E20074}
+8
View File
@@ -0,0 +1,8 @@
@charset "utf-8";
#preview_item{height:50px}
#preview_item ul{margin:0;padding:0;top:0;width:100%;margin:0 auto;text-align:center;background:#000;position:fixed;top:0;z-index:999999}
#preview_item ul li{list-style:none;display:inline-block;height:50px;line-height:50px;padding:0 2px;*display:inline; zoom:1;}
#preview_item ul li a{color:#ccc;padding:0 8px;height:32px;line-height:30px;background:none;font-weight:bold;border-radius:5px;display:inline-block;vertical-align:middle;border:1px solid #aaa;}
#preview_item ul li a:hover{background:#fff;text-decoration:none;border:1px solid #ccc;color:#333}
#preview_item ul li button{color:#fff;padding:0 8px;background:#FF5191;border-radius:3px;height:26px;line-height:24px;vertical-align:middle;border:none}
#preview_item ul li button:hover{background:#e40d5c;color:#fff;text-decoration:none;}
+284
View File
@@ -0,0 +1,284 @@
<?php
$sub_menu = '100410';
include_once('./_common.php');
auth_check_menu($auth, $sub_menu, 'r');
$g5['title'] = 'DB 업그레이드';
include_once('./admin.head.php');
$is_check = false;
//소셜 로그인 관련 필드 및 구글 리챕챠 필드 추가
if(!isset($config['cf_social_login_use'])) {
sql_query("ALTER TABLE `{$g5['config_table']}`
ADD `cf_social_login_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_googl_shorturl_apikey`,
ADD `cf_google_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_twitter_secret`,
ADD `cf_google_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_google_clientid`,
ADD `cf_naver_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_google_secret`,
ADD `cf_naver_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_naver_clientid`,
ADD `cf_kakao_rest_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_naver_secret`,
ADD `cf_social_servicelist` varchar(255) NOT NULL DEFAULT '' AFTER `cf_social_login_use`,
ADD `cf_payco_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_social_servicelist`,
ADD `cf_payco_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_payco_clientid`,
ADD `cf_captcha` varchar(100) NOT NULL DEFAULT '' AFTER `cf_kakao_js_apikey`,
ADD `cf_recaptcha_site_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_captcha`,
ADD `cf_recaptcha_secret_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_recaptcha_site_key`
", true);
$is_check = true;
}
//소셜 로그인 관련 필드 카카오 클라이언트 시크릿 추가
if(!isset($config['cf_kakao_client_secret'])) {
sql_query("ALTER TABLE `{$g5['config_table']}`
ADD `cf_kakao_client_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_kakao_rest_key`
", true);
$is_check = true;
}
// 회원 이미지 관련 필드 추가
if(!isset($config['cf_member_img_size'])) {
sql_query("ALTER TABLE `{$g5['config_table']}`
ADD `cf_member_img_size` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_icon_height`,
ADD `cf_member_img_width` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_size`,
ADD `cf_member_img_height` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_width`
", true);
$sql = " update {$g5['config_table']} set cf_member_img_size = 50000, cf_member_img_width = 60, cf_member_img_height = 60 ";
sql_query($sql, false);
$is_check = true;
}
// 소셜 로그인 관리 테이블 없을 경우 생성
if( isset($g5['social_profile_table']) && !sql_query(" DESC {$g5['social_profile_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['social_profile_table']}` (
`mp_no` int(11) NOT NULL AUTO_INCREMENT,
`mb_id` varchar(255) NOT NULL DEFAULT '',
`provider` varchar(50) NOT NULL DEFAULT '',
`object_sha` varchar(45) NOT NULL DEFAULT '',
`identifier` varchar(255) NOT NULL DEFAULT '',
`profileurl` varchar(255) NOT NULL DEFAULT '',
`photourl` varchar(255) NOT NULL DEFAULT '',
`displayname` varchar(150) NOT NULL DEFAULT '',
`description` varchar(255) NOT NULL DEFAULT '',
`mp_register_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`mp_latest_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
UNIQUE KEY `mp_no` (`mp_no`),
KEY `mb_id` (`mb_id`),
KEY `provider` (`provider`)
) ", true);
$is_check = true;
}
// 게시판 짧은 주소
$sql = " select bo_table from {$g5['board_table']} ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
$write_table = $g5['write_prefix'] . $row['bo_table']; // 게시판 테이블 전체이름
$sql = " SHOW COLUMNS FROM {$write_table} LIKE 'wr_seo_title' ";
$row = sql_fetch($sql);
if( !$row ){
sql_query("ALTER TABLE `{$write_table}`
ADD `wr_seo_title` varchar(200) NOT NULL DEFAULT '' AFTER `wr_content`,
ADD INDEX `wr_seo_title` (`wr_seo_title`);
", false);
$is_check = true;
}
}
// 내용 관리 짧은 주소
$sql = " SHOW COLUMNS FROM `{$g5['content_table']}` LIKE 'co_seo_title' ";
$row = sql_fetch($sql);
if( !$row ){
sql_query("ALTER TABLE `{$g5['content_table']}`
ADD `co_seo_title` varchar(200) NOT NULL DEFAULT '' AFTER `co_content`,
ADD INDEX `co_seo_title` (`co_seo_title`);
", false);
$is_check = true;
}
$sql = "select * from {$g5['content_table']} limit 100 ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
if( ! $row['co_seo_title']){
$co_seo_title = exist_seo_title_recursive('content', generate_seo_title($row['co_subject']), $g5['content_table'], $row['co_id']);
$sql = " update {$g5['content_table']}
set co_seo_title = '$co_seo_title'
where co_id = '{$row['co_id']}' ";
sql_query($sql);
}
}
// 메모 테이블
$sql = " SHOW COLUMNS FROM `{$g5['memo_table']}` LIKE 'me_send_id' ";
$row = sql_fetch($sql);
if( !$row ){
sql_query("ALTER TABLE `{$g5['memo_table']}`
ADD `me_send_id` INT(11) NOT NULL DEFAULT '0',
ADD `me_type` ENUM('send','recv') NOT NULL DEFAULT 'recv',
ADD `me_send_ip` VARCHAR(100) NOT NULL DEFAULT '',
CHANGE COLUMN `me_id` `me_id` INT(11) NOT NULL AUTO_INCREMENT;
", false);
$is_check = true;
}
// 읽지 않은 메모 수 칼럼
if(!isset($member['mb_memo_cnt'])) {
sql_query(" ALTER TABLE `{$g5['member_table']}`
ADD `mb_memo_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_call`", true);
$is_check = true;
}
// 스크랩 읽은 수 추가
if(!isset($member['mb_scrap_cnt'])) {
sql_query(" ALTER TABLE `{$g5['member_table']}`
ADD `mb_scrap_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_cnt`", true);
$is_check = true;
}
// 짧은 URL 주소를 사용 여부 필드 추가
if (!isset($config['cf_bbs_rewrite'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}`
ADD `cf_bbs_rewrite` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_link_target` ", true);
$is_check = true;
}
// 파일테이블에 추가 칼럼
$sql = " SHOW COLUMNS FROM `{$g5['board_file_table']}` LIKE 'bf_fileurl' ";
$row = sql_fetch($sql);
if( !$row ) {
sql_query(" ALTER TABLE `{$g5['board_file_table']}`
ADD COLUMN `bf_fileurl` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bf_content`,
ADD COLUMN `bf_thumburl` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bf_fileurl`,
ADD COLUMN `bf_storage` VARCHAR(50) NOT NULL DEFAULT '' AFTER `bf_thumburl`", true);
$is_check = true;
}
if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
// 임시저장 테이블이 없을 경우 생성
if(!sql_query(" DESC {$g5['g5_shop_post_log_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_post_log_table']}` (
`log_id` int(11) NOT NULL AUTO_INCREMENT,
`oid` bigint(20) unsigned NOT NULL,
`mb_id` varchar(255) NOT NULL DEFAULT '',
`post_data` text NOT NULL,
`ol_code` varchar(255) NOT NULL DEFAULT '',
`ol_msg` text NOT NULL,
`ol_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`ol_ip` varchar(25) NOT NULL DEFAULT '',
PRIMARY KEY (`log_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ", true);
$is_check = true;
}
$result = sql_query("describe `{$g5['g5_shop_post_log_table']}`");
while ($row = sql_fetch_array($result)){
if( isset($row['Field']) && $row['Field'] === 'ol_msg' && $row['Type'] === 'varchar(255)' ){
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` MODIFY ol_msg TEXT NOT NULL;", false);
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` DROP PRIMARY KEY;", false);
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` ADD `log_id` int(11) NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (`log_id`);", false);
$is_check = true;
break;
}
}
if (!isset($default['de_id'])) {
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
ADD COLUMN `de_id` INT(11) NOT NULL AUTO_INCREMENT FIRST,
ADD PRIMARY KEY (`de_id`); ", true);
$is_check = true;
}
}
// auth.au_menu 컬럼 크기 조정
$sql = " SHOW COLUMNS FROM `{$g5['auth_table']}` LIKE 'au_menu' ";
$row = sql_fetch($sql);
if (
stripos($row['Type'], 'varchar') !== false
&& (int) preg_replace('/[^0-9]/', '', $row['Type']) < 50
) {
sql_query(" ALTER TABLE `{$g5['auth_table']}` CHANGE `au_menu` `au_menu` VARCHAR(50) NOT NULL; ", true);
$is_check = true;
}
// qa config 테이블 auto id key 추가
$row = sql_fetch("select * from `{$g5['qa_config_table']}` limit 1");
if (!isset($row['qa_id'])) {
sql_query(" ALTER TABLE `{$g5['qa_config_table']}` ADD COLUMN `qa_id` INT(11) NOT NULL AUTO_INCREMENT FIRST,
ADD PRIMARY KEY (`qa_id`); ", true);
$is_check = true;
}
// config 기본 테이블 auto id key 추가
if (!isset($config['cf_id'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}`
ADD COLUMN `cf_id` INT(11) NOT NULL AUTO_INCREMENT FIRST,
ADD PRIMARY KEY (`cf_id`); ", true);
$is_check = true;
}
// login 테이블 auto id key 추가
$row = sql_fetch("select * from `{$g5['login_table']}` limit 1");
if (!isset($row['lo_id'])) {
sql_query(" ALTER TABLE `{$g5['login_table']}`
ADD COLUMN `lo_id` INT(11) NOT NULL AUTO_INCREMENT FIRST,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`lo_id`),
ADD UNIQUE KEY `lo_ip_unique` (`lo_ip`) ", true);
$is_check = true;
}
// visit 테이블 auto id key 로 변경
$result = sql_query("describe `{$g5['visit_table']}`");
while ($row = sql_fetch_array($result)){
if (isset($row['Field']) && $row['Field'] === 'vi_id' && (isset($row['Default']) && $row['Default'] == 0)){
sql_query("ALTER TABLE `{$g5['visit_table']}`
CHANGE COLUMN `vi_id` `vi_id` INT(11) NOT NULL AUTO_INCREMENT;
", false);
$is_check = true;
}
}
$is_check = run_replace('admin_dbupgrade', $is_check);
$db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다.<br>현재 DB 업그레이드가 완료된 상태입니다.';
?>
<div class="local_desc01 local_desc">
<p>
<?php echo $db_upgrade_msg; ?>
</p>
</div>
<?php
include_once ('./admin.tail.php');
+58
View File
@@ -0,0 +1,58 @@
<?php
/**
* @file admin.common.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
/**
* 그누관리자 모드로 활성화되어 있는지 체크
*/
if ($eyoom['use_eyoom_admin'] == 'n' || $use_eyoom_builder === false) return;
/**
* 관리자모드 라이브러리 파일
*/
@include_once(G5_ADMIN_PATH.'/admin.lib.php');
if( isset($token) ){
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);
}
/**
* 이벤트 후킹
*/
run_event('admin_common');
/**
* 영카트5 인가?
*/
$is_youngcart = false;
if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
$is_youngcart = true;
/**
* 쇼핑몰 라이브러리 파일
*/
include_once(EYOOM_ADMIN_LIB_PATH.'/shop.lib.php');
}
/**
* 이윰 관리자모드 라이브러리 파일
*/
@include_once(EYOOM_ADMIN_LIB_PATH.'/admin.lib.php');
/**
* $dir 변수 정의
*/
if($_REQUEST['dir']) {
$dir = preg_replace('/[^a-z0-9_]/i', '', trim($_REQUEST['dir']));
$dir = substr($dir, 0, 20);
}
/**
* $pid 변수 정의
*/
if($_REQUEST['pid']) {
$pid = preg_replace('/[^a-z0-9_|]/i', '', trim($_REQUEST['pid']));
$pid = substr($pid, 0, 50);
}
+63
View File
@@ -0,0 +1,63 @@
<?php
/**
* @file head.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit; // 개별 페이지 접근 불가
$g5_debug['php']['begin_time'] = $begin_time = get_microtime();
/**
* 다중관리자인지 체크
* $manager : /eyoom/config.php 파일에서 정의
*/
$mg_auth = array();
if ($manager) {
$mg_menu = $eb->mb_unserialize($manager['mg_menu']);
$i=0;
foreach ($mg_menu as $k => $v) {
$mg_auth[$i++] = $k;
}
}
/**
* 폼전송 모드일 때 헤더 출력 방지
*/
if ($smode) return;
else {
@include_once(EYOOM_ADMIN_INC_PATH.'/admin.menu.php');
}
/**
* 쇼핑몰 권한 체크
*/
if ($member['mb_id'] != $config['cf_admin'] && !in_array('shop', $mg_auth)) {
$is_youngcart = false;
}
$g5_sidebar = $_COOKIE['sidebar'] == 'close' ? 'close': '';
/**
* 그누 헤더정보 출력
*/
@include_once(EYOOM_ADMIN_PATH.'/head.sub.php');
/**
* 최고관리자 정보
*/
$adminfo = sql_fetch("select * from {$g5['member_table']} where mb_no = '1' limit 1");
if (!$adminfo) $adminfo = get_member($config['cf_admin']);
/**
* 이윰빌더 최신 배포버전
*/
$eyoom_latest_version = $eb->get_eyoom_version();
/**
* 사용자 프로그램
*/
@include_once(EYOOM_ADMIN_USER_PATH . '/admin.head.php');
/**
* 헤더 디자인 출력
*/
@include_once(EYOOM_ADMIN_THEME_PATH . '/admin.head.html.php');
+25
View File
@@ -0,0 +1,25 @@
<?php
/**
* @file tail.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit; // 개별 페이지 접근 불가
/**
* 폼전송 모드일 때 출력 방지
*/
if ($smode) return;
/**
* 버전 표기
*/
$print_version = ($is_admin == 'super') ? 'Version ' . G5_GNUBOARD_VER : '';
/**
* 사용자 프로그램
*/
@include_once(EYOOM_ADMIN_USER_PATH . '/admin.tail.php');
/**
* 테일 디자인 출력
*/
@include_once(EYOOM_ADMIN_THEME_PATH . "/admin.tail.html.php");
@@ -0,0 +1,37 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/bbs_group_board.ajax.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = '300120';
auth_check_menu($auth, $sub_menu, 'r');
$gr_sql = '';
if ($gr_id) {
$gr_sql = " and gr_id = '" . sql_real_escape_string($gr_id) . "' ";
}
$sql = " select bo_table, bo_subject from {$g5['board_table']} where (1) $gr_sql order by bo_table asc ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$bo_tables[$i] = $row['bo_table'];
$bo_subject[$i] = $row['bo_subject'];
}
if ($i>0) {
$_bo_tables = implode('|', $bo_tables);
$_bo_subject = implode('|', $bo_subject);
}
$_value_array['bo_table'] = $_bo_tables;
$_value_array['bo_subject'] = $_bo_subject;
include_once EYOOM_CLASS_PATH.'/json.class.php';
$json = new Services_JSON();
$output = $json->encode($_value_array);
echo $output;
@@ -0,0 +1,97 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/bbs_list.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300120";
$action_url1 = G5_ADMIN_URL . '/?dir=board&amp;pid=bbs_list_update&amp;smode=1';
/**
* 그룹정보
*/
$row = sql_fetch("select * from {$g5['group_table']} where gr_id = '{$gr_id}' ");
$gr_subject = $row['gr_subject'];
/**
* 기본 쿼리
*/
$sql_common = " from {$write_table} ";
$sql_search = " where (1) ";
/**
* 검색 대상
*/
if ($sca || $stx) {
$sql_search .= " and " . get_sql_search($sca, $sfl, $stx, $sop);
}
/**
* 게시물 대상
*/
if (isset($_REQUEST['view'])) { // search order (검색 오름, 내림차순)
$view = preg_match("/^(w|c)$/i", $view) ? $view : '';
if ($view)
$qstr .= '&amp;view=' . urlencode($view);
} else {
$view = '';
}
if ($view == 'w')
$sql_search .= " and `wr_is_comment` = 0 ";
else if ($view == 'c')
$sql_search .= " and `wr_is_comment` = 1 ";
/**
* 출력 순서
*/
if (!$sst) {
$sst = "wr_num, wr_reply";
$sod = "asc";
}
$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 = $config['cf_page_rows'];
$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);
$k=0;
$list = array();
for ($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i] = get_list($row, $board, $g5['admin_path'], $board['bo_subject_len']);
$list[$i]['bo_table'] = $bo_table;
$list_num = $total_count - ($page - 1) * $rows;
$list[$i]['num'] = $list_num - $k;
$k++;
}
$width="100%";
$colspan = 11;
$list_count = count($list);
$qstr .= $gr_id ? "&amp;gr_id={$gr_id}": '';
$qstr .= "&amp;bo_table={$bo_table}";
/**
* 페이징
*/
$paging = $eb->set_paging('admin', $dir, $pid, $qstr);
/**
* 검색버튼
*/
$frm_submit = ' <div class="text-center margin-top-10 margin-bottom-10"> ';
$frm_submit .= ' <input type="submit" value="검색" class="btn-e btn-e-lg btn-e-dark" accesskey="s">' ;
$frm_submit .= '</div>';
@@ -0,0 +1,122 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_list_update.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300120";
check_demo();
$post_count_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
$chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? $_POST['chk'] : array();
$act_button = isset($_POST['act_button']) ? strip_tags($_POST['act_button']) : '';
if (isset($_REQUEST['view'])) { // search order (검색 오름, 내림차순)
$view = preg_match("/^(w|c)$/i", $view) ? $view : '';
if ($view)
$qstr .= '&amp;view=' . urlencode($view);
} else {
$view = '';
}
if (!$post_count_chk) {
alert($act_button . " 하실 항목을 하나 이상 체크하세요.");
}
check_admin_token();
if ($act_button == "선택수정") {
auth_check_menu($auth, $sub_menu, 'w');
for ($i = 0; $i < $post_count_chk; $i++) {
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$post_wr_id = isset($_POST['wr_ids'][$k]) ? clean_xss_tags($_POST['wr_ids'][$k], 1, 1) : '';
$post_wr_datetime = isset($_POST['wr_datetime'][$k]) ? clean_xss_tags($_POST['wr_datetime'][$k], 1, 1) : '';
$post_wr_hit = isset($_POST['wr_hit'][$k]) ? clean_xss_tags($_POST['wr_hit'][$k], 1, 1) : '';
$post_wr_good = isset($_POST['wr_good'][$k]) ? clean_xss_tags($_POST['wr_good'][$k], 1, 1) : '';
$post_wr_nogood = isset($_POST['wr_nogood'][$k]) ? clean_xss_tags($_POST['wr_nogood'][$k], 1, 1) : '';
$sql = " select `wr_is_comment` from {$write_table} where wr_id = '" . sql_real_escape_string($post_wr_id) . "' ";
$wr = sql_fetch($sql);
$sql = " update {$write_table}
set wr_datetime = '" . sql_real_escape_string($post_wr_datetime) . "',
wr_hit = '" . sql_real_escape_string($post_wr_hit) . "',
wr_good = '" . sql_real_escape_string($post_wr_good) . "',
wr_nogood = '" . sql_real_escape_string($post_wr_nogood) . "'
where wr_id = '" . sql_real_escape_string($post_wr_id) . "' ";
sql_query($sql);
if ($wr['wr_is_comment'] == 0)
$new_up_val = sql_real_escape_string($post_wr_hit);
else
$new_up_val = sql_real_escape_string($post_wr_good);
$sql = "update {$g5['board_new_table']} set `wr_hit` = '" . $new_up_val . "', `bn_datetime` = '" . sql_real_escape_string($post_wr_datetime) . "' where `bo_table` = '{$bo_table}' and `wr_id` = '" . sql_real_escape_string($post_wr_id) . "'";
sql_query($sql);
}
$msg = "정상적으로 수정하였습니다.";
} elseif ($act_button == "선택삭제") {
if ($view != 'c') {
$msg = "선택삭제는 게시물타입 댓글 시에만 지원합니다.";
} else {
for ($i = 0; $i < $post_count_chk; $i++) {
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$post_wr_id = isset($_POST['wr_ids'][$k]) ? clean_xss_tags($_POST['wr_ids'][$k], 1, 1) : '';
$write = sql_fetch(" select * from {$write_table} where wr_id = '{$post_wr_id}' ");
// 코멘트 포인트 삭제
if (!delete_point($write['mb_id'], $bo_table, $post_wr_id, '댓글')) {
insert_point($write['mb_id'], $board['bo_comment_point'] * (-1), "{$board['bo_subject']} {$write['wr_parent']}-{$post_wr_id} 댓글삭제");
}
// 행운 포인트 여부 체크 후 있다면 행운 포인트 삭제
$po_rel_action = $board['bo_subject'].'|'.$wr_id.'|'.$post_wr_id;
$sql = "select * from {$g5['point_table']} where mb_id = '{$write['mb_id']}' and po_rel_table = '@lucky' and po_rel_action = '{$po_rel_action}'";
$po = sql_fetch($sql);
if ($po['po_id']) {
$po_content = "{$board['bo_subject']} {$write['wr_parent']}-{$post_wr_id} 댓글삭제 행운포인트 취소";
insert_point($write['mb_id'], $po['po_point'] * (-1), $po_content, '@lucky', $write['mb_id'], $po_rel_action);
}
// 코멘트 삭제
sql_query(" delete from {$write_table} where wr_id = '{$post_wr_id}' ");
// 코멘트가 삭제되므로 해당 게시물에 대한 최근 시간을 다시 얻는다.
$sql = " select max(wr_datetime) as wr_last from {$write_table} where wr_parent = '{$write['wr_parent']}' ";
$row = sql_fetch($sql);
// 원글의 코멘트 숫자를 감소
sql_query(" update {$write_table} set wr_comment = wr_comment - 1, wr_last = '{$row['wr_last']}' where wr_id = '{$write['wr_parent']}' ");
// 코멘트 숫자 감소
sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment - 1 where bo_table = '{$bo_table}' ");
// 새글 삭제
sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$bo_table}' and wr_id = '{$post_wr_id}' ");
// 글쓰기 활동 삭제
sql_query("delete from `writing_activity` where `bo_table` = '{$bo_table}' and `wr_id` = '{$post_wr_id}' ", false);
delete_cache_latest($bo_table);
}
$msg = "정상적으로 삭제하였습니다.";
}
}
// query string
$qstr .= $gr_id ? '&amp;gr_id='.$gr_id: '';
$qstr .= $bo_table ? '&amp;bo_table='.$bo_table: '';
$qstr .= $view ? '&amp;view='.$view: '';
run_event('admin_board_list_update', $act_button, $chk, $board_table, $qstr);
alert($msg, G5_ADMIN_URL . '/?dir=board&amp;pid=bbs_list&amp;' . $qstr);
@@ -0,0 +1,59 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/boardgroup_list.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300850";
$action_url1 = G5_ADMIN_URL . '/?dir=board&amp;pid=blacklist_search_update&amp;smode=1';
auth_check_menu($auth, $sub_menu, 'r');
$sql_common = " from `blacklist_search` as bs LEFT JOIN `{$g5['member_table']}` as mb ON bs.`mb_id` = mb.`mb_id` ";
$sql_search = " where (1) ";
if ($stx) {
$sql_search .= " and ( ";
$sql_search .= " ({$sfl} like '%{$stx}%') ";
$sql_search .= " ) ";
}
if ($sst) {
$sql_order = " order by {$sst} {$sod} ";
} else {
$sql_order = " order by bs.`bs_no` desc ";
}
$sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) {
$page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
}
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$no = $total_count - $from_record;
$sql = " select bs.*, mb.`mb_nick` {$sql_common} {$sql_search} {$sql_order} limit {$from_record}, {$rows} ";
$result = sql_query($sql);
$list = array();
for ($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i] = $row;
}
/**
* 페이징
*/
$paging = $eb->set_paging('admin', $dir, $pid, $qstr);
/**
* 검색버튼
*/
$frm_submit = ' <div class="text-center margin-top-10 margin-bottom-10"> ';
$frm_submit .= ' <input type="submit" value="검색" class="btn-e btn-e-lg btn-e-dark" accesskey="s">' ;
$frm_submit .= '</div>';
@@ -0,0 +1,96 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_addon.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
auth_check_menu($auth, $sub_menu, 'w');
if ($is_admin != 'super') alert('최고관리자만 접근 가능합니다.');
/**
* 테마 환경설정 파일
*/
include_once(EYOOM_ADMIN_CORE_PATH . "/theme/theme_head.php");
if (!$board) alert("잘못된 접근입니다.");
if ($eyoom_board['use_gnu_skin'] == 'y') {
alert("게시판 확장기능은 그누보드스킨에서는 사용하실 수 없습니다.");
}
$action_url1 = G5_ADMIN_URL . '/?dir=board&amp;pid=board_addon_update&amp;smode=1';
/**
* 탭메뉴
*/
$pg_anchor = array(
'anc_bo_blind' => '신고',
'anc_bo_rating' => '별점',
'anc_bo_tag' => '태그',
'anc_bo_automove' => '자동이동',
'anc_bo_best' => '인기게시물',
'anc_bo_wrfixed' => '상단고정',
'anc_bo_pointpost' => '포인트게시글',
'anc_bo_cmtpoint' => '댓글포인트',
'anc_bo_cmtbest' => '댓글베스트',
'anc_bo_addon' => '애드온',
'anc_bo_exif' => 'EXIF',
'anc_bo_adopt' => '채택',
'anc_bo_scheduled' => '예약게시판',
);
/**
* 이윰 게시판 스킨
*/
$bo_skin = get_skin_dir('board',G5_PATH.'/theme/'.$this_theme.'/skin');
/**
* 태그 작성 레벨은 글쓰기 권한의 레벨과 같거나 높아야 함
*/
if(!isset($eyoom_board['bo_tag_level']) || $eyoom_board['bo_tag_level'] < $board['bo_write_level']) $eyoom_board['bo_tag_level'] = $board['bo_write_level'];
/**
* EXIF 상세설정값
*/
if(!$eyoom_board['bo_exif_detail']) {
$exif_detail = $exif->get_exif_default();
} else {
$exif_detail = $eb->mb_unserialize(stripslashes($eyoom_board['bo_exif_detail']));
}
$i=0;
foreach($exif_item as $key => $val) {
$exif_data[$i]['key'] = $key;
$exif_data[$i]['entity'] = $val;
$exif_data[$i]['item'] = $exif_detail[$key]['item'];
$exif_data[$i]['use'] = $exif_detail[$key]['use'];
$i++;
}
/**
* 예약게시판 대상게시판 추출용
*/
$sql = " select bo_table, bo_subject from {$g5['board_table']} where (1) order by bo_table asc ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$bo_tables[$i] = $row['bo_table'];
$bo_subject[$i] = $row['bo_subject'];
}
/**
* 버튼
*/
$frm_submit_fixed = ' <input type="submit" value="확인" class="admin-fixed-submit-btn btn-e btn-e-red" accesskey="s">' ;
$frm_submit = ' <div class="text-center margin-top-30 margin-bottom-30"> ';
$frm_submit .= ' <input type="submit" value="확인" class="btn-e btn-e-lg btn-e-red" accesskey="s">' ;
if ($bo_table && !$wmode) {
$frm_submit .= ' <a href="'.get_eyoom_pretty_url($board['bo_table']).'" class="btn-e btn-e-lg btn-e-dark" target="_blank">게시판 바로가기</a>';
}
if (!$wmode) {
$frm_submit .= ' <a href="' . G5_ADMIN_URL . '/?dir=board&amp;pid=board_list&amp;'.$qstr.'" class="btn-e btn-e-lg btn-e-dark">목록</a> ';
}
$frm_submit .= '</div>';
@@ -0,0 +1,552 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_addon_update.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
if ($w == 'u') {
check_demo();
}
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$bo_table = isset($_POST['bo_table']) ? trim($_POST['bo_table']) : '';
if ($eyoom_board['use_gnu_skin'] == 'y') {
alert("게시판 이윰확장기능은 그누보드스킨에서는 사용하실 수 없습니다.");
}
/**
* 이윰게시판 설정에서 쇼핑몰 스킨사용체크 필드 추가
*/
if(!sql_query(" select use_shop_skin from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}` add `use_shop_skin` enum('y','n') NOT NULL default 'n' after `use_gnu_skin` ";
sql_query($sql, true);
}
/**
* 채택게시판 설정 필드 추가
*/
if(!sql_query(" select bo_use_adopt_point from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}`
add `bo_use_adopt_point` char(1) NOT NULL default '' after `bo_use_extimg`,
add `bo_adopt_minpoint` int(7) NOT NULL default '0' after `bo_use_adopt_point`,
add `bo_adopt_maxpoint` int(11) NOT NULL default '0' after `bo_adopt_minpoint`,
add `bo_adopt_ratio` smallint(3) NOT NULL default '0' after `bo_adopt_maxpoint`
";
sql_query($sql, true);
}
/**
* 회원당 하루 게시물 작성회수 설정 필드 추가
*/
if(!sql_query(" select bo_write_limit from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}`
add `bo_write_limit` smallint(3) NOT NULL default '0' after `bo_adopt_ratio`
";
sql_query($sql, true);
}
/**
* 별점 평가 기능 확장 & 추천회원 / 비추천회원 뷰페이지에서 보이기 설정 필드 추가
*/
if(!sql_query(" select bo_use_rating_member from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}`
add `bo_use_rating_member` char(1) NOT NULL default '0' after `bo_use_rating_list`,
add `bo_use_rating_score` char(1) NOT NULL default '0' after `bo_use_rating_member`,
add `bo_use_rating_comment` char(1) NOT NULL default '0' after `bo_use_rating_score`,
add `bo_rating_point` int(11) NOT NULL default '0' after `bo_use_rating_comment`,
add `bo_use_good_member` char(1) NOT NULL default '1' after `bo_use_video_photo`,
add `bo_use_nogood_member` char(1) NOT NULL default '0' after `bo_use_good_member`
";
sql_query($sql, true);
}
if(!sql_query(" select bo_use_good_member from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}`
add `bo_use_good_member` char(1) NOT NULL default '1' after `bo_use_video_photo`,
add `bo_use_nogood_member` char(1) NOT NULL default '0' after `bo_use_good_member`
";
sql_query($sql, true);
}
/**
* 게시물 상단고정 설정 필드 추가
*/
if(!sql_query(" select bo_use_wrfixed from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}`
add `bo_use_wrfixed` char(1) NOT NULL default '' after `bo_adopt_ratio`,
add `bo_wrfixed_type` char(1) NOT NULL default '1' after `bo_use_wrfixed`,
add `bo_wrfixed_point` int(7) NOT NULL default '1000' after `bo_wrfixed_type`,
add `bo_wrfixed_date` smallint(3) NOT NULL default '5' after `bo_wrfixed_point`
";
sql_query($sql, true);
}
/*
* 게시물 상단고정 관리 테이블 없을 경우 생성
*/
if (!sql_query(" DESC {$g5['eyoom_wrfixed']} ", false)) {
sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['eyoom_wrfixed']}` (
`bo_table` varchar(20) NOT NULL DEFAULT '',
`wr_id` int(11) NOT NULL DEFAULT '0',
`mb_id` varchar(30) NOT NULL,
`bf_wrfixed_point` int(11) NOT NULL DEFAULT '0',
`bf_wrfixed_date` smallint(3) NOT NULL DEFAULT '1',
`bf_open` enum('y','n') NOT NULL DEFAULT 'n',
`po_datetime` datetime NOT NULL,
`ex_datetime` datetime NOT NULL,
`bf_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'
) ",
true
);
}
/**
* 포인트게시물 설정 필드 추가
*/
if(!sql_query(" select bo_use_pointpost from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}`
add `bo_use_pointpost` char(1) NOT NULL default '' after `bo_wrfixed_date`,
add `bo_pointpost_point` varchar(255) NOT NULL default '' after `bo_use_pointpost`
";
sql_query($sql, true);
}
/*
* 인기게시물 관리 테이블 없을 경우 생성
*/
if (!sql_query(" DESC {$g5['eyoom_best']} ", false)) {
sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['eyoom_best']}` (
`bb_id` int(11) unsigned NOT NULL auto_increment,
`bo_table` varchar(20) NOT NULL,
`wr_id` int(11) NOT NULL,
`mb_id` varchar(20) NOT NULL,
`wr_good` int(11) NOT NULL default '0',
`wr_hit` int(11) NOT NULL default '0',
`wr_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`bb_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`bb_id`),
KEY `mb_id` (`mb_id`)
) ",
true
);
}
/**
* 인기게시물 설정 필드 추가
*/
if(!sql_query(" select bo_use_best from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}`
add `bo_use_best` char(1) NOT NULL default '' after `bo_use_automove`,
add `bo_best` varchar(255) NOT NULL default '' after `bo_automove`
";
sql_query($sql, true);
}
/**
* 투표기능 설정 필드 추가
*/
if(!sql_query(" select bo_use_addon_poll from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}`
add `bo_use_addon_poll` char(1) NOT NULL default '0' after `bo_use_addon_map`,
add `bo_addon_poll_point` int(7) NOT NULL default '0' after `bo_use_addon_poll`,
add `bo_addon_poll_type` char(1) NOT NULL default '1' after `bo_addon_poll_point`
";
sql_query($sql, true);
}
/*
* 투표 테이블 없을 경우 생성
*/
if (!sql_query(" DESC {$g5['eyoom_bbspoll']} ", false)) {
sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['eyoom_bbspoll']}` (
`po_id` int(11) unsigned NOT NULL auto_increment,
`bo_table` varchar(20) NOT NULL DEFAULT '',
`wr_id` int(11) NOT NULL DEFAULT '0',
`mb_id` varchar(20) NOT NULL DEFAULT '',
`po_flag` char(2) NOT NULL DEFAULT '',
`po_point` int(7) NOT NULL DEFAULT '0',
`po_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`po_id`)
) ",
true
);
}
/**
* 예약게시글 사용여부 필드 추가
*/
if(!sql_query(" select bo_use_scheduled from {$g5['eyoom_board']} limit 1 ", false)) {
$sql = " alter table `{$g5['eyoom_board']}`
add `bo_use_scheduled` char(1) NOT NULL default '' after `bo_best`,
add `bo_table_scheduled` varchar(30) NOT NULL after `bo_use_scheduled`,
add `bo_scheduled_ip` varchar(20) NOT NULL after `bo_table_scheduled`
";
sql_query($sql, true);
}
/**
* 예약게시글 사용시, 게시글 공개 시간 필드 추가
*/
if($eyoom_board['bo_use_scheduled'] && !sql_query(" select wr_opendate from {$write_table} limit 1 ", false)) {
$sql = " alter table `{$write_table}`
add `wr_opendate` datetime NOT NULL default '0000-00-00 00:00:00' after `wr_twitter_user`
";
sql_query($sql, true);
}
/*
* 예약게시글 테이블 없을 경우 생성
*/
if (!sql_query(" DESC {$g5['eyoom_scheduled']} ", false)) {
sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['eyoom_scheduled']}` (
`sd_id` int(11) unsigned NOT NULL auto_increment,
`bo_table` varchar(20) NOT NULL DEFAULT '',
`wr_id` int(11) NOT NULL DEFAULT '0',
`tg_table` varchar(20) NOT NULL DEFAULT '',
`wr_opendate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`sd_id`)
) ",
true
);
}
/**
* 게시물 자동 이동/복사
*/
$bo_use_automove = isset($_POST['bo_use_automove']) ? (int) $_POST['bo_use_automove'] : 0;
if ($bo_use_automove) {
$post_bo_automove['count1'] = isset($_POST['bo_automove_count1']) ? (int) clean_xss_tags(trim($_POST['bo_automove_count1'])) : '';
$post_bo_automove['target1'] = isset($_POST['bo_automove_target1']) ? clean_xss_tags(trim($_POST['bo_automove_target1'])) : '';
$post_bo_automove['action1'] = isset($_POST['bo_automove_action1']) ? clean_xss_tags(trim($_POST['bo_automove_action1'])) : '';
$post_bo_automove['count2'] = isset($_POST['bo_automove_count2']) ? (int) clean_xss_tags(trim($_POST['bo_automove_count2'])) : '';
$post_bo_automove['target2'] = isset($_POST['bo_automove_target2']) ? clean_xss_tags(trim($_POST['bo_automove_target2'])) : '';
$post_bo_automove['action2'] = isset($_POST['bo_automove_action2']) ? clean_xss_tags(trim($_POST['bo_automove_action2'])) : '';
$post_bo_automove['count3'] = isset($_POST['bo_automove_count3']) ? (int) clean_xss_tags(trim($_POST['bo_automove_count3'])) : '';
$post_bo_automove['target3'] = isset($_POST['bo_automove_target3']) ? clean_xss_tags(trim($_POST['bo_automove_target3'])) : '';
$post_bo_automove['action3'] = isset($_POST['bo_automove_action3']) ? clean_xss_tags(trim($_POST['bo_automove_action3'])) : '';
$bo_automove = serialize($post_bo_automove);
} else {
$bo_automove = '';
}
/**
* 인기게시물
*/
$bo_use_best = isset($_POST['bo_use_best']) ? (int) $_POST['bo_use_best'] : 0;
if ($bo_use_best) {
$post_bo_best['use1'] = isset($_POST['bo_best_use1']) ? (int) clean_xss_tags(trim($_POST['bo_best_use1'])) : '';
$post_bo_best['count1'] = isset($_POST['bo_best_count1']) ? (int) clean_xss_tags(trim($_POST['bo_best_count1'])) : '';
$post_bo_best['use2'] = isset($_POST['bo_best_use2']) ? (int) clean_xss_tags(trim($_POST['bo_best_use2'])) : '';
$post_bo_best['count2'] = isset($_POST['bo_best_count2']) ? (int) clean_xss_tags(trim($_POST['bo_best_count2'])) : '';
$bo_best = serialize($post_bo_best);
// 조건이 바뀌면 기존 인기게시물 중에서 조건이 맞지 않으면 삭제
if ($post_bo_best['use1']) {
if ($post_bo_best['use2']) {
$where = " and (wr_hit < {$post_bo_best['count1']} and wr_good < {$post_bo_best['count2']}) ";
} else {
$where = " and wr_hit < {$post_bo_best['count1']} ";
}
} else if ($post_bo_best['use2']) {
$where = " and wr_good < {$post_bo_best['count2']}";
}
$sql = "delete from {$g5['eyoom_best']} where bo_table='{$bo_table}' {$where} ";
sql_query($sql);
} else {
$bo_best = '';
$sql = "delete from {$g5['eyoom_best']} where bo_table='{$bo_table}' ";
sql_query($sql);
}
$bo_use_point_explain = isset($_POST['bo_use_point_explain']) ? (int) $_POST['bo_use_point_explain'] : 0;
$bo_cmtpoint_target = isset($_POST['bo_cmtpoint_target']) ? (int) $_POST['bo_cmtpoint_target'] : 1;
$bo_firstcmt_point = isset($_POST['bo_firstcmt_point']) ? (int) $_POST['bo_firstcmt_point'] : 0;
$bo_firstcmt_point_type = isset($_POST['bo_firstcmt_point_type']) ? (int) $_POST['bo_firstcmt_point_type'] : 1;
$bo_bomb_point = isset($_POST['bo_bomb_point']) ? (int) $_POST['bo_bomb_point'] : 0;
$bo_bomb_point_type = isset($_POST['bo_bomb_point_type']) ? (int) $_POST['bo_bomb_point_type'] : 1;
$bo_bomb_point_limit = isset($_POST['bo_bomb_point_limit']) ? (int) $_POST['bo_bomb_point_limit'] : 10;
$bo_bomb_point_cnt = isset($_POST['bo_bomb_point_cnt']) ? (int) $_POST['bo_bomb_point_cnt'] : 0;
$bo_lucky_point = isset($_POST['bo_lucky_point']) ? (int) $_POST['bo_lucky_point'] : 0;
$bo_lucky_point_type = isset($_POST['bo_lucky_point_type']) ? (int) $_POST['bo_lucky_point_type'] : 1;
$bo_lucky_point_ratio = isset($_POST['bo_lucky_point_ratio']) ? (int) $_POST['bo_lucky_point_ratio'] : 0;
$bo_use_exif = isset($_POST['bo_use_exif']) ? (int) $_POST['bo_use_exif'] : 0;
$bo_exif_detail = isset($_POST['bo_exif_detail']) ? serialize($_POST['bo_exif_detail']) : '';
$bo_use_adopt_point = isset($_POST['bo_use_adopt_point']) ? (int) $_POST['bo_use_adopt_point'] : 0;
$bo_adopt_minpoint = isset($_POST['bo_adopt_minpoint']) ? (int) $_POST['bo_adopt_minpoint'] : 0;
$bo_adopt_maxpoint = isset($_POST['bo_adopt_maxpoint']) ? (int) $_POST['bo_adopt_maxpoint'] : 0;
$bo_adopt_ratio = isset($_POST['bo_adopt_ratio']) ? (int) $_POST['bo_adopt_ratio'] : 0;
$bo_use_wrfixed = isset($_POST['bo_use_wrfixed']) ? (int) $_POST['bo_use_wrfixed'] : 0;
$bo_wrfixed_type = isset($_POST['bo_wrfixed_type']) ? (int) $_POST['bo_wrfixed_type'] : 1;
$bo_wrfixed_point = isset($_POST['bo_wrfixed_point']) ? (int) $_POST['bo_wrfixed_point'] : 1000;
$bo_wrfixed_date = isset($_POST['bo_wrfixed_date']) ? (int) $_POST['bo_wrfixed_date'] : 5;
$bo_use_pointpost = isset($_POST['bo_use_pointpost']) ? (int) $_POST['bo_use_pointpost'] : 0;
$bo_pointpost_point = isset($_POST['bo_pointpost_point']) ? $_POST['bo_pointpost_point'] : 1;
$bo_use_hotgul = isset($_POST['bo_use_hotgul']) ? (int) $_POST['bo_use_hotgul'] : 1;
$bo_use_cmt_best = isset($_POST['bo_use_cmt_best']) ? (int) $_POST['bo_use_cmt_best'] : 0;
$bo_use_yellow_card = isset($_POST['bo_use_yellow_card']) ? (int) $_POST['bo_use_yellow_card'] : 0;
$bo_use_rating = isset($_POST['bo_use_rating']) ? (int) $_POST['bo_use_rating'] : 2;
$bo_use_rating_list = isset($_POST['bo_use_rating_list']) ? (int) $_POST['bo_use_rating_list'] : 0;
$bo_use_rating_member = isset($_POST['bo_use_rating_member']) ? (int) $_POST['bo_use_rating_member'] : 0;
$bo_use_rating_score = isset($_POST['bo_use_rating_score']) ? (int) $_POST['bo_use_rating_score'] : 0;
$bo_use_rating_comment = isset($_POST['bo_use_rating_comment']) ? (int) $_POST['bo_use_rating_comment'] : 0;
$bo_rating_point = isset($_POST['bo_rating_point']) ? (int) $_POST['bo_rating_point'] : 0;
$bo_use_tag = isset($_POST['bo_use_tag']) ? (int) $_POST['bo_use_tag'] : 0;
$bo_use_addon_emoticon = isset($_POST['bo_use_addon_emoticon']) ? (int) $_POST['bo_use_addon_emoticon'] : 0;
$bo_use_addon_video = isset($_POST['bo_use_addon_video']) ? (int) $_POST['bo_use_addon_video'] : 0;
$bo_use_addon_coding = isset($_POST['bo_use_addon_coding']) ? (int) $_POST['bo_use_addon_coding'] : 0;
$bo_use_addon_soundcloud = isset($_POST['bo_use_addon_soundcloud']) ? (int) $_POST['bo_use_addon_soundcloud'] : 0;
$bo_use_addon_map = isset($_POST['bo_use_addon_map']) ? (int) $_POST['bo_use_addon_map'] : 0;
$bo_use_addon_poll = isset($_POST['bo_use_addon_poll']) ? (int) $_POST['bo_use_addon_poll'] : 0;
$bo_addon_poll_point = isset($_POST['bo_addon_poll_point']) ? (int) $_POST['bo_addon_poll_point'] : 0;
$bo_addon_poll_type = isset($_POST['bo_addon_poll_type']) ? (int) $_POST['bo_addon_poll_type'] : 1;
$bo_use_addon_cmtfile = isset($_POST['bo_use_addon_cmtfile']) ? (int) $_POST['bo_use_addon_cmtfile'] : 0;
$bo_count_cmtfile = isset($_POST['bo_count_cmtfile']) ? (int) $_POST['bo_count_cmtfile'] : 1;
$bo_cmt_best_min = isset($_POST['bo_cmt_best_min']) ? (int) $_POST['bo_cmt_best_min'] : 10;
$bo_cmt_best_limit = isset($_POST['bo_cmt_best_limit']) ? (int) $_POST['bo_cmt_best_limit'] : 5;
$bo_tag_level = isset($_POST['bo_tag_level']) ? (int) $_POST['bo_tag_level'] : 2;
$bo_tag_limit = isset($_POST['bo_tag_limit']) ? (int) $_POST['bo_tag_limit'] : 10;
$bo_blind_limit = isset($_POST['bo_blind_limit']) ? (int) $_POST['bo_blind_limit'] : 5;
$bo_blind_view = isset($_POST['bo_blind_view']) ? (int) $_POST['bo_blind_view'] : 10;
$bo_blind_direct = isset($_POST['bo_blind_direct']) ? (int) $_POST['bo_blind_direct'] : 10;
$bo_use_scheduled = isset($_POST['bo_use_scheduled']) ? (int) $_POST['bo_use_scheduled'] : 0;
$bo_table_scheduled = isset($_POST['bo_table_scheduled']) ? clean_xss_tags($_POST['bo_table_scheduled']) : '';
$bo_scheduled_ip = isset($_POST['bo_scheduled_ip']) ? clean_xss_tags($_POST['bo_scheduled_ip']) : '';
$where = " bo_table='{$bo_table}' ";
/**
* 포인트게시글 필터링
*/
$bo_pointpost_point = clean_xss_tags($bo_pointpost_point);
if ($bo_pointpost_point && !preg_match('/^[0-9|]+$/', $bo_pointpost_point)) {
alert('게시물포인트 설정이 잘못되었습니다.');
}
if (!$bo_use_pointpost) {
$bo_pointpost_point = '';
}
$set = "
bo_use_point_explain = '{$bo_use_point_explain}',
bo_cmtpoint_target = '{$bo_cmtpoint_target}',
bo_firstcmt_point = '{$bo_firstcmt_point}',
bo_firstcmt_point_type = '{$bo_firstcmt_point_type}',
bo_bomb_point = '{$bo_bomb_point}',
bo_bomb_point_type = '{$bo_bomb_point_type}',
bo_bomb_point_limit = '{$bo_bomb_point_limit}',
bo_bomb_point_cnt = '{$bo_bomb_point_cnt}',
bo_lucky_point = '{$bo_lucky_point}',
bo_lucky_point_type = '{$bo_lucky_point_type}',
bo_lucky_point_ratio = '{$bo_lucky_point_ratio}',
bo_use_exif = '{$bo_use_exif}',
bo_exif_detail = '{$bo_exif_detail}',
bo_use_adopt_point = '{$bo_use_adopt_point}',
bo_adopt_minpoint = '{$bo_adopt_minpoint}',
bo_adopt_maxpoint = '{$bo_adopt_maxpoint}',
bo_adopt_ratio = '{$bo_adopt_ratio}',
bo_use_wrfixed = '{$bo_use_wrfixed}',
bo_wrfixed_type = '{$bo_wrfixed_type}',
bo_wrfixed_point = '{$bo_wrfixed_point}',
bo_wrfixed_date = '{$bo_wrfixed_date}',
bo_use_pointpost = '{$bo_use_pointpost}',
bo_pointpost_point = '{$bo_pointpost_point}',
bo_use_hotgul = '{$bo_use_hotgul}',
bo_use_cmt_best = '{$bo_use_cmt_best}',
bo_use_yellow_card = '{$bo_use_yellow_card}',
bo_use_rating = '{$bo_use_rating}',
bo_use_rating_list = '{$bo_use_rating_list}',
bo_use_rating_member = '{$bo_use_rating_member}',
bo_use_rating_score = '{$bo_use_rating_score}',
bo_use_rating_comment = '{$bo_use_rating_comment}',
bo_rating_point = '{$bo_rating_point}',
bo_use_tag = '{$bo_use_tag}',
bo_use_automove = '{$bo_use_automove}',
bo_use_best = '{$bo_use_best}',
bo_use_scheduled = '{$bo_use_scheduled}',
bo_table_scheduled = '{$bo_table_scheduled}',
bo_scheduled_ip = '{$bo_scheduled_ip}',
bo_use_addon_emoticon = '{$bo_use_addon_emoticon}',
bo_use_addon_video = '{$bo_use_addon_video}',
bo_use_addon_coding = '{$bo_use_addon_coding}',
bo_use_addon_soundcloud = '{$bo_use_addon_soundcloud}',
bo_use_addon_map = '{$bo_use_addon_map}',
bo_use_addon_poll = '{$bo_use_addon_poll}',
bo_addon_poll_point = '{$bo_addon_poll_point}',
bo_addon_poll_type = '{$bo_addon_poll_type}',
bo_use_addon_cmtfile = '{$bo_use_addon_cmtfile}',
bo_count_cmtfile = '{$bo_count_cmtfile}',
bo_cmt_best_min = '{$bo_cmt_best_min}',
bo_cmt_best_limit = '{$bo_cmt_best_limit}',
bo_tag_level = '{$bo_tag_level}',
bo_tag_limit = '{$bo_tag_limit}',
bo_automove = '{$bo_automove}',
bo_best = '{$bo_best}',
bo_blind_limit = '{$bo_blind_limit}',
bo_blind_view = '{$bo_blind_view}',
bo_blind_direct = '{$bo_blind_direct}'
";
$sql = "update {$g5['eyoom_board']} set $set where $where";
sql_query($sql);
/**
* 투표기능 활성화에 따라 파일 설명 사용 여부 설정
* 투표기능 사용이면 파일 설명 사용 활성
*/
if ($bo_use_addon_poll == 1) {
$sql = "update {$g5['board_table']} set bo_use_file_content = 1 where $where";
sql_query($sql);
}
/**
* 같은 그룹내 게시판 동일 옵션 적용
*/
$grp_fields = '';
if (is_checked('chk_grp_hotgul')) $grp_fields .= " , bo_use_hotgul = '{$bo_use_hotgul}' ";
if (is_checked('chk_grp_cmt_best')) $grp_fields .= " , bo_use_cmt_best = '{$bo_use_cmt_best}' ";
if (is_checked('chk_grp_point_explain')) $grp_fields .= " , bo_use_point_explain = '{$bo_use_point_explain}' ";
if (is_checked('chk_grp_yellow_card')) $grp_fields .= " , bo_use_yellow_card = '{$bo_use_yellow_card}' ";
if (is_checked('chk_grp_exif')) $grp_fields .= " , bo_use_exif = '{$bo_use_exif}' ";
if (is_checked('chk_grp_rating')) $grp_fields .= " , bo_use_rating = '{$bo_use_rating}' ";
if (is_checked('chk_grp_rating_list')) $grp_fields .= " , bo_use_rating_list = '{$bo_use_rating_list}' ";
if (is_checked('chk_grp_rating_member')) $grp_fields .= " , bo_use_rating_member = '{$bo_use_rating_member}' ";
if (is_checked('chk_grp_rating_score')) $grp_fields .= " , bo_use_rating_score = '{$bo_use_rating_score}' ";
if (is_checked('chk_grp_rating_comment')) $grp_fields .= " , bo_use_rating_comment = '{$bo_use_rating_comment}' ";
if (is_checked('chk_grp_rating_point')) $grp_fields .= " , bo_rating_point = '{$bo_rating_point}' ";
if (is_checked('chk_grp_use_tag')) $grp_fields .= " , bo_use_tag = '{$bo_use_tag}' ";
if (is_checked('chk_grp_use_wrfixed')) $grp_fields .= " , bo_use_wrfixed = '{$bo_use_wrfixed}' ";
if (is_checked('chk_grp_wrfixed_type')) $grp_fields .= " , bo_wrfixed_type = '{$bo_wrfixed_type}' ";
if (is_checked('chk_grp_wrfixed_point')) $grp_fields .= " , bo_wrfixed_point = '{$bo_wrfixed_point}' ";
if (is_checked('chk_grp_wrfixed_date')) $grp_fields .= " , bo_wrfixed_date = '{$bo_wrfixed_date}' ";
if (is_checked('chk_grp_use_pointpost')) $grp_fields .= " , bo_use_pointpost = '{$bo_use_pointpost}' ";
if (is_checked('chk_grp_pointpost_point')) $grp_fields .= " , bo_pointpost_point = '{$bo_pointpost_point}' ";
if (is_checked('chk_grp_use_automove')) $grp_fields .= " , bo_use_automove = '{$bo_use_automove}' ";
if (is_checked('chk_grp_use_best')) $grp_fields .= " , bo_use_best = '{$bo_use_best}' ";
if (is_checked('chk_grp_addon_emoticon')) $grp_fields .= " , bo_use_addon_emoticon = '{$bo_use_addon_emoticon}' ";
if (is_checked('chk_grp_addon_video')) $grp_fields .= " , bo_use_addon_video = '{$bo_use_addon_video}' ";
if (is_checked('chk_grp_addon_coding')) $grp_fields .= " , bo_use_addon_coding = '{$bo_use_addon_coding}' ";
if (is_checked('chk_grp_addon_soundcloud')) $grp_fields .= " , bo_use_addon_soundcloud = '{$bo_use_addon_soundcloud}' ";
if (is_checked('chk_grp_addon_map')) $grp_fields .= " , bo_use_addon_map = '{$bo_use_addon_map}' ";
if (is_checked('chk_grp_addon_poll')) {
$grp_fields .= " , bo_use_addon_poll = '{$bo_use_addon_poll}' ";
$grp_fields .= " , bo_addon_poll_point = '{$bo_addon_poll_point}' ";
$grp_fields .= " , bo_addon_poll_type = '{$bo_addon_poll_type}' ";
}
if (is_checked('chk_grp_addon_cmtfile')) $grp_fields .= " , bo_use_addon_cmtfile = '{$bo_use_addon_cmtfile}', bo_count_cmtfile = '{$bo_count_cmtfile}' ";
if (is_checked('chk_grp_cmtbest_min')) $grp_fields .= " , bo_cmt_best_min = '{$bo_cmt_best_min}' ";
if (is_checked('chk_grp_cmtbest_limit')) $grp_fields .= " , bo_cmt_best_limit = '{$bo_cmt_best_limit}' ";
if (is_checked('chk_grp_tag_level')) $grp_fields .= " , bo_tag_level = '{$bo_tag_level}' ";
if (is_checked('chk_grp_tag_limit')) $grp_fields .= " , bo_tag_limit = '{$bo_tag_limit}' ";
if (is_checked('chk_grp_automove')) $grp_fields .= " , bo_automove = '{$bo_automove}' ";
if (is_checked('chk_grp_best')) $grp_fields .= " , bo_best = '{$bo_best}' ";
if (is_checked('chk_grp_exif_detail')) $grp_fields .= " , bo_exif_detail = '{$bo_exif_detail}' ";
if (is_checked('chk_grp_blind_limit')) $grp_fields .= " , bo_blind_limit = '{$bo_blind_limit}' ";
if (is_checked('chk_grp_blind_view')) $grp_fields .= " , bo_blind_view = '{$bo_blind_view}' ";
if (is_checked('chk_grp_blind_direct')) $grp_fields .= " , bo_blind_direct = '{$bo_blind_direct}' ";
if (is_checked('chk_grp_cmtpoint_target')) $grp_fields .= " , bo_cmtpoint_target = '{$bo_cmtpoint_target}' ";
if (is_checked('chk_grp_firstcmt_point')) {
$grp_fields .= " , bo_firstcmt_point = '{$bo_firstcmt_point}' ";
$grp_fields .= " , bo_firstcmt_point_type = '{$bo_firstcmt_point_type}' ";
}
if (is_checked('chk_grp_bomb_point')) {
$grp_fields .= " , bo_bomb_point = '{$bo_bomb_point}' ";
$grp_fields .= " , bo_bomb_point_type = '{$bo_bomb_point_type}' ";
$grp_fields .= " , bo_bomb_point_limit = '{$bo_bomb_point_limit}' ";
$grp_fields .= " , bo_bomb_point_cnt = '{$bo_bomb_point_cnt}' ";
}
if (is_checked('chk_grp_lucky_point')) {
$grp_fields .= " , bo_lucky_point = '{$bo_lucky_point}' ";
$grp_fields .= " , bo_lucky_point_type = '{$bo_lucky_point_type}' ";
$grp_fields .= " , bo_lucky_point_ratio = '{$bo_lucky_point_ratio}' ";
}
if ($grp_fields) {
sql_query(" update {$g5['eyoom_board']} set bo_table = bo_table {$grp_fields} where gr_id = '{$gr_id}' ");
}
if (is_checked('chk_grp_addon_poll') && $bo_use_addon_poll == 1) {
$sql = "update {$g5['board_table']} set bo_use_file_content = 1 where gr_id = '{$gr_id}'";
sql_query($sql);
}
// 모든 게시판 동일 옵션 적용
$all_fields = '';
if (is_checked('chk_all_hotgul')) $all_fields .= " , bo_use_hotgul = '{$bo_use_hotgul}' ";
if (is_checked('chk_all_cmt_best')) $all_fields .= " , bo_use_cmt_best = '{$bo_use_cmt_best}' ";
if (is_checked('chk_all_point_explain')) $all_fields .= " , bo_use_point_explain = '{$bo_use_point_explain}' ";
if (is_checked('chk_all_yellow_card')) $all_fields .= " , bo_use_yellow_card = '{$bo_use_yellow_card}' ";
if (is_checked('chk_all_exif')) $all_fields .= " , bo_use_exif = '{$bo_use_exif}' ";
if (is_checked('chk_all_rating')) $all_fields .= " , bo_use_rating = '{$bo_use_rating}' ";
if (is_checked('chk_all_rating_list')) $all_fields .= " , bo_use_rating_list = '{$bo_use_rating_list}' ";
if (is_checked('chk_all_rating_member')) $all_fields .= " , bo_use_rating_member = '{$bo_use_rating_member}' ";
if (is_checked('chk_all_rating_score')) $all_fields .= " , bo_use_rating_score = '{$bo_use_rating_score}' ";
if (is_checked('chk_all_rating_comment')) $all_fields .= " , bo_use_rating_comment = '{$bo_use_rating_comment}' ";
if (is_checked('chk_all_rating_point')) $all_fields .= " , bo_rating_point = '{$bo_rating_point}' ";
if (is_checked('chk_all_use_tag')) $all_fields .= " , bo_use_tag = '{$bo_use_tag}' ";
if (is_checked('chk_all_use_wrfixed')) $all_fields .= " , bo_use_wrfixed = '{$bo_use_wrfixed}' ";
if (is_checked('chk_all_wrfixed_type')) $all_fields .= " , bo_wrfixed_type = '{$bo_wrfixed_type}' ";
if (is_checked('chk_all_wrfixed_point')) $all_fields .= " , bo_wrfixed_point = '{$bo_wrfixed_point}' ";
if (is_checked('chk_all_wrfixed_date')) $all_fields .= " , bo_wrfixed_date = '{$bo_wrfixed_date}' ";
if (is_checked('chk_all_use_pointpost')) $all_fields .= " , bo_use_pointpost = '{$bo_use_pointpost}' ";
if (is_checked('chk_all_pointpost_point')) $all_fields .= " , bo_pointpost_point = '{$bo_pointpost_point}' ";
if (is_checked('chk_all_use_automove')) $all_fields .= " , bo_use_automove = '{$bo_use_automove}' ";
if (is_checked('chk_all_use_best')) $all_fields .= " , bo_use_best = '{$bo_use_best}' ";
if (is_checked('chk_all_addon_emoticon')) $all_fields .= " , bo_use_addon_emoticon = '{$bo_use_addon_emoticon}' ";
if (is_checked('chk_all_addon_video')) $all_fields .= " , bo_use_addon_video = '{$bo_use_addon_video}' ";
if (is_checked('chk_all_addon_coding')) $all_fields .= " , bo_use_addon_coding = '{$bo_use_addon_coding}' ";
if (is_checked('chk_all_addon_soundcloud')) $all_fields .= " , bo_use_addon_soundcloud = '{$bo_use_addon_soundcloud}' ";
if (is_checked('chk_all_addon_map')) $all_fields .= " , bo_use_addon_map = '{$bo_use_addon_map}' ";
if (is_checked('chk_all_addon_poll')) {
$all_fields .= " , bo_use_addon_poll = '{$bo_use_addon_poll}' ";
$all_fields .= " , bo_addon_poll_point = '{$bo_addon_poll_point}' ";
$all_fields .= " , bo_addon_poll_type = '{$bo_addon_poll_type}' ";
}
if (is_checked('chk_all_addon_cmtfile')) $all_fields .= " , bo_use_addon_cmtfile = '{$bo_use_addon_cmtfile}', bo_count_cmtfile = '{$bo_count_cmtfile}' ";
if (is_checked('chk_all_cmtbest_min')) $all_fields .= " , bo_cmt_best_min = '{$bo_cmt_best_min}' ";
if (is_checked('chk_all_cmtbest_limit')) $all_fields .= " , bo_cmt_best_limit = '{$bo_cmt_best_limit}' ";
if (is_checked('chk_all_tag_level')) $all_fields .= " , bo_tag_level = '{$bo_tag_level}' ";
if (is_checked('chk_all_tag_limit')) $all_fields .= " , bo_tag_limit = '{$bo_tag_limit}' ";
if (is_checked('chk_all_automove')) $all_fields .= " , bo_automove = '{$bo_automove}' ";
if (is_checked('chk_all_best')) $all_fields .= " , bo_best = '{$bo_best}' ";
if (is_checked('chk_all_exif_detail')) $all_fields .= " , bo_exif_detail = '{$bo_exif_detail}' ";
if (is_checked('chk_all_blind_limit')) $all_fields .= " , bo_blind_limit = '{$bo_blind_limit}' ";
if (is_checked('chk_all_blind_view')) $all_fields .= " , bo_blind_view = '{$bo_blind_view}' ";
if (is_checked('chk_all_blind_direct')) $all_fields .= " , bo_blind_direct = '{$bo_blind_direct}' ";
if (is_checked('chk_all_cmtpoint_target')) $all_fields .= " , bo_cmtpoint_target = '{$bo_cmtpoint_target}' ";
if (is_checked('chk_all_firstcmt_point')) {
$all_fields .= " , bo_firstcmt_point = '{$bo_firstcmt_point}' ";
$all_fields .= " , bo_firstcmt_point_type = '{$bo_firstcmt_point_type}' ";
}
if (is_checked('chk_all_bomb_point')) {
$all_fields .= " , bo_bomb_point = '{$bo_bomb_point}' ";
$all_fields .= " , bo_bomb_point_type = '{$bo_bomb_point_type}' ";
$all_fields .= " , bo_bomb_point_limit = '{$bo_bomb_point_limit}' ";
$all_fields .= " , bo_bomb_point_cnt = '{$bo_bomb_point_cnt}' ";
}
if (is_checked('chk_all_lucky_point')) {
$all_fields .= " , bo_lucky_point = '{$bo_lucky_point}' ";
$all_fields .= " , bo_lucky_point_type = '{$bo_lucky_point_type}' ";
$all_fields .= " , bo_lucky_point_ratio = '{$bo_lucky_point_ratio}' ";
}
if ($all_fields) {
sql_query(" update {$g5['eyoom_board']} set bo_table = bo_table {$all_fields} where 1 ");
}
if (is_checked('chk_all_addon_poll') && $bo_use_addon_poll == 1) {
$sql = "update {$g5['board_table']} set bo_use_file_content = 1 where 1";
sql_query($sql);
}
$qstr = $wmode ? '&amp;wmode=1':'';
alert("정상적으로 적용하였습니다.", G5_ADMIN_URL . "/?dir=board&amp;pid=board_addon&amp;w=u&amp;bo_table={$bo_table}&amp;{$qstr}");
@@ -0,0 +1,23 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_copy.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
auth_check_menu($auth, $sub_menu, 'w');
$action_url1 = G5_ADMIN_URL . '/?dir=board&amp;pid=board_copy_update&amp;smode=1';
$bo_table = $_REQUEST['bo_table'];
if (empty($bo_table)) {
alert_close("정상적인 방법으로 이용해주세요.");
}
/**
* 버튼
*/
$frm_submit = ' <div class="text-center margin-top-30 margin-bottom-30"> ';
$frm_submit .= ' <input type="submit" value="확인" class="btn-e btn-e-lg btn-e-red" accesskey="s">' ;
$frm_submit .= '</div>';
@@ -0,0 +1,288 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_copy_update.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
check_demo();
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$copy_config = clean_xss_tags(trim($_POST['copy_config']));
$target_table = isset($_POST['target_table']) ? trim($_POST['target_table']) : '';
$target_subject = isset($_POST['target_subject']) ? trim($_POST['target_subject']) : '';
$target_subject = strip_tags(clean_xss_attributes($target_subject));
$file_copy = array();
if (empty($bo_table)) {
alert("원본 테이블 정보가 없습니다.");
}
if (!preg_match('/[A-Za-z0-9_]{1,20}/', $target_table)) {
alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)');
}
// 게시판명이 금지된 단어로 되어 있으면
if ($w == '' && in_array($target_table, get_bo_table_banned_word())) {
alert('입력한 게시판 TABLE명을 사용할수 없습니다. 다른 이름으로 입력해 주세요.');
}
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where bo_table = '$target_table' ");
if ($row['cnt']) {
alert($target_table . '은(는) 이미 존재하는 게시판 테이블명 입니다.\\n복사할 테이블명으로 사용할 수 없습니다.');
}
// 게시판 테이블 생성
$sql = get_table_define($g5['write_prefix'] . $bo_table);
$sql = str_replace($g5['write_prefix'] . $bo_table, $g5['write_prefix'] . $target_table, $sql);
sql_query($sql, false);
// 구조만 복사시에는 공지사항 번호는 복사하지 않는다.
if ($copy_case == 'schema_only') {
$board['bo_notice'] = '';
}
// 게시판 정보
$sql = " insert into {$g5['board_table']}
set bo_table = '$target_table',
gr_id = '{$board['gr_id']}',
bo_subject = '$target_subject',
bo_device = '{$board['bo_device']}',
bo_admin = '{$board['bo_admin']}',
bo_list_level = '{$board['bo_list_level']}',
bo_read_level = '{$board['bo_read_level']}',
bo_write_level = '{$board['bo_write_level']}',
bo_reply_level = '{$board['bo_reply_level']}',
bo_comment_level = '{$board['bo_comment_level']}',
bo_upload_level = '{$board['bo_upload_level']}',
bo_download_level = '{$board['bo_download_level']}',
bo_html_level = '{$board['bo_html_level']}',
bo_link_level = '{$board['bo_link_level']}',
bo_count_modify = '{$board['bo_count_modify']}',
bo_count_delete = '{$board['bo_count_delete']}',
bo_read_point = '{$board['bo_read_point']}',
bo_write_point = '{$board['bo_write_point']}',
bo_comment_point = '{$board['bo_comment_point']}',
bo_download_point = '{$board['bo_download_point']}',
bo_use_category = '{$board['bo_use_category']}',
bo_category_list = '{$board['bo_category_list']}',
bo_use_sideview = '{$board['bo_use_sideview']}',
bo_use_file_content = '{$board['bo_use_file_content']}',
bo_use_secret = '{$board['bo_use_secret']}',
bo_use_dhtml_editor = '{$board['bo_use_dhtml_editor']}',
bo_use_rss_view = '{$board['bo_use_rss_view']}',
bo_use_good = '{$board['bo_use_good']}',
bo_use_nogood = '{$board['bo_use_nogood']}',
bo_use_name = '{$board['bo_use_name']}',
bo_use_signature = '{$board['bo_use_signature']}',
bo_use_ip_view = '{$board['bo_use_ip_view']}',
bo_use_list_view = '{$board['bo_use_list_view']}',
bo_use_list_content = '{$board['bo_use_list_content']}',
bo_use_list_file = '{$board['bo_use_list_file']}',
bo_table_width = '{$board['bo_table_width']}',
bo_subject_len = '{$board['bo_subject_len']}',
bo_mobile_subject_len = '{$board['bo_mobile_subject_len']}',
bo_page_rows = '{$board['bo_page_rows']}',
bo_mobile_page_rows = '{$board['bo_mobile_page_rows']}',
bo_new = '{$board['bo_new']}',
bo_hot = '{$board['bo_hot']}',
bo_image_width = '{$board['bo_image_width']}',
bo_skin = '{$board['bo_skin']}',
bo_mobile_skin = '{$board['bo_mobile_skin']}',
bo_include_head = '{$board['bo_include_head']}',
bo_include_tail = '{$board['bo_include_tail']}',
bo_content_head = '".addslashes($board['bo_content_head'])."',
bo_content_tail = '".addslashes($board['bo_content_tail'])."',
bo_mobile_content_head = '".addslashes($board['bo_mobile_content_head'])."',
bo_mobile_content_tail = '".addslashes($board['bo_mobile_content_tail'])."',
bo_insert_content = '".addslashes($board['bo_insert_content'])."',
bo_gallery_cols = '{$board['bo_gallery_cols']}',
bo_gallery_width = '{$board['bo_gallery_width']}',
bo_gallery_height = '{$board['bo_gallery_height']}',
bo_mobile_gallery_width = '{$board['bo_mobile_gallery_width']}',
bo_mobile_gallery_height = '{$board['bo_mobile_gallery_height']}',
bo_upload_size = '{$board['bo_upload_size']}',
bo_reply_order = '{$board['bo_reply_order']}',
bo_use_search = '{$board['bo_use_search']}',
bo_order = '{$board['bo_order']}',
bo_notice = '{$board['bo_notice']}',
bo_upload_count = '{$board['bo_upload_count']}',
bo_use_email = '{$board['bo_use_email']}',
bo_use_cert = '{$board['bo_use_cert']}',
bo_use_sns = '{$board['bo_use_sns']}',
bo_use_captcha = '{$board['bo_use_captcha']}',
bo_sort_field = '{$board['bo_sort_field']}',
bo_ex_cnt = '{$board['bo_ex_cnt']}',
bo_1_subj = '".addslashes($board['bo_1_subj'])."',
bo_2_subj = '".addslashes($board['bo_2_subj'])."',
bo_3_subj = '".addslashes($board['bo_3_subj'])."',
bo_4_subj = '".addslashes($board['bo_4_subj'])."',
bo_5_subj = '".addslashes($board['bo_5_subj'])."',
bo_6_subj = '".addslashes($board['bo_6_subj'])."',
bo_7_subj = '".addslashes($board['bo_7_subj'])."',
bo_8_subj = '".addslashes($board['bo_8_subj'])."',
bo_9_subj = '".addslashes($board['bo_9_subj'])."',
bo_10_subj = '".addslashes($board['bo_10_subj'])."',
bo_1 = '".addslashes($board['bo_1'])."',
bo_2 = '".addslashes($board['bo_2'])."',
bo_3 = '".addslashes($board['bo_3'])."',
bo_4 = '".addslashes($board['bo_4'])."',
bo_5 = '".addslashes($board['bo_5'])."',
bo_6 = '".addslashes($board['bo_6'])."',
bo_7 = '".addslashes($board['bo_7'])."',
bo_8 = '".addslashes($board['bo_8'])."',
bo_9 = '".addslashes($board['bo_9'])."',
bo_10 = '".addslashes($board['bo_10'])."' ";
sql_query($sql, false);
// 게시판 폴더 생성
@mkdir(G5_DATA_PATH.'/file/'.$target_table, G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH.'/file/'.$target_table, G5_DIR_PERMISSION);
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$board_path = G5_DATA_PATH.'/file/'.$target_table;
$file = $board_path . '/index.php';
$f = @fopen($file, 'w');
@fwrite($f, '');
@fclose($f);
@chmod($file, G5_FILE_PERMISSION);
$copy_file = 0;
if ($copy_case == 'schema_data_both') {
$d = dir(G5_DATA_PATH.'/file/'.$bo_table);
while ($entry = $d->read()) {
if ($entry == '.' || $entry == '..') continue;
// 김선용 201007 :
if (is_dir(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry)) {
$dd = dir(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry);
@mkdir(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry, G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry, G5_DIR_PERMISSION);
while ($entry2 = $dd->read()) {
if ($entry2 == '.' || $entry2 == '..') {
continue;
}
@copy(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry . '/' . $entry2, G5_DATA_PATH . '/file/' . $target_table . '/' . $entry . '/' . $entry2);
@chmod(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry . '/' . $entry2, G5_DIR_PERMISSION);
$copy_file++;
}
$dd->close();
} else {
@copy(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry, G5_DATA_PATH . '/file/' . $target_table . '/' . $entry);
@chmod(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry, G5_DIR_PERMISSION);
$copy_file++;
}
}
$d->close();
run_event('admin_board_copy_file', $bo_table, $target_table);
// 글복사
$sql = " insert into {$g5['write_prefix']}$target_table select * from {$g5['write_prefix']}$bo_table ";
sql_query($sql, false);
// 게시글수 저장
$sql = " select bo_count_write, bo_count_comment from {$g5['board_table']} where bo_table = '$bo_table' ";
$row = sql_fetch($sql);
$sql = " update {$g5['board_table']} set bo_count_write = '{$row['bo_count_write']}', bo_count_comment = '{$row['bo_count_comment']}' where bo_table = '$target_table' ";
sql_query($sql, false);
// 4.00.01
$sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' ";
$result = sql_query($sql, false);
for ($i=0; $row=sql_fetch_array($result); $i++)
$file_copy[$i] = $row;
}
if (count($file_copy)) {
for ($i=0; $i<count($file_copy); $i++) {
$file_copy[$i] = run_replace('admin_copy_update_file', $file_copy[$i], $file_copy[$i]['bf_file'], $bo_table, $target_table);
$sql = " insert into {$g5['board_file_table']}
set bo_table = '$target_table',
wr_id = '{$file_copy[$i]['wr_id']}',
bf_no = '{$file_copy[$i]['bf_no']}',
bf_source = '".addslashes($file_copy[$i]['bf_source'])."',
bf_file = '{$file_copy[$i]['bf_file']}',
bf_download = '{$file_copy[$i]['bf_download']}',
bf_content = '".addslashes($file_copy[$i]['bf_content'])."',
bf_fileurl = '".addslashes($file_copy[$i]['bf_fileurl'])."',
bf_thumburl = '".addslashes($file_copy[$i]['bf_thumburl'])."',
bf_storage = '".addslashes($file_copy[$i]['bf_storage'])."',
bf_filesize = '{$file_copy[$i]['bf_filesize']}',
bf_width = '{$file_copy[$i]['bf_width']}',
bf_height = '{$file_copy[$i]['bf_height']}',
bf_type = '{$file_copy[$i]['bf_type']}',
bf_datetime = '{$file_copy[$i]['bf_datetime']}' ";
sql_query($sql, false);
}
}
/**
* 이윰게시판설정 복사
*/
if (isset($_POST['copy_config'])) {
if ($copy_config == '1') {
$res = sql_query("SHOW COLUMNS FROM {$g5['eyoom_board']}");
$k=0;
$eb_fields = array();
for ($i=0; $row=sql_fetch_array($res); $i++) {
if ($row['Field'] == 'bo_id' || $row['Field'] == 'bo_table') continue;
$eb_fields[$k] = $row['Field'];
$k++;
}
$fields = implode(',', $eb_fields);
$sql = "select {$fields} from {$g5['eyoom_board']} where bo_table = '{$bo_table}' ";
$result = sql_query($sql);
$insert = array();
for ($i=0; $row=sql_fetch_array($result); $i++) {
$eb_values = array();
foreach($eb_fields as $k => $field) {
$eb_values[$k] = "'{$row[$field]}'";
}
$values = implode(',', $eb_values);
$insert[$i] = "insert into {$g5['eyoom_board']} (bo_table, {$fields}) values ('{$target_table}',{$values})";
}
if (isset($insert)) {
$sql = implode(';', $insert);
sql_query($sql, false);
}
unset($insert);
}
/**
* 확장필드 정보 복사
*/
if ($board['bo_ex_cnt'] > 0) {
sql_query("delete from {$g5['eyoom_exboard']} where bo_table = '{$target_table}' ");
$result = sql_query("select * from {$g5['eyoom_exboard']} where (1) and bo_table = '{$bo_table}' order by ex_no asc ");
for($i=0; $row=sql_fetch_array($result); $i++) {
$insert = "insert into {$g5['eyoom_exboard']}
set bo_table = '$target_table',
ex_fname = '{$row['ex_fname']}',
ex_subject = '{$row['ex_subject']}',
ex_use_search = '{$row['ex_use_search']}',
ex_required = '{$row['ex_required']}',
ex_form = '{$row['ex_form']}',
ex_type = '{$row['ex_type']}',
ex_length = '{$row['ex_length']}',
ex_default = '{$row['ex_default']}',
ex_item_value = '{$row['ex_item_value']}' ";
sql_query($insert, false);
}
}
}
delete_cache_latest($bo_table);
delete_cache_latest($target_table);
echo "<script>top.document.location.reload();</script>";
@@ -0,0 +1,24 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_excode.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
auth_check_menu($auth, $sub_menu, 'w');
$ex_no = clean_xss_tags(trim($_GET['ex_no']));
if (!$board || !$ex_no) {
alert("잘못된 접근입니다.");
}
/**
* 확장필드의 정보 가져오기
*/
$exinfo = sql_fetch("select * from {$g5['eyoom_exboard']} where (1) and ex_no = '{$ex_no}' and bo_table = '{$board['bo_table']}' ");
if ($exinfo['ex_item_value']) {
$exitem = explode('|', $exinfo['ex_item_value']);
}
@@ -0,0 +1,37 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_exform.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
auth_check_menu($auth, $sub_menu, 'w');
if ($is_admin != 'super') alert('최고관리자만 접근 가능합니다.');
if (!$board) alert("잘못된 접근입니다.");
if ($eyoom_board['use_gnu_skin'] == 'y') {
alert("게시판 확장필드 기능은 그누보드스킨에서는 사용하실 수 없습니다.");
}
$action_url1 = G5_ADMIN_URL . '/?dir=board&amp;pid=board_exform_update&amp;smode=1';
if ($w == '') {
$exinfo = array();
$num = $board['bo_ex_cnt'] + 1;
$exinfo['ex_fname'] = EYOOM_EXBOARD_PREFIX . $num;
} else if ($w == 'u') {
$ex_no = clean_xss_tags(trim($_GET['ex_no']));
if (!$ex_no) alert("잘못된 접근입니다.");
$exinfo = sql_fetch("select * from {$g5['eyoom_exboard']} where (1) and ex_no = '{$ex_no}' and bo_table = '{$board['bo_table']}' ");
}
/**
* 버튼셋
*/
$frm_submit = ' <div class="text-center margin-top-30 margin-bottom-30"> ';
$frm_submit .= ' <input type="submit" value="확장필드 적용하기" id="btn_submit" class="btn-e btn-e-lg btn-e-red" accesskey="s">' ;
$frm_submit .= ' </div>';
@@ -0,0 +1,168 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_exform_update.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
if ($w == 'u')
check_demo();
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$bo_ex_cnt = clean_xss_tags(trim($_POST['bo_ex_cnt']));
$ex_no = clean_xss_tags(trim($_POST['ex_no']));
$ex_fname = clean_xss_tags(trim($_POST['ex_fname']));
$ex_subject = clean_xss_tags(trim($_POST['ex_subject']));
$ex_use_search = clean_xss_tags(trim($_POST['ex_use_search']));
$ex_form = clean_xss_tags(trim($_POST['ex_form']));
$ex_form_old = clean_xss_tags(trim($_POST['ex_form_old']));
$ex_required = clean_xss_tags(trim($_POST['ex_required']));
$ex_type = clean_xss_tags(trim($_POST['ex_type']));
$ex_type_old = clean_xss_tags(trim($_POST['ex_type_old']));
$ex_length = clean_xss_tags(trim($_POST['ex_length']));
$ex_length_old = clean_xss_tags(trim($_POST['ex_length_old']));
$ex_default = clean_xss_tags(trim($_POST['ex_default']));
$ex_item_value = clean_xss_tags(trim($_POST['ex_item_value']));
if ($bo_ex_cnt != $board['bo_ex_cnt']) {
alert("잘못된 접근입니다.");
} else {
$write_table = $g5['write_prefix'] . $board['bo_table'];
}
$add_set = "";
$_default = "";
if (!$ex_length) $ex_length = 255;
if ($ex_default != null) $_default = " default '".$ex_default."' ";
if ($w == '') {
// 필드 입력값
$set_info = "
bo_table = '{$board['bo_table']}',
ex_fname = '{$ex_fname}',
ex_subject = '{$ex_subject}',
ex_use_search = '{$ex_use_search}',
ex_form = '{$ex_form}',
ex_required = '{$ex_required}',
ex_type = '{$ex_type}',
ex_length = '{$ex_length}',
ex_default = '{$ex_default}',
ex_item_value = '{$ex_item_value}'
";
// 확장필드 관리 레코드 추가
$sql = " insert into {$g5['eyoom_exboard']} set {$set_info}";
sql_query($sql, true);
// $write_table의 마지막 컬럼에 확장필드 추가
if ($ex_type) {
switch($ex_type) {
case 'varchar': $add_set = "varchar({$ex_length}) not null {$_default} "; break;
case 'char': $add_set = "char({$ex_length}) not null {$_default} "; break;
case 'int': $add_set = "int({$ex_length}) not null {$_default} "; break;
case 'text': $add_set = "text not null"; break;
}
} else if ($ex_form == 'address' || $ex_form == 'textarea') {
$add_set = "text not null";
}
$sql = " alter table `{$write_table}` add `{$ex_fname}` {$add_set} ";
sql_query($sql, true);
// 최종 확장필드 갯수
$sql = "SHOW COLUMNS FROM {$write_table} LIKE 'ex_%'";
$res = sql_query($sql);
$ex = array();
for($i=0; $row=sql_fetch_array($res); $i++) {
$ex[$i] = $row['Field'];
}
$bo_ex_cnt = count($ex);
// 확장필드 카운트수 증가
sql_query("update {$g5['board_table']} set bo_ex_cnt = '{$bo_ex_cnt}' where bo_table = '{$board['bo_table']}' ");
$msg = "확장필드를 정상적으로 추가하였습니다.";
} else if ($w == 'u') {
$alter_yn = false;
if ($ex_form != $ex_form_old) {
$alter_yn = true;
$set_form = ", ex_form = '{$ex_form}' ";
switch ($ex_form) {
case 'text': $ex_item_value = ''; break;
case 'textarea':
case 'address':
$ex_length = '';
$ex_default = '';
$ex_item_value = '';
$ex_type = 'text';
break;
}
}
if ($ex_type != $ex_type_old) {
$alter_yn = true;
$set_type = ", ex_type = '{$ex_type}' ";
}
if ($ex_length != $ex_length_old) {
$alter_yn = true;
$set_length = ", ex_length = '{$ex_length}' ";
}
if ($ex_default != $ex_default_old) {
$alter_yn = true;
$set_default = ", ex_default = '{$ex_default}' ";
}
/**
* 필드 입력값
*/
$set_info = "
bo_table = '{$board['bo_table']}',
ex_fname = '{$ex_fname}',
ex_subject = '{$ex_subject}',
ex_use_search = '{$ex_use_search}',
ex_required = '{$ex_required}',
ex_item_value = '{$ex_item_value}'
{$set_form}
{$set_type}
{$set_length}
{$set_default}
";
/**
* 확장필드 관리 레코드 정보 업데이트
*/
$sql = " update {$g5['eyoom_exboard']} set {$set_info} where ex_no = '{$ex_no}' and bo_table = '{$board['bo_table']}' ";
sql_query($sql, true);
if ($alter_yn) {
// $write_table의 마지막 컬럼에 확장필드 추가
if ($ex_type) {
switch($ex_type) {
case 'varchar': $change_set = "varchar({$ex_length}) not null {$_default} "; break;
case 'char': $change_set = "char({$ex_length}) not null {$_default} "; break;
case 'int': $change_set = "int({$ex_length}) not null {$_default} "; break;
case 'text': $change_set = "text not null"; break;
}
}
if ($ex_form == 'address' || $ex_form == 'textarea') {
$change_set = "text not null";
}
$sql = " alter table `{$write_table}` change `{$ex_fname}` `{$ex_fname}` {$change_set} ";
sql_query($sql, true);
}
$msg = "확장필드를 정상적으로 수정하였습니다.";
}
if ($iw == '') {
echo "
<script>alert('{$msg}');window.parent.closeModal();</script>
";
}
@@ -0,0 +1,108 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_exlist_update.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
check_demo();
$post_count_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
$chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? $_POST['chk'] : array();
$act_button = isset($_POST['act_button']) ? strip_tags($_POST['act_button']) : '';
$board_table = (isset($_POST['board_table']) && is_array($_POST['board_table'])) ? $_POST['board_table'] : array();
if (! $post_count_chk) {
alert($act_button." 하실 항목을 하나 이상 체크하세요.");
}
check_admin_token();
if ($_POST['act_button'] == "선택수정") {
auth_check_menu($auth, $sub_menu, 'w');
for ($i=0; $i<$post_count_chk; $i++) {
unset($ex_use_search, $ex_required);
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$ex_use_search = $_POST['ex_use_search'][$k] == 'y' ? 'y':'n';
$ex_required = $_POST['ex_required'][$k] == 'y' ? 'y':'n';
$ex_subject = isset($_POST['ex_subject'][$k]) ? clean_xss_tags($_POST['ex_subject'][$k], 1, 1) : '';
$ex_no = isset($_POST['ex_no'][$k]) ? (int) $_POST['ex_no'][$k] : 0;
$post_board_table = isset($_POST['board_table'][$k]) ? clean_xss_tags($_POST['board_table'][$k], 1, 1) : '';
$sql = " update {$g5['eyoom_exboard']} set
ex_subject = '{$ex_subject}',
ex_use_search = '{$ex_use_search}',
ex_required = '{$ex_required}'
where ex_no = '{$ex_no}' and bo_table = '{$post_board_table}' ";
sql_query($sql);
}
$msg = "정상적으로 수정하였습니다.";
if (!$page) $page = 1;
$qstr = "page={$page}";
} else if ($_POST['act_button'] == "선택삭제") {
auth_check_menu($auth, $sub_menu, 'd');
$write_table = $g5['write_prefix'] . $board['bo_table'];
$del_count = count((array)$_POST['chk']);
$del_ex_no = array();
for ($i=0; $i<$del_count; $i++) {
unset($ex_fname);
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$del_ex_no[$i] = isset($_POST['ex_no'][$k]) ? (int) $_POST['ex_no'][$k] : 0;
$ex_fname = isset($_POST['ex_fname'][$k]) ? clean_xss_tags($_POST['ex_fname'][$k]) : '';
$sql = " alter table `{$write_table}` drop `{$ex_fname}`";
sql_query($sql, true);
}
/**
* 쿼리 조건문
*/
$where = " find_in_set(ex_no, '".implode(',', $del_ex_no)."') and bo_table = '{$_POST['bo_table']}' ";
/**
* 확장필드 테이블 레코드 삭제
*/
$sql = "delete from {$g5['eyoom_exboard']} where {$where} ";
sql_query($sql);
// 최종 확장필드 갯수
$sql = "SHOW COLUMNS FROM {$write_table} LIKE 'ex_%'";
$res = sql_query($sql);
$ex = array();
for($i=0; $row=sql_fetch_array($res); $i++) {
$ex[$i] = $row['Field'];
}
$bo_ex_cnt = count($ex);
sql_query("update {$g5['board_table']} set bo_ex_cnt = '{$bo_ex_cnt}' where bo_table = '{$_POST['bo_table']}' ");
$msg = "선택한 확장필드를 정상적으로 삭제하였습니다.";
}
// query string
$qstr .= $grid ? '&amp;grid='.$grid: '';
$qstr .= $boskin ? '&amp;boskin='.$boskin: '';
$qstr .= $bomobileskin ? '&amp;bomobileskin='.$bomobileskin: '';
$qstr .= $bo_ex ? '&amp;bo_ex='.$bo_ex: '';
$qstr .= $bo_cate ? '&amp;bo_cate='.$bo_cate: '';
$qstr .= $bo_sideview ? '&amp;bo_sideview='.$bo_sideview: '';
$qstr .= $bo_dhtml ? '&amp;bo_dhtml='.$bo_dhtml: '';
$qstr .= $bo_secret ? '&amp;bo_secret='.$bo_secret: '';
$qstr .= $bo_good ? '&amp;bo_good='.$bo_good: '';
$qstr .= $bo_nogood ? '&amp;bo_nogood='.$bo_nogood: '';
$qstr .= $bo_file ? '&amp;bo_file='.$bo_file: '';
$qstr .= $bo_cont ? '&amp;bo_cont='.$bo_cont: '';
$qstr .= $bo_list ? '&amp;bo_list='.$bo_list: '';
$qstr .= $bo_sns ? '&amp;bo_sns='.$bo_sns: '';
alert($msg, G5_ADMIN_URL . "/?dir=board&amp;pid=board_extend&amp;bo_table={$_POST['bo_table']}&amp;{$qstr}");
@@ -0,0 +1,126 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_extend.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
auth_check_menu($auth, $sub_menu, 'w');
if ($is_admin != 'super') alert('최고관리자만 접근 가능합니다.');
if (!$board) alert("잘못된 접근입니다.");
if ($eyoom_board['use_gnu_skin'] == 'y') {
alert("게시판 확장필드 기능은 그누보드스킨에서는 사용하실 수 없습니다.");
}
$action_url1 = G5_ADMIN_URL . '/?dir=board&amp;pid=board_extend_update&amp;smode=1';
$action_url2 = G5_ADMIN_URL . '/?dir=board&amp;pid=board_exlist_update&amp;smode=1';
/**
* 탭메뉴
*/
$pg_anchor = array(
'anc_bo_basic' => '기본 설정',
'anc_bo_auth' => '권한 설정',
'anc_bo_function' => '기능 설정',
'anc_bo_design' => '디자인/양식',
'anc_bo_point' => '포인트 설정',
'anc_bo_exfields' => '여분필드'
);
/**
* 게시판 확장필드 테이블 생성
*/
$sql = "
CREATE TABLE IF NOT EXISTS `" . $g5['eyoom_exboard'] . "` (
`ex_no` int(11) unsigned NOT NULL auto_increment,
`bo_table` varchar(20) NOT NULL,
`ex_fname` varchar(10) NOT NULL,
`ex_subject` varchar(50) NOT NULL,
`ex_use_search` enum('y','n') NOT NULL default 'n',
`ex_required` enum('y','n') NOT NULL default 'n',
`ex_form` varchar(20) NOT NULL default 'text',
`ex_type` varchar(20) NOT NULL,
`ex_length` mediumint(5) NOT NULL,
`ex_default` varchar(255) NOT NULL,
`ex_item_value` text NOT NULL,
PRIMARY KEY (`ex_no`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
";
$sql = get_db_create_replace($sql);
sql_query($sql, true);
/**
* 배너 테이블에서 작업테마의 배너/광고 레코드 정보 가져오기
*/
$sql_common = " from {$g5['eyoom_exboard']} ";
/**
* 작업테마 조건문
*/
$sql_search = " where bo_table='{$board['bo_table']}' ";
/**
* 출력순서
*/
$sql_order = " order by ex_no asc ";
$sql = " select * {$sql_common} {$sql_search} {$sql_order}";
$result = sql_query($sql);
$list = array();
for ($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i] = $row;
switch($row['ex_form']) {
case 'text':
$list[$i]['form'] = "&lt;input type='<strong class='color-red'>text</strong>' name='{$row['ex_fname']}'&gt;";
break;
case 'radio':
$list[$i]['form'] = "&lt;input type='<strong class='color-red'>radio</strong>' name='{$row['ex_fname']}'&gt;";
break;
case 'checkbox':
$list[$i]['form'] = "&lt;input type='<strong class='color-red'>checkbox</strong>' name='{$row['ex_fname']}'&gt;";
break;
case 'select':
$list[$i]['form'] = "&lt;<strong class='color-red'>select</strong> name='{$row['ex_fname']}'&gt;";
break;
case 'textarea':
$list[$i]['form'] = "&lt;<strong class='color-red'>textarea</strong> name='{$row['ex_fname']}'&gt;";
break;
case 'address':
$list[$i]['form'] = "<strong class='color-red'>address</strong>";
break;
}
}
// query string
$qstr .= $grid ? '&amp;grid='.$grid: '';
$qstr .= $boskin ? '&amp;boskin='.$boskin: '';
$qstr .= $bomobileskin ? '&amp;bomobileskin='.$bomobileskin: '';
$qstr .= $bo_ex ? '&amp;bo_ex='.$bo_ex: '';
$qstr .= $bo_cate ? '&amp;bo_cate='.$bo_cate: '';
$qstr .= $bo_sideview ? '&amp;bo_sideview='.$bo_sideview: '';
$qstr .= $bo_dhtml ? '&amp;bo_dhtml='.$bo_dhtml: '';
$qstr .= $bo_secret ? '&amp;bo_secret='.$bo_secret: '';
$qstr .= $bo_good ? '&amp;bo_good='.$bo_good: '';
$qstr .= $bo_nogood ? '&amp;bo_nogood='.$bo_nogood: '';
$qstr .= $bo_file ? '&amp;bo_file='.$bo_file: '';
$qstr .= $bo_cont ? '&amp;bo_cont='.$bo_cont: '';
$qstr .= $bo_list ? '&amp;bo_list='.$bo_list: '';
$qstr .= $bo_sns ? '&amp;bo_sns='.$bo_sns: '';
$qstr .= $wmode ? '&amp;wmode=1': '';
/**
* 버튼셋
*/
$frm_submit = ' <div class="text-center margin-top-30 margin-bottom-30"> ';
$frm_submit .= ' <input type="submit" value="일괄추가" class="btn-e btn-e-lg btn-e-red" accesskey="s">' ;
$frm_submit .= !$wmode ? ' <a href="' . G5_ADMIN_URL . '/?dir=board&amp;pid=board_list&amp;'.$qstr.'" class="btn-e btn-e-lg btn-e-dark">목록</a> ': '';
$frm_submit .= '</div>';
@@ -0,0 +1,91 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_extend_update.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
if ($w == 'u')
check_demo();
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$bo_ex_cnt = clean_xss_tags(trim($_POST['bo_ex_cnt']));
$bo_exadd = clean_xss_tags(trim($_POST['bo_exadd']));
if ($bo_ex_cnt != $board['bo_ex_cnt']) {
alert("잘못된 접근입니다.");
} else {
$write_table = $g5['write_prefix'] . $board['bo_table'];
}
if ($eyoom_board['use_gnu_skin'] == 'y') {
alert("게시판 확장필드 기능은 그누보드스킨에서는 사용하실 수 없습니다.");
}
// 확장필드를 게시판 테이블에 추가하기
$add_set = array();
$k = $bo_ex_cnt + 1;
$add_set = array();
for($i=0; $i<$bo_exadd; $i++) {
unset($ex_fname, $set_info, $insert);
$ex_fname = EYOOM_EXBOARD_PREFIX . $k;
$j = $k - 1;
if ($k == 1) {
$add_set[$i] = " ADD `{$ex_fname}` VARCHAR(255) NOT NULL default '' ";
} else {
$after_fields = EYOOM_EXBOARD_PREFIX . $j;
$add_set[$i] = " ADD `{$ex_fname}` VARCHAR(255) NOT NULL default '' AFTER `{$after_fields}`";
}
$set_info = "
bo_table = '{$board['bo_table']}',
ex_fname = '{$ex_fname}',
ex_subject = '확장필드 {$k}',
ex_form = 'text',
ex_type = 'varchar',
ex_length = '255'
";
$insert = "insert into {$g5['eyoom_exboard']} set {$set_info}";
sql_query($insert);
$k++;
}
$add_fields = implode(',', $add_set);
$sql = " ALTER TABLE `{$write_table}` {$add_fields} ";
sql_query($sql, true);
// 최종 추가된 확장필드 갯수
$sql = "SHOW COLUMNS FROM {$write_table} LIKE 'ex_%'";
$res = sql_query($sql);
$ex = array();
for($i=0; $row=sql_fetch_array($res); $i++) {
$ex[$i] = $row['Field'];
}
$bo_ex_cnt = count($ex);
sql_query("update {$g5['board_table']} set bo_ex_cnt = '{$bo_ex_cnt}' where bo_table = '{$board['bo_table']}' ");
// query string
$qstr .= $grid ? '&amp;grid='.$grid: '';
$qstr .= $boskin ? '&amp;boskin='.$boskin: '';
$qstr .= $bomobileskin ? '&amp;bomobileskin='.$bomobileskin: '';
$qstr .= $bo_ex ? '&amp;bo_ex='.$bo_ex: '';
$qstr .= $bo_cate ? '&amp;bo_cate='.$bo_cate: '';
$qstr .= $bo_sideview ? '&amp;bo_sideview='.$bo_sideview: '';
$qstr .= $bo_dhtml ? '&amp;bo_dhtml='.$bo_dhtml: '';
$qstr .= $bo_secret ? '&amp;bo_secret='.$bo_secret: '';
$qstr .= $bo_good ? '&amp;bo_good='.$bo_good: '';
$qstr .= $bo_nogood ? '&amp;bo_nogood='.$bo_nogood: '';
$qstr .= $bo_file ? '&amp;bo_file='.$bo_file: '';
$qstr .= $bo_cont ? '&amp;bo_cont='.$bo_cont: '';
$qstr .= $bo_list ? '&amp;bo_list='.$bo_list: '';
$qstr .= $bo_sns ? '&amp;bo_sns='.$bo_sns: '';
$qstr .= $wmode ? '&amp;wmode=1': '';
alert("정상적으로 확장필드를 일괄 추가하였습니다. 세부 설정을 해주세요.", G5_ADMIN_URL . "/?dir=board&amp;pid=board_extend&amp;bo_table={$board['bo_table']}&amp{$qstr}");
@@ -0,0 +1,321 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_list.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
$action_url1 = G5_ADMIN_URL . '/?dir=board&amp;pid=board_form_update&amp;smode=1';
require_once G5_EDITOR_LIB;
/**
* 테마 환경설정 파일
*/
include_once(EYOOM_ADMIN_CORE_PATH . "/theme/theme_head.php");
auth_check_menu($auth, $sub_menu, 'w');
$sql = " select count(*) as cnt from {$g5['group_table']} ";
$row = sql_fetch($sql);
if (!$row['cnt']) {
alert('게시판그룹이 한개 이상 생성되어야 합니다.', './boardgroup_form.php');
}
$html_title = '게시판';
if (!isset($board['bo_device'])) {
// 게시판 사용 필드 추가
// both : pc, mobile 둘다 사용
// pc : pc 전용 사용
// mobile : mobile 전용 사용
// none : 사용 안함
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_device` ENUM( 'both', 'pc', 'mobile' ) NOT NULL DEFAULT 'both' AFTER `bo_subject` ", false);
}
if (!isset($board['bo_mobile_skin'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_skin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bo_skin` ", false);
}
if (!isset($board['bo_gallery_width'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_gallery_width` INT NOT NULL AFTER `bo_gallery_cols`, ADD `bo_gallery_height` INT NOT NULL DEFAULT '0' AFTER `bo_gallery_width`, ADD `bo_mobile_gallery_width` INT NOT NULL DEFAULT '0' AFTER `bo_gallery_height`, ADD `bo_mobile_gallery_height` INT NOT NULL DEFAULT '0' AFTER `bo_mobile_gallery_width` ", false);
}
if (!isset($board['bo_mobile_subject_len'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_subject_len` INT(11) NOT NULL DEFAULT '0' AFTER `bo_subject_len` ", false);
}
if (!isset($board['bo_mobile_page_rows'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_page_rows` INT(11) NOT NULL DEFAULT '0' AFTER `bo_page_rows` ", false);
}
if (!isset($board['bo_mobile_content_head'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_content_head` TEXT NOT NULL AFTER `bo_content_head`, ADD `bo_mobile_content_tail` TEXT NOT NULL AFTER `bo_content_tail`", false);
}
if (!isset($board['bo_use_cert'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_use_cert` ENUM('','cert','adult') NOT NULL DEFAULT '' AFTER `bo_use_email` ", false);
}
if (!isset($board['bo_use_sns'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_use_sns` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_cert` ", false);
$result = sql_query(" select bo_table from `{$g5['board_table']}` ");
for ($i=0; $row=sql_fetch_array($result); $i++) {
sql_query(
" ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}`
ADD `wr_facebook_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_ip`,
ADD `wr_twitter_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_facebook_user` ", false
);
}
}
$sql = " SHOW COLUMNS FROM `{$g5['board_table']}` LIKE 'bo_use_cert' ";
$row = sql_fetch($sql);
if (strpos($row['Type'], 'hp-') === false) {
sql_query(" ALTER TABLE `{$g5['board_table']}` CHANGE `bo_use_cert` `bo_use_cert` ENUM('','cert','adult','hp-cert','hp-adult') NOT NULL DEFAULT '' ", false);
}
if (!isset($board['bo_use_list_file'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_use_list_file` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_list_view` ", false);
$result = sql_query(" select bo_table from `{$g5['board_table']}` ");
for ($i=0; $row=sql_fetch_array($result); $i++) {
sql_query(
" ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}`
ADD `wr_file` TINYINT NOT NULL DEFAULT '0' AFTER `wr_datetime` ", false
);
}
}
if (!isset($board['bo_mobile_subject'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_subject` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bo_subject` ", false);
}
if (!isset($board['bo_use_captcha'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_use_captcha` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_sns` ", false);
}
if (!isset($board['bo_select_editor'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_select_editor` VARCHAR(50) NOT NULL DEFAULT '' AFTER `bo_use_dhtml_editor` ", false);
}
if (!isset($board['bo_point_target'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_point_target` VARCHAR(10) NOT NULL DEFAULT 'gnu' AFTER `bo_count_modify` ", false);
}
if (isset($eyoom_board['bo_use_summernote_mo'])) {
sql_query(" ALTER TABLE `{$g5['eyoom_board']}` CHANGE `bo_use_summernote_mo` `bo_goto_url` VARCHAR(255) NULL", false);
sql_query(" UPDATE `{$g5['eyoom_board']}` SET `bo_goto_url` = '' ", false);
}
if (!isset($board['bo_poll_level'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_poll_level` tinyint(4) NOT NULL DEFAULT '1' AFTER `bo_html_level` ", false);
}
/**
* 회원당 하루 게시물 작성회수 설정 필드 추가
*/
if(!isset($board['bo_use_wrlimit'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_use_wrlimit` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_captcha` ", false);
}
$board_default = array(
'bo_mobile_subject'=>'',
'bo_device'=>'',
'bo_use_category'=>0,
'bo_category_list'=>'',
'bo_admin'=>'',
'bo_list_level'=>0,
'bo_read_level'=>0,
'bo_write_level'=>0,
'bo_reply_level'=>0,
'bo_comment_level'=>0,
'bo_link_level'=>0,
'bo_upload_level'=>0,
'bo_download_level'=>0,
'bo_html_level'=>0,
'bo_poll_level'=>0,
'bo_use_sideview'=>0,
'bo_select_editor'=>'',
'bo_use_rss_view'=>0,
'bo_use_good'=>0,
'bo_use_nogood'=>0,
'bo_use_name'=>0,
'bo_use_signature'=>0,
'bo_use_ip_view'=>0,
'bo_use_list_content'=>0,
'bo_use_list_file'=>0,
'bo_use_list_view'=>0,
'bo_use_email'=>0,
'bo_use_file_content'=>0,
'bo_use_cert'=>'',
'bo_write_min'=>0,
'bo_write_max'=>0,
'bo_comment_min'=>0,
'bo_comment_max'=>0,
'bo_use_sns'=>0,
'bo_order'=>0,
'bo_use_captcha'=>0,
'bo_content_head'=>'',
'bo_content_tail'=>'',
'bo_mobile_content_head'=>'',
'bo_mobile_content_tail'=>'',
'bo_insert_content'=>'',
'bo_sort_field'=>'',
);
for ($i = 0; $i <= 10; $i++) {
$board_default['bo_'.$i.'_subj'] = '';
$board_default['bo_'.$i] = '';
}
$board = array_merge($board_default, $board);
run_event('adm_board_form_before', $board, $w);
$required = "";
$readonly = "";
$sound_only = "";
$required_valid = "";
if ($w == '') {
$html_title .= ' 생성';
unset($eyoom_board);
$eyoom_board['use_gnu_skin'] = 'n';
$eyoom_board['bo_skin'] = 'basic';
$required = 'required';
$required_valid = 'alnum_';
$sound_only = '<strong class="sound_only">필수</strong>';
$board['bo_count_delete'] = 1;
$board['bo_count_modify'] = 1;
$board['bo_read_point'] = $config['cf_read_point'];
$board['bo_write_point'] = $config['cf_write_point'];
$board['bo_comment_point'] = $config['cf_comment_point'];
$board['bo_download_point'] = $config['cf_download_point'];
$board['bo_gallery_cols'] = 4;
$board['bo_gallery_width'] = 202;
$board['bo_gallery_height'] = 150;
$board['bo_mobile_gallery_width'] = 125;
$board['bo_mobile_gallery_height'] = 100;
$board['bo_table_width'] = 100;
$board['bo_page_rows'] = $config['cf_page_rows'];
$board['bo_mobile_page_rows'] = $config['cf_page_rows'];
$board['bo_subject_len'] = 60;
$board['bo_mobile_subject_len'] = 30;
$board['bo_new'] = 24;
$board['bo_hot'] = 100;
$board['bo_image_width'] = 600;
$board['bo_upload_count'] = 2;
$board['bo_upload_size'] = 1048576;
$board['bo_reply_order'] = 1;
$board['bo_use_search'] = 1;
$board['bo_skin'] = 'basic';
$board['bo_mobile_skin'] = 'basic';
$board['gr_id'] = $gr_id;
$board['bo_use_secret'] = 0;
$board['bo_include_head'] = '_head.php';
$board['bo_include_tail'] = '_tail.php';
} elseif ($w == 'u') {
$html_title .= ' 수정';
if (!$board['bo_table']) {
alert('존재하지 않은 게시판 입니다.');
}
if ($is_admin == 'group') {
if ($member['mb_id'] != $group['gr_admin']) {
alert('그룹이 틀립니다.');
}
}
$readonly = 'readonly';
}
if ($is_admin != 'super') {
$group = get_group($board['gr_id']);
$is_admin = is_admin($member['mb_id']);
}
$g5['title'] = $html_title;
/**
* 탭메뉴
*/
$pg_anchor = array(
'anc_bo_basic' => '기본 설정',
'anc_bo_auth' => '권한 설정',
'anc_bo_function' => '기능 설정',
'anc_bo_design' => '디자인/양식',
'anc_bo_point' => '포인트 설정',
'anc_bo_exfields' => '여분필드'
);
$board_auth = array(
'list' => '목록보기',
'read' => '글읽기',
'write' => '글쓰기',
'reply' => '글답변',
'comment' => '댓글쓰기',
'link' => '링크',
'upload' => '업로드',
'download' => '다운로드',
'html' => 'HTML 쓰기',
'poll' => '투표하기'
);
$i = 0;
foreach($board_auth as $key => $val) {
$bo_auth[$i]['item'] = $key;
$bo_auth[$i]['text'] = $val;
$bo_auth[$i]['field'] = "bo_{$key}_level";
$bo_auth[$i]['level'] = $board["bo_{$key}_level"];
$i++;
}
/**
* 이윰 게시판 스킨
*/
$bo_eyoom_skin = get_skin_dir('board',G5_PATH.'/theme/'.$this_theme.'/skin');
/**
* 게시물 랜덤노출 기능 추가
*/
$bo_sort_fields = get_board_sort_fields($board);
$bo_sort_rand = array("rand()","랜덤");
$bo_sort_fields = $eb->insert_array($bo_sort_fields, 1, $bo_sort_rand);
// query string
$qstr .= $gr_id ? '&amp;gr_id='.$gr_id: '';
$qstr .= $bo_skin ? '&amp;bo_skin='.$bo_skin: '';
$qstr .= $bo_mobile_skin ? '&amp;bo_mobile_skin='.$bo_mobile_skin: '';
$qstr .= $bo_ex ? '&amp;bo_ex='.$bo_ex: '';
$qstr .= $bo_cate ? '&amp;bo_cate='.$bo_cate: '';
$qstr .= $bo_sideview ? '&amp;bo_sideview='.$bo_sideview: '';
$qstr .= $bo_dhtml ? '&amp;bo_dhtml='.$bo_dhtml: '';
$qstr .= $bo_secret ? '&amp;bo_secret='.$bo_secret: '';
$qstr .= $bo_good ? '&amp;bo_good='.$bo_good: '';
$qstr .= $bo_nogood ? '&amp;bo_nogood='.$bo_nogood: '';
$qstr .= $bo_file ? '&amp;bo_file='.$bo_file: '';
$qstr .= $bo_cont ? '&amp;bo_cont='.$bo_cont: '';
$qstr .= $bo_list ? '&amp;bo_list='.$bo_list: '';
$qstr .= $bo_sns ? '&amp;bo_sns='.$bo_sns: '';
$qstr .= $wmode ? '&amp;wmode=1': '';
/**
* 버튼
*/
$frm_submit_fixed = ' <input type="submit" value="확인" class="admin-fixed-submit-btn btn-e btn-e-red" accesskey="s">' ;
$frm_submit = ' <div class="text-center margin-top-30 margin-bottom-30"> ';
$frm_submit .= ' <input type="submit" value="확인" class="btn-e btn-e-lg btn-e-red" accesskey="s">' ;
if ($bo_table && $w && !$wmode) {
$frm_submit .= ' <a href="'.G5_ADMIN_URL.'/?dir=board&amp;pid=board_copy&amp;bo_table='.$board['bo_table'].'&amp;wmode=1" onclick="eb_modal(this.href); return false;" class="btn-e btn-e-lg btn-e-dark">게시판복사</a> <a href="'.get_eyoom_pretty_url($board['bo_table']).'" class="btn-e btn-e-lg btn-e-dark" target="_blank">게시판 바로가기</a> <a href="'.G5_ADMIN_URL.'/?dir=board&amp;pid=board_thumbnail_delete&amp;bo_table='.$board['bo_table'].'&amp;'.$qstr.'" onclick="return delete_confirm2(\"게시판 썸네일 파일을 삭제하시겠습니까?\");" class="btn-e btn-e-lg btn-e-dark">게시판 썸네일 삭제</a>';
}
if (!$wmode) {
$frm_submit .= ' <a href="' . G5_ADMIN_URL . '/?dir=board&amp;pid=board_list&amp;'.$qstr.'" class="btn-e btn-e-lg btn-e-dark">목록</a> ';
}
$frm_submit .= '</div>';
@@ -0,0 +1,704 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_form_update.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
if ($w == 'u') {
check_demo();
}
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$gr_id = isset($_POST['gr_id']) ? preg_replace('/[^a-z0-9_]/i', '', (string)$_POST['gr_id']) : '';
$bo_admin = isset($_POST['bo_admin']) ? preg_replace('/[^a-z0-9_\, \|\#]/i', '', $_POST['bo_admin']) : '';
$bo_subject = isset($_POST['bo_subject']) ? strip_tags(clean_xss_attributes($_POST['bo_subject'])) : '';
$bo_mobile_subject = isset($_POST['bo_mobile_subject']) ? strip_tags(clean_xss_attributes($_POST['bo_mobile_subject'])) : '';
if (!$gr_id) {
alert('그룹 ID는 반드시 선택하세요.');
}
if (!$bo_table) {
alert('게시판 TABLE명은 반드시 입력하세요.');
}
if (!preg_match("/^([A-Za-z0-9_]{1,20})$/", $bo_table)) {
alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)');
}
if (!$bo_subject) {
alert('게시판 제목을 입력하세요.');
}
// 게시판명이 금지된 단어로 되어 있으면
if ($w == '' && in_array($bo_table, get_bo_table_banned_word())) {
alert('입력한 게시판 TABLE명을 사용할수 없습니다. 다른 이름으로 입력해 주세요.');
}
$bo_include_head = isset($_POST['bo_include_head']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['bo_include_head'], 0, 255)) : '';
$bo_include_tail = isset($_POST['bo_include_tail']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['bo_include_tail'], 0, 255)) : '';
// 관리자가 자동등록방지를 사용해야 할 경우
if ($board && (isset($board['bo_include_head']) && $board['bo_include_head'] !== $bo_include_head || $board['bo_include_tail'] !== $bo_include_tail) && function_exists('get_admin_captcha_by') && get_admin_captcha_by()) {
include_once(G5_CAPTCHA_PATH . '/captcha.lib.php');
if (!chk_captcha()) {
alert('자동등록방지 숫자가 틀렸습니다.');
}
}
if ($file = $bo_include_head) {
$file_ext = pathinfo($file, PATHINFO_EXTENSION);
if (!$file_ext || !in_array($file_ext, array('php', 'htm', 'html')) || !preg_match('/^.*\.(php|htm|html)$/i', $file)) {
alert('상단 파일 경로의 확장자는 php, htm, html 만 허용합니다.');
}
}
if ($file = $bo_include_tail) {
$file_ext = pathinfo($file, PATHINFO_EXTENSION);
if (!$file_ext || !in_array($file_ext, array('php', 'htm', 'html')) || !preg_match('/^.*\.(php|htm|html)$/i', $file)) {
alert('하단 파일 경로의 확장자는 php, htm, html 만 허용합니다.');
}
}
if (!is_include_path_check($bo_include_head, 1)) {
alert('상단 파일 경로에 포함시킬수 없는 문자열이 있습니다.');
}
if (!is_include_path_check($bo_include_tail, 1)) {
alert('하단 파일 경로에 포함시킬수 없는 문자열이 있습니다.');
}
if (function_exists('filter_input_include_path')) {
$bo_include_head = filter_input_include_path($bo_include_head);
$bo_include_tail = filter_input_include_path($bo_include_tail);
}
$board_path = G5_DATA_PATH . '/file/' . $bo_table;
// 게시판 디렉토리 생성
@mkdir($board_path, G5_DIR_PERMISSION);
@chmod($board_path, G5_DIR_PERMISSION);
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$file = $board_path . '/index.php';
if ($f = @fopen($file, 'w')) {
@fwrite($f, '');
@fclose($f);
@chmod($file, G5_FILE_PERMISSION);
}
// 분류에 & 나 = 는 사용이 불가하므로 2바이트로 바꾼다.
$src_char = array('&', '=');
$dst_char = array('', '〓');
$bo_category_list = isset($_POST['bo_category_list']) ? str_replace($src_char, $dst_char, $_POST['bo_category_list']) : '';
//https://github.com/gnuboard/gnuboard5/commit/f5f4925d4eb28ba1af728e1065fc2bdd9ce1da58 에 따른 조치
$str_bo_category_list = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\/\^\*]/", "", (string)$bo_category_list);
$bo_use_category = isset($_POST['bo_use_category']) ? (int) $_POST['bo_use_category'] : 0;
$bo_use_sideview = isset($_POST['bo_use_sideview']) ? (int) $_POST['bo_use_sideview'] : 0;
$bo_use_dhtml_editor = isset($_POST['bo_use_dhtml_editor']) ? (int) $_POST['bo_use_dhtml_editor'] : 0;
$bo_use_good = isset($_POST['bo_use_good']) ? (int) $_POST['bo_use_good'] : 0;
$bo_use_nogood = isset($_POST['bo_use_nogood']) ? (int) $_POST['bo_use_nogood'] : 0;
$bo_use_name = isset($_POST['bo_use_name']) ? (int) $_POST['bo_use_name'] : 0;
$bo_use_signature = isset($_POST['bo_use_signature']) ? (int) $_POST['bo_use_signature'] : 0;
$bo_use_ip_view = isset($_POST['bo_use_ip_view']) ? (int) $_POST['bo_use_ip_view'] : 0;
$bo_use_list_view = isset($_POST['bo_use_list_view']) ? (int) $_POST['bo_use_list_view'] : 0;
$bo_use_list_file = isset($_POST['bo_use_list_file']) ? (int) $_POST['bo_use_list_file'] : 0;
$bo_use_list_content = isset($_POST['bo_use_list_content']) ? (int) $_POST['bo_use_list_content'] : 0;
$bo_use_email = isset($_POST['bo_use_email']) ? (int) $_POST['bo_use_email'] : 0;
$bo_use_sns = isset($_POST['bo_use_sns']) ? (int) $_POST['bo_use_sns'] : 0;
$bo_use_captcha = isset($_POST['bo_use_captcha']) ? (int) $_POST['bo_use_captcha'] : 0;
$bo_use_wrlimit = isset($_POST['bo_use_wrlimit']) ? (int) $_POST['bo_use_wrlimit'] : 0;
$bo_table_width = isset($_POST['bo_table_width']) ? (int) $_POST['bo_table_width'] : 0;
$bo_subject_len = isset($_POST['bo_subject_len']) ? (int) $_POST['bo_subject_len'] : 0;
$bo_mobile_subject_len = isset($_POST['bo_mobile_subject_len']) ? (int) $_POST['bo_mobile_subject_len'] : 0;
$bo_page_rows = isset($_POST['bo_page_rows']) ? (int) $_POST['bo_page_rows'] : 0;
$bo_mobile_page_rows = isset($_POST['bo_mobile_page_rows']) ? (int) $_POST['bo_mobile_page_rows'] : 0;
$bo_use_rss_view = isset($_POST['bo_use_rss_view']) ? (int) $_POST['bo_use_rss_view'] : 0;
$bo_use_approval = isset($_POST['bo_use_approval']) ? (int) $_POST['bo_use_approval'] : 0;
$bo_use_secret = isset($_POST['bo_use_secret']) ? (int) $_POST['bo_use_secret'] : 0;
$bo_use_file_content = isset($_POST['bo_use_file_content']) ? (int) $_POST['bo_use_file_content'] : 0;
$bo_new = isset($_POST['bo_new']) ? (int) $_POST['bo_new'] : 0;
$bo_hot = isset($_POST['bo_hot']) ? (int) $_POST['bo_hot'] : 0;
$bo_image_width = isset($_POST['bo_image_width']) ? (int) $_POST['bo_image_width'] : 0;
$bo_use_search = isset($_POST['bo_use_search']) ? (int) $_POST['bo_use_search'] : 0;
$bo_use_cert = isset($_POST['bo_use_cert']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['bo_use_cert']) : '';
$bo_device = isset($_POST['bo_device']) ? clean_xss_tags($_POST['bo_device'], 1, 1) : '';
$bo_list_level = isset($_POST['bo_list_level']) ? (int) $_POST['bo_list_level'] : 0;
$bo_read_level = isset($_POST['bo_read_level']) ? (int) $_POST['bo_read_level'] : 0;
$bo_write_level = isset($_POST['bo_write_level']) ? (int) $_POST['bo_write_level'] : 0;
$bo_reply_level = isset($_POST['bo_reply_level']) ? (int) $_POST['bo_reply_level'] : 0;
$bo_comment_level = isset($_POST['bo_comment_level']) ? (int) $_POST['bo_comment_level'] : 0;
$bo_html_level = isset($_POST['bo_html_level']) ? (int) $_POST['bo_html_level'] : 0;
$bo_poll_level = isset($_POST['bo_poll_level']) ? (int) $_POST['bo_poll_level'] : 0;
$bo_link_level = isset($_POST['bo_link_level']) ? (int) $_POST['bo_link_level'] : 0;
$bo_count_modify = isset($_POST['bo_count_modify']) ? (int) $_POST['bo_count_modify'] : 0;
$bo_count_delete = isset($_POST['bo_count_delete']) ? (int) $_POST['bo_count_delete'] : 0;
$bo_upload_level = isset($_POST['bo_upload_level']) ? (int) $_POST['bo_upload_level'] : 0;
$bo_download_level = isset($_POST['bo_download_level']) ? (int) $_POST['bo_download_level'] : 0;
$bo_point_target = isset($_POST['bo_point_target']) ? clean_xss_tags($_POST['bo_point_target']) : 'gnu';
$bo_read_point = isset($_POST['bo_read_point']) ? (int) $_POST['bo_read_point'] : 0;
$bo_write_point = isset($_POST['bo_write_point']) ? (int) $_POST['bo_write_point'] : 0;
$bo_comment_point = isset($_POST['bo_comment_point']) ? (int) $_POST['bo_comment_point'] : 0;
$bo_download_point = isset($_POST['bo_download_point']) ? (int) $_POST['bo_download_point'] : 0;
$bo_select_editor = isset($_POST['bo_select_editor']) ? clean_xss_tags($_POST['bo_select_editor'], 1, 1) : '';
$bo_skin = isset($_POST['bo_skin']) ? clean_xss_tags($_POST['bo_skin'], 1, 1) : '';
$bo_mobile_skin = isset($_POST['bo_mobile_skin']) ? clean_xss_tags($_POST['bo_mobile_skin'], 1, 1) : '';
$bo_content_head = isset($_POST['bo_content_head']) ? $_POST['bo_content_head'] : '';
$bo_content_tail = isset($_POST['bo_content_tail']) ? $_POST['bo_content_tail'] : '';
$bo_mobile_content_head = isset($_POST['bo_mobile_content_head']) ? $_POST['bo_mobile_content_head'] : '';
$bo_mobile_content_tail = isset($_POST['bo_mobile_content_tail']) ? $_POST['bo_mobile_content_tail'] : '';
$bo_insert_content = isset($_POST['bo_insert_content']) ? $_POST['bo_insert_content'] : '';
$bo_gallery_cols = isset($_POST['bo_gallery_cols']) ? (int) $_POST['bo_gallery_cols'] : 0;
$bo_gallery_width = isset($_POST['bo_gallery_width']) ? (int) $_POST['bo_gallery_width'] : 0;
$bo_gallery_height = isset($_POST['bo_gallery_height']) ? (int) $_POST['bo_gallery_height'] : 0;
$bo_mobile_gallery_width = isset($_POST['bo_mobile_gallery_width']) ? (int) $_POST['bo_mobile_gallery_width'] : 0;
$bo_mobile_gallery_height = isset($_POST['bo_mobile_gallery_height']) ? (int) $_POST['bo_mobile_gallery_height'] : 0;
$bo_upload_count = isset($_POST['bo_upload_count']) ? (int) $_POST['bo_upload_count'] : 0;
$bo_upload_size = isset($_POST['bo_upload_size']) ? (int) $_POST['bo_upload_size'] : 0;
$bo_reply_order = isset($_POST['bo_reply_order']) ? (int) $_POST['bo_reply_order'] : 0;
$bo_order = isset($_POST['bo_order']) ? (int) $_POST['bo_order'] : 0;
$bo_write_min = isset($_POST['bo_write_min']) ? (int) $_POST['bo_write_min'] : 0;
$bo_write_max = isset($_POST['bo_write_max']) ? (int) $_POST['bo_write_max'] : 0;
$bo_comment_min = isset($_POST['bo_comment_min']) ? (int) $_POST['bo_comment_min'] : 0;
$bo_comment_max = isset($_POST['bo_comment_max']) ? (int) $_POST['bo_comment_max'] : 0;
$bo_sort_field = isset($_POST['bo_sort_field']) ? clean_xss_tags($_POST['bo_sort_field'], 1, 1) : '';
$use_gnu_skin = isset($_POST['use_gnu_skin']) && $_POST['use_gnu_skin'] ? $_POST['use_gnu_skin']: 'n';
if ($use_gnu_skin != 'n') $use_gnu_skin = 'y';
if ($use_gnu_skin == 'n') {
$bo_use_anonymous = isset($_POST['bo_use_anonymous']) ? (int) $_POST['bo_use_anonymous'] : '';
$bo_use_good_member = isset($_POST['bo_use_good_member']) ? (int) $_POST['bo_use_good_member'] : '';
$bo_use_nogood_member = isset($_POST['bo_use_nogood_member']) ? (int) $_POST['bo_use_nogood_member'] : '';
$bo_use_list_image = isset($_POST['bo_use_list_image']) ? (int) $_POST['bo_use_list_image'] : '';
$bo_use_video_photo = isset($_POST['bo_use_video_photo']) ? (int) $_POST['bo_use_video_photo'] : '';
$bo_use_infinite_scroll = isset($_POST['bo_use_infinite_scroll']) ? (int) $_POST['bo_use_infinite_scroll'] : '';
$bo_use_extimg = isset($_POST['bo_use_extimg']) ? (int) $_POST['bo_use_extimg'] : '';
$bo_write_limit = isset($_POST['bo_write_limit']) ? (int) $_POST['bo_write_limit'] : 0;
$download_fee_ratio = isset($_POST['download_fee_ratio']) ? (int) $_POST['download_fee_ratio'] : 0;
$use_shop_skin = isset($_POST['use_shop_skin']) ? $_POST['use_shop_skin'] : 'n';
$bo_eyoom_skin = isset($_POST['bo_eyoom_skin']) ? $_POST['bo_eyoom_skin'] : 'basic';
$bo_sel_date_type = isset($_POST['bo_sel_date_type']) ? (int) $_POST['bo_sel_date_type'] : 1;
$bo_goto_url = isset($_POST['bo_goto_url']) ? $_POST['bo_goto_url'] : '';
if ($bo_goto_url) {
$bo_goto_url = substr($bo_goto_url,0,1000);
$bo_goto_url = trim(strip_tags($bo_goto_url));
$bo_goto_url = preg_replace("#[\\\]+$#", "", $bo_goto_url);
}
}
$etcs = array();
for ($i = 1; $i <= 10; $i++) {
$etcs['bo_' . $i . '_subj'] = ${'bo_' . $i . '_subj'} = isset($_POST['bo_' . $i . '_subj']) ? $_POST['bo_' . $i . '_subj'] : '';
$etcs['bo_' . $i] = ${'bo_' . $i} = isset($_POST['bo_' . $i]) ? $_POST['bo_' . $i] : '';
}
$sql_common = " gr_id = '{$gr_id}',
bo_subject = '{$bo_subject}',
bo_mobile_subject = '{$bo_mobile_subject}',
bo_device = '{$bo_device}',
bo_admin = '{$bo_admin}',
bo_list_level = '{$bo_list_level}',
bo_read_level = '{$bo_read_level}',
bo_write_level = '{$bo_write_level}',
bo_reply_level = '{$bo_reply_level}',
bo_comment_level = '{$bo_comment_level}',
bo_html_level = '{$bo_html_level}',
bo_poll_level = '{$bo_poll_level}',
bo_link_level = '{$bo_link_level}',
bo_count_modify = '{$bo_count_modify}',
bo_count_delete = '{$bo_count_delete}',
bo_upload_level = '{$bo_upload_level}',
bo_download_level = '{$bo_download_level}',
bo_point_target = '{$bo_point_target}',
bo_read_point = '{$bo_read_point}',
bo_write_point = '{$bo_write_point}',
bo_comment_point = '{$bo_comment_point}',
bo_download_point = '{$bo_download_point}',
bo_use_category = '{$bo_use_category}',
bo_category_list = '{$str_bo_category_list}',
bo_use_sideview = '{$bo_use_sideview}',
bo_use_file_content = '{$bo_use_file_content}',
bo_use_secret = '{$bo_use_secret}',
bo_use_dhtml_editor = '{$bo_use_dhtml_editor}',
bo_select_editor = '{$bo_select_editor}',
bo_use_rss_view = '{$bo_use_rss_view}',
bo_use_approval = '{$bo_use_approval}',
bo_use_good = '{$bo_use_good}',
bo_use_nogood = '{$bo_use_nogood}',
bo_use_name = '{$bo_use_name}',
bo_use_signature = '{$bo_use_signature}',
bo_use_ip_view = '{$bo_use_ip_view}',
bo_use_list_view = '{$bo_use_list_view}',
bo_use_list_file = '{$bo_use_list_file}',
bo_use_list_content = '{$bo_use_list_content}',
bo_use_email = '{$bo_use_email}',
bo_use_cert = '{$bo_use_cert}',
bo_use_sns = '{$bo_use_sns}',
bo_use_captcha = '{$bo_use_captcha}',
bo_use_wrlimit = '{$bo_use_wrlimit}',
bo_table_width = '{$bo_table_width}',
bo_subject_len = '{$bo_subject_len}',
bo_mobile_subject_len = '{$bo_mobile_subject_len}',
bo_page_rows = '{$bo_page_rows}',
bo_mobile_page_rows = '{$bo_mobile_page_rows}',
bo_new = '{$bo_new}',
bo_hot = '{$bo_hot}',
bo_image_width = '{$bo_image_width}',
bo_skin = '{$bo_skin}',
bo_mobile_skin = '{$bo_mobile_skin}',
";
// 최고 관리자인 경우에만 수정가능
if ($is_admin === 'super') {
$sql_common .= " bo_include_head = '" . $bo_include_head . "',
bo_include_tail = '" . $bo_include_tail . "',
bo_content_head = '{$bo_content_head}',
bo_content_tail = '{$bo_content_tail}',
bo_mobile_content_head = '{$bo_mobile_content_head}',
bo_mobile_content_tail = '{$bo_mobile_content_tail}',
";
}
$sql_common .= " bo_insert_content = '{$bo_insert_content}',
bo_gallery_cols = '{$bo_gallery_cols}',
bo_gallery_width = '{$bo_gallery_width}',
bo_gallery_height = '{$bo_gallery_height}',
bo_mobile_gallery_width = '{$bo_mobile_gallery_width}',
bo_mobile_gallery_height= '{$bo_mobile_gallery_height}',
bo_upload_count = '{$bo_upload_count}',
bo_upload_size = '{$bo_upload_size}',
bo_reply_order = '{$bo_reply_order}',
bo_use_search = '{$bo_use_search}',
bo_order = '{$bo_order}',
bo_write_min = '{$bo_write_min}',
bo_write_max = '{$bo_write_max}',
bo_comment_min = '{$bo_comment_min}',
bo_comment_max = '{$bo_comment_max}',
bo_sort_field = '{$bo_sort_field}',
bo_1_subj = '{$bo_1_subj}',
bo_2_subj = '{$bo_2_subj}',
bo_3_subj = '{$bo_3_subj}',
bo_4_subj = '{$bo_4_subj}',
bo_5_subj = '{$bo_5_subj}',
bo_6_subj = '{$bo_6_subj}',
bo_7_subj = '{$bo_7_subj}',
bo_8_subj = '{$bo_8_subj}',
bo_9_subj = '{$bo_9_subj}',
bo_10_subj = '{$bo_10_subj}',
bo_1 = '{$bo_1}',
bo_2 = '{$bo_2}',
bo_3 = '{$bo_3}',
bo_4 = '{$bo_4}',
bo_5 = '{$bo_5}',
bo_6 = '{$bo_6}',
bo_7 = '{$bo_7}',
bo_8 = '{$bo_8}',
bo_9 = '{$bo_9}',
bo_10 = '{$bo_10}' ";
// 이윰게시판 스킨 사용
$sql_common2 = "
bo_use_anonymous = '".$bo_use_anonymous."',
bo_use_good_member = '".$bo_use_good_member."',
bo_use_nogood_member = '".$bo_use_nogood_member."',
bo_use_list_image = '".$bo_use_list_image."',
bo_use_video_photo = '".$bo_use_video_photo."',
bo_use_infinite_scroll = '".$bo_use_infinite_scroll."',
bo_use_extimg = '".$bo_use_extimg."',
bo_write_limit = '".$bo_write_limit."',
download_fee_ratio = '".$download_fee_ratio."',
use_shop_skin = '".$use_shop_skin."',
bo_skin = '".$bo_eyoom_skin."',
bo_goto_url = '".$bo_goto_url."',
bo_sel_date_type = '".$bo_sel_date_type."'
";
if ($w == '') {
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where bo_table = '{$bo_table}' ");
if ($row['cnt']) {
alert($bo_table . ' 은(는) 이미 존재하는 TABLE 입니다.');
}
$sql = " insert into {$g5['board_table']}
set bo_table = '{$bo_table}',
bo_count_write = '0',
bo_count_comment = '0',
$sql_common ";
sql_query($sql);
// 게시판 테이블 생성
$file = file(G5_ADMIN_PATH . '/sql_write.sql');
$file = get_db_create_replace($file);
$sql = implode("\n", $file);
$create_table = $g5['write_prefix'] . $bo_table;
// sql_board.sql 파일의 테이블명을 변환
$source = array('/__TABLE_NAME__/', '/;/');
$target = array($create_table, '');
$sql = preg_replace($source, $target, $sql);
sql_query($sql, false);
// eyoom_board 테이블에 추가
$sql = "insert into {$g5['eyoom_board']}
set bo_table='{$bo_table}',
gr_id='{$gr_id}',
use_gnu_skin='{$use_gnu_skin}',
$sql_common2 ";
sql_query($sql);
$msg = "게시판 정상적으로 생성하였습니다.";
} elseif ($w == 'u') {
// 게시판의 글 수
$sql = " select count(*) as cnt from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 0 ";
$row = sql_fetch($sql);
$bo_count_write = $row['cnt'];
// 게시판의 코멘트 수
$sql = " select count(*) as cnt from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 1 ";
$row = sql_fetch($sql);
$bo_count_comment = $row['cnt'];
// 글수 조정
/*
엔피씨님의 팁으로 교체합니다. 130308
http://sir.kr/g5_tiptech/27207
*/
if (isset($_POST['proc_count'])) {
// 원글을 얻습니다.
//$sql = " select wr_id from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 0 ";
$sql = " select a.wr_id, (count(b.wr_parent) - 1) as cnt from {$g5['write_prefix']}{$bo_table} a, {$g5['write_prefix']}{$bo_table} b where a.wr_id=b.wr_parent and a.wr_is_comment=0 group by a.wr_id ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
/*
// 코멘트수를 얻습니다.
$sql2 = " select count(*) as cnt from {$g5['write_prefix']}$bo_table where wr_parent = '{$row['wr_id']}' and wr_is_comment = 1 ";
$row2 = sql_fetch($sql2);
*/
sql_query(" update {$g5['write_prefix']}{$bo_table} set wr_comment = '{$row['cnt']}' where wr_id = '{$row['wr_id']}' ");
}
}
// 공지사항에는 등록되어 있지만 실제 존재하지 않는 글 아이디는 삭제합니다.
$bo_notice = "";
$lf = "";
if ($board['bo_notice']) {
$tmp_array = explode(",", $board['bo_notice']);
for ($i = 0; $i < count($tmp_array); $i++) {
$tmp_wr_id = trim($tmp_array[$i]);
$row = sql_fetch(" select count(*) as cnt from {$g5['write_prefix']}{$bo_table} where wr_id = '{$tmp_wr_id}' ");
if ($row['cnt']) {
$bo_notice .= $lf . $tmp_wr_id;
$lf = ",";
}
}
}
$sql = " update {$g5['board_table']}
set bo_notice = '{$bo_notice}',
bo_count_write = '{$bo_count_write}',
bo_count_comment = '{$bo_count_comment}',
{$sql_common}
where bo_table = '{$bo_table}' ";
sql_query($sql);
// eyoom_board 테이블 업데이트
if ($use_gnu_skin == 'n') {
$sql = " update {$g5['eyoom_board']}
set use_gnu_skin='{$use_gnu_skin}',
{$sql_common2}
where bo_table = '{$bo_table}' ";
sql_query($sql);
} else {
$sql = " update {$g5['eyoom_board']} set use_gnu_skin='{$use_gnu_skin}' where bo_table = '{$bo_table}' ";
sql_query($sql);
}
/**
* 최신글 캐시 스위치온
*/
$latest->make_switch_on($bo_table, $theme);
$msg = "게시판 정보를 정상적으로 수정하였습니다.";
}
// 같은 그룹내 게시판 동일 옵션 적용
$grp_fields = '';
if (is_checked('chk_grp_device')) $grp_fields .= " , bo_device = '{$bo_device}' ";
if (is_checked('chk_grp_admin')) $grp_fields .= " , bo_admin = '{$bo_admin}' ";
if (is_checked('chk_grp_list_level')) $grp_fields .= " , bo_list_level = '{$bo_list_level}' ";
if (is_checked('chk_grp_read_level')) $grp_fields .= " , bo_read_level = '{$bo_read_level}' ";
if (is_checked('chk_grp_write_level')) $grp_fields .= " , bo_write_level = '{$bo_write_level}' ";
if (is_checked('chk_grp_reply_level')) $grp_fields .= " , bo_reply_level = '{$bo_reply_level}' ";
if (is_checked('chk_grp_comment_level')) $grp_fields .= " , bo_comment_level = '{$bo_comment_level}' ";
if (is_checked('chk_grp_link_level')) $grp_fields .= " , bo_link_level = '{$bo_link_level}' ";
if (is_checked('chk_grp_upload_level')) $grp_fields .= " , bo_upload_level = '{$bo_upload_level}' ";
if (is_checked('chk_grp_download_level')) $grp_fields .= " , bo_download_level = '{$bo_download_level}' ";
if (is_checked('chk_grp_html_level')) $grp_fields .= " , bo_html_level = '{$bo_html_level}' ";
if (is_checked('chk_grp_poll_level')) $grp_fields .= " , bo_poll_level = '{$bo_poll_level}' ";
if (is_checked('chk_grp_count_modify')) $grp_fields .= " , bo_count_modify = '{$bo_count_modify}' ";
if (is_checked('chk_grp_count_delete')) $grp_fields .= " , bo_count_delete = '{$bo_count_delete}' ";
if (is_checked('chk_grp_point_target')) $grp_fields .= " , bo_point_target = '{$bo_point_target}' ";
if (is_checked('chk_grp_read_point')) $grp_fields .= " , bo_read_point = '{$bo_read_point}' ";
if (is_checked('chk_grp_write_point')) $grp_fields .= " , bo_write_point = '{$bo_write_point}' ";
if (is_checked('chk_grp_comment_point')) $grp_fields .= " , bo_comment_point = '{$bo_comment_point}' ";
if (is_checked('chk_grp_download_point')) $grp_fields .= " , bo_download_point = '{$bo_download_point}' ";
if (is_checked('chk_grp_category_list')) {
$grp_fields .= " , bo_category_list = '{$str_bo_category_list}' ";
$grp_fields .= " , bo_use_category = '{$bo_use_category}' ";
}
if (is_checked('chk_grp_use_sideview')) $grp_fields .= " , bo_use_sideview = '{$bo_use_sideview}' ";
if (is_checked('chk_grp_use_file_content')) $grp_fields .= " , bo_use_file_content = '{$bo_use_file_content}' ";
if (is_checked('chk_grp_use_secret')) $grp_fields .= " , bo_use_secret = '{$bo_use_secret}' ";
if (is_checked('chk_grp_use_dhtml_editor')) $grp_fields .= " , bo_use_dhtml_editor = '{$bo_use_dhtml_editor}' ";
if (is_checked('chk_grp_select_editor')) $grp_fields .= " , bo_select_editor = '{$bo_select_editor}' ";
if (is_checked('chk_grp_use_rss_view')) $grp_fields .= " , bo_use_rss_view = '{$bo_use_rss_view}' ";
if (is_checked('chk_grp_use_approval')) $grp_fields .= " , bo_use_approval = '{$bo_use_approval}' ";
if (is_checked('chk_grp_use_good')) $grp_fields .= " , bo_use_good = '{$bo_use_good}' ";
if (is_checked('chk_grp_use_nogood')) $grp_fields .= " , bo_use_nogood = '{$bo_use_nogood}' ";
if (is_checked('chk_grp_use_name')) $grp_fields .= " , bo_use_name = '{$bo_use_name}' ";
if (is_checked('chk_grp_use_signature')) $grp_fields .= " , bo_use_signature = '{$bo_use_signature}' ";
if (is_checked('chk_grp_use_ip_view')) $grp_fields .= " , bo_use_ip_view = '{$bo_use_ip_view}' ";
if (is_checked('chk_grp_use_list_view')) $grp_fields .= " , bo_use_list_view = '{$bo_use_list_view}' ";
if (is_checked('chk_grp_use_list_file')) $grp_fields .= " , bo_use_list_file = '{$bo_use_list_file}' ";
if (is_checked('chk_grp_use_list_content')) $grp_fields .= " , bo_use_list_content = '{$bo_use_list_content}' ";
if (is_checked('chk_grp_use_email')) $grp_fields .= " , bo_use_email = '{$bo_use_email}' ";
if (is_checked('chk_grp_use_cert')) $grp_fields .= " , bo_use_cert = '{$bo_use_cert}' ";
if (is_checked('chk_grp_use_sns')) $grp_fields .= " , bo_use_sns = '{$bo_use_sns}' ";
if (is_checked('chk_grp_use_captcha')) $grp_fields .= " , bo_use_captcha = '{$bo_use_captcha}' ";
if (is_checked('chk_grp_use_wrlimit')) $grp_fields .= " , bo_use_wrlimit = '{$bo_use_wrlimit}' ";
if (is_checked('chk_grp_skin')) $grp_fields .= " , bo_skin = '{$bo_skin}' ";
if (is_checked('chk_grp_mobile_skin')) $grp_fields .= " , bo_mobile_skin = '{$bo_mobile_skin}' ";
if (is_checked('chk_grp_gallery_cols')) $grp_fields .= " , bo_gallery_cols = '{$bo_gallery_cols}' ";
if (is_checked('chk_grp_gallery_width')) $grp_fields .= " , bo_gallery_width = '{$bo_gallery_width}' ";
if (is_checked('chk_grp_gallery_height')) $grp_fields .= " , bo_gallery_height = '{$bo_gallery_height}' ";
if (is_checked('chk_grp_mobile_gallery_width')) $grp_fields .= " , bo_mobile_gallery_width = '{$bo_mobile_gallery_width}' ";
if (is_checked('chk_grp_mobile_gallery_height'))$grp_fields .= " , bo_mobile_gallery_height = '{$bo_mobile_gallery_height}' ";
if (is_checked('chk_grp_table_width')) $grp_fields .= " , bo_table_width = '{$bo_table_width}' ";
if (is_checked('chk_grp_page_rows')) $grp_fields .= " , bo_page_rows = '{$bo_page_rows}' ";
if (is_checked('chk_grp_mobile_page_rows')) $grp_fields .= " , bo_mobile_page_rows = '{$bo_mobile_page_rows}' ";
if (is_checked('chk_grp_subject_len')) $grp_fields .= " , bo_subject_len = '{$bo_subject_len}' ";
if (is_checked('chk_grp_mobile_subject_len')) $grp_fields .= " , bo_mobile_subject_len = '{$bo_mobile_subject_len}' ";
if (is_checked('chk_grp_new')) $grp_fields .= " , bo_new = '{$bo_new}' ";
if (is_checked('chk_grp_hot')) $grp_fields .= " , bo_hot = '{$bo_hot}' ";
if (is_checked('chk_grp_image_width')) $grp_fields .= " , bo_image_width = '{$bo_image_width}' ";
if (is_checked('chk_grp_reply_order')) $grp_fields .= " , bo_reply_order = '{$bo_reply_order}' ";
if (is_checked('chk_grp_sort_field')) $grp_fields .= " , bo_sort_field = '{$bo_sort_field}' ";
if (is_checked('chk_grp_write_min')) $grp_fields .= " , bo_write_min = '{$bo_write_min}' ";
if (is_checked('chk_grp_write_max')) $grp_fields .= " , bo_write_max = '{$bo_write_max}' ";
if (is_checked('chk_grp_comment_min')) $grp_fields .= " , bo_comment_min = '{$bo_comment_min}' ";
if (is_checked('chk_grp_comment_max')) $grp_fields .= " , bo_comment_max = '{$bo_comment_max}' ";
if (is_checked('chk_grp_upload_count')) $grp_fields .= " , bo_upload_count = '{$bo_upload_count}' ";
if (is_checked('chk_grp_upload_size')) $grp_fields .= " , bo_upload_size = '{$bo_upload_size}' ";
//최고관리자만 수정가능
if ($is_admin === 'super'){
if (is_checked('chk_grp_include_head')) $grp_fields .= " , bo_include_head = '{$bo_include_head}' ";
if (is_checked('chk_grp_include_tail')) $grp_fields .= " , bo_include_tail = '{$bo_include_tail}' ";
if (is_checked('chk_grp_content_head')) $grp_fields .= " , bo_content_head = '{$bo_content_head}' ";
if (is_checked('chk_grp_content_tail')) $grp_fields .= " , bo_content_tail = '{$bo_content_tail}' ";
if (is_checked('chk_grp_mobile_content_head')) $grp_fields .= " , bo_mobile_content_head = '{$bo_mobile_content_head}' ";
if (is_checked('chk_grp_mobile_content_tail')) $grp_fields .= " , bo_mobile_content_tail = '{$bo_mobile_content_tail}' ";
}
if (is_checked('chk_grp_insert_content')) $grp_fields .= " , bo_insert_content = '{$bo_insert_content}' ";
if (is_checked('chk_grp_use_search')) $grp_fields .= " , bo_use_search = '{$bo_use_search}' ";
if (is_checked('chk_grp_order')) $grp_fields .= " , bo_order = '{$bo_order}' ";
for ($i=1; $i<=10; $i++) {
if (is_checked('chk_grp_'.$i)) {
$grp_fields .= " , bo_{$i}_subj = '".$etcs['bo_'.$i.'_subj']."' ";
$grp_fields .= " , bo_{$i} = '".$etcs['bo_'.$i]."' ";
}
}
if ($grp_fields) {
sql_query(" update {$g5['board_table']} set bo_table = bo_table {$grp_fields} where gr_id = '$gr_id' ");
}
// 이윰게시판 스킨 사용
if ($use_gnu_skin == 'n') {
$grp_fields = '';
if (is_checked('chk_grp_use_gnu_skin')) $grp_fields .= " , use_gnu_skin = '{$use_gnu_skin}' ";
if (is_checked('chk_grp_anonymous')) $grp_fields .= " , bo_use_anonymous = '{$bo_use_anonymous}' ";
if (is_checked('chk_grp_good_member')) $grp_fields .= " , bo_use_good_member = '{$bo_use_good_member}' ";
if (is_checked('chk_grp_nogood_member')) $grp_fields .= " , bo_use_nogood_member = '{$bo_use_nogood_member}' ";
if (is_checked('chk_grp_list_image')) $all_fields .= " , bo_use_list_image = '{$bo_use_list_image}' ";
if (is_checked('chk_grp_video_photo')) $grp_fields .= " , bo_use_video_photo = '{$bo_use_video_photo}' ";
if (is_checked('chk_grp_infinite_scroll')) $all_fields .= " , bo_use_infinite_scroll = '{$bo_use_infinite_scroll}' ";
if (is_checked('chk_grp_extimg')) $grp_fields .= " , bo_use_extimg = '{$bo_use_extimg}' ";
if (is_checked('chk_grp_write_limit')) $grp_fields .= " , bo_write_limit = '{$bo_write_limit}' ";
if (is_checked('chk_grp_download_ratio')) $grp_fields .= " , download_fee_ratio = '{$download_fee_ratio}' ";
if (is_checked('chk_grp_shop_skin')) $grp_fields .= " , use_shop_skin = '{$use_shop_skin}' ";
if (is_checked('chk_grp_eyoom_skin')) $grp_fields .= " , bo_skin = '{$bo_eyoom_skin}' ";
if (is_checked('chk_grp_date_type')) $grp_fields .= " , bo_sel_date_type = '{$bo_sel_date_type}' ";
if ($grp_fields) {
sql_query(" update {$g5['eyoom_board']} set bo_table = bo_table {$grp_fields} where gr_id = '{$gr_id}' ");
}
} else if ($use_gnu_skin == 'y') {
$grp_fields = '';
if (is_checked('chk_grp_use_gnu_skin')) $grp_fields .= " , use_gnu_skin = '{$use_gnu_skin}' ";
if ($grp_fields) {
sql_query(" update {$g5['eyoom_board']} set bo_table = bo_table {$grp_fields} where gr_id = '{$gr_id}' ");
}
}
// 모든 게시판 동일 옵션 적용
$all_fields = '';
if (is_checked('chk_all_device')) $all_fields .= " , bo_device = '{$bo_device}' ";
if (is_checked('chk_all_admin')) $all_fields .= " , bo_admin = '{$bo_admin}' ";
if (is_checked('chk_all_list_level')) $all_fields .= " , bo_list_level = '{$bo_list_level}' ";
if (is_checked('chk_all_read_level')) $all_fields .= " , bo_read_level = '{$bo_read_level}' ";
if (is_checked('chk_all_write_level')) $all_fields .= " , bo_write_level = '{$bo_write_level}' ";
if (is_checked('chk_all_reply_level')) $all_fields .= " , bo_reply_level = '{$bo_reply_level}' ";
if (is_checked('chk_all_comment_level')) $all_fields .= " , bo_comment_level = '{$bo_comment_level}' ";
if (is_checked('chk_all_link_level')) $all_fields .= " , bo_link_level = '{$bo_link_level}' ";
if (is_checked('chk_all_upload_level')) $all_fields .= " , bo_upload_level = '{$bo_upload_level}' ";
if (is_checked('chk_all_download_level')) $all_fields .= " , bo_download_level = '{$bo_download_level}' ";
if (is_checked('chk_all_html_level')) $all_fields .= " , bo_html_level = '{$bo_html_level}' ";
if (is_checked('chk_all_poll_level')) $all_fields .= " , bo_poll_level = '{$bo_poll_level}' ";
if (is_checked('chk_all_count_modify')) $all_fields .= " , bo_count_modify = '{$bo_count_modify}' ";
if (is_checked('chk_all_count_delete')) $all_fields .= " , bo_count_delete = '{$bo_count_delete}' ";
if (is_checked('chk_all_point_target')) $all_fields .= " , bo_point_target = '{$bo_point_target}' ";
if (is_checked('chk_all_read_point')) $all_fields .= " , bo_read_point = '{$bo_read_point}' ";
if (is_checked('chk_all_write_point')) $all_fields .= " , bo_write_point = '{$bo_write_point}' ";
if (is_checked('chk_all_comment_point')) $all_fields .= " , bo_comment_point = '{$bo_comment_point}' ";
if (is_checked('chk_all_download_point')) $all_fields .= " , bo_download_point = '{$bo_download_point}' ";
if (is_checked('chk_all_category_list')) {
$all_fields .= " , bo_category_list = '{$str_bo_category_list}' ";
$all_fields .= " , bo_use_category = '{$bo_use_category}' ";
}
if (is_checked('chk_all_use_sideview')) $all_fields .= " , bo_use_sideview = '{$bo_use_sideview}' ";
if (is_checked('chk_all_use_file_content')) $all_fields .= " , bo_use_file_content = '{$bo_use_file_content}' ";
if (is_checked('chk_all_use_secret')) $all_fields .= " , bo_use_secret = '{$bo_use_secret}' ";
if (is_checked('chk_all_use_dhtml_editor')) $all_fields .= " , bo_use_dhtml_editor = '{$bo_use_dhtml_editor}' ";
if (is_checked('chk_all_select_editor')) $all_fields .= " , bo_select_editor = '{$bo_select_editor}' ";
if (is_checked('chk_all_use_rss_view')) $all_fields .= " , bo_use_rss_view = '{$bo_use_rss_view}' ";
if (is_checked('chk_all_use_approval')) $all_fields .= " , bo_use_approval = '{$bo_use_approval}' ";
if (is_checked('chk_all_use_good')) $all_fields .= " , bo_use_good = '{$bo_use_good}' ";
if (is_checked('chk_all_use_nogood')) $all_fields .= " , bo_use_nogood = '{$bo_use_nogood}' ";
if (is_checked('chk_all_use_name')) $all_fields .= " , bo_use_name = '{$bo_use_name}' ";
if (is_checked('chk_all_use_signature')) $all_fields .= " , bo_use_signature = '{$bo_use_signature}' ";
if (is_checked('chk_all_use_ip_view')) $all_fields .= " , bo_use_ip_view = '{$bo_use_ip_view}' ";
if (is_checked('chk_all_use_list_view')) $all_fields .= " , bo_use_list_view = '{$bo_use_list_view}' ";
if (is_checked('chk_all_use_list_file')) $all_fields .= " , bo_use_list_file = '{$bo_use_list_file}' ";
if (is_checked('chk_all_use_list_content')) $all_fields .= " , bo_use_list_content = '{$bo_use_list_content}' ";
if (is_checked('chk_all_use_email')) $all_fields .= " , bo_use_email = '{$bo_use_email}' ";
if (is_checked('chk_all_use_cert')) $all_fields .= " , bo_use_cert = '{$bo_use_cert}' ";
if (is_checked('chk_all_use_sns')) $all_fields .= " , bo_use_sns = '{$bo_use_sns}' ";
if (is_checked('chk_all_use_captcha')) $all_fields .= " , bo_use_captcha = '{$bo_use_captcha}' ";
if (is_checked('chk_all_use_wrlimit')) $all_fields .= " , bo_use_wrlimit = '{$bo_use_wrlimit}' ";
if (is_checked('chk_all_skin')) $all_fields .= " , bo_skin = '{$bo_skin}' ";
if (is_checked('chk_all_mobile_skin')) $all_fields .= " , bo_mobile_skin = '{$bo_mobile_skin}' ";
if (is_checked('chk_all_gallery_cols')) $all_fields .= " , bo_gallery_cols = '{$bo_gallery_cols}' ";
if (is_checked('chk_all_gallery_width')) $all_fields .= " , bo_gallery_width = '{$bo_gallery_width}' ";
if (is_checked('chk_all_gallery_height')) $all_fields .= " , bo_gallery_height = '{$bo_gallery_height}' ";
if (is_checked('chk_all_mobile_gallery_width')) $all_fields .= " , bo_mobile_gallery_width = '{$bo_mobile_gallery_width}' ";
if (is_checked('chk_all_mobile_gallery_height'))$all_fields .= " , bo_mobile_gallery_height = '{$bo_mobile_gallery_height}' ";
if (is_checked('chk_all_table_width')) $all_fields .= " , bo_table_width = '{$bo_table_width}' ";
if (is_checked('chk_all_page_rows')) $all_fields .= " , bo_page_rows = '{$bo_page_rows}' ";
if (is_checked('chk_all_mobile_page_rows')) $all_fields .= " , bo_mobile_page_rows = '{$bo_mobile_page_rows}' ";
if (is_checked('chk_all_subject_len')) $all_fields .= " , bo_subject_len = '{$bo_subject_len}' ";
if (is_checked('chk_all_mobile_subject_len')) $all_fields .= " , bo_mobile_subject_len = '{$bo_mobile_subject_len}' ";
if (is_checked('chk_all_new')) $all_fields .= " , bo_new = '{$bo_new}' ";
if (is_checked('chk_all_hot')) $all_fields .= " , bo_hot = '{$bo_hot}' ";
if (is_checked('chk_all_image_width')) $all_fields .= " , bo_image_width = '{$bo_image_width}' ";
if (is_checked('chk_all_reply_order')) $all_fields .= " , bo_reply_order = '{$bo_reply_order}' ";
if (is_checked('chk_all_sort_field')) $all_fields .= " , bo_sort_field = '{$bo_sort_field}' ";
if (is_checked('chk_all_write_min')) $all_fields .= " , bo_write_min = '{$bo_write_min}' ";
if (is_checked('chk_all_write_max')) $all_fields .= " , bo_write_max = '{$bo_write_max}' ";
if (is_checked('chk_all_comment_min')) $all_fields .= " , bo_comment_min = '{$bo_comment_min}' ";
if (is_checked('chk_all_comment_max')) $all_fields .= " , bo_comment_max = '{$bo_comment_max}' ";
if (is_checked('chk_all_upload_count')) $all_fields .= " , bo_upload_count = '{$bo_upload_count}' ";
if (is_checked('chk_all_upload_size')) $all_fields .= " , bo_upload_size = '{$bo_upload_size}' ";
//최고관리자만 수정가능
if ($is_admin === 'super'){
if (is_checked('chk_all_include_head')) $all_fields .= " , bo_include_head = '{$bo_include_head}' ";
if (is_checked('chk_all_include_tail')) $all_fields .= " , bo_include_tail = '{$bo_include_tail}' ";
if (is_checked('chk_all_content_head')) $all_fields .= " , bo_content_head = '{$bo_content_head}' ";
if (is_checked('chk_all_content_tail')) $all_fields .= " , bo_content_tail = '{$bo_content_tail}' ";
if (is_checked('chk_all_mobile_content_head')) $all_fields .= " , bo_mobile_content_head = '{$bo_mobile_content_head}' ";
if (is_checked('chk_all_mobile_content_tail')) $all_fields .= " , bo_mobile_content_tail = '{$bo_mobile_content_tail}' ";
}
if (is_checked('chk_all_insert_content')) $all_fields .= " , bo_insert_content = '{$bo_insert_content}' ";
if (is_checked('chk_all_use_search')) $all_fields .= " , bo_use_search = '{$bo_use_search}' ";
if (is_checked('chk_all_order')) $all_fields .= " , bo_order = '{$bo_order}' ";
for ($i=1; $i<=10; $i++) {
if (is_checked('chk_all_'.$i)) {
$all_fields .= " , bo_{$i}_subj = '".$etcs['bo_'.$i.'_subj']."' ";
$all_fields .= " , bo_{$i} = '".$etcs['bo_'.$i]."' ";
}
}
if ($all_fields) {
sql_query(" update {$g5['board_table']} set bo_table = bo_table {$all_fields} ");
}
// 이윰게시판 스킨 사용
if ($use_gnu_skin == 'n') {
$all_fields = '';
if (is_checked('chk_all_use_gnu_skin')) $all_fields .= " , use_gnu_skin = '{$use_gnu_skin}' ";
if (is_checked('chk_all_anonymous')) $all_fields .= " , bo_use_anonymous = '{$bo_use_anonymous}' ";
if (is_checked('chk_all_good_member')) $all_fields .= " , bo_use_good_member = '{$bo_use_good_member}' ";
if (is_checked('chk_all_nogood_member')) $all_fields .= " , bo_use_nogood_member = '{$bo_use_nogood_member}' ";
if (is_checked('chk_all_list_image')) $all_fields .= " , bo_use_list_image = '{$bo_use_list_image}' ";
if (is_checked('chk_all_video_photo')) $all_fields .= " , bo_use_video_photo = '{$bo_use_video_photo}' ";
if (is_checked('chk_all_infinite_scroll')) $all_fields .= " , bo_use_infinite_scroll = '{$bo_use_infinite_scroll}' ";
if (is_checked('chk_all_extimg')) $all_fields .= " , bo_use_extimg = '{$bo_use_extimg}' ";
if (is_checked('chk_all_write_limit')) $all_fields .= " , bo_write_limit = '{$bo_write_limit}' ";
if (is_checked('chk_all_download_ratio')) $all_fields .= " , download_fee_ratio = '{$download_fee_ratio}' ";
if (is_checked('chk_all_shop_skin')) $all_fields .= " , use_shop_skin = '{$use_shop_skin}' ";
if (is_checked('chk_all_eyoom_skin')) $all_fields .= " , bo_skin = '{$bo_eyoom_skin}' ";
if (is_checked('chk_all_date_type')) $all_fields .= " , bo_sel_date_type = '{$bo_sel_date_type}' ";
if ($all_fields) {
sql_query(" update {$g5['eyoom_board']} set bo_table = bo_table {$all_fields} ");
}
} else if ($use_gnu_skin == 'y') {
$all_fields = '';
if (is_checked('chk_all_use_gnu_skin')) $all_fields .= " , use_gnu_skin = '{$use_gnu_skin}' ";
if ($all_fields) {
sql_query(" update {$g5['eyoom_board']} set bo_table = bo_table {$all_fields} ");
}
}
delete_cache_latest($bo_table);
// query string
$qstr .= $grid ? '&amp;grid='.$grid: '';
$qstr .= $boskin ? '&amp;boskin='.$boskin: '';
$qstr .= $bomobileskin ? '&amp;bomobileskin='.$bomobileskin: '';
$qstr .= $bo_ex ? '&amp;bo_ex='.$bo_ex: '';
$qstr .= $bo_cate ? '&amp;bo_cate='.$bo_cate: '';
$qstr .= $bo_sideview ? '&amp;bo_sideview='.$bo_sideview: '';
$qstr .= $bo_dhtml ? '&amp;bo_dhtml='.$bo_dhtml: '';
$qstr .= $bo_secret ? '&amp;bo_secret='.$bo_secret: '';
$qstr .= $bo_good ? '&amp;bo_good='.$bo_good: '';
$qstr .= $bo_nogood ? '&amp;bo_nogood='.$bo_nogood: '';
$qstr .= $bo_file ? '&amp;bo_file='.$bo_file: '';
$qstr .= $bo_cont ? '&amp;bo_cont='.$bo_cont: '';
$qstr .= $bo_list ? '&amp;bo_list='.$bo_list: '';
$qstr .= $bo_sns ? '&amp;bo_sns='.$bo_sns: '';
$qstr .= $wmode ? '&amp;wmode=1': '';
if(function_exists('get_admin_captcha_by'))
get_admin_captcha_by('remove');
run_event('admin_board_form_update', $bo_table, $w);
alert($msg, G5_ADMIN_URL . "/?dir=board&amp;pid=board_form&amp;w=u&bo_table={$bo_table}&amp;{$qstr}");
@@ -0,0 +1,299 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_list.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
$action_url1 = G5_ADMIN_URL . '/?dir=board&amp;pid=board_list_update&amp;smode=1';
auth_check_menu($auth, $sub_menu, 'r');
/**
* 게시판 여유필드 확장수 저장 필드 추가
*/
if(!sql_query(" select bo_ex_cnt from {$g5['board_table']} limit 1 ", false)) {
$sql = " alter table `{$g5['board_table']}` add `bo_ex_cnt` int(5) NOT NULL default '0' after `bo_sort_field` ";
sql_query($sql, true);
}
/**
* 승인게시판 사용여부 필드 추가
*/
if(!sql_query(" select bo_use_approval from {$g5['board_table']} limit 1 ", false)) {
$sql = " alter table `{$g5['board_table']}` add `bo_use_approval` tinyint(4) NOT NULL default '0' after `bo_ex_cnt` ";
sql_query($sql, true);
}
/**
* 게시물 새글 테이블에 아이피 필드 추가
*/
if(!sql_query(" select wr_ip from {$g5['board_new_table']} limit 1 ", false)) {
$sql = " alter table `{$g5['board_new_table']}` add `wr_ip` varchar(255) NOT NULL after `mb_id` ";
sql_query($sql, true);
}
$sql_common = " from {$g5['board_table']} a ";
$sql_search = " where (1) ";
if ($is_admin != "super") {
$sql_common .= " , {$g5['group_table']} b ";
$sql_search .= " and (a.gr_id = b.gr_id and b.gr_admin = '{$member['mb_id']}') ";
}
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "bo_table":
$sql_search .= " ($sfl like '$stx%') ";
break;
case "a.gr_id":
$sql_search .= " ($sfl = '$stx') ";
break;
default:
$sql_search .= " ($sfl like '%$stx%') ";
break;
}
$sql_search .= " ) ";
}
// 그룹검색
if (isset($_REQUEST['grid'])) {
if (!is_array($_REQUEST['grid'])) {
$grid = filter_var($_REQUEST['grid'], FILTER_VALIDATE_REGEXP, array(
"options" => array("regexp" => "/^[a-z0-9_\.]+$/i")
));
$grid = preg_replace('/[^a-z0-9_\.]/i', '', trim($grid));
}
} else {
$grid = '';
}
if ($grid) {
$sql_search .= " and a.gr_id = '{$grid}' ";
$qstr .= "&amp;grid={$grid}";
}
// 확장필드
$bo_ex = isset($_GET['bo_ex']) ? (int) $_GET['bo_ex']: '';
if ($bo_ex) {
$bo_ex_val = $bo_ex-1 == 1 ? 1:'';
$sql_search .= $bo_ex_val ? ' and a.bo_ex_cnt > 0 ': ' and a.bo_ex_cnt = 0 ';
$qstr .= "&amp;bo_ex={$bo_ex}";
if ($bo_ex == '1') {
$bo_ex_no = 'checked';
} else if ($bo_ex == '2') {
$bo_ex_yes = 'checked';
}
} else {
$bo_ex_all = 'checked';
}
// 분류사용
$bo_cate = isset($_GET['bo_cate']) ? (int) $_GET['bo_cate']: '';
if ($bo_cate) {
$bo_cate_val = $bo_cate-1 == 1 ? 1:'';
$sql_search .= " and a.bo_use_category = '{$bo_cate_val}' ";
$qstr .= "&amp;bo_cate={$bo_cate}";
if ($bo_cate == '1') {
$bo_cate_no = 'checked';
} else if ($bo_cate == '2') {
$bo_cate_yes = 'checked';
}
} else {
$bo_cate_all = 'checked';
}
// 사이드 네임뷰
$bo_sideview = isset($_GET['bo_sideview']) ? (int) $_GET['bo_sideview']: '';
if ($bo_sideview) {
$bo_sideview_val = $bo_sideview-1 == 1 ? 1:'';
$sql_search .= " and a.bo_use_sideview = '{$bo_sideview_val}' ";
$qstr .= "&amp;bo_sideview={$bo_sideview}";
if ($bo_sideview == '1') {
$bo_sideview_no = 'checked';
} else if ($bo_sideview == '2') {
$bo_sideview_yes = 'checked';
}
} else {
$bo_sideview_all = 'checked';
}
// DHTML 사용
$bo_dhtml = isset($_GET['bo_dhtml']) ? (int) $_GET['bo_dhtml']: '';
if ($bo_dhtml) {
$bo_dhtml_val = $bo_dhtml-1 == 1 ? 1:'';
$sql_search .= " and a.bo_use_dhtml_editor = '{$bo_dhtml_val}' ";
$qstr .= "&amp;bo_dhtml={$bo_dhtml}";
if ($bo_dhtml == '1') {
$bo_dhtml_no = 'checked';
} else if ($bo_dhtml == '2') {
$bo_dhtml_yes = 'checked';
}
} else {
$bo_dhtml_all = 'checked';
}
// 비밀글 사용
$bo_secret = isset($_GET['bo_secret']) ? (int) $_GET['bo_secret']: '';
if ($bo_secret) {
$bo_secret_val = $bo_secret-1;
$sql_search .= " and a.bo_use_secret = '{$bo_secret_val}' ";
$qstr .= "&amp;bo_secret={$bo_secret}";
if ($bo_secret == '1') {
$bo_secret_no = 'checked';
} else if ($bo_secret == '2') {
$bo_secret_chk = 'checked';
} else if ($bo_secret == '3') {
$bo_secret_yes = 'checked';
}
} else {
$bo_secret_all = 'checked';
}
// 추천사용
$bo_good = isset($_GET['bo_good']) ? (int) $_GET['bo_good']: '';
if ($bo_good) {
$bo_good_val = $bo_good-1 == 1 ? 1:'';
$sql_search .= " and a.bo_use_good = '{$bo_good_val}' ";
$qstr .= "&amp;bo_good={$bo_good}";
if ($bo_good == '1') {
$bo_good_no = 'checked';
} else if ($bo_good == '2') {
$bo_good_yes = 'checked';
}
} else {
$bo_good_all = 'checked';
}
// 비추천사용
$bo_nogood = isset($_GET['bo_nogood']) ? (int) $_GET['bo_nogood']: '';
if ($bo_nogood) {
$bo_nogood_val = $bo_nogood-1 == 1 ? 1:'';
$sql_search .= " and a.bo_use_nogood = '{$bo_nogood_val}' ";
$qstr .= "&amp;bo_nogood={$bo_nogood}";
if ($bo_nogood == '1') {
$bo_nogood_no = 'checked';
} else if ($bo_nogood == '2') {
$bo_nogood_yes = 'checked';
}
} else {
$bo_nogood_all = 'checked';
}
// 목록에서 파일 사용
$bo_file = isset($_GET['bo_file']) ? (int) $_GET['bo_file']: '';
if ($bo_file) {
$bo_file_val = $bo_file-1 == 1 ? 1:'';
$sql_search .= " and a.bo_use_list_file = '{$bo_file_val}' ";
$qstr .= "&amp;bo_file={$bo_file}";
if ($bo_file == '1') {
$bo_file_no = 'checked';
} else if ($bo_file == '2') {
$bo_file_yes = 'checked';
}
} else {
$bo_file_all = 'checked';
}
// 목록에서 내용 사용
$bo_cont = isset($_GET['bo_cont']) ? (int) $_GET['bo_cont']: '';
if ($bo_cont) {
$bo_cont_val = $bo_cont-1 == 1 ? 1:'';
$sql_search .= " and a.bo_use_list_content = '{$bo_cont_val}' ";
$qstr .= "&amp;bo_cont={$bo_cont}";
if ($bo_cont == '1') {
$bo_cont_no = 'checked';
} else if ($bo_cont == '2') {
$bo_cont_yes = 'checked';
}
} else {
$bo_cont_all = 'checked';
}
// 전체목록보이기 사용
$bo_list = isset($_GET['bo_list']) ? (int) $_GET['bo_list']: '';
if ($bo_list) {
$bo_list_val = $bo_list-1 == 1 ? 1:'';
$sql_search .= " and a.bo_use_list_view = '{$bo_list_val}' ";
$qstr .= "&amp;bo_list={$bo_list}";
if ($bo_list == '1') {
$bo_list_no = 'checked';
} else if ($bo_list == '2') {
$bo_list_yes = 'checked';
}
} else {
$bo_list_all = 'checked';
}
// SNS 사용
$bo_sns = isset($_GET['bo_sns']) ? (int) $_GET['bo_sns']: '';
if ($bo_sns) {
$bo_sns_val = $bo_sns-1 == 1 ? 1:'';
$sql_search .= " and a.bo_use_sns = '{$bo_sns_val}' ";
$qstr .= "&amp;bo_sns={$bo_sns}";
if ($bo_sns == '1') {
$bo_sns_no = 'checked';
} else if ($bo_sns == '2') {
$bo_sns_yes = 'checked';
}
} else {
$bo_sns_all = 'checked';
}
if (!$sst) {
$sst = "a.gr_id, a.bo_table";
$sod = "asc";
}
$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 = $config['cf_page_rows'];
$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);
$list = array();
for ($i=0; $row=sql_fetch_array($result); $i++) {
/**
* 이윰 게시판 테이블에 게시판 정보가 있는지 체크
*/
$tmp = sql_fetch("select bo_table, bo_skin, use_gnu_skin, bo_write_limit from {$g5['eyoom_board']} where bo_table='{$row['bo_table']}' limit 1",false);
if(! (isset($tmp) && $tmp['bo_table'])) {
sql_query("insert into {$g5['eyoom_board']} set bo_table='{$row['bo_table']}', gr_id='{$row['gr_id']}', bo_skin='basic', use_gnu_skin='n'");
}
$list[$i] = $row;
$gr_select = str_replace('"', "'", get_group_select("gr_id[$i]", $row['gr_id']));
$list[$i]['gr_select'] = preg_replace("/\\n/", "", $gr_select);
$skin_select = str_replace('"', "'", get_skin_select('board', 'bo_skin_'.$i, "bo_skin[$i]", $row['bo_skin']));
$list[$i]['skin_select'] = preg_replace("/\\n/", "", $skin_select);
$mobile_skin_select = str_replace('"', "'", get_mobile_skin_select('board', 'bo_mobile_skin_'.$i, "bo_mobile_skin[$i]", $row['bo_mobile_skin']));
$list[$i]['mobile_skin_select'] = preg_replace("/\\n/", "", $mobile_skin_select);
$row2 = sql_fetch("select use_gnu_skin from {$g5['eyoom_board']} where bo_table='{$row['bo_table']}' ");
$list[$i]['use_gnu_skin'] = $row2['use_gnu_skin'];
}
$bo_cnt = count($list);
/**
* 페이징
*/
$paging = $eb->set_paging('admin', $dir, $pid, $qstr);
/**
* 검색버튼
*/
$frm_submit = ' <div class="text-center margin-top-10 margin-bottom-10"> ';
$frm_submit .= ' <input type="submit" value="검색" class="btn-e btn-e-lg btn-e-dark" accesskey="s">' ;
$frm_submit .= '</div>';
@@ -0,0 +1,147 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_list_update.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
check_demo();
$post_count_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
$chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? $_POST['chk'] : array();
$act_button = isset($_POST['act_button']) ? strip_tags($_POST['act_button']) : '';
$board_table = (isset($_POST['board_table']) && is_array($_POST['board_table'])) ? $_POST['board_table'] : array();
if (!$post_count_chk) {
alert($act_button . " 하실 항목을 하나 이상 체크하세요.");
}
check_admin_token();
if ($act_button == "선택수정") {
auth_check_menu($auth, $sub_menu, 'w');
for ($i = 0; $i < $post_count_chk; $i++) {
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$post_gr_id = isset($_POST['gr_id'][$k]) ? clean_xss_tags($_POST['gr_id'][$k], 1, 1) : '';
$post_bo_device = isset($_POST['bo_device'][$k]) ? clean_xss_tags($_POST['bo_device'][$k], 1, 1) : '';
$post_bo_skin = isset($_POST['bo_skin'][$k]) ? clean_xss_tags($_POST['bo_skin'][$k], 1, 1) : '';
$post_bo_mobile_skin = isset($_POST['bo_mobile_skin'][$k]) ? clean_xss_tags($_POST['bo_mobile_skin'][$k], 1, 1) : '';
$post_bo_read_point = isset($_POST['bo_read_point'][$k]) ? clean_xss_tags($_POST['bo_read_point'][$k], 1, 1) : '';
$post_bo_write_point = isset($_POST['bo_write_point'][$k]) ? clean_xss_tags($_POST['bo_write_point'][$k], 1, 1) : '';
$post_bo_comment_point = isset($_POST['bo_comment_point'][$k]) ? clean_xss_tags($_POST['bo_comment_point'][$k], 1, 1) : '';
$post_bo_download_point = isset($_POST['bo_download_point'][$k]) ? clean_xss_tags($_POST['bo_download_point'][$k], 1, 1) : '';
$post_bo_use_search = isset($_POST['bo_use_search'][$k]) ? clean_xss_tags($_POST['bo_use_search'][$k], 1, 1) : '';
$post_bo_use_sns = isset($_POST['bo_use_sns'][$k]) ? clean_xss_tags($_POST['bo_use_sns'][$k], 1, 1) : '';
$post_bo_order = isset($_POST['bo_order'][$k]) ? clean_xss_tags($_POST['bo_order'][$k], 1, 1) : '';
$post_board_table = isset($_POST['board_table'][$k]) ? clean_xss_tags($_POST['board_table'][$k], 1, 1) : '';
$bo_skin_set = '';
if ($post_bo_skin && $post_bo_mobile_skin) {
$bo_skin_set = " bo_skin = '" . sql_real_escape_string($post_bo_skin) . "',
bo_mobile_skin = '" . sql_real_escape_string($post_bo_mobile_skin) . "',
";
}
unset($post_use_gnu_skin);
if (isset($_POST['use_gnu_skin'][$k])) {
$post_use_gnu_skin = $_POST['use_gnu_skin'][$k] == 'y' ? 'y': 'n';
}
if ($is_admin != 'super') {
$sql = " select count(*) as cnt from {$g5['board_table']} a, {$g5['group_table']} b
where a.gr_id = '" . sql_real_escape_string($post_gr_id) . "'
and a.gr_id = b.gr_id
and b.gr_admin = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if (!$row['cnt']) {
alert('최고관리자가 아닌 경우 다른 관리자의 게시판(' . $board_table[$k] . ')은 수정이 불가합니다.');
}
}
$p_bo_subject = is_array($_POST['bo_subject']) ? strip_tags(clean_xss_attributes($_POST['bo_subject'][$k])) : '';
$sql = " update {$g5['board_table']}
set gr_id = '" . sql_real_escape_string($post_gr_id) . "',
bo_subject = '" . $p_bo_subject . "',
bo_device = '" . sql_real_escape_string($post_bo_device) . "',
{$bo_skin_set}
bo_read_point = '" . sql_real_escape_string($post_bo_read_point) . "',
bo_write_point = '" . sql_real_escape_string($post_bo_write_point) . "',
bo_comment_point = '" . sql_real_escape_string($post_bo_comment_point) . "',
bo_download_point = '" . sql_real_escape_string($post_bo_download_point) . "',
bo_use_search = '" . sql_real_escape_string($post_bo_use_search) . "',
bo_use_sns = '" . sql_real_escape_string($post_bo_use_sns) . "',
bo_order = '" . sql_real_escape_string($post_bo_order) . "'
where bo_table = '" . sql_real_escape_string($post_board_table) . "' ";
sql_query($sql);
if ($post_use_gnu_skin) {
$sql = " update {$g5['eyoom_board']} set use_gnu_skin = '{$post_use_gnu_skin}' where bo_table = '" . sql_real_escape_string($post_board_table) . "' ";
sql_query($sql);
}
}
$msg = "정상적으로 수정하였습니다.";
} else if ($act_button == "선택삭제") {
if ($is_admin != 'super') {
alert('게시판 삭제는 최고관리자만 가능합니다.');
}
auth_check_menu($auth, $sub_menu, 'd');
// _BOARD_DELETE_ 상수를 선언해야 board_delete.inc.php 가 정상 작동함
/* 확인필요 22.05.27
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects,
or it should execute logic with side effects, but should not do both.*/
define('_BOARD_DELETE_', true);
for ($i=0; $i<$post_count_chk; $i++) {
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
// include 전에 $bo_table 값을 반드시 넘겨야 함
$tmp_bo_table = isset($_POST['board_table'][$k]) ? trim(clean_xss_tags($_POST['board_table'][$k], 1, 1)) : '';
if (preg_match("/^[A-Za-z0-9_]+$/", $tmp_bo_table)) {
include (G5_ADMIN_PATH . '/board_delete.inc.php');
// 확장필드 정보 삭제
sql_query("delete from {$g5['eyoom_exboard']} where bo_table = '" . sql_real_escape_string($tmp_bo_table) . "' ");
// 이윰게시판 확장 정보 삭제
sql_query("delete from {$g5['eyoom_board']} where bo_table = '" . sql_real_escape_string($tmp_bo_table) . "' ");
// 인기게시글 삭제
sql_query(" delete from {$g5['eyoom_best']} where bo_table = '{$tmp_bo_table}' ");
}
}
$msg = "선택한 게시판을 삭제하였습니다.";
}
// query string
$qstr .= $grid ? '&amp;grid='.$grid: '';
$qstr .= $boskin ? '&amp;boskin='.$boskin: '';
$qstr .= $bomobileskin ? '&amp;bomobileskin='.$bomobileskin: '';
$qstr .= $bo_ex ? '&amp;bo_ex='.$bo_ex: '';
$qstr .= $bo_cate ? '&amp;bo_cate='.$bo_cate: '';
$qstr .= $bo_sideview ? '&amp;bo_sideview='.$bo_sideview: '';
$qstr .= $bo_dhtml ? '&amp;bo_dhtml='.$bo_dhtml: '';
$qstr .= $bo_secret ? '&amp;bo_secret='.$bo_secret: '';
$qstr .= $bo_good ? '&amp;bo_good='.$bo_good: '';
$qstr .= $bo_nogood ? '&amp;bo_nogood='.$bo_nogood: '';
$qstr .= $bo_file ? '&amp;bo_file='.$bo_file: '';
$qstr .= $bo_cont ? '&amp;bo_cont='.$bo_cont: '';
$qstr .= $bo_list ? '&amp;bo_list='.$bo_list: '';
$qstr .= $bo_sns ? '&amp;bo_sns='.$bo_sns: '';
$qstr .= $wmode ? '&amp;wmode=1': '';
run_event('admin_board_list_update', $act_button, $chk, $board_table, $qstr);
alert($msg, G5_ADMIN_URL . '/?dir=board&amp;pid=board_list&amp;' . $qstr);
@@ -0,0 +1,33 @@
<?php
/**
* @file /adm/eyoom_admin/core/board/board_list_update.php
*/
if (!defined('_EYOOM_IS_ADMIN_')) exit;
$sub_menu = "300100";
auth_check_menu($auth, $sub_menu, 'w');
if (!$board['bo_table']) {
alert('존재하지 않는 게시판입니다.');
}
$g5['title'] = $board['bo_subject'] . ' 게시판 썸네일 삭제';
$directory = G5_DATA_PATH . '/file/' . $bo_table;
$cnt=0;
$print_html = array();
if (is_dir($directory)) {
$files = glob($dirname.'/thumb-*');
if (is_array($files)) {
foreach($files as $thumbnail) {
$cnt++;
@unlink($thumbnail);
$print_html[$cnt] = $thumbnail;
flush();
}
}
}

Some files were not shown because too many files have changed in this diff Show More