<?php
if($curPage != "last") {
$nextPage = $curPage + 1;
$output = ’<a href="’.$url.’’.$nextPage.’"><img class="border" src="’.$img.’’.$curPage.’.jpg" alt="Tales of Vesperia Manga (Page ’.$curPage.’)" title="Click to go to the next page." /></a>’;
}
else {
$output = ’<img class="border" src="’.$img.’’.$curPage.’.jpg" alt="Tales of Vesperia Manga (Page ’.$curPage.’)" />’;
}
return $output;
?>
(Ignore the site-specific stuff for the moment.

)
http://www.talesunion.com/x360/vesperia/manga/main/1
I basically needed a way to get a manga viewer script working (thanks to DirectResize for the resizing of the manga scans), and that meant the "click to go to next page" functionality. PHP makes it so much easier than C++, since &curPage could be a int or a string. ^.^
Anyways, think a trimmed down version that removes the site-specific stuff might be useful in the Repo?
EDIT: The Repo version would also include a flag to set the filetype (instead of forcing the user to use JPG).