This commit is contained in:
Olivier Berten 2021-01-08 02:09:50 +01:00
parent 02b55b54e4
commit b743448db3
2 changed files with 6 additions and 6 deletions

View File

@ -229,13 +229,13 @@ if(is_string($content)) {
} }
echo "</ul></li>\n"; echo "</ul></li>\n";
} }
foreach(array('pdf','eps','png') as $a) { foreach(array('pdf','svg','eps','png') as $a) {
echo '<li><a href="download.php?id='.$c['id'].'&amp;format='.$a.'">'.strtoupper($a).'</a></li>'."\n"; echo '<li><a href="download.php?id='.$c['id'].'&amp;format='.$a.'">'.strtoupper($a).'</a></li>'."\n";
} }
echo "</ul>\n"; echo "</ul>\n";
if($c['gabc_verses'] || $c['tex_verses']){ if($c['gabc_verses'] || $c['tex_verses']){
echo "<ul>\n"; echo "<ul>\n";
foreach(array('gabc','pdf','eps','png') as $a) { foreach(array('gabc','pdf','svg','eps','png') as $a) {
echo '<li><a href="download.php?id='.$c['id'].'&amp;format='.$a.'&amp;1verse=1">'.strtoupper($a).' (1st verse only)</a></li>'."\n"; echo '<li><a href="download.php?id='.$c['id'].'&amp;format='.$a.'&amp;1verse=1">'.strtoupper($a).' (1st verse only)</a></li>'."\n";
} }
echo "</ul>\n"; echo "</ul>\n";

View File

@ -137,7 +137,7 @@ function mgabc2tex($c, $firstverse = False) {
$tex .= '\greannotation{\small \textbf{'.$mode.".}}\n"; $tex .= '\greannotation{\small \textbf{'.$mode.".}}\n";
} }
if($c['commentary']) { if($c['commentary']) {
$tex .= '\commentary{{\small \emph{'.$c['commentary']."}}}\n"; $tex .= '\grecommentary{{\small \emph{'.$c['commentary']."}}}\n";
$tex .= '\nolinebreak[4]'."\n"; $tex .= '\nolinebreak[4]'."\n";
} }
# #
@ -196,7 +196,7 @@ function makeimgfiles($id, $tex, $suffix = '') {
unlink(substr($f[1],0,-4).'.pdf'); unlink(substr($f[1],0,-4).'.pdf');
} }
$uri = __DIR__.'/scores/'.$id.'.png'; $uri = __DIR__.'/scores/svg/'.$id.'.svg';
if(!is_file($uri) || (array_key_exists("force", $_GET) && $_GET["force"] == "1")) { if(!is_file($uri) || (array_key_exists("force", $_GET) && $_GET["force"] == "1")) {
$sql1 = 'SELECT * FROM '.db('chants').' WHERE id = '.$id; $sql1 = 'SELECT * FROM '.db('chants').' WHERE id = '.$id;
$req1 = $mysqli->query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.$mysqli->error); $req1 = $mysqli->query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.$mysqli->error);
@ -206,7 +206,7 @@ if(!is_file($uri) || (array_key_exists("force", $_GET) && $_GET["force"] == "1")
} }
makeimg($c); makeimg($c);
} }
header('Content-Disposition: inline; filename='.$id.'.png'); header('Content-Disposition: inline; filename='.$id.'.svg');
header("Content-type: image/png"); header("Content-type: image/svg+xml");
readfile($uri); readfile($uri);
?> ?>