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; $controllo = false;
$selezionesenzafine = false;
foreach ($results as $result) { foreach ($results as $result) {
$dataconfrontoiniziounix = strtotime($result->data_partenza); $dataconfrontoiniziounix = strtotime($result->data_partenza);
$dataconfrontofineunix = strtotime($result->data_fine); $dataconfrontofineunix = strtotime($result->data_fine);
$hafine = $result->hafine;
if ($hafine){
if (!$selezionesenzafine){
if ($datacorrenteunix <= $dataconfrontofineunix){ if ($datacorrenteunix <= $dataconfrontofineunix){
if ($datacorrenteunix >= $dataconfrontoiniziounix){ if ($datacorrenteunix >= $dataconfrontoiniziounix){
$controllo = true; $controllo = true;
@ -28,14 +37,23 @@ if ($datacorrenteunix <= $dataconfrontofineunix){
$urlfileprescelto = $result->url_completo; $urlfileprescelto = $result->url_completo;
} }
} }
}
} else {
$controllo = true;
$selezionesenzafine = true;
$nomefileprescelto = $result->nome_file;
$urlfileprescelto = $result->url_completo;
}
} }
if ($controllo){ 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; $finalurl = $urlcomp.$urlfileprescelto;
@ -228,7 +246,10 @@ function generajsmodal() {
function generahtmlmodal($filepdf){ 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 ' return '
<div style="text-align:center;z-index:5000;"> <div style="text-align:center;z-index:5000;">
@ -371,7 +392,10 @@ return '
function generahtmlmodalridotto($filepdf,$etichetta){ 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 ' return '
<div style="z-index:5000;"> <div style="z-index:5000;">
@ -509,4 +533,4 @@ function generahtmlmodalridotto($filepdf,$etichetta){
</div> </div>
'; ';
} }