Ajout de la recherche OpenSearch
Possibilité de générer un code QR depuis la barre de recherche, en ajoutant le générateur comme moteur de recherche.
This commit is contained in:
parent
9ce259cfa0
commit
8a2a605f45
22 changed files with 2632 additions and 2043 deletions
37
options.inc.php
Executable file
37
options.inc.php
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
supprimerVieuxQR(60 * 60 * 24 * 7); // Indique le temps en secondes après lequel le code qr sera supprimé quand qq chargera la page
|
||||
$theme = "defaut"; // defaut ou parinux
|
||||
|
||||
if ($theme == "defaut") {
|
||||
$couleurPrincipale = "#2D2F34";
|
||||
} else if ($theme == "parinux") {
|
||||
$couleurPrincipale = "#157097";
|
||||
}
|
||||
|
||||
$cheminInstall = "http://localhost:8888/qr/";
|
||||
|
||||
|
||||
|
||||
function generateRandomString($length) {
|
||||
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
$charactersLength = strlen($characters);
|
||||
$randomString = '';
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
||||
}
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
function supprimerVieuxQR($tempsDeSuppression) {
|
||||
$listeCodesQR = new DirectoryIterator("temp");
|
||||
foreach($listeCodesQR as $listeCodesQR) {
|
||||
if ($listeCodesQR->getFilename() != "." AND $listeCodesQR->getFilename() != "..") {
|
||||
if ((time() - filemtime("temp/" . $listeCodesQR->getFilename())) > $tempsDeSuppression) { // Si le temps actuel (en heure Posix) moins la date de dernière modification de l'image est supérieur à la durée de vie demandée de l'image
|
||||
unlink("temp/" . $listeCodesQR->getFilename()); // Alors supprimer cette image
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue