svnno****@sourc*****
svnno****@sourc*****
2010年 1月 25日 (月) 21:24:39 JST
Revision: 803 http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=803 Author: rsk Date: 2010-01-25 21:24:39 +0900 (Mon, 25 Jan 2010) Log Message: ----------- expack: - E_NOTICEãåºãç®æãåæ¸ä¸ã Modified Paths: -------------- p2ex/trunk/info.php p2ex/trunk/js/iphone.js p2ex/trunk/js/json2.js p2ex/trunk/lib/P2Util.php p2ex/trunk/lib/ThreadRead.php p2ex/trunk/lib/login_first.inc.php p2ex/trunk/lib/read_footer_k.inc.php p2ex/trunk/lib/read_header_k.inc.php p2ex/trunk/read_new_k.php p2ex/trunk/style/read_css.inc -------------- next part -------------- Modified: p2ex/trunk/info.php =================================================================== --- p2ex/trunk/info.php 2010-01-25 09:18:47 UTC (rev 802) +++ p2ex/trunk/info.php 2010-01-25 12:24:39 UTC (rev 803) @@ -205,6 +205,7 @@ // {{{ palace `FbN // a°üèXXg Ç +$isPalace = false; if ($pallines = FileCtl::file_read_lines($_conf['palace_idx'], FILE_IGNORE_NEW_LINES)) { foreach ($pallines as $l) { $palarray = explode('<>', $l); @@ -266,6 +267,8 @@ // O èȵtOZbg if (file_exists($aThread->keydat) or file_exists($aThread->keyidx)) { $existLog = true; +} else { + $existLog = false; } //================================================================= @@ -345,6 +348,8 @@ if (checkRecent($aThread->host, $aThread->bbs, $aThread->key) or checkResHist($aThread->host, $aThread->bbs, $aThread->key)) { $offrec_ht = " / [<a href=\"info.php?{$common_q}&offrec=true{$popup_q}{$ttitle_en_q}{$_conf['k_at_a']}\" title=\"±ÌXðuÅßÇñ¾XvÆu«Ýðv©çOµÜ·\">ð©çO·</a>]"; +} else { + $offrec_ht = ''; } if (!$_conf['ktai']) { Modified: p2ex/trunk/js/iphone.js =================================================================== --- p2ex/trunk/js/iphone.js 2010-01-25 09:18:47 UTC (rev 802) +++ p2ex/trunk/js/iphone.js 2010-01-25 12:24:39 UTC (rev 803) @@ -251,6 +251,70 @@ }; // }}} +// {{{ setHashScrool() + +/** + * y[WàNÌNbNðXN[É·é + * + * Ü讫ªæÈ©Á½ÌÅóB + * + * @param {Node|String} contextNode + * @return void + */ +iutil.setHashScrool = function(contextNode) { + var anchors, anchor, targetId, targetElement, i, l, expr; + + switch (typeof contextNode) { + case 'string': + contextNode = document.getElementById(contextNode); + break; + case 'undefined': + contextNode = document.body; + break; + } + if (!contextNode) { + return; + } + + expr = './/a[starts-with(@href, "#") and (' + + '@href = "#header" or @href = "#footer" or @href = "#top" or @href = "#bottom"' + + ' or contains(concat(" ", @class, " "), " button ")' + + ')]'; + anchors = document.evaluate(expr, + contextNode, null, + XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + l = anchors.snapshotLength; + + for (i = 0; i < l; i++) { + anchor = anchors.snapshotItem(i); + targetId = anchor.getAttribute('href').substring(1); + targetElement = document.getElementById(targetId); + if (!targetElement) { + continue; + } + + anchor.onclick = (function (element) { + return function (event) { + var from, to, d, e, f, g; + + from = iutil.getPageY(event || window.event); + to = element.offsetTop; + d = to - from; + e = 30; + f = 30; + + for (g = 1; g < f; g++) { + window.setTimeout(window.scrollTo, e * g, + 0, from + Math.floor(d * Math.sqrt(g / f))); + } + window.setTimeout(window.scrollTo, e * g, 0, to); + + return false; + }; + })(targetElement); + } +}; + // {{{ adjustTextareaSize() /** @@ -366,6 +430,9 @@ contextNode = document.body; break; } + if (!contextNode) { + return; + } if (typeof expr != 'string') { args = [toggle, contextNode]; @@ -995,6 +1062,7 @@ // labelÉCxgnhðo^·é if (iutil.iphone) { iutil.setLabelAction(document.body); + //iutil.setHashScrool(document.body); } // textareaÌð²® Modified: p2ex/trunk/js/json2.js =================================================================== --- p2ex/trunk/js/json2.js 2010-01-25 09:18:47 UTC (rev 802) +++ p2ex/trunk/js/json2.js 2010-01-25 12:24:39 UTC (rev 803) @@ -1,6 +1,6 @@ /* http://www.JSON.org/json2.js - 2009-04-16 + 2009-09-29 Public Domain. @@ -8,6 +8,14 @@ See http://www.JSON.org/js.html + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. + + This file creates a global JSON object containing two methods: stringify and parse. @@ -33,7 +41,7 @@ value represented by the name/value pair that should be serialized, or undefined if nothing should be serialized. The toJSON method will be passed the key associated with the value, and this will be - bound to the object holding the key. + bound to the value For example, this would serialize Dates as ISO strings. @@ -136,18 +144,10 @@ This is a reference implementation. You are free to copy, modify, or redistribute. - - This code should be minified before deployment. - See http://javascript.crockford.com/jsmin.html - - USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO - NOT CONTROL. */ -/*jslint evil: true */ +/*jslint evil: true, strict: false */ -/*global JSON */ - /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, @@ -155,12 +155,14 @@ test, toJSON, toString, valueOf */ + // Create a JSON object only if one does not already exist. We create the // methods in a closure to avoid creating global variables. if (!this.JSON) { - JSON = {}; + this.JSON = {}; } + (function () { function f(n) { @@ -172,12 +174,13 @@ Date.prototype.toJSON = function (key) { - return this.getUTCFullYear() + '-' + + return isFinite(this.valueOf()) ? + this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + - f(this.getUTCSeconds()) + 'Z'; + f(this.getUTCSeconds()) + 'Z' : null; }; String.prototype.toJSON = Modified: p2ex/trunk/lib/P2Util.php =================================================================== --- p2ex/trunk/lib/P2Util.php 2010-01-25 09:18:47 UTC (rev 802) +++ p2ex/trunk/lib/P2Util.php 2010-01-25 12:24:39 UTC (rev 803) @@ -1072,17 +1072,24 @@ $date = date('Y/m/d (D) G:i:s'); // HOSTðæ¾ - if (!$remoto_host = $_SERVER['REMOTE_HOST']) { - $remoto_host = gethostbyaddr($_SERVER['REMOTE_ADDR']); + if (array_key_exists('REMOTE_HOST', $_SERVER)) { + $remote_host = $_SERVER['REMOTE_HOST']; + } else { + $remote_host = ''; } - if ($remoto_host == $_SERVER['REMOTE_ADDR']) { - $remoto_host = ""; + if (!$remote_host) { + $remote_host = gethostbyaddr($_SERVER['REMOTE_ADDR']); } + if ($remote_host == $_SERVER['REMOTE_ADDR']) { + $remote_host = ''; + } - $user = (isset($_login->user_u)) ? $_login->user_u : ""; + $user = (isset($_login->user_u)) ? $_login->user_u : ''; // Vµ¢OsðÝè - $newdata = $date."<>".$_SERVER['REMOTE_ADDR']."<>".$remoto_host."<>".$_SERVER['HTTP_USER_AGENT']."<>".$_SERVER['HTTP_REFERER']."<>".""."<>".$user; + $newdata = implode('<>', array($date, $_SERVER['REMOTE_ADDR'], $remote_host, + $_SERVER['HTTP_USER_AGENT'], $_SERVER['HTTP_REFERER'], + '', $user)); //$newdata = htmlspecialchars($newdata, ENT_QUOTES); // ܸ^uðSÄOµÄ @@ -1671,7 +1678,7 @@ return; } - if ($_conf['ktai'] && $_conf['k_save_packet']) { + if ($_conf['ktai'] && $_conf['mobile.save_packet']) { echo mb_convert_kana($_info_msg_ht, 'rnsk'); } else { echo $_info_msg_ht; Modified: p2ex/trunk/lib/ThreadRead.php =================================================================== --- p2ex/trunk/lib/ThreadRead.php 2010-01-25 09:18:47 UTC (rev 802) +++ p2ex/trunk/lib/ThreadRead.php 2010-01-25 12:24:39 UTC (rev 803) @@ -189,7 +189,7 @@ $request .= "\r\n"; // WEBT[oÖÚ± - $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); + $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); if (!$fp) { $this->_pushInfoConnectionTimedOut($url, $errno, $errstr); $this->diedat = true; @@ -417,7 +417,7 @@ $request .= "\r\n"; // WEBT[oÖÚ± - $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); + $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); if (!$fp) { $this->_pushInfoConnectionTimedOut($url, $errno, $errstr); $this->diedat = true; @@ -603,7 +603,7 @@ $request .= "\r\n"; // WEBT[oÖÚ± - $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); + $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); if (!$fp) { $this->_pushInfoConnectionTimedOut($url, $errno, $errstr); return false; @@ -899,7 +899,7 @@ $request .= "\r\n"; // WEBT[oÖÚ± - $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); + $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); if (!$fp) { $this->_pushInfoConnectionTimedOut($url, $errno, $errstr); $this->diedat = true; @@ -1491,7 +1491,7 @@ } if (is_null($body)) { - $msg = '<p class="info-msg"><strong>gzipWJG[</strong><br>'; + $msg = '<p class="info-msg">gzipWJG[<br>'; $msg .= sprintf('rep2 error: <a href="%s"%s>%s</a> ðgzipfR[hūܹñŵ½B', P2Util::throughIme($url), $_conf['ext_win_target_at'], @@ -1519,11 +1519,11 @@ { global $_conf; - $msg = '<p class="info-msg"><strong>'; + $msg = '<p class="info-msg">'; $msg .= sprintf('HTTPÚ±G[ (%d) %s', $errno, htmlspecialchars($errstr, ENT_QUOTES)); - $msg .= '</strong><br>'; + $msg .= '<br>'; $msg .= sprintf('rep2 info: <a href="%s"%s>%s</a> Éڱūܹñŵ½B', P2Util::throughIme($url), $_conf['ext_win_target_at'], @@ -1547,7 +1547,7 @@ { global $_conf; - $msg = '<p class="info-msg"><strong>HTTPÚ±^CAEg</strong><br>'; + $msg = '<p class="info-msg">HTTPÚ±^CAEg<br>'; $msg .= sprintf('rep2 info: <a href="%s"%s>%s</a> ðÇÝÝ®¹Å«Ü¹ñŵ½B', P2Util::throughIme($url), $_conf['ext_win_target_at'], Modified: p2ex/trunk/lib/login_first.inc.php =================================================================== --- p2ex/trunk/lib/login_first.inc.php 2010-01-25 09:18:47 UTC (rev 802) +++ p2ex/trunk/lib/login_first.inc.php 2010-01-25 12:24:39 UTC (rev 803) @@ -321,7 +321,7 @@ // HTMLvg //========================================================= P2Util::header_nocache(); - echo $doctype; + echo $_conf['doctype']; echo <<<EOP <html lang="ja"> <head> Modified: p2ex/trunk/lib/read_footer_k.inc.php =================================================================== --- p2ex/trunk/lib/read_footer_k.inc.php 2010-01-25 09:18:47 UTC (rev 802) +++ p2ex/trunk/lib/read_footer_k.inc.php 2010-01-25 12:24:39 UTC (rev 803) @@ -33,11 +33,11 @@ if (!$aThread->diedat) { if (!empty($_conf['disable_res'])) { $dores_ht = <<<EOP - | <a href="{$motothre_url}"{$_conf['k_accesskey_at']['res']}{$holdhandlers_at}>{$_conf['k_accesskey_st']['res']}{$dores_st}</a> + | <a href="{$motothre_url}"{$_conf['k_accesskey_at']['res']}>{$_conf['k_accesskey_st']['res']}{$dores_st}</a> EOP; } else { $dores_ht = <<<EOP -<a href="post_form.php?{$host_bbs_key_q}&rescount={$aThread->rescount}{$ttitle_en_q}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['res']}{$holdhandlers_at}>{$_conf['k_accesskey_st']['res']}{$dores_st}</a> +<a href="post_form.php?{$host_bbs_key_q}&rescount={$aThread->rescount}{$ttitle_en_q}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['res']}>{$_conf['k_accesskey_st']['res']}{$dores_st}</a> EOP; } } else { Modified: p2ex/trunk/lib/read_header_k.inc.php =================================================================== --- p2ex/trunk/lib/read_header_k.inc.php 2010-01-25 09:18:47 UTC (rev 802) +++ p2ex/trunk/lib/read_header_k.inc.php 2010-01-25 12:24:39 UTC (rev 803) @@ -61,7 +61,7 @@ //---------------------------------------------- // $htm['read_navi_range'] -- 1- 101- 201- -$htm['read_navi_range'] = "<a{$pointer_header_at} href=\"{$_conf['read_php']}?{$host_bbs_key_q}&ls=1-{$rnum_range}{$offline_range_q}{$_conf['k_at_a']}\"{$_conf['k_accesskey_at'][1]}>1-</a>\t"; +$htm['read_navi_range'] = "<a{$pointer_header_at} href=\"{$_conf['read_php']}?{$host_bbs_key_q}&ls=1-{$rnum_range}{$offline_q}{$_conf['k_at_a']}\"{$_conf['k_accesskey_at'][1]}>1-</a>\t"; //---------------------------------------------- Modified: p2ex/trunk/read_new_k.php =================================================================== --- p2ex/trunk/read_new_k.php 2010-01-25 09:18:47 UTC (rev 802) +++ p2ex/trunk/read_new_k.php 2010-01-25 12:24:39 UTC (rev 803) @@ -101,17 +101,17 @@ // &sb_view={$sb_view} if ($aThreadList->spmode) { $sb_ht = <<<EOP -<a href="{$_conf['subject_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}&spmode={$aThreadList->spmode}{$_conf['k_at_a']}" target="_blank">{$ptitle_hd}</a> +<a href="{$_conf['subject_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}&spmode={$aThreadList->spmode}{$_conf['k_at_a']}">{$ptitle_hd}</a> EOP; $sb_ht_btm = <<<EOP -<a href="{$_conf['subject_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}&spmode={$aThreadList->spmode}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['up']} target="_blank">{$_conf['k_accesskey_st']['up']}{$ptitle_hd}</a> +<a href="{$_conf['subject_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}&spmode={$aThreadList->spmode}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['up']}>{$_conf['k_accesskey_st']['up']}{$ptitle_hd}</a> EOP; } else { $sb_ht = <<<EOP -<a href="{$_conf['subject_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}{$_conf['k_at_a']}" target="_blank">{$ptitle_hd}</a> +<a href="{$_conf['subject_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}{$_conf['k_at_a']}">{$ptitle_hd}</a> EOP; $sb_ht_btm = <<<EOP -<a href="{$_conf['subject_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['up']} target="_blank">{$_conf['k_accesskey_st']['up']}{$ptitle_hd}</a> +<a href="{$_conf['subject_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['up']}>{$_conf['k_accesskey_st']['up']}{$ptitle_hd}</a> EOP; } @@ -412,6 +412,8 @@ if ($spmode) { $read_header_itaj_ht = " ({$itaj_hd})"; + } else { + $read_header_itaj_ht = ''; } P2Util::printInfoHtml(); @@ -478,7 +480,7 @@ // c[o[ªHTML ======= if ($spmode) { $toolbar_itaj_ht = <<<EOP - (<a href="{$_conf['subject_php']}?{$host_bbs_key_q}{$_conf['k_at_a']}" target="_blank">{$itaj_hd}</a>) + (<a href="{$_conf['subject_php']}?{$host_bbs_key_q}{$_conf['k_at_a']}">{$itaj_hd}</a>) EOP; } else { $toolbar_itaj_ht = ''; @@ -495,10 +497,10 @@ $read_footer_ht = <<<EOP <div id="ntt_bt{$newthre_num}" name="ntt_bt{$newthre_num}" class="read_new_toolbar"> {$read_range_ht} -<a class="button" href="info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}" target="_blank">{$info_st}</a> -<a class="button" href="spm_k.php?{$host_bbs_key_q}&ls={$aThread->ls}&spm_default={$aThread->resrange['to']}&from_read_new=1{$_conf['k_at_a']}" target="_blank">Á</a> +<a class="button" href="info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}">{$info_st}</a> +<a class="button" href="spm_k.php?{$host_bbs_key_q}&ls={$aThread->ls}&spm_default={$aThread->resrange['to']}&from_read_new=1{$_conf['k_at_a']}">Á</a> <br> -<a href="{$_conf['read_php']}?{$host_bbs_key_q}&offline=1&rescount={$aThread->rescount}{$_conf['k_at_a']}#r{$aThread->rescount}" target="_blank">{$aThread->ttitle_hd}</a>{$toolbar_itaj_ht} +<a href="{$_conf['read_php']}?{$host_bbs_key_q}&offline=1&rescount={$aThread->rescount}{$_conf['k_at_a']}#r{$aThread->rescount}">{$aThread->ttitle_hd}</a>{$toolbar_itaj_ht} <a class="button" href="#ntt{$newthre_num}">£</a> </div> <hr>\n Modified: p2ex/trunk/style/read_css.inc =================================================================== --- p2ex/trunk/style/read_css.inc 2010-01-25 09:18:47 UTC (rev 802) +++ p2ex/trunk/style/read_css.inc 2010-01-25 12:24:39 UTC (rev 803) @@ -136,10 +136,6 @@ word-break: break-all; } -/* V XÔi±±ÅÍJ[ªV mFÌ@\ðÁÄ¢éÌÅÁÊÉfontÅ -J[wèðµÄ¢éBthread_class.inc - transRes ðQÆ) */ -/* .newres{color:{$newres_color};} © æÁÄ»ÝͳøÌÝè */ - .onthefly{ /* on the fly */ color:#0a0; border:1px #0a0 solid;