1 12-09-2021 11:16 -

Bonjour tous,
j'ai besoin de votre aide pour afficher la date de dernière mise à jour sur index.php, template 7.
(voir Image)
Merci
JLouis

https://agora.chauvigne.info/uploads/images/2021/09/12/page_index.jpg

2 15-09-2021 09:16 -

Comme ça?
Michel

https://agora.chauvigne.info/uploads/images/2021/09/15/jpval_date.jpg

3 15-09-2021 10:08 -

Bonjour Michel,
Oui, comme ça

4 15-09-2021 16:55 -

Dans ton fichier templates/template7/index.php,
introduis ces deux lignes :

                        if($lastadd == "")
                            $lastadd = displayDate($dbrow['changedate'],"") . "<br />\n";

après la ligne 195 =>     while( $dbrow = tng_fetch_assoc( $resulttng ) ) {

et avant la ligne 197 =>     $lastadd .= "<a href=\"getperson.php?personID={$dbrow['personID']}&amp;  etc...


pour avoir ce résultat :
while( $dbrow = tng_fetch_assoc( $resulttng ) ) {
    if($lastadd == "")
        $lastadd = displayDate($dbrow['changedate'],"") . "<br />\n";

        $lastadd .= "<a href=\"getperson.php?personID={$dbrow['personID']}&amp;tree={$dbrow['gedcom']}\">";


les numéros de ligne sont donnés à titre indicatif. Mon fichier n'est pas modifié.
Grosso modo, c'est presqu'à la fin du fichier
Michel

5 15-09-2021 19:31 -

Parfait..
le magicien du php a encore frappé.
Merci Michel
Jean-Louis
https://agora.chauvigne.info/uploads/images/2021/09/15/2021-09-15_19_26_54-racine..jpg

6 16-09-2021 20:30 -

... et ce code pour un affichage au format européen (les fonctions de TNG ne fonctionnent pas dans ce cas..)

                        if($lastadd == ""){
                            // passe en format europeen
                            $old_date_timestamp = strtotime($dbrow['changedate']);
                            $new_date = date('d-m-Y H:i:s', $old_date_timestamp);
                            // Affiche la date
                            $lastadd = displayDate($new_date) . "<br />\n<br />\n";
                        }

Michel

https://agora.chauvigne.info/uploads/images/2021/09/16/jpval_date2.jpg

7 16-09-2021 22:11 -

plus que parfait...
https://agora.chauvigne.info/uploads/images/2021/09/16/index.jpg
JLouis

8 16-09-2021 23:47 -

Si tu veux supprimer les secondes, il suffit d'effacer le ":s" après le "H:i"

9 17-09-2021 00:01 -

c'est fait. Parfait Michel