Files
core/twe/c_vote.php
T
Hide_D 0c9be5c53f 루트DB를 관리하는 방식을 통째로 변경
- DB 불러오는 방식을 기존의 set.php에서 conf.php의 getRootDB()를 이용하도록 변경
- ADODB 에 기반한 _DB 클래스 폐기
- DBS.php 폐기
- _Setting 클래스 용도 변경
- 서버 목록 정의 방식을 하나로 모음
- 로그인시 세션에 사용자 등급을 추가
- "참여"(donation) 관련 코드 전면 제거
- 서버 리셋시 부운영자 비밀번호 문제 수정
- 서버 오픈,닫힘 여부를 새 서버 목록 정의 방식에 따르도록 수정
- DBS.php가 폐기 되었으므로 서버 오픈시 기본 정보를 json으로 받아오도록 하기 위하여 기본 준비
-  기존에 남아있던 세부 서버 로그인 처리 파일을 제거(enterPost.php)
- DBS.php 삭제로 전콘 변경시에도 각 서버로 json 호출을 하도록 하는 방식으로 준비
- 전콘을 수동으로 서버에 올린뒤 처리할 수 있도록 하던 legacy 코드 제거
- general 테이블에서 userlevel 컬럼을 삭제하고, 세션에 기록된 userGrade를 이용하도록 변경
- 벌점 제한을 모든 유저 공통으로 하도록 수정
- 세부 서버 리셋을 json ajax로 처리하도록 준비
2018-03-07 00:59:31 +09:00

90 lines
3.3 KiB
PHP

<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select develcost,vote,votecomment from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,vote,name,nation,horse,weap,book,item,npc from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($btn == "투표" && $me['vote'] == 0 && $sel > 0) {
$develcost = $admin['develcost'] * 5;
$query = "update general set gold=gold+{$develcost},vote='{$sel}' where owner='{$_SESSION['noMember']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log = array();
$log = uniqueItem($connect, $me, $log, 1);
pushGenLog($me, $log);
}
else if($btn == "댓글" && $comment != "") {
$comment = str_replace("|", " ", $comment);
$comment = str_replace(":", " ", $comment);
$comment = trim($comment);
$comment = addslashes(SQ2DQ($comment));
$nation = getNationStaticInfo($me['nation']);
if($nation == null) {
$nation['name'] = "재야";
}
if($admin['votecomment'] != "") { $admin['votecomment'] .= "|"; }
$admin['votecomment'] .= "{$nation['name']}:{$me['name']}:{$comment}";
$query = "update game set votecomment='{$admin['votecomment']}' where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
if(getUserGrade() < 5){
echo "<!--<script>location.replace('a_vote.php');</script>"; //TODO:debug all and replace -->
echo 'a_vote.php ';
die();
}
if($btn == "수정") {
if($title != "") {
$vote = explode("|", $admin['vote']);
$vote[0] = addslashes(SQ2DQ($title));
$admin['vote'] = implode("|", $vote);
$query = "update game set vote='{$admin['vote']}' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "추가") {
if($str != "") {
$str = addslashes(SQ2DQ($str));
$admin['vote'] .= "|{$str}";
$query = "update game set vote='{$admin['vote']}' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "리셋") {
$query = "update game set voteopen=1,vote='',votecomment='' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set vote='0'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "알림") {
$query = "update general set newvote='1' where vote=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "숨김") {
$query = "update game set voteopen=0 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전체통계만") {
$query = "update game set voteopen=1 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전부") {
$query = "update game set voteopen=2 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
?>
<!--<script>location.replace('a_vote.php');</script>"; //TODO:debug all and replace -->
a_vote.php