Skip to content

Commit 213b6f8

Browse files
killer4989open774
authored andcommitted
浪人の有効期限表示を設定で切り替えられるようにした
ほぼやっつけで'エラー・期限切れの場合のみ表示'に関しては期限切れのアカウントがないので 人柱機能ということにしてください。
1 parent 0340267 commit 213b6f8

4 files changed

Lines changed: 23 additions & 0 deletions

File tree

conf/conf.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ function p2_init()
8080
$_conf['expack.tgrep_url'] = 'http://page2.xrea.jp/tgrep/search';
8181
$_conf['test.dig2ch_url'] = 'https://dig.5ch.net/';
8282
$_conf['expack.gate_php'] = '//open774.github.io/p2-php/gate.html';
83+
$_conf['title_php'] = 'title.php';
8384
$_conf['menu_php'] = 'menu.php';
8485
$_conf['subject_php'] = 'subject.php';
8586
$_conf['read_php'] = 'read.php';

conf/conf_user_def.inc.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,15 @@
596596
$conf_user_def['2ch_ssl.post'] = 0; // (0)
597597
$conf_user_rad['2ch_ssl.post'] = array('1' => 'する', '0' => 'しない');
598598

599+
// 浪人の有効期限表示
600+
$conf_user_def['disp_ronin_expiration'] = 0; // (0)
601+
$conf_user_sel['disp_ronin_expiration'] = array(
602+
'0' => 'する',
603+
'1' => 'エラー・期限切れの場合のみ表示',
604+
'2' => 'タイトル画面のみ表示',
605+
'3' => 'しない'
606+
);
607+
599608
// }}}
600609
// {{{ 拡張パックとiPhone
601610

lib/P2Util.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,10 @@ function checkRoninExpiration()
18491849
{
18501850
global $_conf;
18511851

1852+
if($_conf['disp_ronin_expiration'] === "3"){
1853+
return true;
1854+
}
1855+
18521856
$url = 'https://auth.bbspink.com/auth/timecheck.php';
18531857

18541858
if($_conf['2chapi_use'] == 1) {
@@ -1938,6 +1942,13 @@ function checkRoninExpiration()
19381942
return true;
19391943
}
19401944

1945+
if(
1946+
$_conf['disp_ronin_expiration'] === "1"
1947+
|| ($_conf['disp_ronin_expiration'] === "2" && basename($_SERVER["SCRIPT_NAME"]) !== $_conf['title_php'])
1948+
){
1949+
return true;
1950+
}
1951+
19411952
self::pushInfoHtml("<p>p2 info: 浪人<●>の有効期限は {$date} です。</p>");
19421953
return true;
19431954
}

rep2/edit_conf_user.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@
449449
array('ssl_capath', 'SSL通信で接続先を検証するための証明書があるディレクトリ ex)&quot;/etc/ssl/certs&quot;<br>設定なして動く場合は設定不要'),
450450
array('2ch_ssl.subject', '2ch.netのsubjec.txtとSETTING.TXTの取得にSSLを使用する'),
451451
array('2ch_ssl.post', '2ch.netの書き込みにSSLを使用する'),
452+
'浪人設定',
453+
array('disp_ronin_expiration', '浪人の有効期限を表示設定'),
452454
);
453455
printEditConfGroupHtml($groupname, $conflist, $flags);
454456
}

0 commit comments

Comments
 (0)