PlaneteDomo a écrit:Bonjour à tous,
j'ouvre ce sujet pour permettre la discussion à propos de mon script "les saints du jour".
N'hésitez pas pour les commentaires, les idées d'améliorations, les questions sur le fonctionnement ...
A bientôt
Mickael
jeremydk a écrit:Idem dans l'application de mon téléphone il est noté N/R et sur PC dans ma pièce il est bien noté mais dans le portail j'ai NaN.
Bart (eedomus team) a écrit:Bonjour,
le bug de la valeur qui n'apparaissait pas sur les apps pour Smartphone est corrigé.
(Au besoin cliquer sur "Synchroniser" dans l'app eedomus)
Bien cordialement
<?php
/*
Script développé par : Mickael VIALAT - http://www.planete-domotique.com
et tenté d'être modifié par Yvan
Merci de partager toute modification ou amélioration de ce script avec la communauté eedomus
sur le forum : http://forum.eedomus.com
*/
$Donnees = array(
$Saints = array(),
$PrenomsBretons = array(),
$Proverbe = array(),
$dicton = array(),
);
// Mois de janvier à décembre
for ($m = 1; ; $m++) {
if ($m = abs(date('m'))) {
$mois = $m ;
$jour = abs(date('d'))-1 ;
if ($m > 12) {
break ;
}
}
break ;
}
$Saints[1] = array("Jour de l'An","Basile","Geneviève","Odilon","Edouard","Mélaine","Raymond","Lucien Felix","Alix","Guillaume","Paulin","Tatiana","Yvette","Nina","Rémi","Marcel","Roseline","Prisca","Marius","Sébastien","Agnès","Vincent","Barnard","François","Manuel, Brittany","Paule","Angèle","Valère","Gildas","Martine","Marcelle");
$Saints[2] = array("Ella", "Théophane", "Blaise", "Véronique", "Agathe", "Gaston", "Eugènie", "Jacqueline", "Apolline", "Arnaud", "Notre-Dame de Lourdes", "Félix", "Béatrice d'Ornacieu, Jordane et Jourdain de Saxe", "Valentin, Constantin, Cyrille et Tino", "Claude La Colombière, Claudette, Claudie, Claudine, Claudius, Faustin, Georgette, Georgia et Georgine", "Julienne, Lucille, Paméla et Pamphile", "Alexis", "Bernadette", "Gabin", "Aimée", "Pierre, Damien", "Isabelle de Longchamp", "Lazare le peintre d'icônes Une plaiet Polycarpe", "Modeste", "Roméo", "Nestor", "Honorine", "Romain de Condat, Antoinette et Toinon");
$PrenomsBretons[2] = array("", "", "", "", "", "", "", "", "", "", "", "", "Gwengad", "Biavili", "Levenou", "Eliaz et Eliez", "Gireg", "Riwan, Riwana, Riwanenn, Riwanez et Riwanig", "Tiernvael", "Luc'her", "Gwenn, Gwenna, Gwennaig, Gwennenn, Gwennez et Gwennig", "Tevarzeg", "Tad Rigoleg", "Kenan", "Roparzh et Roperzh", "Koulfinid", "Sesilina", "Rivelen");
$Proverbe[2] = array("La vraie richesse est celle de l'esprit.", "Le pain de noce coûte cher à celui qui le mange.", "Les beaux esprits se rencontrent.", "Les poltrons fuient le danger, le danger fuit les braves.", "Ne faites pas la porte plus grande que la maison.", "Plus grande est la foule, plus aveugle est son coeur.", "Qui aime bien, châtie bien.", "Regretter le passé, c'est courir après le vent.", "Tout passe, tout casse.", "Une plaisanterie n'a jamais gagné un ennemi, mais a souvent perdu un ami.", "Tout saint nouveau a des miracles à faire.", "Buveur d'eau ne fut jamais artiste.", "Celui qui a perdu un oeil connaît la valeur de celui qui lui reste.", "Cheval de paille, cheval de bataille.", "Du dire au faire, il y a au milieu la mer.", "Il est plus facile de donner un conseil que son propre argent.");
//$Dicton[2] = array("L'habit ne fait pas le moine.", "A la Saint-Valentin, la pie monte au sapin.
//Tel temps le jour de la Saint-Valentin, tel temps au printemps qui vient.", "Si février est chaud, Croyez bien, sans défaut, Que par cette aventure, Pâques aura sa froidure.
//A la Saint-Claude regarde ton seau, tu ne le verras pas plus haut.", "Par la blanche gelée, la pluie est présagée.
//S'il neige à la Saint-Onésime, la récolte est à l'abîme.", "Février pluvieux, mars hâleux, bons pour les laboureux.", "A la Saint-Bernadette, souvent le soleil est à la fête.", "Février de tous les mois, est le pire cent fois.", "Souvent à la Saint-Aimée, la campagne est enneigée.", "A la Saint-Pierre-Damien, l'hiver reprend ou s'éteint.", "Neige à la Saint-Isabelle, fait la fleur plus belle.", "A la Saint-Pierre, l'hiver s'en va ou se resserre.", "A la Saint-Mathias, neige et glace.", "Il vaut mieux voir un loup dans le troupeau, qu'un mois de février trop beau.", "S'il tonne en février, point de vin tiré.", "A la Saint-Honorine, bourgeonne l'aubépine.", "Beau ciel à la Saint-Romain, il y aura des denrées et du bon vin.");
$Saints[3] = array("Aubin et Albin","Charles le Bon ainsi que les Carl, Carlos, Charley, Charly, Jaouen et Joévin","Guénolé","Casimir","Olive ainsi que les Olivette et Olivia","Colette Boylet ainsi que les Nicole et Nicoletta","Félicité","Journée de la Femme","Françoise","Vivien","Rosine","Justine","Rodrigue","Mathilde","Louise","Bénédicte","Patrick","Cyrille","Joseph","Herbert","Clémence","Léa","Victorien","Aldemar","Humbert","Lara","Habib","Gontran","Gladys","Amédée","Benjamin");
$PrenomsBretons[3] = array("Albin, Albina, Albinenn, Dewi, Diwi, Albinig, Bina, Binenn, Binig, Devi, Divi", "Jaoua et Nonn ainsi que Nonna et Nonnita", "Gwenolé ainsi que Gwennolé et Gwenola", "Jeran", "Piran", "Senan", "", "", "", "", "", "", "Gwengad", "Biavili", "Levenou", "Eliaz et Eliez", "Gireg", "Riwan, Riwana, Riwanenn, Riwanez et Riwanig", "Tiernvael", "Luc'her", "Gwenn, Gwenna, Gwennaig, Gwennenn, Gwennez et Gwennig", "Tevarzeg", "Tad Rigoleg", "Kenan", "Roparzh et Roperzh", "Koulfinid", "Sesilina", "Rivelen");
$Proverbe[3] = array("Jamais un envieux ne pardonne au mérite.", "L'habit ne fait pas le moine.", "La chance va plus loin que les grands bras.", "La rêverie est le dimanche de la pensée.", "Le meilleur moyen de se défaire d'un ennemi est d'en faire un ami.", "Les absents ont toujours tort.", ".", ".", ".", ".", ".", ".", ".", ".", ".", ".");
//$Dicton[3] = array("Quand il pleut à la Saint-Aubin, n'as ni paille, ni foin, ni grain.", "Si mars commence en courroux, il finira tout doux, tout doux.", "S'il gèle à la Saint-Guénolé, au taureau ferme le pré.", "Bonhomme ne regarde jamais ton blé en mars, ta fille en mai.", "Quand en mars il pleut dru et que tout le monde crie : Tout est perdu !, il n'a pas encore assez plu.", "Au jour de Sainte-Colette, commence à chanter l'alouette.", ".", ".", ".", ".", ".", ".", ".", ".", ".", ".");
$Saints[4] = array("Hugues","Sandrine","Richard","Isidore","Irène","Marcelin","Clotaire","Julie","Gautier","Fulbert","Stanislas","Jules","Ida","Maxime","Paterne","Benoît-Joseph","Anicet","Parfait","Emma","Odette","Anselme","Alexandre","Georges","Fidèle","Marc","Alida","Zita","Valérie","Ava, Catherine","Robert");
$Saints[5] = array("Fête du Travail","Boris","Philippe","Sylvain","Judith","Prudence","Gisèle","Désiré","Pacôme","Solange","Estelle","Achille","Rolande","Matthias","Denise","Honoré","Pascal","Eric","Yves","Bernardin","Constantin","Emile","Didier","Donatien","Sophie","Bérenger","Augustin","Germain","Aymar","Ferdinand","Visitation");
$Saints[6] = array("Justin","Blandine","Kévin","Clotilde","Igor","Norbert","Gilbert","Médard","Diane","Landry","Barnabé","Guy","St Antoine de Padoue","Elisée","Germaine","St Jean-François Régis","Hervé","Léonce","Romuald","Silvère","Rodolphe","Aaron","Audrey","Jean-Baptiste","Eléonore","Anthelme","Fernand","Irénée","Pierre, Paul","Martial");
$Saints[7] = array("Thierry","Martinien","Thomas","Florent, Eliane","Antoine","Mariette, Nolwenn","Raoul","Thibaut","Amandine","Ulrich","Benoît","Olivier","Henri Enzo","Camille - Fête Nationale","Donald Wladimir","Carmen Elvire","Carole Charlotte, Caroline","Frédéric","Arsène","Marine","Victor","Madeleine, Margaux","Brigitte","Christine Ségolène","Jacques, James","Anne, Nancy","Nathalie","Samson","Marthe","Juliette","Germain");
$Saints[8] = array("Alphonse","Alexandrine","Lydie","Jean-Marie","Abel","Octavien","Gaetan","Dominique","Amour","Laurent, Laura","Clara","Clarisse","Hippolyte, Philomène","Evrard, Maximilien","Alfred, Myriam, Marion, Marie","Armel","Hyacinthe","Hélène, Laetitia","Eudes","Bernard","Christophe, Noémie","Fabrice","Rose","Barthélémy, Nathanaël","Louis, Clovis, Ludovic","Natacha","Monique","Linda","Sabine, Sabrina","Sacha","Aristide");
$Saints[9] = array("Gilles","Ingrid","Grégory","Rosalie Moïse","Raïssa","Bertrand","Régine","Adrien","Alain","Inès","Adelphe","Apollinaire","Aimé","Materne","Lola, Roland","Edith","Renaud","Nadège Nadia","Emilie","Davy","Matthieu","Maurice","Constant","Thècle","Hermann","Damien","Vincent","Venceslas","Michel","Jéröme");
$Saints[10] = array("Thérèse","Léger","Gérard, Blanche","Fanny, Oriane","Fleur","Bruno","Serge","Pélagie","Denis, Sybille","Ghislain, Virgile","Firmin","Wilfried","Géraud","Juste, Céleste","Aurélie","Edwige","Baudouin","Luc","René","Adeline","Céline","Elodie","St Jean de Capistran","Florentin","Enguerran, Doria","Dimitri","Emeline","Simon, Jude","Narcisse","Bienvenue","Quentin");
$Saints[11] = array("Toussaint","Jour des Défunts","Hubert","Aymeric Karl Charles","Sylvie","Léonard","Carine","Geoffroy","Théodore","Léon","Martin","Christian","Brice","Sidonie","Arthur, Albert","Marguerite","Elisabeth, Elsa","Aude","Tanguy","Edmond, Edmée","Présentation de Marie","Cécile","Clément","Flora","Catherine","Delphine","Astrid Séverine","St Jacques de la Marche","Saturnin","André");
$Saints[12] = array("Florence","Viviane","François-Xavier","Barbara","Gérald","Nicolas","Ambroise","Frida Elfried","Fourier","Romaric","Daniel","Chantal","Lucie","Odile","Ninon","Alice","Gaël","Gatien","Urbain","Théophile","St Pierre C.","Xavière","Armand","Adèle","Joyeux Noël!","Etienne","Jean","Gaspard - Saints Innocents","David","Roger","Saint Sylvestre");
if ($mois<=count($Saints) && $jour<count($Saints[$mois]))
echo "<saint>"."Aujourd'hui nous fêtons les ", $Saints[$mois][$jour]."</saint>";
//echo "<bretons>"."Fêtes et prénoms bretons : ", $PrenomsBretons[$mois][$jour]."</bretons>";
//echo "<saint>"."Proverbe ", $Saints[$mois][$jour]."</saint>";
//echo "<saint>"."Dicton ", $Saints[$mois][$jour]."</saint>";
else
echo "<saint></saint>";
echo"<bretons></bretons>";
?>
<?php
/*
Script développé par :
Mickael VIALAT - http://www.planete-domotique.com
Merci de partager toute modification ou amélioration de ce script avec la communauté eedomus
sur le forum : http://forum.eedomus.com
*/
sdk_header('text/xml'); //modif à tester
$xml = '<?xml version="1.0" encoding="UTF-8"?>'; //modif à tester
$arr_saint = array();
// Mois de Janvier à Février avec un saint par jour
$arr_saint[1] = array("Jour de l'An","Basile","Geneviève","Odilon","Edouard","Mélaine","Raymond","Lucien Felix","Alix","Guillaume","Paulin","Tatiana","Yvette","Nina","Rémi","Marcel","Roseline","Prisca","Marius","Sébastien","Agnès","Vincent","Barnard","François","Manuel, Brittany","Paule","Angèle","Valère","Gildas","Martine","Marcelle");
$arr_saint[2] = array("Ella","Théophane","Blaise","Véronique","Agathe","Gaston","Eugènie","Jacqueline","Apolline","Arnaud","Notre-Dame de Lourdes","Félix","Béatrice","Valentin","Claude","Julienne","Alexis","Bernadette","Gabin","Aimée","Pierre, Damien","Isabelle","Lazare","Modeste","Roméo","Nestor","Honorine","Romain");
$arr_saint[3] = array("Jonathan","Charles","Guénolé","Casimir","Olivia","Colette","Félicité","Journée de la Femme","Françoise","Vivien","Rosine","Justine","Rodrigue","Mathilde","Louise","Bénédicte","Patrick","Cyrille","Joseph","Herbert","Clémence","Léa","Victorien","Aldemar","Humbert","Lara","Habib","Gontran","Gladys","Amédée","Benjamin");
$arr_saint[4] = array("Hugues","Sandrine","Richard","Isidore","Irène","Marcelin","Clotaire","Julie","Gautier","Fulbert","Stanislas","Jules","Ida","Maxime","Paterne","Benoît-Joseph","Anicet","Parfait","Emma","Odette","Anselme","Alexandre","Georges","Fidèle","Marc","Alida","Zita","Valérie","Ava, Catherine","Robert");
$arr_saint[5] = array("Fête du Travail","Boris","Philippe","Sylvain","Judith","Prudence","Gisèle","Désiré","Pacôme","Solange","Estelle","Achille","Rolande","Matthias","Denise","Honoré","Pascal","Eric","Yves","Bernardin","Constantin","Emile","Didier","Donatien","Sophie","Bérenger","Augustin","Germain","Aymar","Ferdinand","Visitation");
$arr_saint[6] = array("Justin","Blandine","Kévin","Clotilde","Igor","Norbert","Gilbert","Médard","Diane","Landry","Barnabé","Guy","St Antoine de Padoue","Elisée","Germaine","St Jean-François Régis","Hervé","Léonce","Romuald","Silvère","Rodolphe","Aaron","Audrey","Jean-Baptiste","Eléonore","Anthelme","Fernand","Irénée","Pierre, Paul","Martial");
$arr_saint[7] = array("Thierry","Martinien","Thomas","Florent, Eliane","Antoine","Mariette, Nolwenn","Raoul","Thibaut","Amandine","Ulrich","Benoît","Olivier","Henri Enzo","Camille - Fête Nationale","Donald Wladimir","Carmen Elvire","Carole Charlotte, Caroline","Frédéric","Arsène","Marine","Victor","Madeleine, Margaux","Brigitte","Christine Ségolène","Jacques, James","Anne, Nancy","Nathalie","Samson","Marthe","Juliette","Germain");
$arr_saint[8] = array("Alphonse","Alexandrine","Lydie","Jean-Marie","Abel","Octavien","Gaetan","Dominique","Amour","Laurent, Laura","Clara","Clarisse","Hippolyte, Philomène","Evrard, Maximilien","Alfred, Myriam, Marion, Marie","Armel","Hyacinthe","Hélène, Laetitia","Eudes","Bernard","Christophe, Noémie","Fabrice","Rose","Barthélémy, Nathanaël","Louis, Clovis, Ludovic","Natacha","Monique","Linda","Sabine, Sabrina","Sacha","Aristide");
$arr_saint[9] = array("Gilles","Ingrid","Grégory","Rosalie Moïse","Raïssa","Bertrand","Régine","Adrien","Alain","Inès","Adelphe","Apollinaire","Aimé","Materne","Lola, Roland","Edith","Renaud","Nadège Nadia","Emilie","Davy","Matthieu","Maurice","Constant","Thècle","Hermann","Damien","Vincent","Venceslas","Michel","Jéröme");
$arr_saint[10] = array("Thérèse","Léger","Gérard, Blanche","Fanny, Oriane","Fleur","Bruno","Serge","Pélagie","Denis, Sybille","Ghislain, Virgile","Firmin","Wilfried","Géraud","Juste, Céleste","Aurélie","Edwige","Baudouin","Luc","René","Adeline","Céline","Elodie","St Jean de Capistran","Florentin","Enguerran, Doria","Dimitri","Emeline","Simon, Jude","Narcisse","Bienvenue","Quentin");
$arr_saint[11] = array("Toussaint","Jour des Défunts","Hubert","Aymeric Karl Charles","Sylvie","Léonard","Carine","Geoffroy","Théodore","Léon","Martin","Christian","Brice","Sidonie","Arthur, Albert","Marguerite","Elisabeth, Elsa","Aude","Tanguy","Edmond, Edmée","Présentation de Marie","Cécile","Clément","Flora","Catherine","Delphine","Astrid Séverine","St Jacques de la Marche","Saturnin","André");
$arr_saint[12] = array("Florence","Viviane","François-Xavier","Barbara","Gérald","Nicolas","Ambroise","Frida Elfried","Fourier","Romaric","Daniel","Chantal","Lucie","Odile","Ninon","Alice","Gaël","Gatien","Urbain","Théophile","St Pierre C.","Xavière","Armand","Adèle","Joyeux Noël!","Etienne","Jean","Gaspard - Saints Innocents","David","Roger","Saint Sylvestre");
$month = abs(date('m'));
$day = abs(date('d'))-3;
if ($month<=count($arr_saint) && $day<count($arr_saint[$month]))
$xml= "<saint>".$arr_saint[$month][$day]."</saint>"; //modif à tester
else
$xml= "<saint></saint>"; //modif à tester
echo $xml; //modif à tester
$xml= "<saint>".$arr_saint[$month][$day]."</saint>";
$xml= "<saint>".utf8_encode($arr_saint[$month][$day])."</saint>";
Retour vers Scripts & Périphériques du store
Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 8 invité(s)