ファイル構成変更
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use \Dao;
|
||||
use \Dto;
|
||||
|
||||
|
||||
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);
|
||||
|
||||
if ($row = Dao\Thread :: find ($thread))
|
||||
{
|
||||
$title = $row -> title;
|
||||
$explain = $row -> explain;
|
||||
}
|
||||
|
||||
if (isset ($_GET['id']))
|
||||
{
|
||||
if (($_GET['evaluate'] ?? '') === 'good')
|
||||
{
|
||||
Dao\Response :: like ((int) $_GET['id']);
|
||||
header ("Location: ./?thread=$thread&sort=$sort");
|
||||
}
|
||||
|
||||
if (($_GET['evaluate'] ?? '') === 'bad')
|
||||
{
|
||||
Dao\Response :: dislike ((int) $_GET['id']);
|
||||
header ("Location: ./?thread=$thread&sort=$sort");
|
||||
}
|
||||
}
|
||||
|
||||
require_once './forms/index.frm.php';
|
||||
|
||||
Reference in New Issue
Block a user