123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- require_once("../../api.php");
- require_once("../../include/lib.php");
- if (!isset($_GET["id"])) header("Location: /404.php");
- $id = (int)$_GET["id"];
- $cur = "/artworks/?id=".$id;
- $res = get("illust/".$id);
- if (!isset($res->body)) {
- header("Location: /404.php");
- die();
- }
- $res = $res->body;
- if ($res->commentCount > 0) {
- $com = get("illusts/comments/roots?illust_id=".$id);
- }
- $rec = get("illust/".$id."/recommend/init?limit=".$rpsize);
- $out = ["title" => $res->alt, "desc" => $res->description, "img_sec" => "artwork", "img_id" => $id];
- $icon = "";
- foreach ($res->userIllusts as $k => $v) {
- if (is_null($v)) continue;
- if (isset($v->profileImageUrl)) $icon = imgprx($v->profileImageUrl);
- }
- ?>
- <?php include("../../include/header.php"); ?>
- <div style="text-align: center;">
- <?php for ($i = 0; $i < $res->pageCount; $i++) { ?>
- <p>
- <a href="<?= imgprx(str_replace("_p0", "_p".$i, $res->urls->original)) ?>">
- <img src="<?= imgprx(str_replace("_p0_", "_p".$i."_", $res->urls->regular)) ?>" alt="<?= $res->illustTitle ?>" />
- </a>
- </p>
- <?php } ?>
- </div>
- <h1><?= $res->illustTitle ?></h1>
- <p>
- 好:<?= $res->likeCount ?> 保:<?= $res->bookmarkCount ?> 視:<?= $res->viewCount ?><br />
- <img src="<?= $icon ?>" alt="<?= $res->userName ?>" /> <a href="/users?id=<?= $res->userId ?>"><?= $res->userName ?></a>
- </p>
- <h2>コメント (<?= $res->commentCount ?>)</h2>
- <table>
- <?php
- if (!$com->error) {
- foreach ($com->body->comments as $c) {
- ?>
- <tr>
- <td rowspan="2" style="vertical-align: top;"><img src="<?= imgprx($c->img) ?>" alt="<?= $c->userName ?>" style="width: 40px; height: 40px;" /></td>
- <td style="padding-left: 12px;"><a href="/users/?id=<?= $c->userId ?>"><?= $c->userName ?></a> <?= $c->commentDate ?></td>
- </tr>
- <tr>
- <td style="padding-left: 12px;">
- <?php
- if (is_null($c->stampId)) {
- echo $c->comment;
- }
- else {
- ?>
- <img src="/proxy.php?url=s.pximg.net/common/images/stamp/generated-stamps/<?= $c->stampId ?>_s.jpg" alt="<?= $c->stampId ?>" />
- <?php
- }
- ?>
- </td>
- </tr>
- <?php
- }
- }
- else {
- echo $com->message;
- }
- ?>
- </table>
- <h2>関連作品</h2>
- <?php
- if (!$rec->error) {
- foreach ($rec->body->illusts as $r) {
- if (is_null($r->id)) continue;
- ?>
- <div class="searchres">
- <a href="/artworks/?id=<?= $r->id ?>">
- <img src="<?= imgprx($r->url) ?>" alt="<?= $r->alt ?>" style="width: 260px; height: 260px;" />
- <?= $r->title ?>
- </a>
- <br />
- <a href="/users/?id=<?= $r->userId ?>">
- <img src="<?= imgprx($r->profileImageUrl) ?>" alt="<?= $r->userName ?>" style="width: 24px; height: 24px;" />
- <?= $r->userName ?>
- </a>
- </div>
- <?php
- }
- }
- else {
- echo $rec->message;
- }
- ?>
- <?php include("../../include/footer.php"); ?>
|