12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- require_once("../../../api.php");
- require_once("../../../include/lib.php");
- if (!isset($_GET["id"])) header("Location: " . SITEURL . "/404.php");
- $id = (int)$_GET["id"];
- $cur = "/users/bookmarks/?id=".$id;
- $page = isset($_GET["page"]) ? (int)$_GET["page"] : 1;
- if ($page < 1) $page = 1;
- $pagemax = 40;
- $offset = $pagemax * ($page - 1);
- $res = get("user/".$id."/illusts/bookmarks?offset=".$offset."&limit=".$pagemax."&rest=show&tag=");
- if (!isset($res->body)) {
- header("Location: " . SITEURL . "/404.php");
- die();
- }
- $top = get("user/".$id."/profile/top");
- $res = $res->body;
- $top = $top->body;
- if (count((array)$res->works) == 0) header("Location: " . SITEURL . "/404.php");
- $out = ["title" => $top->extraData->meta->title, "desc" => $top->extraData->meta->description, "img_sec" => "userhead", "img_id" => $id];
- $bookmarks = count((array)$res->works);
- ?>
- <?php
- include("../../../include/header.php");
- $title = $top->extraData->meta->ogp->title;
- $now = "bookmark";
- $bmc = $bookmarks;
- $cunt = get("user/".$id."/profile/all");
- $ilc = count((array)$cunt->body->illusts);
- $mgc = count((array)$cunt->body->manga);
- unset($cunt);
- include("../../../include/usermenu.php");
- ?>
- <hr />
- <?php
- if ($bookmarks > 0) {
- ?>
- <h2>ブックマーク</h2>
- <?php
- foreach ($res->works as $k => $v) {
- ?>
- <div class="searchres">
- <a href="<?= SITEURL ?>/artworks/?id=<?= $v->id ?>">
- <img src="<?= imgprx($v->url) ?>" alt="<?= $v->alt ?>">
- <?= $v->title ?>
- </a>
- <br />
- <a href="<?= SITEURL ?>/users/?id=<?= $v->userId ?>">
- <img src="<?= imgprx($v->profileImageUrl) ?>" alt="<?= $v->userName ?>" style="width: 24px; height: 24px;" />
- <?= $v->userName ?>
- </a>
- </div>
- <?php
- }
- }
- unset($res);
- unset($top);
- $sum = ceil($bookmarks/$pagemax);
- include("../../../include/pagination.php");
- include("../../../include/footer.php");
- ?>
|