Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- lib/ShowThread.php.org
- +++ lib/ShowThread.php
- @@ -360,6 +360,31 @@
- $this->_quote_res_nums = array();
- $this->_quote_res_nums_checked = array();
- $this->_quote_res_nums_done = array();
- +
- + if (P2HostMgr::isHost2chs ($this->thread->host) || P2HostMgr::isHostBbsPink ($this->thread->host)) {
- + $cache = new Cache_Lite([
- + 'cacheDir' => $_conf['cache_dir'].DIRECTORY_SEPARATOR.'sikiguard'.DIRECTORY_SEPARATOR,
- + 'lifeTime' => 600,
- + 'fileNameProtection' => false,
- + 'automaticSerialization' => false,
- + ]);
- + preg_match('/5ch\.net|bbspink\.com/', $this->thread->host, $m);
- + $host_short = $m[0];
- + if (!$sikiguard_tx = $cache->get($host_short.'_'.$this->thread->bbs)) {
- + $ch = curl_init();
- + curl_setopt($ch, CURLOPT_URL, 'https://sikiguard.net/'.$host_short.'/'.$this->thread->bbs.'/id.txt?t='.microtime(true).'00');
- + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
- + curl_setopt($ch, CURLOPT_HTTPHEADER, ['User-Agent: Monazilla/1.00']);
- + $sikiguard_tx = curl_exec($ch);
- + curl_close($ch);
- + if (!file_exists($_conf['cache_dir'] . DIRECTORY_SEPARATOR . 'sikiguard')) {
- + mkdir($_conf['cache_dir'].DIRECTORY_SEPARATOR.'sikiguard');
- + }
- + $cache->save($sikiguard_tx, $host_short.'_'.$this->thread->bbs);
- + }
- + $this->sikiguard_ids = explode(PHP_EOL, $sikiguard_tx);
- + }
- }
- // }}}
- @@ -791,6 +816,11 @@
- $ngaborns_hits['aborn_msg']++;
- return $this->_markNgAborn($i, self::ABORN, true);
- }
- +
- + preg_match('/20(\d\d)\/(\d\d)\/(\d\d).+ID:(.+)/', $date_id, $m);
- + if ($m && in_array($m[4].' '.$m[1].$m[2].$m[3], $this->sikiguard_ids)) {
- + return $this->_markNgAborn($i, self::NG_ID, false);
- + }
- // }}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement