query( "select max(id) from fanart"); $content = $resultID->fetch_row(); $resultID->close(); $maxImage = $content[0]; $imagePrev = ($imageNum > 1) ? $imageNum - 1 : $maxImage; $imageNext = ($imageNum < $maxImage) ? $imageNum + 1 : 1; showImage( $imageNum, $imagePrev, $imageNext); dbDisconnect(); function showImage( $imageNum, $imagePrev, $imageNext) { global $linkID; $resultID = $linkID->query("select submit, filename, content, link from fanart where id=$imageNum"); $content = $resultID->fetch_row(); $resultID->close(); /* echo "

$content[0]

$content[2]
"; */ echo "

Submitted by: $content[0]

"; if (NULL != $content[3]) { echo ""; } showThumbnail( "thumbPrev", "Previous", $imagePrev); showThumbnail( "thumbNext", "Next", $imageNext); bubble( NULL, ""); echo "
$content[2]
"; echo "
"; } function showThumbnail( $class, $label, $thumbID) { global $linkID; $resultID = $linkID->query( "select id, submit, thumbnail from fanart where id=$thumbID"); $content = $resultID->fetch_row(); $resultID->close(); echo "

$label

Submitted by: $content[1]

"; } ?>