MODIFICATO FILE:
photo-contest/shortcodes/contest-gallery-detail.php
(RIGA 60)
//####### CALCOLO DATA – $photo_date MODIFICATO
$photo_id = $_GET[‘photo_id’];
function ComputeDiff($date1,$date2,$format)
{
$datet1 = new DateTime($date1);
$datet2 = new DateTime($date2);
$difference = $datet1->diff($datet2);
return $difference->format($format);
}
//funzione che converte la data nel formato dd-mm-yyyy
function convertToItalianFormat($data)
{
$data = str_replace(‘/’, ‘-‘, $data);
return date(‘Y-m-d’, strtotime($data));
}
$date1 = get_post_meta( $photo_id, ‘custom-field’, true); // la data inserita
$date2 = get_the_date( $date_format, $post->ID );//data di pubblicazione
$date1 = convertToItalianFormat($date1);
$date2 = convertToItalianFormat($date2);
$format = “%R%y years %m months”;
$eta = ComputeDiff($date2,$date1,$format);
//####### CALCOLO DATA fine #########MODIFICATO AGGIUNTO
(RIGA 199)
$html .= ‘<span>’ . ‘</br> ANNI: ‘. ‘</span> ‘ . $eta ; //##### MODIFICATO OKKK
if( current_user_can(‘administrator’)) {
$html .= ‘<span>’ . ‘</br> Nascita: ‘. $giorno . “/” . $mese .”/”. $anno .”;
}//##### MODIFICATO Fine OKKK
#
(RIGA 273)
$html .= ‘<li><a href=”https://t.me/share/url?url=’.$ogurl_encode . ‘&text=’. $title . ‘” target=”_blank”><i class=”fa fa-fw fa-lg fa-telegram”></i></a></li>’; //####### MODIFICATO AGGIUNTO
MODIFICATO FILE:
\photo-contest\includes\templates\pc-modern-gallery-lightbox-vote.php
(RIGA 76)
//####### ALTRO CALCOLO DATA – $photo_date ######### ALTRO TIPO MODIFICATO AGGIUNTO
//$photo_id = $_GET[‘photo_id’];
$xpostmeta = get_post_meta( $contestitem->ID, ‘custom-field’, true); // la data inserita
$data = get_the_date( $date_format, $post->ID );//data di pubblicazione
list($anno, $mese, $giorno) = preg_split(‘/[-\.\/: ]/’, $xpostmeta);
$eta = date(‘Y’) – $anno;
if (date(‘m’) <$mese) {
$eta–;
} elseif (date(‘d’) <$giorno) {
$eta–;
}
//####### CALCOLO DATA fine #########MODIFICATO AGGIUNTO
(RIGA 93)
$html .= ‘<span>’ . ‘</br> ANNI: ‘. ‘</span> ‘ . $eta ; //##### MODIFICATO OKKK
if( current_user_can(‘administrator’)) {
$html .= ‘<span>’ . ‘</br> Nascita: ‘. $giorno . “/” . $mese .”/”. $anno .”;
}//##### MODIFICATO Fine OKKK
MODIFICATO FILE: photo-contest/shortcodes/contest-share.php
(RIGA 432)
$html .= ‘<li><a href=”https://t.me/share/url?url=’.$share_url_encode . ‘” target=”_blank”><i class=”fa fa-fw fa-lg fa-telegram”></i></a></li>’; //####### MODIFICATO AGGIUNTO
********* PER METTERE LA GALLERIA in 2 colonne *******
CANCELLATO TUTTO QUELLO CHE é @media (max-width: 500px) {
NEI FILE: /css/
public.css
modern.css
classic.css
****************************
######### IN FUNCTION: ################
//### MODIFICATO PER CONTEST
function replace_text($text){
if(is_page(430)){ //####### BABY BUMP
$text = str_replace(‘Titolo’,’Nome della Mamma’, $text);
$text = str_replace(‘(Opzionale)’,”, $text);
$text = str_replace(‘”text” id=”pc_custom_field_image”‘,'”date” id=”pc_custom_field_image”‘, $text);
$text = str_replace(‘baby-bump/?contest=contest-condition’,’baby-bump/regolamento’, $text);
}
if(is_page(88)){ //####### Piccoli Artisti
$text = str_replace(‘Titolo’,’Nome Artista’, $text);
$text = str_replace(‘(Opzionale)’,”, $text);
$text = str_replace(‘”text” id=”pc_custom_field_image”‘,'”date” id=”pc_custom_field_image”‘, $text);
$text = str_replace(‘piccoli-artisti/?contest=contest-condition’,’piccoli-artisti/regolamento’, $text);
}
return $text;
}
add_filter(‘the_content’,’replace_text’, 11);
****************************
###########
############ FUNGE OKK AVVISO CARICA FOTO
in FUNCTION:
$text = str_replace('','dopo l\'invio, attendere il completamento', $text);
E NELLA PAGINA:
###############################
###############