Improve issue name display when name is very long and has a hypen

This commit is contained in:
Junior 2026-09-04 11:51:21 -04:00
parent 3c5188c13f
commit af6d0d8338
2 changed files with 18 additions and 2 deletions

View File

@ -77,10 +77,20 @@ foreach ( $entries as $entry ) {
$folders[] = $info;
} else {
if ( (substr($entry, -3) == "cbz") || (substr($entry, -3) == "cbr") ) {
$info["comname"] = substr(((strpos($entry, " - ") !== false) ? str_replace(" - ", "<br />", $entry) : $entry), 0, -4);
$withoutext = substr($entry, 0, -4);
if ( strlen($withoutext) <= ISSUELENGTHCUTOFF ) {
$info["comname"] = str_replace(" - ", "<br />", $withoutext);
} else {
if ( strpos($withoutext, " - ") !== false ) {
$info["comname"] = substr($withoutext, strpos($withoutext, " - ") + 3);
} else {
$info["comname"] = $withoutext;
}
}
//$info["comname"] = substr(((strpos($entry, " - ") !== false) ? str_replace(" - ", "<br />", $entry) : $entry), 0, -4);
$info["relcomic"] = base64_encode($compath . (($compath == "/") ? "" : "/") . $entry);
$info["mtime"] = filemtime($fullcompath . $entry);
$info["thumburl"] = THUMBSDIR . $compath . (($compath == "/") ? "" : "/") . substr($entry, 0, -4) . ".jpg";
$info["thumburl"] = THUMBSDIR . $compath . (($compath == "/") ? "" : "/") . $withoutext . ".jpg";
if ( in_array($entry, $issues_read) ) {
$info["read"] = true;
$readclass = " readborder";

View File

@ -29,6 +29,12 @@ define('EXTRACTSDIR', 'comics');
//
define('ADULTMODE', false);
//
// The character count in the comic title where, when exceeded
// the folder/comic/series name will be removed for readability.
//
define('ISSUELENGTHCUTOFF', 25);
//
// Database information for tracking last read page
//