• R/O
  • HTTP
  • SSH
  • HTTPS

YANMAH2-season2-: Commit


Commit MetaInfo

Revisionce6c23c4bae6546eff903c4e22f785e701ca4c18 (tree)
Time2014-11-02 15:09:33
AuthorKana Koda <kodakana@user...>
CommiterKana Koda

Log Message

ログイン必須化(Forbidden対策)。

Change Summary

Incremental Difference

--- a/entries.php
+++ b/entries.php
@@ -356,65 +356,66 @@ $request_url = constRequest($json_url);
356356 // var_dump($get_image);
357357 if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
358358 $json = getJson($request_url, TRUE, $conkey, $conkey_sec, $_SESSION['acstoken'], $_SESSION['acs_sec']);
359-} else {
360- $json = getJson($request_url, FALSE);
361-}
362-if (preg_match("/^oauth_problem=token_rejected$/", $json['body'])){
363- $echo = $echo . "<p class=\"oauth-res\">アクセストークンが無効になっています。<a href=\"{$relogin}\">再認証</a>を行なってください。</p>";
364- $json = getJson(constRequest($json_url_noaouth), FALSE);
365-}
366-if ($json['stat'] !== TRUE){
367- $contents = strip_tags($json['stat']);
368- $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
369- $echo = $echo . "<blockquote>";
370- if (isset($json['http'])) echo "HTTP {$json['http']}<br />";
371- $echo = $echo . "{$json['stat']}<br />{$contents}</blockquote>\n";
372- $timeline_putted = FALSE;
373-} else {
374- $json_body = $json['body'];
375- $contents = checkEntryData($json_body);
376- if ($contents['stat'] == FALSE && $contents['ercode'] != 'x'){
377-// var_dump($contents);
378-// var_dump($json['body']);
379- $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
380- $echo = $echo . "<blockquote>HTTP {$json['http']}<br />";
381- $echo = $echo . 'XML error '.$contents['ercode'].':'.$contents['ermes'];
382- $echo = $echo . "<br />".strip_tags($json['body'])."</blockquote>\n";
383- $timeline_putted = FALSE;
384- } elseif ($contents['stat'] == FALSE && $contents['ercode'] == 'x'){
385- $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
386- $echo = $echo . "<blockquote>HTTP {$json['http']}<br />{$contents['ermes']}</blockquote>\n";
387- $timeline_putted = FALSE;
359+ if (preg_match("/^oauth_problem=token_rejected$/", $json['body'])){
360+ $echo = $echo . "<p class=\"oauth-res\">アクセストークンが無効になっています。<a href=\"{$relogin}\">再認証</a>を行なってください。</p>";
361+ $json = getJson(constRequest($json_url_noaouth), FALSE);
362+ }
363+ if ($json['stat'] !== TRUE){
364+ $contents = strip_tags($json['stat']);
365+ $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
366+ $echo = $echo . "<blockquote>";
367+ if (isset($json['http'])) echo "HTTP {$json['http']}<br />";
368+ $echo = $echo . "{$json['stat']}<br />{$contents}</blockquote>\n";
369+ $timeline_putted = FALSE;
388370 } else {
389-// var_dump($contents);
390- $first_e = 'first';
391- if ($entries_mode == 'default' || $entries_mode == 'album'){ $dict = array(); $spam = 0; }
392- if ($entries_mode == 'users' || $entries_mode == 'keyword_users' || $entries_mode == 'favours'){
393- $ustock = array();
394- $echo = $echo . "<dl class=\"users-list\">\n";
395- }
396- foreach ($contents['contents'] as $val){
397- echo mb_convert_encoding($echo, $charcode, 'UTF-8');
398- $echo = '';
399- if ($entries_mode == 'users' || $entries_mode == 'keyword_users' || $entries_mode == 'favours'){
400- $entry_processor_mode = 'users';
401- require 'entry_processor.php';
402- } else {
403- $entry_processor_mode = "entries";
404- require 'entry_processor.php';
405- echo mb_convert_encoding($echo, $charcode, 'UTF-8');
406- $echo = '';
371+ $json_body = $json['body'];
372+ $contents = checkEntryData($json_body);
373+ if ($contents['stat'] == FALSE && $contents['ercode'] != 'x'){
374+ // var_dump($contents);
375+ // var_dump($json['body']);
376+ $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
377+ $echo = $echo . "<blockquote>HTTP {$json['http']}<br />";
378+ $echo = $echo . 'XML error '.$contents['ercode'].':'.$contents['ermes'];
379+ $echo = $echo . "<br />".strip_tags($json['body'])."</blockquote>\n";
380+ $timeline_putted = FALSE;
381+ } elseif ($contents['stat'] == FALSE && $contents['ercode'] == 'x'){
382+ $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
383+ $echo = $echo . "<blockquote>HTTP {$json['http']}<br />{$contents['ermes']}</blockquote>\n";
384+ $timeline_putted = FALSE;
385+ } else {
386+ // var_dump($contents);
387+ $first_e = 'first';
388+ if ($entries_mode == 'default' || $entries_mode == 'album'){ $dict = array(); $spam = 0; }
389+ if ($entries_mode == 'users' || $entries_mode == 'keyword_users' || $entries_mode == 'favours'){
390+ $ustock = array();
391+ $echo = $echo . "<dl class=\"users-list\">\n";
407392 }
408- $timeline_putted = TRUE;
409- }
410- if (isset($spam) && $spam > 0) $echo = "<p>{$spam} スパムっぽいのを表示しませんでした。</p>";
411- if ($entries_mode == 'users' || $entries_mode == 'keyword_users' || $entries_mode == 'favours') {
412- $echo = $echo . "</dl>\n";
413-// var_dump($dict);
414- $echo = $echo . '<p>' . count($ustock) . '/' . count($contents['contents']) .
415- ' unique</p>' . "\n";
416- }
393+ foreach ($contents['contents'] as $val){
394+ echo mb_convert_encoding($echo, $charcode, 'UTF-8');
395+ $echo = '';
396+ if ($entries_mode == 'users' || $entries_mode == 'keyword_users' || $entries_mode == 'favours'){
397+ $entry_processor_mode = 'users';
398+ require 'entry_processor.php';
399+ } else {
400+ $entry_processor_mode = "entries";
401+ require 'entry_processor.php';
402+ echo mb_convert_encoding($echo, $charcode, 'UTF-8');
403+ $echo = '';
404+ }
405+ $timeline_putted = TRUE;
406+ }
407+ if (isset($spam) && $spam > 0) $echo = "<p>{$spam} スパムっぽいのを表示しませんでした。</p>";
408+ if ($entries_mode == 'users' || $entries_mode == 'keyword_users' || $entries_mode == 'favours') {
409+ $echo = $echo . "</dl>\n";
410+ // var_dump($dict);
411+ $echo = $echo . '<p>' . count($ustock) . '/' . count($contents['contents']) .
412+ ' unique</p>' . "\n";
413+ }
414+ }
417415 }
416+} else {
417+// $json = getJson($request_url, FALSE);
418+ $echo = $echo . '<p>内容を読むには<a href="./login.php?return='.rawurlencode(rawurldecode($self_anchor_with_imagemode)).'" class="navigation-link">ログイン</a>してください。</p>';
418419 }
419420 echo mb_convert_encoding($echo, $charcode, 'UTF-8');
420421 $echo = '';
--- a/entry.php
+++ b/entry.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
@@ -178,41 +178,44 @@ $echo = $echo . '<div class="contents">'."\n";
178178 if (isset($_GET['image'])){
179179 $_SESSION['image'] = $_GET['image'];
180180 }
181-$request_url = $json_url;
182- $json = getJson($request_url, FALSE);
183-if ($json['stat'] !== TRUE){
184- $contents = strip_tags($json['stat']);
185- $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
186- $echo = $echo . "<blockquote>{$contents}</blockquote>\n";
187-} else {
188- $json_body = $json['body'];
189- $contents = simplexml_load_string($json['body']);
190- if (preg_match("/^oauth_problem=token_rejected$/", $json_body)){
191- $echo = $echo . "<p>認証情報が無効です。<a href=\"{$relogin}\">再認証</a>を行なってください。</p>";
192- } elseif (libxml_get_last_error() !== FALSE){
193- $contents = strip_tags($contents);
194- $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
195- $echo = $echo . "<blockquote>{$contents}</blockquote>\n";
196- } elseif (isset($contents['error'])){
197- $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
198- $echo = $echo . "<blockquote>{$contents['error']}</blockquote>\n";
181+if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
182+ $request_url = $json_url;
183+ $json = getJson($request_url, FALSE);
184+ if ($json['stat'] !== TRUE){
185+ $contents = strip_tags($json['stat']);
186+ $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
187+ $echo = $echo . "<blockquote>{$contents}</blockquote>\n";
199188 } else {
200- $entry_processor_mode = "entry";
201- $val = $contents;
202- require 'entry_processor.php';
203- if (isset($contents->replies) && $contents->replies[0]->id != ''){
204- $echo = $echo . '<dl><dt>リプライ</dt>';
205- $echo = $echo . '<dd>';
206- foreach($contents->replies as $val){
207- $val->keyword = $_GET['keyword'];
208- require 'entry_processor.php';
209- }
210- $echo = $echo . '</dd>';
211- $echo = $echo . '</dl>';
212- }
189+ $json_body = $json['body'];
190+ $contents = simplexml_load_string($json['body']);
191+ if (preg_match("/^oauth_problem=token_rejected$/", $json_body)){
192+ $echo = $echo . "<p>認証情報が無効です。<a href=\"{$relogin}\">再認証</a>を行なってください。</p>";
193+ } elseif (libxml_get_last_error() !== FALSE){
194+ $contents = strip_tags($contents);
195+ $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
196+ $echo = $echo . "<blockquote>{$contents}</blockquote>\n";
197+ } elseif (isset($contents['error'])){
198+ $echo = $echo . "<p>はてなハイク API からデータを取得できなかったような気がします。</p>\n";
199+ $echo = $echo . "<blockquote>{$contents['error']}</blockquote>\n";
200+ } else {
201+ $entry_processor_mode = "entry";
202+ $val = $contents;
203+ require 'entry_processor.php';
204+ if (isset($contents->replies) && $contents->replies[0]->id != ''){
205+ $echo = $echo . '<dl><dt>リプライ</dt>';
206+ $echo = $echo . '<dd>';
207+ foreach($contents->replies as $val){
208+ $val->keyword = $_GET['keyword'];
209+ require 'entry_processor.php';
210+ }
211+ $echo = $echo . '</dd>';
212+ $echo = $echo . '</dl>';
213+ }
214+ }
213215 }
216+} else {
217+ $echo = $echo . '<p>内容を読むには<a href="./login.php?return='.rawurlencode(rawurldecode($self_anchor_with_imagemode)).'" class="navigation-link">ログイン</a>してください。</p>';
214218 }
215-
216219 ?>
217220 <?php
218221 if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
--- a/index.php
+++ b/index.php
@@ -74,79 +74,80 @@ if (isset($_SESSION['oauth_stat'])){
7474 }
7575 $echo = $echo . '</div>'."\n";
7676 }
77-$echo = $echo . <<<EOL
78-<div class="index-content">
79-<h2 id="users-index-head">ユーザーのページ</h2>
80-<ul>
81-EOL;
8277 if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
83- $echo = $echo . "<li><a href=\"./entries.php?following={$_SESSION['hatenaid']}\n";
84-// if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
85- $echo = $echo . "\" class=\"user\">{$_SESSION['hatenaid']} のアンテナ</a></li>\n";
86- $echo = $echo . "<li><a href=\"./entries.php?user={$_SESSION['hatenaid']}";
87-// if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
88- $echo = $echo . "\" class=\"user\">{$_SESSION['hatenaid']} のエントリー</a></li>\n";
89- $echo = $echo . "<li><a href=\"./entries.php?favours={$_SESSION['hatenaid']}";
90-// if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . "&amp;image=on";
91- $echo = $echo . "\" class=\"user\">{$_SESSION['hatenaid']} のお気に入り</a></li>\n";
92- $echo = $echo . "<li><a href=\"{$relogin}\" class=\"user\">再認証</a></li>";
93-} else {
94- $echo = $echo . '<li><form method="get" action="./entries.php">';
95- $echo = $echo . '<label for="userflw">id:</label><input type="text" name="following" maxlength="32" id="userflw"/><label for="userflw">のアンテナを</label><input type="submit" value="表示" />';
96-// if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '<input type="hidden" name="image" value="on" />';
97- $echo = $echo . '</form></li>'."\n";
98- $echo = $echo . '<li><form method="get" action="./entries.php">';
99- $echo = $echo . '<label for="username">id:</label><input type="text" name="user" maxlength="32" id="username"/><label for="username">のエントリーを</label><input type="submit" value="表示" />';
100- if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '<input type="hidden" name="image" value="on" />';
101- $echo = $echo . '</form></li>'."\n";
102-}
78+ $echo = $echo . <<<EOL
79+ <div class="index-content">
80+ <h2 id="users-index-head">ユーザーのページ</h2>
81+ <ul>
82+EOL;
83+// if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
84+ $echo = $echo . "<li><a href=\"./entries.php?following={$_SESSION['hatenaid']}\n";
85+ // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
86+ $echo = $echo . "\" class=\"user\">{$_SESSION['hatenaid']} のアンテナ</a></li>\n";
87+ $echo = $echo . "<li><a href=\"./entries.php?user={$_SESSION['hatenaid']}";
88+ // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
89+ $echo = $echo . "\" class=\"user\">{$_SESSION['hatenaid']} のエントリー</a></li>\n";
90+ $echo = $echo . "<li><a href=\"./entries.php?favours={$_SESSION['hatenaid']}";
91+ // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . "&amp;image=on";
92+ $echo = $echo . "\" class=\"user\">{$_SESSION['hatenaid']} のお気に入り</a></li>\n";
93+ $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+// }
103104
104-// $echo = $echo . "<li><a href=\"./config.php";
105-// if (isset($get_image) && $get_image == 'on') $echo = $echo . '?image=on';
106-// $echo = $echo . "\" class=\"user\">YANMAH2 の設定</a></li>\n";
107-$echo = $echo . "</ul>\n</div>\n";
108-?>
109-<?php
110-$echo = $echo . <<<EOL
111-<div class="index-content content">
112-<h2 id="entries-index-head">みんなのページ</h2>
113-<ul>
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";
108+ $echo = $echo . "</ul>\n</div>\n";
109+ $echo = $echo . <<<EOL
110+ <div class="index-content content">
111+ <h2 id="entries-index-head">みんなのページ</h2>
112+ <ul>
114113 EOL;
115-$echo = $echo . '<li><a href="./entries.php';
116-// if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '?image=on';
117-$echo = $echo . '" class="entries">みんなのエントリー</a></li>';
118-$echo = $echo . '<li><a href="./entries.php?album=public';
119-// if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
120-$echo = $echo . '" class="entries">みんなのアルバム</a></li>';
121-$echo = $echo . '<li><a href="./entries.php?users=public';
122-// if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
123-$echo = $echo . '" class="entries">ユーザー一覧</a></li>';
124-$echo = $echo . "</ul>\n</div>\n";
125-?>
126-<?php
127-$echo = $echo . <<<EOL
128-<div class="index-content">
129-<h2 id="keywords-index-head">キーワード</h2>
130-<ul>
131-<li><form method="get" action="./keywords.php" accept-charset="{$meta_charset}">
132-<label for="go2keyword">キーワード</label><input type="text" name="word" maxlength="170" id="go2keyword" /><label for="go2keyword">を</label>
133-<input type="submit" value="検索" />
114+ $echo = $echo . '<li><a href="./entries.php';
115+ // if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '?image=on';
116+ $echo = $echo . '" class="entries">みんなのエントリー</a></li>';
117+ $echo = $echo . '<li><a href="./entries.php?album=public';
118+ // if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
119+ $echo = $echo . '" class="entries">みんなのアルバム</a></li>';
120+ $echo = $echo . '<li><a href="./entries.php?users=public';
121+ // if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '&amp;image=on';
122+ $echo = $echo . '" class="entries">ユーザー一覧</a></li>';
123+ $echo = $echo . "</ul>\n</div>\n";
124+ $echo = $echo . <<<EOL
125+ <div class="index-content">
126+ <h2 id="keywords-index-head">キーワード</h2>
127+ <ul>
128+ <li><form method="get" action="./keywords.php" accept-charset="{$meta_charset}">
129+ <label for="go2keyword">キーワード</label><input type="text" name="word" maxlength="170" id="go2keyword" /><label for="go2keyword">を</label>
130+ <input type="submit" value="検索" />
134131 EOL;
135-// if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '<input type="hidden" name="image" value="on" />';
136-$echo = $echo . '</form></li>';
137-// $request_url = "{$api_base_url}keywords/hot.xml".'?without_related_keywords=1';
138-// $use_cache = FALSE;
139-// require_once 'keywords_processor.php';
140-?>
141-<?php
142-if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
143- $echo = $echo . '<li><a href="./keywords.php?user=' . $_SESSION['hatenaid'];
144- $echo = $echo . '" class="keyword">' . $_SESSION['hatenaid'] . ' のお気に入りキーワード</a></li>' . "\n";
132+ // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '<input type="hidden" name="image" value="on" />';
133+ $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){
138+ $echo = $echo . '<li><a href="./keywords.php?user=' . $_SESSION['hatenaid'];
139+ $echo = $echo . '" class="keyword">' . $_SESSION['hatenaid'] . ' のお気に入りキーワード</a></li>' . "\n";
140+// }
141+ $echo = $echo . '<li><a href="./keywords.php';
142+ // if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '?image=on';
143+ $echo = $echo . '" class="keyword">キーワード一覧</a></li>';
144+ $echo = $echo . "</ul>\n</div>\n";
145+} else {
146+ $echo = $echo . "<div class=\"index-content\">\n<ul>";
147+ $echo = $echo . '<li><a href="./login.php?return='.rawurlencode(rawurldecode($self_anchor_with_imagemode)).'" class="navigation-link">ログイン</a></li>'."\n";
148+ $echo = $echo . "</ul>\n</div>\n";
145149 }
146-$echo = $echo . '<li><a href="./keywords.php';
147-// if(isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '?image=on';
148-$echo = $echo . '" class="keyword">キーワード一覧</a></li>';
149-$echo = $echo . "</ul>\n</div>\n</div>\n<hr />\n";
150+$echo = $echo . "</div>\n<hr />\n";
150151 ?>
151152 <?php
152153 $echo = $echo . echoCommonFooter('#com-hdr');
--- a/keywords.php
+++ b/keywords.php
@@ -75,7 +75,12 @@ if (isset($_GET['page']) && $_GET['page'] != ''){
7575 $relog_back = $self_anchor_possibly_with_pagenum . '&log=try';
7676 $relogin = $self_anchor_possibly_with_pagenum . '&amp;with=haiku&amp;callback='.rawurlencode($relog_back);
7777 } else {
78- $self_anchor_possibly_with_pagenum = $self_anchor;
78+ if ($list_mode != 'default'){
79+ $self_anchor_possibly_with_pagenum = $self_anchor.'&page=1';
80+ } else {
81+ $self_anchor_possibly_with_pagenum = $self_anchor.'?page=1';
82+ }
83+// $self_anchor_possibly_with_pagenum = $self_anchor;
7984 if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != ''){
8085 $relog_back = $self_anchor_possibly_with_pagenum . '&log=try';
8186 $relogin = $self_anchor_possibly_with_pagenum . '&amp;with=haiku&amp;callback='.rawurlencode($relog_back);
@@ -118,31 +123,35 @@ $echo = $echo . "<h1 id=\"entries-head\" class=\"head1\">{$page_head}</h1>\n<hr
118123 $echo = $echo . "</div>\n";
119124 ?>
120125 <?php
121-$echo = $echo . '<div class="contents"><ul class="kwd-ls">';
122-$echo = $echo . '<li><form method="get" action="./keywords.php" accept-charset="'.$meta_charset.'">
123-';
124-$echo = $echo . '<label for="go2keyword">キーワード</label><input type="text" name="word" maxlength="170" id="go2keyword" /><label for="go2keyword">を</label>
125-';
126-// if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '<input type="hidden" name="image" value="on" />';
127-$echo = $echo . '<input type="submit" value="検索" /></form></li>';
128-?>
129-<?php
130-if (isset($_GET["page"]) && $_GET["page"] != ''){
131- if (isset($get_word) && $get_word != ''){
132- $request_url = $json_url . "&page=" . htmlspecialchars($_GET["page"], ENT_QUOTES);
133- } elseif (isset($get_user) && $get_user != ''){
126+$echo = $echo . '<div class="contents">'."\n";
127+if (isset($_SESSION['auth']) && $_SESSION['auth'] === TRUE){
128+ $echo = $echo . '<ul class="kwd-ls">'."\n";
129+ $echo = $echo . '<li><form method="get" action="./keywords.php" accept-charset="'.$meta_charset.'">
130+ ';
131+ $echo = $echo . '<label for="go2keyword">キーワード</label><input type="text" name="word" maxlength="170" id="go2keyword" /><label for="go2keyword">を</label>
132+ ';
133+ // if (isset($_GET['image']) && $_GET['image'] == 'on') $echo = $echo . '<input type="hidden" name="image" value="on" />';
134+ $echo = $echo . '<input type="submit" value="検索" /></form></li>';
135+ if (isset($_GET["page"]) && $_GET["page"] != ''){
136+ if (isset($get_word) && $get_word != ''){
134137 $request_url = $json_url . "&page=" . htmlspecialchars($_GET["page"], ENT_QUOTES);
135- } elseif (isset($get_related) && $get_related != ''){
136- $request_url = $json_url . '?page='.htmlspecialchars($_GET['page'], ENT_QUOTES);
137- } else {
138- $request_url = $json_url . '&page=' . htmlspecialchars($_GET['page'], ENT_QUOTES);
139- }
140-} else {
141- $request_url = $json_url;
138+ } elseif (isset($get_user) && $get_user != ''){
139+ $request_url = $json_url . "&page=" . htmlspecialchars($_GET["page"], ENT_QUOTES);
140+ } elseif (isset($get_related) && $get_related != ''){
141+ $request_url = $json_url . '?page='.htmlspecialchars($_GET['page'], ENT_QUOTES);
142+ } else {
143+ $request_url = $json_url . '&page=' . htmlspecialchars($_GET['page'], ENT_QUOTES);
144+ }
145+ } else {
146+ $request_url = $json_url;
147+ }
148+ // var_dump($request_url);
149+ require_once 'keywords_processor.php';
150+ $echo = $echo . "</ul>\n";
151+} else {
152+ $echo = $echo . '<p>内容を読むには<a href="./login.php?return='.rawurlencode(rawurldecode($self_anchor_with_imagemode)).'" class="navigation-link">ログイン</a>してください。</p>';
142153 }
143-// var_dump($request_url);
144-require_once 'keywords_processor.php';
145-$echo = $echo . "</ul><hr /></div>";
154+$echo = $echo . "<hr /></div>\n";
146155 ?>
147156 <?php
148157 if ($list_mode == 'related' || $list_mode == 'following'){
--- a/product_definitions.php
+++ b/product_definitions.php
@@ -7,7 +7,7 @@
77 <?php
88 $product_name_abbr = "YANMAH2 -season 2-";
99 $product_name_full = "Yet ANother Mobile Accelerated HatenaHaiku";
10-$product_version = "1.9901-beta";
10+$product_version = "1.9905-beta";
1111 $project_name = "YANMAH2 project";
1212 $project_url = "http://yanmah2.sourceforge.jp/";
1313 $user_agent = $product_name_abbr . '/' . $product_version . ' ' . $_SERVER['SERVER_NAME'];
Show on old repository browser