-
Notifications
You must be signed in to change notification settings - Fork 2
/
mw.jump.update.php
96 lines (77 loc) · 3.24 KB
/
mw.jump.update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?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 or !$wr_id) die("데이터가 없습니다.");
include_once("{$board_skin_path}/mw.lib/mw.skin.basic.lib.php");
if (!$is_admin and !($mw_basic['cf_jump_level'] && $mw_basic['cf_jump_level'] <= $member['mb_level'])) {
die("권한이 없습니다.");
}
if (!$is_admin and $write['mb_id'] != $member['mb_id']) {
die("권한이 없습니다.");
}
if ($mw_basic['cf_jump_days'] or $mw_basic['cf_jump_count']) {
$jump_days = $mw_basic['cf_jump_days'] - 1;
$old = date("Y-m-d 00:00:00", strtotime("-{$jump_days} day", $g4['server_time']));
if (!$mw_basic['cf_jump_days']) $old = "";
$sql = " select count(*) as cnt from {$mw['jump_log_table']} ";
$sql.= " where mb_id = '{$member['mb_id']}' ";
$sql.= " and jp_datetime > '$old' ";
$row = sql_fetch($sql);
$count = $row['cnt'];
$count++;
if ($mw_basic['cf_jump_count'] and $count > $mw_basic['cf_jump_count'] and !$is_admin) {
die("횟수를 초과했습니다. ({$mw_basic['cf_jump_days']}일에 {$mw_basic['cf_jump_count']}번)");
}
}
if ($mw_basic['cf_jump_point']) {
if ($mw_basic['cf_jump_point'] > $member['mb_point']) {
die("포인트가 부족합니다.");
}
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} ";
$sql.= " set wr_num = '{$wr_num}' ";
$sql.= " , wr_datetime = '{$g4['time_ymdhis']}' ";
$sql.= " where wr_id = '{$write['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);
}
*/
mw_jump($bo_table, $wr_id);
echo "ok";