• R/O
  • HTTP
  • SSH
  • HTTPS

YANMAH2-season2-: Commit


Commit MetaInfo

Revision4034804543384b7dac211de501e6b3ca7f42079c (tree)
Time2014-12-31 14:26:36
AuthorKana Koda <kodakana@user...>
CommiterKana Koda

Log Message

ホスト切り替え設定を廃止。

Change Summary

Incremental Difference

--- a/config.php
+++ b/config.php
@@ -47,13 +47,13 @@ if (isset($_POST['elimit']) && preg_match("/^[0123456789]{1,3}$/", $_POST['elimi
4747 $pcount = '';
4848 $setck = 0;
4949 }
50-if (isset($_POST['hdomain']) && preg_match("/^(h|h1beta)(\.hatena\.ne\.jp|\.hatena\.com)$/", $_POST['hdomain'])){
51- $phdomain = $_POST['hdomain'];
52- $setck = 1;
53-} else {
54- $phdomain = '';
55- $setck = 0;
56-}
50+// if (isset($_POST['hdomain']) && preg_match("/^(h|h1beta)(\.hatena\.ne\.jp|\.hatena\.com)$/", $_POST['hdomain'])){
51+// $phdomain = $_POST['hdomain'];
52+// $setck = 1;
53+// } else {
54+// $phdomain = '';
55+// $setck = 0;
56+// }
5757 if (isset($_POST['iscale']) && preg_match("/^[[:digit:]]{1}\.{0,1}[[:digit:]]{0,1}$/", $_POST['iscale'])){
5858 $piscale = $_POST['iscale'];
5959 $setck = 1;
@@ -63,7 +63,7 @@ if (isset($_POST['iscale']) && preg_match("/^[[:digit:]]{1}\.{0,1}[[:digit:]]{0,
6363 }
6464
6565 if ($setck == 1){
66- setcookie('y2config', 'count=' . $pcount . '&showicon=' . $pshowicon . '&disbr=' . $pdisbr . '&elimit=' . $pelimit . '&hdomain=' . $phdomain . '&iscale=' . $piscale . '&starisjs=' . $pstarisjs, time()+60*60*24*365);
66+ setcookie('y2config', 'count=' . $pcount . '&showicon=' . $pshowicon . '&disbr=' . $pdisbr . '&elimit=' . $pelimit . '&iscale=' . $piscale . '&starisjs=' . $pstarisjs, time()+60*60*24*365);
6767 }
6868 ?>
6969 <?php
@@ -109,13 +109,13 @@ if (isset($_POST['elimit']) && preg_match("/^[0123456789]{1,3}$/", $_POST['elimi
109109 } else {
110110 $entry_limit = $entry_limit;
111111 }
112-if (isset($_POST['hdomain']) && preg_match("/^(h|h1beta)(\.hatena\.ne\.jp|\.hatena\.com)$/", $_POST['hdomain'])){
113- $hdomain = $_POST['hdomain'];
114-} elseif (isset($y2config['hdomain']) && preg_match("/^(h|h1beta)(\.hatena\.ne\.jp|\.hatena\.com)$/", $y2config['hdomain'])){
115- $hdomain = $y2config['hdomain'];
116-} else {
117- $hdomain = 'default';
118-}
112+// if (isset($_POST['hdomain']) && preg_match("/^(h|h1beta)(\.hatena\.ne\.jp|\.hatena\.com)$/", $_POST['hdomain'])){
113+// $hdomain = $_POST['hdomain'];
114+// } elseif (isset($y2config['hdomain']) && preg_match("/^(h|h1beta)(\.hatena\.ne\.jp|\.hatena\.com)$/", $y2config['hdomain'])){
115+// $hdomain = $y2config['hdomain'];
116+// } else {
117+// $hdomain = 'default';
118+// }
119119 if (isset($_POST['iscale']) && preg_match("/^[[:digit:]]{1}\.{0,1}[[:digit:]]{0,1}$/", $_POST['iscale'])){
120120 $iscale = $_POST['iscale'];
121121 } elseif (isset($y2config['iscale']) && $y2config['iscale'] != '' && preg_match("/^[[:digit:]]{1}\.{0,1}[[:digit:]]{0,1}$/", $y2config['iscale'])){
@@ -182,7 +182,6 @@ $echo = $echo . <<<EOL
182182 <li>タイムラインで改行を減らす:$disbr</li>
183183 <li>はてなスターを JavaScript で処理する:$star_is_js</li>
184184 <li>各エントリの表示文字数制限の基準幅:$entry_limit</li>
185- <li>はてなハイクのドメイン:$hdomain</li>
186185 <li>Viewport の initial-scale:$iscale</li>
187186 </ul>
188187 </div>
@@ -307,23 +306,23 @@ $echo = $echo . <<<EOL
307306 EOL;
308307 ?>
309308 <?php
310-$echo = $echo . <<<EOL
311-<div>
312-<label for="haiku-domain">はてなハイクのドメイン:</label>
313- <select name="hdomain" id="haiku-domain">
314- <option value="h.hatena.ne.jp"
315-EOL;
316-if (isset($hdomain) && ($hdomain == 'h.hatena.ne.jp' || $hdomain == 'default')) $echo = $echo . ' selected="selected"';
317-$echo = $echo . <<<EOL
318->.ne.jp</option>
319- <option value="h.hatena.com"
320-EOL;
321-if (isset($hdomain) && $hdomain == 'h.hatena.com') $echo = $echo . ' selected="selected"';
322-$echo = $echo . <<<EOL
323->.com</option>
324- </select>
325-</div>
326-EOL;
309+// $echo = $echo . <<<EOL
310+// <div>
311+// <label for="haiku-domain">はてなハイクのドメイン:</label>
312+// <select name="hdomain" id="haiku-domain">
313+// <option value="h.hatena.ne.jp"
314+// EOL;
315+// if (isset($hdomain) && ($hdomain == 'h.hatena.ne.jp' || $hdomain == 'default')) $echo = $echo . ' selected="selected"';
316+// $echo = $echo . <<<EOL
317+// >.ne.jp</option>
318+// <option value="h.hatena.com"
319+// EOL;
320+// if (isset($hdomain) && $hdomain == 'h.hatena.com') $echo = $echo . ' selected="selected"';
321+// $echo = $echo . <<<EOL
322+// >.com</option>
323+// </select>
324+// </div>
325+// EOL;
327326 // <option value="h1beta.hatena.ne.jp"
328327 // EOL;
329328 // if (isset($hdomain) && $hdomain == 'h1beta.hatena.ne.jp') $echo = $echo . ' selected="selected"';
--- a/init_processor.php
+++ b/init_processor.php
@@ -1,6 +1,6 @@
11 <?php
22 //YANMAH2 - Yet ANother Mobile Accelerated HatenaHaiku
3-//(c) 2012 YANMAH2 project
3+//(c) 2014 YANMAH2 project
44 //This program is freesoftware. you can redistribute it and/ormodify it under the terms of the [GNU Affero GPL v3](http://www.gnu.org/licenses/agpl.html).
55 ?>
66 <?php defined("HELLO") or exit(); ?>
@@ -105,11 +105,11 @@ if (isset($y2config['starisjs']) && $y2config['starisjs'] != '' && preg_match("/
105105 if (isset($y2config['elimit']) && $y2config['elimit'] != '' && preg_match("/^[0123456789]{1,3}$/", $y2config['elimit'])){
106106 $entry_limit = $y2config['elimit'];
107107 }
108-if (isset($y2config['hdomain']) && $y2config['hdomain'] != '' && preg_match("/^(h|h1beta)(\.hatena\.ne\.jp|\.hatena\.com)$/", $y2config['hdomain'])){
109- $haiku_host = $y2config['hdomain'];
110- $haiku_official_url = preg_replace("/(http:\/\/)[^\/]+(\/.*)/u", "\${1}{$haiku_host}\${2}", $haiku_official_url);
111- $api_base_url = "http://{$haiku_host}/api/";
112-}
108+// if (isset($y2config['hdomain']) && $y2config['hdomain'] != '' && preg_match("/^(h|h1beta)(\.hatena\.ne\.jp|\.hatena\.com)$/", $y2config['hdomain'])){
109+// $haiku_host = $y2config['hdomain'];
110+// $haiku_official_url = preg_replace("/(http:\/\/)[^\/]+(\/.*)/u", "\${1}{$haiku_host}\${2}", $haiku_official_url);
111+// $api_base_url = "http://{$haiku_host}/api/";
112+// }
113113 if (isset($y2config['iscale']) && $y2config['iscale'] != '' && preg_match("/^[[:digit:]]{1}\.{0,1}[[:digit:]]{0,1}$/", $y2config['iscale'])){
114114 $iscale = $y2config['iscale'];
115115 } else {
Show on old repository browser