&size(18){''このページは最新のrep2およびそれに準ずる拡張パックの類を対象にしています。''};~
&size(18){''公開するpatchは、対応するp2のバージョン番号をわかるようにしてください。''};~
(ファイル名にバージョン番号を含めるなど)

#contents

***892@part32さんのrep2実況モード (+live) [#b553a1cc]
http://m-st.xrea.jp/plus/
http://plus-live.main.jp/

***+Wikiパッチ [#j49dd6aa]
下記に載っているパッチがほぼ全て入り、さらにプラグイン機能を備えたp2のパッチです。~
設定フォームで有効/無効を切り替えてください。~
~
#ref(wiki_061125_0215.zip)
~
対応バージョン:+live_061029_0420~
パッチバージョン:061125_0215~
~
機能
-プラグイン(find.2ch.net, 2ken.net, みみずん検索など)
-スレッドあぼーんワード
-[[単語]]をWikipedia/Wapediaのリンクに変換
-この期間、NG/あぼーんネーム/メール/メッセージ/ID/スレ都度にHITしなければ、登録ワードを自動的に外す
-「さぼり」「はきだめ」(あぼーんされたレスの表示)
-一定個数以上の新着があるスレッドをまとめ読みから除外
-投稿フォームに定型文メニューを追加
-名前をクリックすると名前でフィルタリング
-メールをクリックするとメールでフィルタリング
-表示位置の移動をドロップダウンメニューにする(PC)
-SPMをクリックで出す(PC)
-レス番号にSPMをつける(携帯)
-あぼーんされたレスを隠す(携帯)
-任意のスレッドのまとめ読み
-過去ログを各種DAT保管サイトから取得(プラグイン)
-スレッド一覧のフィルタリングでAND/OR・本文検索を可能にする(携帯)
-書き込みフォームの幅(携帯)
-書き込みフォームの高さ(携帯)
-RSS内2chリンクをp2で開く(携帯)
-AAを自動で判定し、NGワードにする。(PC)
-スレッド番号でinfoを開く(携帯)
-スレッドあぼーんトグルスイッチをつける
-「ここから新着」を挿入
-書き込みフォームをダブルクリックするとテキストボックスを自動調整(PC)

***[[単語]]の形式でWikipediaに飛ぶ [#led2c85d]
Wikipedia系のスレッドで使われている[[単語]]([]は半角)の表記でWikipediaに飛びます。~
なお、rep2モバイルではモバイル用のWapediaに飛ぶようにオリジナルから改造してあります。~
(元ネタ:本スレpart35の760-779)
~
~
まず、lib/showthread.class.phpの一番下(?>のすぐ上)に以下のように追記するんだぜ?
 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; 
 } 
んでもってlib/showthreadk.class.phpの488行目とかlib/showthreadpc.class.phpの586行目とかの
 $msg = preg_replace_callback($this->str_to_link_regex, array($this, 'link_callback'), $msg);
と、その下の
 return $msg;
return $msg;
の間に
 $msg = wikipedia($msg); // Wikipediaへの自動リンクなんだぜ。
を追加しとくんだぜ? 

***にくちゃんねる・みみずん検索からDATを取得 [#d5f68f77]
スレッドが過去ログに収納されているとき、DAT保管サイトからDATを取得します。~
なお、DATがなければデータがおかしくなります。~
既得ログはいったん消してから取得した方が良いようです。~
改造例(rep2-expack rev.060903.0030; based on rep2-1.7.29):
#ref(nikutori_sample.zip)
~
threadread.class.php
84行目あたり:
 $this->downloadDat2ch($this->length);
↓
 $this->downloadDat2ch($this->length,$_GET["dat"]);
96行目あたり:
 function downloadDat2ch($from_bytes)
↓
 function downloadDat2ch($from_bytes,$dat)
120行目あたり:
 $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;
 }
804行目あたり:
 $dat_response_msg = "<p>2ch info - このスレッドは過去ログ倉庫に格納されています。 [{$marutori_ht}]</p>";
↓
 $ktai = $_conf['ktai'] ? "&b=k" : "";
 $nikutori_ht = "<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;dat=1{$ktai}\">にくちゃんねるからp2に取り込む</a>";
 $mimitori_ht = "<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;dat=2{$ktai}\">みみずん検索からp2に取り込む</a>";
 $dat_response_msg = "<p>2ch info - このスレッドは過去ログ倉庫に格納されています。 [{$marutori_ht}] [{$nikutori_ht}] [{$mimitori_ht}]</p>";
***必死チェッカー(スレッド用) [#v71ec0fd]
スレッドのレスに必死チェッカーへのリンクボタン([check])を追加します。~
必死チェッカーに対応していない板・IDがない場合はボタンを表示しません。~
〜yyyy/mm/dd〜以外の日付形式ではボタンを生成しません。
なお、対応板リストは変更になったらその都度書き換えて下さい。~
rep2-expack rev.060903.0030; based on rep2-1.7.29と+live 通常モードで確認。~
~
2006/10/28:もう一度VIPの佐賀に対応・大幅に軽い正規表現にした
2006/10/26:p2imeを通すようにした・検索PHPを通さず直でHTMLにアクセスするようにした・ポップアップするようにした~
~
無印:lib/showthreadpc.class.phpの$tores .= "</dt>\n";の上~(287行目あたり)~
expack ASAP:lib/showthreadpc.class.phpの$tores .= "</dt>";の上~(425行目あたり)~
live 通常モード:lib/live/default_view.inc.phpの$tores .= "</dt>";の上~(67行目あたり)~
live 実況モードA:lib/live/live_view.inc.phpの116行目あたり~
live 実況モードB:lib/live/live_view.inc.phpの110行目あたり~
の上に
 $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>";
        }
    }
 }
を追加。

***必死チェッカー(板用) [#t567c48a]
板(スレッド一覧)の下に必死チェッカーへのリンクをつけます。~
p2imeを通します。~
~
lib/sb_footer.inc.phpの46行目あたり
 echo "</table>\n";
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;
    }
 }
を追加。~
80行目あたりの
 echo "</p>";
echo "</p>";
の上に
 echo $hissi_ht;
を追加。
***被参照レス [#h598afef]
そのレスにレスしているレスを検索してポップアップします。~
範囲指定(>>1-10のような形式)のレスは検索しません。~
[Re:]という画像が追加されているので、それをポイントすると(>|>)(\d+,)*レス番号\Dが含まれたレスがポップアップされます。~
rep2-expack rev.060903.0030; based on rep2-1.7.29および+live 通常モードで確認。~
なお、re.pngは+liveに同梱されている画像です。~
~
無印:lib/showthreadpc.class.phpの$tores .= "</dt>\n";の上~(287行目あたり)~
expack ASAP:lib/showthreadpc.class.phpの$tores .= "</dt>";の上~(425行目あたり)~
live 通常モード:lib/live/default_view.inc.phpの$tores .= "</dt>";の上~(67行目あたり)~
live 実況モードA:lib/live/live_view.inc.phpの116行目あたり~
live 実況モードB:lib/live/live_view.inc.phpの110行目あたり~
に
 $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=reg


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS