pageCount == 1) { render_artwork_image( $artwork->urls->original, $artwork->urls->regular, $artwork->width, $artwork->height, sprintf(get_string('artwork.image-alt'), '1', '1') ); return; } list($artwork_pages, $error) = get_artwork_pages($artwork->id); if ($error) { for ($p = 0; $p < $artwork->pageCount; $p ++) { $artwork_pages[$p] = [ 'urls' => [ 'regular' => str_replace('_p0', '_p' . $p, $artwork->urls->original), 'original' => str_replace('_p0', '_p' . $p, $artwork->urls->regular) ], 'width' => false, 'height' => false ]; } } else { $artwork_pages = $artwork_pages['body']; } if ($settings['collapse-pages'] == 'off') { for ($p = 0; $p < $artwork->pageCount; $p ++) { render_artwork_image( $artwork_pages[$p]['urls']['original'], $artwork_pages[$p]['urls']['regular'], $artwork_pages[$p]['width'], $artwork_pages[$p]['height'], sprintf(get_string('artwork.image-alt'), $p + 1, $artwork->pageCount) ); } return; } render_collapsed_content( 2, get_string('artwork.images-show-all'), function($page) use ($artwork, $artwork_pages) { for ($p = $page; $p < ($page == 0 ? 1 : $artwork->pageCount); $p ++) { render_artwork_image( $artwork_pages[$p]['urls']['original'], $artwork_pages[$p]['urls']['regular'], $artwork_pages[$p]['width'], $artwork_pages[$p]['height'], sprintf(get_string('artwork.image-alt'), $p + 1, $artwork->pageCount) ); } } ); } function render_artwork_image($original_url, $regular_url, $width, $height, $alt) { ?>
= get_string('artwork.comments-off') ?>
commentCount == 0) { ?>= get_string('artwork.no-comments') ?>
id, 0, COMMENTS_PREVIEW + 1); if ($error) { ?>= get_string($error) ?>
body->comments; render_comment_list(array_slice($comments, 0, COMMENTS_PREVIEW)); if (count($comments) > COMMENTS_PREVIEW) { ?>= get_string('artwork.show-more')?>
= get_string($error) ?>
body->illusts; render_artworks_grid($related, true, true); }