1.7.4
@ -69,7 +69,7 @@ require("../../include/panels.php");
|
|||||||
$pdfDir = './docs/pdf/';
|
$pdfDir = './docs/pdf/';
|
||||||
|
|
||||||
// Répertoire pour stocker les miniatures
|
// Répertoire pour stocker les miniatures
|
||||||
$thumbDir = './img/';
|
$thumbDir = './docs/img/';
|
||||||
if (!file_exists($thumbDir)) {
|
if (!file_exists($thumbDir)) {
|
||||||
mkdir($thumbDir, 0777, true);
|
mkdir($thumbDir, 0777, true);
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 203 KiB After Width: | Height: | Size: 203 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 384 KiB After Width: | Height: | Size: 384 KiB |
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 162 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 203 KiB After Width: | Height: | Size: 203 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 113 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
BIN
html/kezako/fiches/img/git.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
html/kezako/fiches/img/tunnel-ssh.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 319 KiB |
BIN
html/kezako/fiches/pdf/git.pdf
Normal file
@ -37,7 +37,7 @@ $pdo = sqlConnect($sqlDatabaseHost, $sqlDatabaseName, $sqlDatabaseUser, $sqlData
|
|||||||
margin: 10px;
|
margin: 10px;
|
||||||
box-sizing: border-box; /* Inclut le padding et la marge dans la largeur totale des éléments */
|
box-sizing: border-box; /* Inclut le padding et la marge dans la largeur totale des éléments */
|
||||||
}
|
}
|
||||||
.fiche-img {
|
.fiche img {
|
||||||
height: 20em;
|
height: 20em;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
@ -84,13 +84,54 @@ $pdo = sqlConnect($sqlDatabaseHost, $sqlDatabaseName, $sqlDatabaseUser, $sqlData
|
|||||||
Nous travaillons activement sur le développement de solutions d'apprentissage alternatives.<br>
|
Nous travaillons activement sur le développement de solutions d'apprentissage alternatives.<br>
|
||||||
</div>
|
</div>
|
||||||
<h2>Fiches</h2>
|
<h2>Fiches</h2>
|
||||||
<div class="liste-fiches">
|
<?php
|
||||||
<div class="fiche">
|
// Répertoire des fichiers PDF
|
||||||
<a href="fiches/pdf/tunnel-ssh.pdf" target="_blank">
|
$pdfDir = './fiches/pdf/';
|
||||||
<img src="fiches/img/tunnel-ssh.png" class="fiche-img"/>
|
|
||||||
</a>
|
// Répertoire pour stocker les miniatures
|
||||||
</div>
|
$thumbDir = './fiches/img/';
|
||||||
</div>
|
if (!file_exists($thumbDir)) {
|
||||||
|
mkdir($thumbDir, 0777, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Récupérer la liste des fichiers PDF
|
||||||
|
$pdfFiles = glob($pdfDir . '*.pdf');
|
||||||
|
|
||||||
|
// Fonction pour générer une image à partir de la première page d'un PDF
|
||||||
|
function generateThumbnail($pdfFile, $outputDir, $outputFile) {
|
||||||
|
$outputPath = $outputDir . '/' . pathinfo($outputFile, PATHINFO_FILENAME);
|
||||||
|
$command = "pdftoppm -jpeg -f 1 -singlefile " . escapeshellarg($pdfFile) . " " . escapeshellarg($outputPath);
|
||||||
|
exec($command);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Générer les miniatures
|
||||||
|
foreach ($pdfFiles as $pdfFile) {
|
||||||
|
$pdfFilename = basename($pdfFile);
|
||||||
|
$thumbFilename = pathinfo($pdfFilename, PATHINFO_FILENAME) . '.jpg';
|
||||||
|
$thumbFilePath = $thumbDir . $thumbFilename;
|
||||||
|
|
||||||
|
if (!file_exists($thumbFilePath)) {
|
||||||
|
generateThumbnail($pdfFile, $thumbDir, $thumbFilename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Générer le HTML pour afficher la mosaïque
|
||||||
|
echo '<div class="liste-fiches">';
|
||||||
|
foreach ($pdfFiles as $pdfFile) {
|
||||||
|
$pdfFilename = basename($pdfFile);
|
||||||
|
$thumbFilename = pathinfo($pdfFilename, PATHINFO_FILENAME) . '.jpg';
|
||||||
|
$thumbFilePath = $thumbDir . $thumbFilename;
|
||||||
|
$pdfFilePath = $pdfDir . $pdfFilename;
|
||||||
|
|
||||||
|
echo '<div class="fiche">';
|
||||||
|
echo '<h3>' . $pdfFilename . '</h3>';
|
||||||
|
echo '<a href="' . $pdfFilePath . '" target="_blank">';
|
||||||
|
echo '<img src="' . $thumbFilePath . '" alt="' . $pdfFilename . '">';
|
||||||
|
echo '</a>';
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
echo '</div>';
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
|