투표 동작 방식 변경
This commit is contained in:
+4
-4
@@ -19,8 +19,8 @@ $query = "select no,vote from general where owner='{$userID}'";
|
|||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['develcost','voteopen','vote','votecomment']);
|
$admin = $gameStor->getValues(['develcost','voteopen','vote_title','vote','votecomment']);
|
||||||
|
$vote_title = $admin['vote_title']??'-';
|
||||||
$vote = $admin['vote']?:['-'];
|
$vote = $admin['vote']?:['-'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -70,11 +70,11 @@ if ($isVoteAdmin) {
|
|||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
$vote[0] = Tag2Code($vote[0]);
|
$vote_title = Tag2Code($vote_title);
|
||||||
echo "
|
echo "
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 width=148 align=center id=bg1>제 목</td>
|
<td colspan=2 width=148 align=center id=bg1>제 목</td>
|
||||||
<td width=848 align=left> {$vote[0]}</td>
|
<td width=848 align=left> {$vote_title}</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|||||||
+8
-6
@@ -23,7 +23,7 @@ $db = DB::db();
|
|||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['develcost', 'cost', 'vote', 'votecomment']);
|
$admin = $gameStor->getValues(['develcost', 'cost', 'vote_title', 'vote', 'votecomment']);
|
||||||
|
|
||||||
$query = "select no,vote,name,nation,horse,weap,book,item,npc from general where owner='{$userID}'";
|
$query = "select no,vote,name,nation,horse,weap,book,item,npc from general where owner='{$userID}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -58,19 +58,21 @@ if(!$isVoteAdmin){
|
|||||||
|
|
||||||
if($btn == "수정") {
|
if($btn == "수정") {
|
||||||
if($title != "") {
|
if($title != "") {
|
||||||
$vote = $admin['vote']?:[];
|
$gameStor->vote_title = $title;
|
||||||
$vote[0] = $title;
|
|
||||||
$gameStor->vote = $vote;
|
|
||||||
}
|
}
|
||||||
} elseif($btn == "추가") {
|
} elseif($btn == "추가") {
|
||||||
if($str != "") {
|
if($str != "") {
|
||||||
|
if(!$admin['vote']){
|
||||||
|
$admin['vote'] = [];
|
||||||
|
}
|
||||||
$admin['vote'][] = $str;
|
$admin['vote'][] = $str;
|
||||||
$gameStor->vote=$admin['vote'];
|
$gameStor->vote=$admin['vote'];
|
||||||
}
|
}
|
||||||
} elseif($btn == "리셋") {
|
} elseif($btn == "리셋") {
|
||||||
$gameStor->voteopen=1;
|
$gameStor->voteopen=1;
|
||||||
$gameStor->vote='';
|
$gameStor->vote=['-'];
|
||||||
$gameStor->votecomment='';
|
$gameStor->vote_title = '-';
|
||||||
|
$gameStor->votecomment=[];
|
||||||
|
|
||||||
$query = "update general set vote='0'";
|
$query = "update general set vote='0'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|||||||
Reference in New Issue
Block a user