<?php require_once("../../api.php"); require_once("../../include/lib.php"); if (!isset($_GET["id"])) header("Location: " . SITEURL . "/404.php"); $id = (int)$_GET["id"]; $cur = "/artworks/?id=".$id; $res = get("illust/".$id); if (!isset($res->body)) { header("Location: " . SITEURL . "/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="<?= SITEURL ?>/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="<?= SITEURL ?>/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="<?= SITEURL ?>/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="<?= SITEURL ?>/artworks/?id=<?= $r->id ?>"> <img src="<?= imgprx($r->url) ?>" alt="<?= $r->alt ?>" style="width: 260px; height: 260px;" /> <?= $r->title ?> </a> <br /> <a href="<?= SITEURL ?>/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"); ?>