Update funzioni.php

url dinamico
This commit is contained in:
Daniel Intrieri 2024-01-29 10:45:34 +01:00 committed by GitHub
parent 2dac593288
commit b87257b734
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 29 additions and 5 deletions

View File

@ -14,13 +14,22 @@ $results = $wpdb->get_results($query);
$controllo = false;
$selezionesenzafine = false;
foreach ($results as $result) {
$dataconfrontoiniziounix = strtotime($result->data_partenza);
$dataconfrontofineunix = strtotime($result->data_fine);
$hafine = $result->hafine;
if ($hafine){
if (!$selezionesenzafine){
if ($datacorrenteunix <= $dataconfrontofineunix){
if ($datacorrenteunix >= $dataconfrontoiniziounix){
$controllo = true;
@ -28,14 +37,23 @@ if ($datacorrenteunix <= $dataconfrontofineunix){
$urlfileprescelto = $result->url_completo;
}
}
}
} else {
$controllo = true;
$selezionesenzafine = true;
$nomefileprescelto = $result->nome_file;
$urlfileprescelto = $result->url_completo;
}
}
if ($controllo){
$urlcomp = get_home_url().'/wp-content/plugins/ieimenupdf/menu/';
$cartelle = dirname(__FILE__);
$ultimacartella = basename($cartelle);
$urlcomp = get_home_url().'/wp-content/plugins/'.$ultimacartella.'/menu/';
$finalurl = $urlcomp.$urlfileprescelto;
@ -228,7 +246,10 @@ function generajsmodal() {
function generahtmlmodal($filepdf){
$urlcomp = get_home_url().'/wp-content/plugins/ieimenupdf/';
$cartelle = dirname(__FILE__);
$ultimacartella = basename($cartelle);
$urlcomp = get_home_url().'/wp-content/plugins/'.$ultimacartella.'/';
return '
<div style="text-align:center;z-index:5000;">
@ -371,7 +392,10 @@ return '
function generahtmlmodalridotto($filepdf,$etichetta){
$urlcomp = get_home_url().'/wp-content/plugins/ieimenupdf/';
$cartelle = dirname(__FILE__);
$ultimacartella = basename($cartelle);
$urlcomp = get_home_url().'/wp-content/plugins/'.$ultimacartella.'/';
return '
<div style="z-index:5000;">