572 名前:名称未設定 メェル:sage 投稿日:02/12/15 00:52 ID:fhaHWkke >>571 試しにこんなん作ってみますた <a href="javascript:document.location='http://moooyu.tripod.co.jp/p2conf.txt';" target="_blank" title="Add Link" style="text-decoration: none">http://moooyu.tripod.co.jp/p2conf.txt</a><AddLink-Mark> 拡張子を.phpにしてp2と同じ階層に設置 conf_user.phpとconf_style.incのパーミッションを666にする 正規表現でむりやり対応してるので設定ファイルの書式変わったら使えなくなるし, style/以下のファイルには対応できてないしできそうにない 誰か改良してー
patch -p1 < (パッチファイル名)
index.php --- 47,48c47,51 < <frameset cols="156,*" frameborder="1" border="1"> < <frame src="menu.php" name="menu" scrolling="auto"> --- > <frameset cols="40%,*" frameborder="1" border="1"> > <frameset rows="160,*" frameborder="1" border="1"> > <frame src="menu.php" name="menu" scrolling="auto" noresize> > <frame src="{$title_page}" name="subject" scrolling="auto"> > </frameset> 53,54d55 < <frameset rows="40%,60%" frameborder="1" border="2"> < <frame src="{$title_page}" name="subject" scrolling="auto"> 56d56 < </frameset>
ダウソした後ファイルを解凍、添付の「取扱説明書.txt」を読んで下さい。 尚、今回よりバージョンアップの際に修正する手間の軽減とファイル管理を容易にする 目的から「プラグイン」方式を採用しました。 これにより導入が簡単になったと思います。
ダウソした後ファイルを解凍、添付の「取扱説明書.txt」を読んで下さい。
$p2="http://hogehoge.co.jp/~foo/p2/"; //p2の設置URL httpからフルパスで。相対だと上手く動かないかも $p2dir="/home/foo/public_html/p2"; //p2の設置ディレクトリ フルパスで。相対だと多分動きません $datadir=$p2dir."/data"; //p2のdataディレクトリ $dir2ch=$datadir."/2channel"; //2chのdatの位置 $cache_dir = $datadir."/p2_cache"; //p2のcacheディレクトリ $brd_dir = $cache_dir."/azlucky.s25.xrea.com/2chboard"; //2chのボードファイルの位置 $brd_file = "bbsmenu.html.p2.brd"; //ボードファイル名
@@ -101,7 +101,7 @@ $i++; } foreach($entry as $value) { - if($value != "." && $value !=".." && $value != false && is_dir($path."/".$value)) { + if($value != "." && $value !=".." && $value != false && is_dir($path."/".$value) && glob($path."/".$value."/*.dat")) { $result[] = $value; } } @@ -159,10 +159,15 @@ $key = basename($filename,".dat"); $bbs = explode("/",dirname($filename)); $idxname = str_replace(".dat",".idx",$filename); + if(!file_exists($idxname)){ + $url = $p2."subject.php?host=".$host[0]."&bbs=".$bbs[count($bbs)-1]."&norefresh=true&spmode=soko"; + echo "<a href=\"$url\" target=\"_new\">$host[2] : 過去ログ倉庫</a></br>\n"; + }else{ $idxstr = file_get_contents($idxname); $thread_title = explode("<>",$idxstr); $url = $p2."read.php?bbs=".$bbs[count($bbs)-1]."&key=".$key."&host=".$host[0]."&ls=all&offline=1&field=msg&word=".rawurlencode($query)."&match=on"; echo "<a href=\"$url\" target=\"_new\">$host[2] : $thread_title[0]</a></br>\n"; + } }else{ continue; }
p2/post_form.php p2/read_footer.inc p2/js/post_form.js
p2/showthreadk_class.inc p2/showthreadpc_class.inc
(1)解凍して出てきた以下のファイルを標準ファイルへ上書きして下さい。 index.php menu.php (2)conf_user.php を添付のread_me.txtに従って設定変更して下さい。
#ref(): The style ref(filename,pagename) is ambiguous and become obsolete. Please try ref(pagename/filename)
if (($_conf['sb_show_one'] == 1) or ($_conf['sb_show_one'] == 2 and ereg("news", $aThreadList->bbs) || ereg("plus", $aThreadList->bbs) || $aThreadList->bbs == 'bizplus' || $aThreadList->bbs == 'asia' || $aThreadList->bbs == 'archives' || $aThreadList->bbs == 'kokusai' || $aThreadList->bbs == 'iraq')) {
function wikipedia($msg) { // [[語句]]があった時にWikipediaへ自動リンクするんだぜ? global $_conf; $msg = mb_convert_encoding($msg, "UTF-8", "Shift_JIS"); // 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, "Shift_JIS", "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"; //$url="http://news2.2ch.net/test/read.cgi?bbs=newsplus&key=1038486598"; break; } $dat_response_msg = "<p>2ch info - このスレッドは過去ログ倉庫に格納されています。 [{$marutori_ht}]</p>"; $nikutori_ht = "<a href=\"{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&dat=1\">にくちゃんねるからp2に取り込む</a>"; $mimitori_ht = "<a href=\"{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&dat=2\">みみずん検索からp2に取り込む</a>"; $dat_response_msg = "<p>2ch info - このスレッドは過去ログ倉庫に格納されています。 [{$marutori_ht}] [{$nikutori_ht}] [{$mimitori_ht}]</p>";
$tores .= "</dt>"; if($id){ $date= substr($date_id,0,4).substr($date_id,5,2).substr($date_id,8,2); $tores.= "<form method=\"POST\" name=\"form{$i}\" action=\"http://hissi.dyndns.ws/read.php/{$this->thread->bbs}/search/\" class=\"inline-form\"> <input type=\"hidden\" name=\"date\" value=\"{$date}\"> <input type=\"hidden\" name=\"ID\" value=\"{$id}\"> <input type=\"image\" src=\"img/check.png\"> </form>"; }
showthreadpc.class.phpの$tores .= "</dt>"; $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>";