Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions www/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ function sendImageLdesc($title, $imageID)
</head>
<body>
<div class=main>
<img src="showimage?id=<?php echo urlencode($imageID) ?>">
<img src="showimage?id=<?php echo urlencode($imageID) ?>" alt="Cover art for <?php echo htmlspecialcharx($title) ?>.">
<?php
if ($copymsg || ($copystat && isset($copyrightStatList[$copystat]))
|| $username || $created) {
Expand Down Expand Up @@ -2834,7 +2834,7 @@ function check_admin_privileges($db, $userid) {

}

function coverArtThumbnail($id, $size, $version, $params = "") {
function coverArtThumbnail($id, $size, $version, $params = "", $alt_text = "") {
$thumbnail = "/coverart?id=$id&thumbnail=";
$x15 = round($size * 3 / 2);
$x2 = $size * 2;
Expand All @@ -2844,7 +2844,7 @@ function coverArtThumbnail($id, $size, $version, $params = "") {
}
global $nonce;
return "<style nonce='$nonce'>.coverart__img { max-width: 35vw; height: auto; }</style>"
."<img class='coverart__img' loading='lazy' srcset=\"$thumbnail{$size}x$size$params, $thumbnail{$x15}x$x15$params 1.5x, $thumbnail{$x2}x$x2$params 2x, $thumbnail{$x3}x$x3$params 3x\" src=\"$thumbnail{$size}x$size$params\" height=$size width=$size border=0 alt=\"\">";
."<img class='coverart__img' loading='lazy' srcset=\"$thumbnail{$size}x$size$params, $thumbnail{$x15}x$x15$params 1.5x, $thumbnail{$x2}x$x2$params 2x, $thumbnail{$x3}x$x3$params 3x\" src=\"$thumbnail{$size}x$size$params\" height=$size width=$size border=0 alt=\"$alt_text\">";
}

// ----------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion www/viewgame
Original file line number Diff line number Diff line change
Expand Up @@ -929,13 +929,14 @@ echo helpWinLink("help-ifid", "IFID");
<?php
if ($hasart) {
$arthref = "{$_SERVER['PHP_SELF']}?coverart&id=$id";
$cover_alt_text = "Cover art for $title. Click for full-sized image and copyright information.";
if (isset($_REQUEST['version']))
$arthref .= "&version=" . $_REQUEST['version'];
?>
<div class=coverart>

<a href="<?php echo $arthref ?>&ldesc">
<?php echo coverArtThumbnail($id, 175, isset($_REQUEST['version']) ? $_REQUEST['version'] : $pagevsn); ?>
<?php echo coverArtThumbnail($id, 175, isset($_REQUEST['version']) ? $_REQUEST['version'] : $pagevsn, "", $cover_alt_text); ?>
</a>
</div>
<?php
Expand Down