|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
-
- require_once "${_SERVER['DOCUMENT_ROOT']}/database.php";
-
- if (isset ($_GET['page']))
- $page = $_GET['page'];
- else
- $page = 0;
-
- if (isset ($_GET['thread']))
- $thread = $_GET['thread'];
- else
- $thread = -1;
-
- if (isset ($_GET['sort']))
- {
- $sort = $_GET['sort'];
-
- if (!(in_array ($sort, array ('td', 'eg', 'ta', 'eb'))))
- $sort = 'td';
- }
- else
- $sort = 'td';
-
- // 画像のディレクトリを開く.
- $dir = './images/';
- $handle = opendir ($dir);
-
- // MySQL 宣言
- $mysqli = set_mysql ('miteruzo_bbs');
-
- $mysqli -> set_charset ('utf8');
-
- if ($row = Dao\Thread -> find ($thread))
- {
- $title = $row -> title;
- $explain = $row -> explain;
- }
-
- if (isset ($_GET['id'])
- && isset ($_GET['evaluate'])
- && (($_GET['evaluate'] == 'good') || ($_GET['evaluate'] == 'bad')))
- {
- $mysqli -> query ("
- UPDATE
- responses
- SET
- {$_GET['evaluate']} = {$_GET['evaluate']} + 1
- WHERE
- (thread_id = $thread) AND (response_id = {$_GET['id']})");
-
- header ("Location: ./?thread=$thread&sort=$sort");
- }
-
- require_once './forms/index.frm.php';
-
|