-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathspm_k.php
142 lines (132 loc) · 4.25 KB
/
spm_k.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
/**
* rep2 - 特殊機能実行スクリプト(携帯)
*/
require_once './conf/conf.inc.php';
require_once P2_LIB_DIR . '/spm_k.inc.php';
$_login->authorize(); // ユーザ認証
//=================================================
// 特殊リクエストを実行
//=================================================
if (isset($_GET['ktool_name']) && isset($_GET['ktool_value'])) {
$ktv = (int)$_GET['ktool_value'];
$base_dir_s = P2_BASE_DIR . DIRECTORY_SEPARATOR;
switch ($_GET['ktool_name']) {
case 'goto':
$_REQUEST['ls'] = $_GET['ls'] = sprintf('%d-%d', $ktv, $ktv + $_conf['mobile.rnum_range']);
include $base_dir_s . 'read.php';
exit;
case 'rref':
$_REQUEST['rf'] = array(
'field' => ResFilter::FIELD_NUMBER,
'method' => ResFilter::METHOD_JUST,
'match' => ResFilter::MATCH_ON,
'include' => ResFilter::INCLUDE_REFERENCED,
'word' => (string)$ktv, // intではだめ
);
include $base_dir_s . 'read.php';
exit;
case 'res':
case 'res_quote':
$_GET['resnum'] = $ktv;
$_GET['inyou'] = ($_GET['ktool_name'] == 'res') ? -1 : 1;
include $base_dir_s . 'post_form.php';
exit;
case 'copy_quote':
$_GET['inyou'] = 1;
case 'copy':
$_GET['copy'] = $ktv;
include $base_dir_s . 'read_copy_k.php';
exit;
case 'aas_rotate':
$_GET['rotate'] = 1;
case 'aas':
$_GET['resnum'] = $ktv;
include $base_dir_s . 'aas.php';
exit;
case 'aborn_res':
case 'aborn_name':
case 'aborn_mail':
case 'aborn_id':
case 'aborn_msg':
case 'ng_name':
case 'ng_mail':
case 'ng_id':
case 'ng_msg':
case 'aborn_be': // +Wiki
case 'ng_be': // +Wiki
$_GET['resnum'] = $ktv;
$_GET['popup'] = 1;
$_GET['mode'] = $_GET['ktool_name'];
include $base_dir_s . 'info_sp.php';
exit;
default:
p2die('不正なコマンド');
}
}
//=================================================
// スレの指定
//=================================================
kspDetectThread(); // global $host, $bbs, $key, $ls
$aThread = new Thread();
// hostを分解してidxファイルのパスを求める
if (!isset($aThread->keyidx)) {
$aThread->setThreadPathInfo($host, $bbs, $key);
}
$aThread->itaj = P2Util::getItaName($host, $bbs);
if (!$aThread->itaj) { $aThread->itaj = $aThread->bbs; }
// idxファイルがあれば読み込む
if ($lines = FileCtl::file_read_lines($aThread->keyidx, FILE_IGNORE_NEW_LINES)) {
$idx_data = explode('<>', $lines[0]);
} else {
p2die('指定されたスレッドのidxがありません。');
}
$aThread->getThreadInfoFromIdx();
//=================================================
// 表示用変数を設定
//=================================================
$ptitle_ht = $aThread->ttitle_hd;
$thread_url = "{$_conf['read_php']}?host={$host}&bbs={$bbs}&key={$key}{$_conf['k_at_a']}";
$params = array();
if (!empty($_GET['from_read_new'])) {
$params['from_read_new'] = '1';
}
$default = (!empty($_GET['spm_default'])) ? intval($_GET['spm_default']) : '';
//=================================================
// 表示
//=================================================
P2Util::header_nocache();
echo $_conf['doctype'];
echo <<<EOHEADER
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
{$_conf['extra_headers_ht']}
<title>{$ptitle_ht}</title>
</head>\n
EOHEADER;
echo "<body{$_conf['k_colors']}>";
P2Util::printInfoHtml();
echo "<p><a href=\"{$thread_url}\">{$ptitle_ht}</a></p>";
echo '<hr>';
echo kspform($aThread, $default, $params);
echo '<hr>';
echo '<p>';
if (!empty($_GET['from_read_new'])) {
echo "<a href=\"{$_conf['read_new_k_php']}?cview=1{$_conf['k_at_a']}\">まとめ読みに戻る</a><br>";
}
echo "<a href=\"{$thread_url}\">スレに戻る</a>";
echo '</p>';
echo '</body></html>';
exit;
/*
* Local Variables:
* mode: php
* coding: cp932
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: