• R/O
  • HTTP
  • SSH
  • HTTPS

YANMAH2-season2-: Commit


Commit MetaInfo

Revision4da0688e9b3d261fd2d7e9d10c19a5634cb6f0b7 (tree)
Time2014-11-10 19:59:10
AuthorKana Koda <kodakana@user...>
CommiterKana Koda

Log Message

画像省略時のスタイル改善。
古いコードの整理。
はてなココ終了対応。

Change Summary

Incremental Difference

--- a/coco.php
+++ b/coco.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/or modify it under the terms of the [GNU Affero GPL v3](http://www.gnu.org/licenses/agpl.html).
55 ?>
66 <?php
@@ -22,13 +22,11 @@ $safequery = htmlspecialchars($_SERVER["QUERY_STRING"], ENT_QUOTES);
2222 ?>
2323 <?php
2424 if (!isset($_SESSION['auth']) || $_SESSION['auth'] != TRUE){
25-// if ($_SESSION['image'] != 'on'){
2625 $_SESSION = array();
2726 if (isset($_COOKIE[session_name()])){
2827 setcookie(session_name(), '', time() - 42000, dirname($_SERVER['SCRIPT_NAME']) . '/', $_SERVER["SERVER_NAME"]);
2928 }
3029 session_destroy();
31-// }
3230 }
3331 ?>
3432 <?php
@@ -136,7 +134,6 @@ if (isset($_GET['q'])){
136134 // var_dump($contents->status);
137135 if (!isset($contents->status)){
138136 $error = 'json';
139-// $error_mes = libxml_get_last_error();
140137 $echo = $echo . "<p>はわわ、何かのエラーです。</p>";
141138 $echo = $echo . "<blockquote>{$json_body}</blockquote>";
142139 // var_dump($error_mes);
@@ -170,10 +167,10 @@ if (isset($_GET['q'])){
170167 } else {
171168 $return_base_url = "./entries.php?";
172169 }
173- $return_url = $return_base_url."body=".rawurlencode("{$val->formatted_address} にイマココ!\nmap:{$val->geometry->location->lat}:{$val->geometry->location->lng}").'&amp;from='.rawurlencode($val->address_components[0]->long_name);
170+ $return_url = $return_base_url."body=".rawurlencode("{$val->formatted_address}\nmap:{$val->geometry->location->lat}:{$val->geometry->location->lng}").'&amp;from='.rawurlencode($val->address_components[0]->long_name);
174171 $echo = $echo . '<li>';
175172 $echo = $echo . "<p><a href=\"{$return_url}\" class=\"navigation-link\">";
176- $echo = $echo . $val->formatted_address . ' にイマココする';
173+ $echo = $echo . $val->formatted_address;
177174 $echo = $echo . '</a></p>';
178175 $echo = $echo . "<a href=\"http://www.google.co.jp/m/local?site=local&amp;q={$val->geometry->location->lat}%2C{$val->geometry->location->lng}\" class=\"external-link\">";
179176 if ($get_image == 'on') {
--- a/entries.php
+++ b/entries.php
@@ -41,30 +41,24 @@ if (isset($_GET['album'])) checkAlbum($_GET['album']);
4141 ?>
4242 <?php
4343 if (!isset($_SESSION['auth']) || $_SESSION['auth'] != TRUE){
44-// if ($_SESSION['image'] != 'on'){
4544 $_SESSION = array();
4645 if (isset($_COOKIE[session_name()])){
4746 setcookie(session_name(), '', time() - 42000, dirname($_SERVER['SCRIPT_NAME']) . '/', $_SERVER["SERVER_NAME"]);
4847 }
4948 session_destroy();
50-// }
5149 }
5250 ?>
5351 <?php
5452 //
5553 if (isset($_GET['with']) || isset($_GET['log'])){
5654 require 'login_processor.php';
57-}// if (isset($_SESSION['oauth_stat'])) session_regenerate_id(TRUE);
55+}
56+// if (isset($_SESSION['oauth_stat'])) session_regenerate_id(TRUE);
5857
5958 //投稿処理の呼び出し。
6059 //var_dump($_POST);
6160 if (isset($_POST['posting'])){
62-// if (isset($_SESSION['postkey']) && isset($_POST['postkey']) && md5($_SESSION['postkey']) == $_POST['postkey']){
63-// unset($_SESSION['postkey']);
64-/*var_dump($_POST);
65-exit();*/
6661 require 'post_processor.php';
67-// }
6862 }
6963 ?>
7064 <?php
@@ -248,9 +242,6 @@ if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
248242 $echo = $echo . '</textarea><br />';
249243 $echo = $echo . '<input type="hidden" name="posting" value="status" />';
250244 $echo = $echo . '<input type="hidden" name="return" value="'.htmlspecialchars($self_anchor_possibly_with_pagenum,ENT_QUOTES).'" />';
251-/* $rand = mt_rand(); $_SESSION['postkey'] = $rand;
252- $rand_md5 = md5($rand);
253- echo "<input type=\"hidden\" name=\"postkey\" value=\"{$rand_md5}\" />";*/
254245 if (isset($_GET['from']) && $_GET['from'] != ''){
255246 $_SESSION['source'] = htmlspecialchars($_GET['from'], ENT_QUOTES);
256247 }
@@ -264,7 +255,6 @@ if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
264255 <label for="post-from">from </label><input type="text" id="post-from" name="source" value="{$from}" maxlength="170" />
265256 <a href="./coco.php?
266257 EOL;
267-// if (isset($_GET['keyword'])) echo '?keyword='.rawurlencode($_GET['keyword']);
268258 $echo = $echo . "return=".htmlspecialchars($self_anchor_with_imagemode,ENT_QUOTES);
269259 $echo = $echo . '" class="navigation-link">イマココ</a>';
270260 $echo = $echo . '</form>';
@@ -295,8 +285,6 @@ $echo = $echo . '</form>';
295285 require 'entry_processor.php';
296286 unset($eprocessor_sub_mode);
297287 $echo = $echo . "<hr />\n";
298-/* $val = $_SESSION['post_body'];
299- require 'entry_processor.php';*/
300288 }
301289 $contents = '';
302290 }
@@ -304,7 +292,6 @@ $echo = $echo . '</form>';
304292 if ($_SESSION['post_result'] === FALSE){
305293 $echo = $echo . '<span>' . $_SESSION['post_result_mes'] . '</span>';
306294 $echo = $echo . "<blockquote>{$_SESSION['post_error']}</blockquote>";
307-// var_export($_SESSION['$post_session']);
308295 }
309296 $echo = $echo . '</div>';
310297 $_SESSION['post_to'] = '';
@@ -414,7 +401,6 @@ if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
414401 }
415402 }
416403 } else {
417-// $json = getJson($request_url, FALSE);
418404 $echo = $echo . '<p>内容を読むには<a href="./login.php?return='.rawurlencode(rawurldecode($self_anchor_with_imagemode)).'" class="navigation-link">ログイン</a>してください。</p>';
419405 }
420406 echo mb_convert_encoding($echo, $charcode, 'UTF-8');
--- a/entry.php
+++ b/entry.php
@@ -33,13 +33,11 @@ if (isset($_SESSION['image'])) checkImagemode($_SESSION['image']);
3333 ?>
3434 <?php
3535 if (!isset($_SESSION['auth']) || $_SESSION['auth'] != TRUE){
36-// if ($_SESSION['image'] != 'on'){
3736 $_SESSION = array();
3837 if (isset($_COOKIE[session_name()])){
3938 setcookie(session_name(), '', time() - 42000, dirname($_SERVER['SCRIPT_NAME']) . '/', $_SERVER["SERVER_NAME"]);
4039 }
4140 session_destroy();
42-// }
4341 }
4442 ?>
4543 <?php
@@ -151,7 +149,6 @@ $echo = $echo . "</div>\n";
151149 if ($_SESSION['post_result'] === FALSE){
152150 $echo = $echo . '<span>' . $_SESSION['post_result_mes'] . '</span>';
153151 $echo = $echo . "<blockquote>{$_SESSION['post_error']}</blockquote>";
154-// var_export($_SESSION['$post_session']);
155152 }
156153 $echo = $echo . '</div>';
157154 $_SESSION['post_to'] = '';
--- a/entry_processor.php
+++ b/entry_processor.php
@@ -18,10 +18,8 @@ if ((isset($entry_processor_mode) && ($entry_processor_mode == 'users' || $entry
1818 $keyword_title = $val->target->title;
1919 }
2020 $echo = $echo . "<a href=\"./entries.php?user={$val->user->id}";
21-// if ($get_image == 'on') $echo = $echo . "&amp;image=on";
2221 $echo = $echo . "\" class=\"hatena-id\">{$val->user->name} (id:{$val->user->id})</a></dt>\n";
2322 $echo = $echo . "<dd><a href=\"./entries.php?keyword=".rawurlencode($val->keyword);
24-// if ($get_image == 'on') $echo = $echo . "&amp;image=on";
2523 $echo = $echo . "\" class=\"keyword\">".htmlspecialchars($keyword_title)."</a></dd>\n";
2624 $ustock[] = "{$val->user->id}";
2725 } else {
@@ -29,11 +27,9 @@ if ((isset($entry_processor_mode) && ($entry_processor_mode == 'users' || $entry
2927 $unix_time = strtotime($val->created_at);
3028 if (isset($first_e) && $first_e != '') $first_time = $unix_time; unset($first_e);
3129 $entry_body = $val->html_touch;
32-// $entry_body_text = $val->text;
3330 if ($entries_mode == 'default' || $entries_mode == 'album'){
3431 foreach ($dict as $dfn) {
3532 // var_dump($dfn);
36-// $dkey = preg_quote("{$entry_body}", '/');
3733 $dmt = preg_grep("/".preg_quote("{$entry_body}", '/')."/u", $dfn);
3834 // var_dump($dmt);
3935 if (isset($dmt["{$val->user->id}"])){ $spam = $spam + 1; return; }
@@ -52,11 +48,6 @@ $entry_body = preg_replace("/(<br>){1,}$/u", "", $entry_body);
5248 $entry_body = preg_replace("/<br>/u", "<br />", $entry_body);
5349 $entry_body = preg_replace("/([  ]*<br \/>){3,}/u", "<br /><br />", $entry_body);
5450 $entry_body = preg_replace("/<br \/>/u", "<br />\n", $entry_body);
55-// $entry_body = preg_replace("^[  ]<br \/>\n", "<br \/>\n", $entry_body);
56-// var_dump($entry_body);
57-// $entry_body = preg_replace("/([^.!?。!?…‥])\n{1}/u", "\${1}", $entry_body);
58-// $entry_body = preg_replace("/(、)\n/u", "\${1}", $entry_body);
59-// $entry_body = preg_replace("/(<br \/>){1,}$/u", "", $entry_body);
6051 //改行削減
6152 if (isset($disbr) && $disbr == 'no'){
6253 } elseif ($entries_mode == 'friends_timeline' || $entries_mode == 'default' || $entries_mode == 'keyword_timeline'){
@@ -71,7 +62,6 @@ if (isset($disbr) && $disbr == 'no'){
7162 }
7263 //
7364 $entry_body = preg_replace("/(<br \/>)/u", "\n\${1}\n", $entry_body);
74-// var_dump($entry_body_temp);
7565 $entry_body = preg_replace("/\n+/u", "\n", $entry_body);
7666 $entry_body = preg_replace("/\n$/u", "", $entry_body);
7767 if (preg_match("/((<br \/>|\n)*&gt;&gt;(<br \/>|\n))(.+)((<br \/>\n)&lt;&lt;(<br \/>|\n)*)/us", $entry_body)) {
@@ -79,40 +69,28 @@ if (preg_match("/((<br \/>|\n)*&gt;&gt;(<br \/>|\n))(.+)((<br \/>\n)&lt;&lt;(<br
7969 } else {
8070 $bquote = "0";
8171 }
82-//$entry_body = $entry_body . "\n";
83-//echo htmlspecialchars(var_dump($entry_body));
8472 //文字数制限
8573 if ($entry_processor_mode == "entries" && !preg_match('/^(kalen_t|fumobot)$/u', $val->user->id)){
86-// if ($get_image == 'on'){
87-// $see_more = "<a href=\"./entry.php?entry={$val->id}&amp;user={$val->user->id}&amp;keyword=" . rawurlencode($val->keyword) . "&amp;image=on\" class=\"see-more\">(…)</a>";
88-// } else {
8974 $see_more = "<a href=\"./entry.php?entry={$val->id}&amp;user={$val->user->id}&amp;keyword=" . rawurlencode($val->keyword) . "\" class=\"see-more\">(…)</a>";
90-// }
9175 $plain_body = strip_tags($entry_body);
9276 $entry_width = mb_strwidth($plain_body);
93-// if ($entries_mode == 'default' && $entry_width < 9){ $spam = $spam + 1; return; }
9477 if (($entries_mode == 'default' || $entries_mode == 'album') &&
9578 preg_match("/(^{$http_url_regexp}$)|(^{$http_path_regexp}$)|(^{$http_url_regexp}.+{$http_url_regexp}$)/us", $plain_body) &&
9679 !preg_match("/<img[^>]+>/u", $entry_body)){ $spam = $spam + 1; return; }
9780 $tranc_width = $entry_limit - ($entry_limit/3);
9881 if ($entry_width > ($entry_limit)){
9982 $plain_body = mb_strimwidth($plain_body, 0, $tranc_width, '', "UTF-8");
100-// $entry_body = mb_strimwidth($entry_body, 0, $tranc_width, '', "UTF-8");
101- // echo "...";
10283 $text_a = explode("\n", $entry_body);
10384 $plain_a = explode("\n", $plain_body);
10485 // var_dump($text_a);
10586 $tail = count($plain_a) - 1;
10687 $text_a[$tail] = $plain_a[$tail];
10788 $text_a = array_slice($text_a, 0, $tail + 1);
108-/* $text_a[$tail] = strip_tags($text_a[$tail]);
109- $text_a[$tail] = preg_replace("/<.*$/u", "", $text_a[$tail]);*/
11089 $entry_body = implode("\n", $text_a) . $see_more;
11190 //var_dump($entry_body_temp);
11291 }
11392 }
11493 //引用記法
115-// $entry_body = preg_replace("/(&gt;&gt;\n)(.+)(&lt;&lt;)/us", "<blockquote>\${2}</blockquote>", $entry_body);
11694 if ($bquote == 1) {
11795 $entry_body = preg_replace("/(\n|<br \/>)*&gt;&gt;(\n|<br \/>)/us", "<blockquote>", $entry_body);
11896 $entry_body = preg_replace("/(\n|<br \/>)&lt;&lt;(\n|<br \/>)*/us", "</blockquote>", $entry_body);
@@ -121,36 +99,9 @@ if ($bquote == 1) {
12199 if (preg_match("/<blockquote>/u", $entry_body) && !preg_match("/<\/blockquote>/u", $entry_body)){
122100 $entry_body = $entry_body."</blockquote>";
123101 }
124-// $entry_body = preg_replace("/(<blockquote>)(.+)(\n<<)/us", "\${1}\${2}\n</blockquote>", $entry_body);
125-//
126-// $entry_body = nl2br($entry_body);
127-//for りおきゅん
128-// if ($val->user->id == 'Rio_Baxxter' && $val->keyword == '地震情報'){
129-// $rio_a = explode("\n", $entry_body);
130-// $rio_b = array();
131-// foreach ($rio_a as $rio){
132-// $gmap = '';
133-// if (preg_match("/(http:\/\/maps\.google\.co\.*[^\/]+\/){$http_path_regexp}+/", $rio)) $gmap = mb_ereg_replace("(.*)(<a href=\")(http:\/\/maps\.google\.co\.*[^\/]+\/)({$http_path_regexp}*)(q=)(-*[[:digit:]]{1,3}\.[[:digit:]]+)(,)(-*[[:digit:]]{1,3}\.[[:digit:]]+)({$http_path_regexp}*)(\">)([^<]*)(<\/a>)(.*)", "<br />\nmap:\\6:\\8", $rio);
134-// $rio_b[] = $rio.$gmap;
135-// }
136-// $entry_body = implode("\n", $rio_b);
137-// }
138-//
139-// if ($get_image == 'on'){
140-// // $entry_body = preg_replace("/<a href=\"\/*[^\/]*\/keyword\/([^\/\"]+)\" class=\"keyword\">/u", "<a href=\"./entries.php?keyword=\${1}&amp;image=on\" class=\"keyword\">", $entry_body);
141-// $entry_body = preg_replace("/<a href=\"http:\/\/h[^\.]*\.hatena\.[^\/]+\/touch\/target\?word=([^\"]+)\" class=\"keyword\">/u", "<a href=\"./entries.php?keyword=\${1}&amp;image=on\" class=\"keyword\">", $entry_body);
142-// // $entry_body = preg_replace("/<a href=\"\/*[^\/]*\/([^\/\"]+)\/\" class=\"user\">/u", "<a href=\"./entries.php?user=\${1}&amp;image=on\" class=\"user\">", $entry_body);
143-// $entry_body = preg_replace("/<a href=\"http:\/\/h[^\.]*\.hatena\.[^\/]+\/touch\/([^\/]+)\/\" class=\"user\">/u", "<a href=\"./entries.php?user=\${1}&amp;image=on\" class=\"user\">", $entry_body);
144-// if ($val->user->id == 'fumobot') $entry_body = preg_replace("/<a[^>]*href=\"(http:\/\/h[[:alnum:]]*\.hatena\.[^\/]+\/*)\/keyword\/([^\"]+)\"[^>]*>/u", "<a href=\"./entries.php?keyword=\${2}&amp;image=on\" class=\"keyword\">", $entry_body);
145-// $entry_body = preg_replace("/<a[^>]*href=\"(http:\/\/h[[:alnum:]]*\.hatena\.[^\/]+\/*)\/touch\/asin\/([[:alnum:]]+)\"[^>]*>/u", "<a href=\"./entries.php?keyword=asin%3A\${2}&amp;image=on\" class=\"keyword\">", $entry_body);
146-// } else {
147-// $entry_body = preg_replace("/<a href=\"\/*[^\/]*\/keyword\/([^\/\"]+)\" class=\"keyword\">/u", "<a href=\"./entries.php?keyword=\${1}\" class=\"keyword\">", $entry_body);
148102 $entry_body = preg_replace("/<a href=\"http:\/\/h[^\.]*\.hatena\.[^\/]+\/touch\/target\?word=([^\"]+)\" class=\"keyword\">/u", "<a href=\"./entries.php?keyword=\${1}\" class=\"keyword\">", $entry_body);
149-// $entry_body = preg_replace("/<a href=\"\/*[^\/]*\/([^\/\"]+)\/\" class=\"user\">/u", "<a href=\"./entries.php?user=\${1}\" class=\"user\">", $entry_body);
150103 $entry_body = preg_replace("/<a href=\"http:\/\/h[^\.]*\.hatena\.[^\/]+\/touch\/([^\/]+)\/\" class=\"user\">/u", "<a href=\"./entries.php?user=\${1}\" class=\"user\">", $entry_body);
151-// if ($val->user->id == 'fumobot')$entry_body = preg_replace("/<a[^>]*href=\"(http:\/\/h[[:alnum:]]*\.hatena\.[^\/]+\/*)\/keyword\/([^\"]+)\"[^>]*>/u", "<a href=\"./entries.php?keyword=\${2}\" class=\"keyword\">", $entry_body);
152104 $entry_body = preg_replace("/<a[^>]*href=\"(http:\/\/h[[:alnum:]]*\.hatena\.[^\/]+\/*)\/touch\/asin\/([[:alnum:]]+)\"[^>]*>/u", "<a href=\"./entries.php?keyword=asin%3A\${2}\" class=\"keyword\">", $entry_body);
153-// }
154105 $entry_body = preg_replace("/<div class=\"*user-map\"*><a[^>]*><img[^>]*alt=\"((map):(-*[[:digit:]]{1,3}\.*[[:digit:]]*):(-*[[:digit:]]{1,3}\.*[[:digit:]]*))\"[^>]*><\/a><\/div>/u", "\${1}", $entry_body);
155106
156107 if ($get_image != 'on'){
@@ -185,11 +136,7 @@ if (isset($starisjs) && $starisjs == '1'){
185136 $add_star = '';
186137 }
187138 //キーワードの前処理
188-/*if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
189- $headend = "</form><br />";
190-} else {*/
191139 $headend = "<br />";
192-// }
193140 if ($entries_mode == 'keyword_timeline'){
194141 $entry_kw = '';
195142 } elseif (mb_ereg_match("^{$http_url_regexp}$",htmlspecialchars($val->keyword, ENT_QUOTES))){
@@ -199,9 +146,6 @@ if ($entries_mode == 'keyword_timeline'){
199146 $entry_kw = "ASIN:%KEYWORD%</span>{$headend}\n";
200147 } elseif (!isset($val->keyword)){
201148 $entry_kw = "</span>{$headend}\n";
202-/*} elseif (mb_strpos($entry_body, "{$val->keyword}=") !== FALSE) {
203- //var_dump($val["keyword"]);
204- $entry_body = str_replace("{$val->keyword}=","%KEYWORD%</span>{$headend}\n<span class=\"entry-body\">\n",$entry_body);*/
205149 } elseif (preg_match("/^(id:{1})(.+)/u", $val->keyword) == 0) {
206150 // var_dump($entry_body);
207151 $entry_kw = "%KEYWORD%</span>{$headend}\n";
@@ -217,7 +161,6 @@ if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
217161 //
218162 // var_dump($entry_body);
219163 //公式モバイル版における各エントリへのリンク URL 生成
220-//$refer_link = $haiku_official_url . $val->user->id . '/' . $val->id;
221164 $refer_link = "http://{$haiku_host}/" . $val->user->id . "/" . $val->id;
222165 //タイムスタンプ
223166 if (preg_match("/[0-2][0-9]:[0-9]{2}:[0-9]{2}/u", $val->keyword)){
@@ -261,7 +204,6 @@ foreach ($entry_body_a as $line){
261204 } elseif (preg_match("/<a[^>]*href=\"({$http_url_regexp})\"[^>]*>(<img[^>]*src=\")({$http_url_regexp})(\"[^>]*>)/u", $line)){
262205 $line = preg_replace("/<a[^>]*href=\"(http:{$http_path_regexp})\"[^>]*>(<img[^>]*src=\")({$http_url_regexp})(\"[^>]*>)/ue", "'<a href=\"{$mobile_gateway}'.rawurlencode(rawurldecode('\\3')).'\">\\2{$mobile_gateway_for_images}'.rawurlencode(rawurldecode('\\3')).'\\4';", $line);
263206 }
264-// if (!preg_match("/<a[^>]*href=\"(http:\/\/d\.hatena\.(ne\.jp|com)\/keyword\/{$http_dir_regexp})\"[^>]*>([^<]+)<\/a>/ue", $line)){
265207 if (mb_check_encoding(urldecode($line), 'UTF-8')){
266208 $line = preg_replace("/<a[^>]*href=\"(http:{$http_path_regexp})\"[^>]*>([^<]+)<\/a>/ue", "'<a href=\"{$mobile_gateway}'.rawurlencode(rawurldecode('\\1')).'\">'.rawurldecode('\\2').'</a>';", $line);
267209 } else {
@@ -274,9 +216,9 @@ $entry_body = implode("\n", $entry_body_b);
274216 // var_dump($entry_body);
275217 //map 記法の処理
276218 if ($get_image == 'on'){
277- $entry_body = preg_replace("/(map):(-*[[:digit:]]{1,3}\.*[[:digit:]]*):(-*[[:digit:]]{1,3}\.*[[:digit:]]*)/u", "<a href=\"http://www.google.co.jp/m/local?site=local&amp;q=\${2}%2C\${3}\" class=\"to-map\"><img src=\"http://maps.google.com/maps/api/staticmap?maptype=mobile&amp;markers=\${2}%2C\${3}&amp;sensor=false&amp;size=140x140&amp;zoom=13\" width=\"140\" height=\"140\" /></a><br />[ココ]<a href=\"http://c.hatena.ne.jp/s/nearby?lat=\${2}&amp;lon=\${3}\" class=\"to-coco\">この地点の近くのスポット</a>", $entry_body);
219+ $entry_body = preg_replace("/(map):(-*[[:digit:]]{1,3}\.*[[:digit:]]*):(-*[[:digit:]]{1,3}\.*[[:digit:]]*)/u", "<a href=\"http://www.google.co.jp/m/local?site=local&amp;q=\${2}%2C\${3}\" class=\"to-map\"><img src=\"http://maps.google.com/maps/api/staticmap?maptype=mobile&amp;markers=\${2}%2C\${3}&amp;sensor=false&amp;size=140x140&amp;zoom=13\" width=\"140\" height=\"140\" /></a><br />", $entry_body);
278220 } else {
279- $entry_body = preg_replace("/(map):(-*[[:digit:]]{1,3}\.*[[:digit:]]*):(-*[[:digit:]]{1,3}\.*[[:digit:]]*)/u", "<a href=\"http://www.google.co.jp/m/local?site=local&amp;q=\${2}%2C\${3}\" class=\"to-map\">\${1}:\${2}:\${3}</a><br />[ココ]<a href=\"http://c.hatena.ne.jp/s/nearby?lat=\${2}&amp;lon=\${3}\" class=\"to-coco\">この地点の近くのスポット</a>", $entry_body);
221+ $entry_body = preg_replace("/(map):(-*[[:digit:]]{1,3}\.*[[:digit:]]*):(-*[[:digit:]]{1,3}\.*[[:digit:]]*)/u", "<a href=\"http://www.google.co.jp/m/local?site=local&amp;q=\${2}%2C\${3}\" class=\"to-map\">\${1}:\${2}:\${3}</a><br />", $entry_body);
280222 }
281223 //表示
282224 $echo = $echo . "<div class=\"entry\"";
@@ -290,8 +232,6 @@ if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
290232 } else {
291233 $echo = $echo . '<form method="post" action="';
292234 $echo = $echo . './post.php';
293- // if ($device_who == 'android' && preg_match("/(1\.6)|(1\.5)/", $_SERVER['HTTP_USER_AGENT'])) $echo = $echo . $self_anchor_possibly_with_pagenum;
294- // if (isset($entry_processor_mode) && $entry_processor_mode != 'entry') $echo = $echo . '&amp;reftime=-'.$first_time . ',0'. '#'.$val->id;
295235 $echo = $echo . '" class="star-form">';
296236 }
297237 }
@@ -307,29 +247,18 @@ if (!isset($val->keyword)){
307247 if ($entries_mode == 'keyword_timeline'){
308248 $entry_kw = $add_star . $show_star . '</span>' . $headend . "\n";
309249 } else {
310-// if ($get_image == 'on'){
311-// $entry_kw = str_replace("%KEYWORD%","<a href=\"./entries.php?keyword=" . rawurlencode($val->keyword) . "&amp;image=on\" class=\"keyword\">". htmlspecialchars($val->target->title, ENT_QUOTES) . "</a> {$add_star}{$show_star}",$entry_kw);
312-// } else {
313250 $entry_kw = str_replace("%KEYWORD%","<a href=\"./entries.php?keyword=" . rawurlencode($val->keyword) . "\" class=\"keyword\">". htmlspecialchars($val->target->title, ENT_QUOTES) . "</a> {$add_star}{$show_star}",$entry_kw);
314-// }
315251
316252 //id キーワードの処理
317253 if (preg_match('/^(id:{1}[a-zA-Z]{1}[-_a-zA-Z1234567890]{1,30}[a-zA-Z1234567890]{1})$/u',$val->keyword) >= 1){
318-// if ($get_image == 'on'){
319-// $entry_kw = "<a href=\"./entries.php?keyword=" . rawurlencode($val->keyword) . "&amp;image=on\" class=\"keyword\">" . htmlspecialchars($val->target->word, ENT_QUOTES) . "</a> {$add_star}{$show_star}</span>{$headend}\n";
320-// } else {
321- $entry_kw = "<a href=\"./entries.php?keyword=" . rawurlencode($val->keyword) . "\" class=\"keyword\">" . htmlspecialchars($val->target->word, ENT_QUOTES) . "</a> {$add_star}{$show_star}</span>{$headend}\n";
322-// }
254+
255+ $entry_kw = "<a href=\"./entries.php?keyword=" . rawurlencode($val->keyword) . "\" class=\"keyword\">" . htmlspecialchars($val->target->word, ENT_QUOTES) . "</a> {$add_star}{$show_star}</span>{$headend}\n";
323256 }
324257 }
325258 //Reply-to
326259 if ($val->in_reply_to_status_id != ''){
327260 // echo "...";
328-// if ($get_image == 'on'){
329-// $reply_to = "<span class=\"reply-to reply\"><a href=\"./entry.php?entry={$val->in_reply_to_status_id}&amp;user={$val->in_reply_to_user_id}&amp;keyword=" . rawurlencode($val->keyword) . "&amp;image=on\" class=\"hatena-id\">[← " . $val->in_reply_to_user_id . " へ</a></span>";
330-// } else {
331261 $reply_to = "<span class=\"reply-to reply\"><a href=\"./entry.php?entry={$val->in_reply_to_status_id}&amp;user={$val->in_reply_to_user_id}&amp;keyword=" . rawurlencode($val->keyword) . "\" class=\"hatena-id\">[← " . $val->in_reply_to_user_id . " へ</a></span>";
332-// }
333262 if (mb_substr_count($entry_body, '<br />') < 1){
334263 if (preg_match('/\[画像\(.+\)\]/u', $entry_body) || preg_match('/<img[^>]+\/>/u', $entry_body)){
335264 $reply_to = $reply_to."<br />\n";
@@ -351,31 +280,27 @@ if (isset($in_reply)){
351280 if (isset($val->replies[0]->id)){
352281 $in_reply = '';
353282 foreach($val->replies as $replies){
354-// if ($get_image == 'on'){
355-// $in_reply = $in_reply . " <a href=\"./entry.php?entry={$replies->id}&user={$replies->user->id}&amp;keyword=" . rawurlencode($val->keyword) . "&amp;image=on\" class=\"hatena-id\">[← {$replies->user->id} から</a> ";
356-// } else {
357283 $in_reply = $in_reply . " <a href=\"./entry.php?entry={$replies->id}&user={$replies->user->id}&amp;keyword=" . rawurlencode($val->keyword) . "\" class=\"hatena-id\">[← {$replies->user->id} から</a> ";
358-// }
359284 }
360285 $reply_from = "<span class=\"reply-from reply\">{$in_reply}</span>";
361286 } else {
362287 $reply_from = '';
363288 }
364289 //
365-// $entry_body = preg_replace("/(<a[^>]+>)([^<]+)(<\/a>)/ue", "'\\1'.urldecode('\\2').'\\3';", $entry_body);
366-// var_dump($entry_body);
367290 $entry_body = mb_ereg_replace('\\\("|\'|\\\)', "\\1", $entry_body);
368291 // var_dump($entry_body);
369-// $entry_body = $entry_body . "<br />\n";
370292 $echo = $echo . "{$dating} ";
371293 $echo = $echo . $entry_kw;
372-$echo = $echo . "<p class=\"entry-body\">\n";
294+if ($get_image == 'on'){
295+ $echo = $echo . "<p class=\"entry-body eb-rich\">";
296+} else {
297+ $echo = $echo . "<p class=\"entry-body\">";
298+}
373299 $echo = $echo . $entry_body;
374300 $echo = $echo . "</p>\n";
375301 $echo = $echo . "<span class=\"dating\">";
376302 $echo = $echo . "by <a href=\"./entries.php?user=";
377303 $echo = $echo . $val->user->id;
378-// if ($get_image == 'on') $echo = $echo . "&amp;image=on";
379304 $echo = $echo . "\" class=\"hatena-id\" title=\"id:{$val->user->screen_name}\">";
380305 $echo = $echo . htmlspecialchars($val->user->name, ENT_QUOTES);
381306 $echo = $echo . '</a> ';
--- a/index.php
+++ b/index.php
@@ -12,13 +12,11 @@ require_once "common_functions.php";
1212 <?php
1313 require_once 'init_processor.php';
1414 if (!isset($_SESSION['auth']) || $_SESSION['auth'] != TRUE){
15-// if ($_SESSION['image'] != 'on'){
1615 $_SESSION = array();
1716 if (isset($_COOKIE[session_name()])){
1817 setcookie(session_name(), '', time() - 42000, dirname($_SERVER['SCRIPT_NAME']) . '/', $_SERVER["SERVER_NAME"]);
1918 }
2019 session_destroy();
21-// }
2220 }
2321 //session_regenerate_id(TRUE);
2422 if (isset($_GET['with']) || isset($_GET['log'])){
@@ -80,31 +78,13 @@ if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
8078 <h2 id="users-index-head">ユーザーのページ</h2>
8179 <ul>
8280 EOL;
83-// if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
8481 $echo = $echo . "<li><a href=\"./entries.php?following={$_SESSION['hatenaid']}\n";
85- // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
8682 $echo = $echo . "\" class=\"user\">{$_SESSION['hatenaid']} のアンテナ</a></li>\n";
8783 $echo = $echo . "<li><a href=\"./entries.php?user={$_SESSION['hatenaid']}";
88- // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
8984 $echo = $echo . "\" class=\"user\">{$_SESSION['hatenaid']} のエントリー</a></li>\n";
9085 $echo = $echo . "<li><a href=\"./entries.php?favours={$_SESSION['hatenaid']}";
91- // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . "&amp;image=on";
9286 $echo = $echo . "\" class=\"user\">{$_SESSION['hatenaid']} のお気に入り</a></li>\n";
9387 $echo = $echo . "<li><a href=\"{$relogin}\" class=\"user\">再認証</a></li>";
94-// } else {
95-// $echo = $echo . '<li><form method="get" action="./entries.php">';
96-// $echo = $echo . '<label for="userflw">id:</label><input type="text" name="following" maxlength="32" id="userflw"/><label for="userflw">のアンテナを</label><input type="submit" value="表示" />';
97-// // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '<input type="hidden" name="image" value="on" />';
98-// $echo = $echo . '</form></li>'."\n";
99-// $echo = $echo . '<li><form method="get" action="./entries.php">';
100-// $echo = $echo . '<label for="username">id:</label><input type="text" name="user" maxlength="32" id="username"/><label for="username">のエントリーを</label><input type="submit" value="表示" />';
101-// if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '<input type="hidden" name="image" value="on" />';
102-// $echo = $echo . '</form></li>'."\n";
103-// }
104-
105- // $echo = $echo . "<li><a href=\"./config.php";
106- // if (isset($get_image) && $get_image == 'on') $echo = $echo . '?image=on';
107- // $echo = $echo . "\" class=\"user\">YANMAH2 の設定</a></li>\n";
10888 $echo = $echo . "</ul>\n</div>\n";
10989 $echo = $echo . <<<EOL
11090 <div class="index-content content">
@@ -112,13 +92,10 @@ EOL;
11292 <ul>
11393 EOL;
11494 $echo = $echo . '<li><a href="./entries.php';
115- // if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '?image=on';
11695 $echo = $echo . '" class="entries">みんなのエントリー</a></li>';
11796 $echo = $echo . '<li><a href="./entries.php?album=public';
118- // if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
11997 $echo = $echo . '" class="entries">みんなのアルバム</a></li>';
12098 $echo = $echo . '<li><a href="./entries.php?users=public';
121- // if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
12299 $echo = $echo . '" class="entries">ユーザー一覧</a></li>';
123100 $echo = $echo . "</ul>\n</div>\n";
124101 $echo = $echo . <<<EOL
@@ -129,17 +106,10 @@ EOL;
129106 <label for="go2keyword">キーワード</label><input type="text" name="word" maxlength="170" id="go2keyword" /><label for="go2keyword">を</label>
130107 <input type="submit" value="検索" />
131108 EOL;
132- // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '<input type="hidden" name="image" value="on" />';
133109 $echo = $echo . '</form></li>';
134- // $request_url = "{$api_base_url}keywords/hot.xml".'?without_related_keywords=1';
135- // $use_cache = FALSE;
136- // require_once 'keywords_processor.php';
137-// if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
138110 $echo = $echo . '<li><a href="./keywords.php?user=' . $_SESSION['hatenaid'];
139111 $echo = $echo . '" class="keyword">' . $_SESSION['hatenaid'] . ' のお気に入りキーワード</a></li>' . "\n";
140-// }
141112 $echo = $echo . '<li><a href="./keywords.php';
142- // if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '?image=on';
143113 $echo = $echo . '" class="keyword">キーワード一覧</a></li>';
144114 $echo = $echo . "</ul>\n</div>\n";
145115 } else {
--- a/keywords.php
+++ b/keywords.php
@@ -12,13 +12,11 @@ require_once "common_functions.php";
1212 <?php
1313 require_once "init_processor.php";
1414 if (!isset($_SESSION['auth']) || $_SESSION['auth'] != TRUE){
15-// if ($_SESSION['image'] != 'on'){
1615 $_SESSION = array();
1716 if (isset($_COOKIE[session_name()])){
1817 setcookie(session_name(), '', time() - 42000, dirname($_SERVER['SCRIPT_NAME']) . '/', $_SERVER["SERVER_NAME"]);
1918 }
2019 session_destroy();
21-// }
2220 }
2321 //session_regenerate_id(TRUE);
2422 ?>
@@ -36,10 +34,6 @@ if (isset($_GET["user"])) checkId($_GET["user"]);
3634 if (isset($_GET['page'])) checkPagenum($_GET['page']);
3735 ?>
3836 <?php
39-//
40-// require 'login_processor.php';
41-?>
42-<?php
4337 if (isset($_GET['word']) && $_GET['word'] != ''){
4438 $get_word = $_GET['word'];
4539 $get_word = mb_convert_encoding($get_word, 'UTF-8', $charcode);
@@ -130,7 +124,6 @@ if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
130124 ';
131125 $echo = $echo . '<label for="go2keyword">キーワード</label><input type="text" name="word" maxlength="170" id="go2keyword" /><label for="go2keyword">を</label>
132126 ';
133- // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '<input type="hidden" name="image" value="on" />';
134127 $echo = $echo . '<input type="submit" value="検索" /></form></li>';
135128 if (isset($_GET["page"]) && $_GET["page"] != ''){
136129 if (isset($get_word) && $get_word != ''){
--- a/keywords_processor.php
+++ b/keywords_processor.php
@@ -15,10 +15,8 @@ if ($json['stat'] !== TRUE){
1515 $echo = $echo . "<blockquote>{$json['stat']}</blockquote></li>";
1616 return;
1717 } else {
18-// $contents = json_decode($json['body'], TRUE);
1918 $contents = simplexml_load_string($json['body']);
2019 }
21-// }
2220 // var_dump($contents);
2321 if (libxml_get_last_error() !== FALSE){
2422 $json = strip_tags($json['body']);
@@ -34,7 +32,6 @@ if (libxml_get_last_error() !== FALSE){
3432 foreach ($contents->related_keywords as $val){
3533 $echo = $echo . "<li><a href=\"./entries.php?keyword=";
3634 $echo = $echo . rawurlencode($val);
37-// if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
3835 $echo = $echo . "\" class=\"keyword\">";
3936 $echo = $echo . htmlspecialchars($val, ENT_QUOTES);
4037 $echo = $echo . "</a></li>";
@@ -43,7 +40,6 @@ if (libxml_get_last_error() !== FALSE){
4340 foreach ($contents as $val){
4441 $echo = $echo . "<li><a href=\"./entries.php?keyword=";
4542 $echo = $echo . rawurlencode($val->word);
46-// if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
4743 $echo = $echo . "\" class=\"keyword\">";
4844 $echo = $echo . htmlspecialchars($val->title, ENT_QUOTES);
4945 $echo = $echo . "</a>(" . number_format((double)$val->entry_count) . ")</li>";
--- a/login.php
+++ b/login.php
@@ -118,12 +118,6 @@ if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
118118 }
119119 }
120120
121-// if (isset($error) && $error != ''){
122-// $echo = $echo . $error;
123-// $echo = $echo . "<pre>";
124-// $echo = $echo . var_dump($acstoken['trace']);
125-// $echo = $echo . "</pre>";
126-// }
127121 if (isset($_GET['log']) && $_GET['log'] == 'out'){
128122 $echo = $echo . '<p>ログアウトしました。</p>';
129123 }
@@ -157,11 +151,9 @@ if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
157151 if (preg_match("/.+\?.+/u", $return)){
158152 // echo $return;
159153 $echo = $echo . '<li><a href="' . $return . '&amp;log=on';
160-// if ($_GET['image'] == 'on') echo '&amp;image=on';
161154 $echo = $echo . '" class="navigation-link">元のページ</a>に戻る</li>';
162155 } else {
163156 $echo = $echo . '<li><a href="' . $return . '?log=on';
164-// if ($_GET['image'] == 'on') echo '&amp;image=on';
165157 $echo = $echo . '" class="navigation-link">元のページ</a>に戻る</li>';
166158 }
167159 $echo = $echo . '</ul>';
@@ -182,13 +174,11 @@ if (isset($_SESSION['oauth_stat'])){
182174 <?php
183175 if ($page_phase == 'before'){
184176 if (!isset($_SESSION['auth']) || $_SESSION['auth'] === FALSE){
185-// if ($_SESSION['image'] != 'on'){
186177 $_SESSION = array();
187178 if (isset($_COOKIE[session_name()])){
188179 setcookie(session_name(), '', time() - 42000, dirname($_SERVER['SCRIPT_NAME']) . '/', $_SERVER["SERVER_NAME"]);
189180 }
190181 session_destroy();
191-// }
192182 }
193183 }
194184 ?>
\ No newline at end of file
--- a/product_definitions.php
+++ b/product_definitions.php
@@ -5,9 +5,9 @@
55 ?>
66 <?php defined("HELLO") or exit(); ?>
77 <?php
8-$product_name_abbr = "YANMAH2 -season 2-";
9-$product_name_full = "Yet ANother Mobile Accelerated HatenaHaiku";
10-$product_version = "1.9905-beta";
8+$product_name_abbr = "YANMAH2 〜season 2〜";
9+$product_name_full = "Yet ANother Mobile Accelerated Hatena-Haiku";
10+$product_version = "1.9906-beta";
1111 $project_name = "YANMAH2 project";
1212 $project_url = "http://yanmah2.sourceforge.jp/";
1313 $user_agent = $product_name_abbr . '/' . $product_version . ' ' . $_SERVER['SERVER_NAME'];
--- a/style.php
+++ b/style.php
@@ -200,6 +200,8 @@ if ($device_who == 'ktai'){
200200 }
201201 ?>
202202 margin-top: 2px; margin-bottom: 2px;
203+}
204+.eb-rich {
203205 margin-left: 2em;
204206 }
205207 .entry-body img {
Show on old repository browser