function wikipedia($msg) { // [[語句]]があった時にWikipediaへ自動リンクするんだぜ? global $_conf; $msg = mb_convert_encoding($msg, "UTF-8", "SJIS_win"); // SJISはうざいからUTF-8に変換するんだぜ? if($_conf['ktai']){ $wikipedia = "http://ja.wapedia.org/"; // WapediaのURLなんだぜ? }else{ $wikipedia = "http://ja.wikipedia.org/wiki/"; // WikipediaのURLなんだぜ? } $search = "/\[\[[^\[\]\n<>]+\]\]+/"; // 目印となる正規表現なんだぜ? preg_match_all($search, $msg, $matches); // [[語句]]を探すんだぜ? $matched = preg_replace("/^\[\[|\]\]$/", "", $matches[0]); // いったん"[["と"]]"を取るんだぜ? foreach ($matched as $value) { // リンクに変換するんだぜ? $replaced[] = "[[<a href=?"" . P2Util::throughIme($wikipedia . rawurlencode($value)) . "?"" . $_conf['ext_win_target_at'] . ">$value</a>]]"; // しっかりimeを通すんだぜ? } $msg = str_replace($matches[0], $replaced, $msg); // 変換後の本文を戻すんだぜ? $msg = mb_convert_encoding($msg, "SJIS_win", "UTF-8"); // UTF-8からSJISに戻すんだぜ? return $msg; } $msg = preg_replace_callback($this->str_to_link_regex, array($this, 'link_callback'), $msg); return $msg; $msg = wikipedia($msg); // Wikipediaへの自動リンクなんだぜ。
$this->downloadDat2ch($this->length); $this->downloadDat2ch($this->length,$_GET["dat"]); function downloadDat2ch($from_bytes) function downloadDat2ch($from_bytes,$dat) $url = 'http://' . $this->host . "/{$this->bbs}/dat/{$this->key}.dat"; switch($dat){ case 1: if(strpos($this->host,"bbspink")){ $niku_host = "bbspink-"; }else{ $niku_host = ""; } $niku_host .= substr($this->host,0,strpos($this->host,".")); $url = 'http://makimo.to/cgi-bin/html2dat/html2dat.cgi?' . $niku_host . "_{$this->bbs}/" .substr($this->key,0,4) . "/{$this->key}.html"; break; case 2: $url = "http://mimizun.com:81/log/2ch/{$this->bbs}/{$this->host}/{$this->bbs}/kako/" .substr($this->key,0,4) . "/" . substr($this->key,0,5) . "/{$this->key}.dat"; break; default: $url = 'http://' . $this->host . "/{$this->bbs}/dat/{$this->key}.dat"; break; } $dat_response_msg = "<p>2ch info - このスレッドは過去ログ倉庫に格納されています。 [{$marutori_ht}]</p>"; $ktai = $_conf['ktai'] ? "&b=k" : ""; $nikutori_ht = "<a href=\"{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&dat=1{$ktai}\">にくちゃんねるからp2に取り込む</a>"; $mimitori_ht = "<a href=\"{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&dat=2{$ktai}\">みみずん検索からp2に取り込む</a>"; $dat_response_msg = "<p>2ch info - このスレッドは過去ログ倉庫に格納されています。 [{$marutori_ht}] [{$nikutori_ht}] [{$mimitori_ht}]</p>";
$board=array('ghard', 'gamenews', 'famicom', 'gamerpg', 'gamesrpg', 'handygame', 'gamerobo', 'ff', 'game', 'gamef', 'arc', 'wifi', 'gamechara', 'gamestg', 'gamemusic', 'gamefight', 'gal', 'gsaloon', 'gline', 'newsplus', 'news', 'mnewsplus', 'bizplus', 'news2', 'news4plus', 'aasaloon', 'occult', 'sfx', 'korea', 'av', 'pav', 'stock', 'market', 'baby', 'ms', 'campus', 'livevenus', 'livenhk', 'liveetv', 'liventv', 'livetbs', 'livecx', 'liveanb', 'livetx', 'livemarket1', 'livemarket2', 'jsaloon', 'kouri', 'dog', 'bike', 'f1', 'base', 'mlb', 'hsb', 'soccer', 'football', 'wres', 'keiba', 'ogame', 'ogame2', 'ogame3', 'netgame', 'mmo', 'mmominor', 'anime', 'anime2', 'voice', 'voiceactor', 'doujin', 'comic', 'wcomic', 'musicnews', 'musicj', 'musice', 'jisaku', 'software', 'swf', 'download', 'net', 'news4vip', 'neet4vip'); if($id && ereg("^[a-zA-Z0-9]+\.2ch\.net$",$this->thread->host)){ if(array_search($this->thread->bbs,$board)){ preg_match("/(\d{4})\/(\d{2})\/(\d{2})/i",$date_id,$date_array); $date = $date_array[1].$date_array[2].$date_array[3]; if($date){ $hissi_url=P2Util::throughIme("http://hissi.dyndns.ws/read.php/{$this->thread->bbs}/{$date}/".base64_encode($id).".html"); $tores.= "<a href=\"{$hissi_url}\" onmouseover=\"showHtmlPopUp('{$hissi_url}',event,0.2)\" onmouseout=\"offHtmlPopUp()\" target=\"_blank\"><img src=\"img/check.png\"></a>"; } } }
echo "</table>\n"; if(ereg("^[a-zA-Z0-9]+\.2ch\.net$",$aThreadList->host)){ $board=array('ghard', 'gamenews', 'famicom', 'gamerpg', 'gamesrpg', 'handygame', 'gamerobo', 'ff', 'game', 'gamef', 'arc', 'wifi', 'gamechara', 'gamestg', 'gamemusic', 'gamefight', 'gal', 'gsaloon', 'gline', 'newsplus', 'news', 'mnewsplus', 'bizplus', 'news2', 'news4plus', 'aasaloon', 'occult', 'sfx', 'korea', 'av', 'pav', 'stock', 'market', 'baby', 'ms', 'campus', 'livevenus', 'livenhk', 'liveetv', 'liventv', 'livetbs', 'livecx', 'liveanb', 'livetx', 'livemarket1', 'livemarket2', 'jsaloon', 'kouri', 'dog', 'bike', 'f1', 'base', 'mlb', 'hsb', 'soccer', 'football', 'wres', 'keiba', 'ogame', 'ogame2', 'ogame3', 'netgame', 'mmo', 'mmominor', 'anime', 'anime2', 'voice', 'voiceactor', 'doujin', 'comic', 'wcomic', 'musicnews', 'musicj', 'musice', 'jisaku', 'software', 'swf', 'download', 'net', 'news4vip', 'neet4vip'); if(array_search($aThreadList->bbs,$board)){ require_once P2_LIBRARY_DIR . '/filectl.class.php'; $hissi_url=P2Util::throughIme("http://hissi.dyndns.ws/read.php/{$aThreadList->bbs}/"); $hissi_ht = <<<EOP | <a href="{$hissi_url}" target="read">必死チェッカー</a> EOP; } } echo "</p>"; echo $hissi_ht;
$url_res = "read.php\?bbs={$this->thread->bbs}&key={$this->thread->key}&host={$this->thread->host}&ls=all&offline=1&field=msg&word=%28%3E%7C%81%84%29%28%5Cd%2B%2C%29*{$i}%5CD&method=regex&match=on&submit_filter=%83t%83B%83%8B%83%5E%95%5C%8E%A6"; $tores .="\n<a href=\"{$url_res}\" onmouseover=\"showHtmlPopUp('{$url_res},renzokupop=true',event,0.2)\" onmouseout=\"offHtmlPopUp()\"><img src=\"img/re.png\"></a>";
$tores .= "<div id=\"r{$i}\" name=\"r{$i}\">[<font color=\"{$STYLE['mobile_read_newres_color']}\">{$i}</font>]"; $tores .= "<div id=\"r{$i}\" name=\"r{$i}\">[<font color=\"{$STYLE['mobile_read_newres_color']}\"><a href=\"spm2_k.php\b=k&host={$this->thread->host}&bbs={$this->thread->bbs}&key={$this->thread->key}&offline=1&ktool_value={$i}\">{$i}</a></font>]"; $tores .= "<div id=\"r{$i}\" name=\"r{$i}\">[{$i}]"; $tores .= "<div id=\"r{$i}\" name=\"r{$i}\">[<a href=\"spm2_k.php\b=k&host={$this->thread->host}&bbs={$this->thread->bbs}&key={$this->thread->key}&offline=1&ktool_value={$i}\">{$i}</a>]";
// フィルタ検索 ================================================== // チェックフォーム ===================================== // フィルタ検索 ================================================== // 検索結果
if($_GET['aborn']) return FALSE; // ■プリント $htm['showaborn']="<a href=\"read.php?aborn=1&".$_SERVER["QUERY_STRING"]."\">さぼり</a>";
| {$htm['dores']} の上あたりに
| {$htm['showaborn']} <a href="{$motothre_url}">{$moto_thre_st}</a> <a href="read.php?aborn=1&{$_SERVER["QUERY_STRING"]}">怠</a>
if (!$aThreadList->spmode and $sb_view == "shinchaku" and !$_GET['word']) { if ($aThread->unum >= 件数) { unset($aThread); continue; } }
<a href="{$motothre_url}">{$moto_thre_st}</a> <a href="info.php?host={$aThread->host}{$bbs_q}{$key_q}{$ttitle_en_q}&taborn=2{$_conf['k_at_a']}">あぼーん</a>
<? $before= file_get_contents("http://find.2ch.net/?".$_SERVER["QUERY_STRING"]); //処理は適当 for($i=0;$i<=50;$i++){ $after=ereg_replace("<dt><a href=\"(.*)\"><b>","<dt><a target=\"read\" href=\"read.php?url=\\1\"><b>",$before); if($before==$after){ break; }else{ $before=$after; } } <a href="http://find.2ch.net/" target="_blank" title="2ch公式検索">find.2ch.net</a><br> <a href="find2ch.php" target="subject" title="2ch公式検索">find.2ch.net</a><br>
$this->keydat = $dat_host_dir . '/' . $this->bbs . '/' . $this->key . '.dat'; $this->keydat = $dat_host_dir . '/' . $this->bbs . '/' . substr($this->key,0,4) . '/' . $this->key . '.dat';
$adat = $dat_host_dir . '/' . $this->bbs . '/' . $this->key . '.dat'; $adat = $dat_host_dir . '/' . $this->bbs . '/' . substr($key,0,4) . '/' . $this->key . '.dat';
$dat_path = P2Util::datDirOfHost($host) . '/' . $bbs . '/' . $dat_name; $dat_path = P2Util::datDirOfHost($host) . '/' . $bbs . '/' . substr($key,0,4) . '/' . $dat_name;
while ($entry = $ddir->read()) { if (preg_match($dat_pattern, $entry2, $matches)) { $theidx = $idx_bbs_dir."/".$matches[1].".idx"; if (!file_exists($theidx)) { if ($datlines = @file($dat_bbs_dir."/".$entry)) { $firstdatline = rtrim($datlines[0]); if (strstr($firstdatline, "<>")) { $datline_sepa = "<>"; } else { $datline_sepa = ","; } $d = explode($datline_sepa, $firstdatline); $atitle = $d[4]; $gotnum = sizeof($datlines); $readnum = $gotnum; $anewline = $readnum + 1; $data = array($atitle, $matches[1], '', $gotnum, '', $readnum, '', '', '', $anewline, '', '', ''); P2Util::recKeyIdx($theidx, $data); } } // array_push($lines, $idl[0]); } } if( $entry=='.' || $entry=='..' ) continue; if(is_dir($dat_bbs_dir.'/'.$entry)){ $ddir = dir($dat_bbs_dir.'/'.$entry); while ($entry2 = $ddir->read()) { if (preg_match($dat_pattern, $entry2, $matches)) { $theidx = $idx_bbs_dir."/".$matches[1].".idx"; if (!file_exists($theidx)) { if ($datlines = @file($dat_bbs_dir."/".$entry2)) { $firstdatline = rtrim($datlines[0]); if (strstr($firstdatline, "<>")) { $datline_sepa = "<>"; } else { $datline_sepa = ","; } $d = explode($datline_sepa, $firstdatline); $atitle = $d[4]; $gotnum = sizeof($datlines); $readnum = $gotnum; $anewline = $readnum + 1; $data = array($atitle, $matches[1], '', $gotnum, '', $readnum, '', '', '', $anewline, '', '', ''); P2Util::recKeyIdx($theidx, $data); } } // array_push($lines, $idl[0]); } } $ddir->close(); }
function datDirOfHost($host) { global $_conf; // bbspink if( P2Util::isHostBbsPink($host)) { $dat_host_dir = $_conf['dat_dir']."/bbspink.com"; }else if (P2Util::isHost2chs($host)) { $dat_host_dir = $_conf['dat_dir']."/2ch.net"; // machibbs.com } elseif (P2Util::isHostMachiBbs($host)) { $dat_host_dir = $_conf['dat_dir']."/machi.to"; } elseif (preg_match('/[^.0-9A-Za-z.\\-_]/', $host) && !P2Util::isHostJbbsShitaraba($host)) { $dat_host_dir = $_conf['dat_dir']."/".rawurlencode($host); $old_dat_host_dir = $_conf['dat_dir']."/".$host; if (is_dir($old_dat_host_dir)) { rename($old_dat_host_dir, $dat_host_dir); clearstatcache(); } } else { $dat_host_dir = $_conf['dat_dir']."/".$host; } return $dat_host_dir; }
/** * ImageCache2サムネイル変換 */ function plugin_imageCache2($url, $purl, $str) { global $_conf; global $pre_thumb_unlimited, $pre_thumb_ignore_limit, $pre_thumb_limit; static $serial = 0; ////////ここから追加/////////////////////////// $pita =false; if (preg_match('{^https?://imepita.jp/.+?$}i', $url) && empty($purl['query'])) { $tok = explode("/", $url); $url = $tok[0]."//".$tok[2]."/img/trial/".$tok[3]."/".$tok[4].".jpg"; } elseif (preg_match('{^https?://[^\.]+?.pita.st/+?}i', $url) ) { $src = file_get_contents($url); if(preg_match('{<img src="(https?://image[0-9]+?.pita.st/[^"]+?)"}i', $src, $match)){ $url = $match[1]; $pita = true; } } ////////追加ここまで///////////////////////////
if (preg_match('{^https?://.+?\\.(jpe?g|gif|png)$}i', $url) && empty($purl['query'])) { if ((preg_match('{^https?://.+?\\.(jpe?g|gif|png)$}i', $url) && empty($purl['query'])) || $pita == true) {
611,617d610 < /// z.u.la < $zula_link = ''; < if (true || $_conf['k_use_zula']) { < $zula_url = preg_replace('|^(\w+)://(.+)$|', 'http://z.u.la/$2', $in_url); < $zula_link = '<a href="'.$zula_url.'">z</a>'; < } 629,630c622 < if ($zula_link && $tsukin_link && $jig_link) { --- > if ($tsukin_link && $jig_link) { 635,636c627,628 < if ($zula_link || $tsukin_link || $jig_link) { < $ext_pre = '('.$tsukin_link.$sepa.$jig_link.$sepa.$zula_link.')'; --- > if ($tsukin_link || $jig_link) { > $ext_pre = '('.$tsukin_link.$sepa.$jig_link.')'; 747c739 < if ($_conf['k_use_tsukin'] || $_conf['k_use_zula']) { --- > if ($_conf['k_use_tsukin']) { <// 携帯閲覧時、外部リンクにz.u.la(z)を利用(する:1, しない:0) <$conf_user_def['k_use_zula'] = 1; // (1) <$conf_user_rad['k_use_zula'] = array('1' => 'する', '0' => 'しない');
function plugin_linkYouTube($url, $purl, $str) { global $_conf; // http://www.youtube.com/watch?v=Mn8tiFnAUAI if (preg_match('{^http://([a-z]+)\\.youtube\\.com/watch\\?v=([0-9a-zA-Z_-]+)}', $url, $m)) { $url = P2Util::throughIme($url); return <<<EOP <a href="$url"{$_conf['ext_win_target_at']}>$str</a><br> <object width="425" height="350"> <param name="movie" value="http://{$m[1]}.youtube.com/v/{$m[2]}"></param> <param name="wmode" value="transparent"></param> <embed src="http://{$m[1]}.youtube.com/v/{$m[2]}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed> </object>\n EOP; } return FALSE; }