Skip to content

Commit

Permalink
목록에서 점프기능 관리자 전용 (l2zeo님 제안)
Browse files Browse the repository at this point in the history
  • Loading branch information
curlychoi committed Aug 9, 2016
1 parent 94e1f8b commit 5b46408
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
17 changes: 17 additions & 0 deletions list.skin.php
Expand Up @@ -1106,6 +1106,7 @@
<div class="item" onclick="mw_qna(2)"><i class="fa fa-inbox"></i> 선택 질문 보류</div>
<div class="item" onclick="select_secret()"><i class="fa fa-inbox"></i> 선택 비밀글</div>
<div class="item" onclick="select_secret_open()"><i class="fa fa-inbox"></i> 선택 비밀글 해제</div>
<div class="item" onclick="select_jump()"><i class="fa fa-paper-plane-o"></i> 선택 점프</div>
</div><!--mw_manage-->
<?php } // is_checkbox ?>

Expand Down Expand Up @@ -1294,6 +1295,22 @@ function select_secret() {
f.submit();
}

// 선택한 게시물 점프
function select_jump() {
var f = document.fboardlist;

$("#admin_action").val('');

if (!check_confirm("점프"))
return;

if (!confirm("선택한 게시물을 정말 점프 하시겠습니까?"))
return;

f.action = "<?php echo $board_skin_path?>/mw.adm/mw.jump.update.php";
f.submit();
}

// 선택한 게시물 해제 비밀글
function select_secret_open() {
var f = document.fboardlist;
Expand Down
52 changes: 52 additions & 0 deletions mw.adm/mw.jump.update.php
@@ -0,0 +1,52 @@
<?php
/**
* Bechu-Basic Skin for Gnuboard4
*
* Copyright (c) 2008 Choi Jae-Young <www.miwit.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

include_once("_common.php");

header("Content-Type: text/html; charset=$g4[charset]");
$gmnow = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0"); // rfc2616 - Section 14.21
header("Last-Modified: " . $gmnow);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0

if (!$bo_table) die("데이터가 없습니다.");

include_once("{$board_skin_path}/mw.lib/mw.skin.basic.lib.php");

if (!$is_admin) {
die("권한이 없습니다.");
}

$tmp_array = array();
$tmp_array = $_POST['chk_wr_id'];

$chk_count = count($tmp_array);

for ($i=$chk_count-1; $i>=0; $i--)
{
$wr_id = $tmp_array[$i];
mw_jump($bo_table, $wr_id);
}

goto_url(mw_seo_url($bo_table, 0, "&page=$page" . $qstr));

31 changes: 31 additions & 0 deletions mw.lib/mw.function.lib.php
Expand Up @@ -4395,3 +4395,34 @@ function mw_row_delete_point($board, $write)
}
}

function mw_jump($bo_table, $wr_id)
{
global $g4;
global $mw;
global $member;

$write_table = $g4['write_prefix'].$bo_table;

$wr_num = get_next_num($write_table);

$sql = " update {$write_table} ";
$sql.= " set wr_num = '{$wr_num}' ";
$sql.= " , wr_datetime = '{$g4['time_ymdhis']}' ";
$sql.= " where wr_id = '{$wr_id}' ";

$qry = sql_query($sql);

if ($qry) {
$sql = " insert into {$mw['jump_log_table']} set ";
$sql.= " bo_table = '{$bo_table}' ";
$sql.= " , wr_id = '{$wr_id}' ";
$sql.= " , mb_id = '{$member['mb_id']}' ";
$sql.= " , jp_datetime = '{$g4['time_ymdhis']}' ";
sql_query($sql);

$sql = " update {$g4['board_new_table']} set bn_datetime = '{$g4['time_ymdhis']}' ";
$sql.= " where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' ";
sql_query($sql);
}
}

3 changes: 3 additions & 0 deletions mw.proc/mw.jump.update.php
Expand Up @@ -67,6 +67,7 @@
insert_point($member['mb_id'], -1*$mw_basic['cf_jump_point'], "새글 점프", $bo_table, $wr_id, $g4['time_ymd'].'-'.$count);
}

/*
$wr_num = get_next_num($write_table);
$sql = " update {$write_table} ";
Expand All @@ -88,6 +89,8 @@
$sql.= " where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' ";
sql_query($sql);
}
*/
mw_jump($bo_table, $wr_id);

echo "ok";

0 comments on commit 5b46408

Please sign in to comment.