Changeset 3145
- Timestamp:
- 07/31/13 16:38:24 (10 years ago)
- Location:
- plugins/bloganniv
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/bloganniv/CHANGELOG.txt
r2794 r3145 6 6 - Localisation 7 7 - Intégration corrections proposées sur http://www.myouaibe.com/index.php/post/2007/08/23/Plugin-BlogAnniv-pour-DOTCLEAR-2 8 9 == Version 1.2 ================================================================ 10 - Ajout du piochage automatique de la date du blog si non saisie dans le widget 11 - Ajout @ devant la fonction checkdate pour eviter un warning 12 13 == Version 1.3 ================================================================ 14 - Ajout choix affichage page pour le widget 15 - Correction de traduction -
plugins/bloganniv/README.txt
r2794 r3145 2 2 =============================================================================== 3 3 4 Cette version de plugin sert aafficher le nombre de jours restant avant l'anniversaire de votre blog4 Cette version de plugin sert à afficher le nombre de jours restant avant l'anniversaire de votre blog 5 5 6 Il affiche le nombre de jours restant avant l'anniversaire et le nombre d'année de votre blog.6 Il affiche le nombre de jours restant avant l'anniversaire et le nombre d'année(s) de votre blog. 7 7 8 8 Installation -
plugins/bloganniv/_define.php
r2794 r3145 24 24 /* Name */ "Blog Anniv", 25 25 /* Description*/ "Décompte du nombre de jours avant et après la date anniversaire du blog", 26 /* Author */ "Fran6t, brol",27 /* Version */ '1. 1',26 /* Author */ "Fran6t, Pierre Van Glabeke", 27 /* Version */ '1.3', 28 28 /* Permissions */ 'blogAnniv' 29 29 ); -
plugins/bloganniv/_public.php
r2794 r3145 51 51 52 52 // Si nous sommes pas en page accueil et que c'est coché page accueil uniquement on fait rien 53 if ($w->homeonly && $core->url->type != 'default') { 53 54 if (($w->homeonly == 1 && $core->url->type != 'default') || 55 ($w->homeonly == 2 && $core->url->type == 'default')) { 54 56 return; 55 57 } … … 57 59 $title = $w->title ? html::escapeHTML($w->title) : __('Subscribe'); 58 60 $ftdatecrea = $w->ftdatecrea; 59 // Test si la date est valide 61 //Si la date est vide nous recherchons la date en base 62 if (strlen(rtrim($ftdatecrea))==0){ 63 /////////////////////////////////////////////// 64 //ACCES BDD 65 //je récupère la date du blog 66 require_once dirname(__FILE__).'/class.dc.dateBlog.php'; 60 67 61 $date = $ftdatecrea; 68 $lc = new dateBlog($GLOBALS['core']->blog); 69 try { 70 $Posts = $lc->getdateBlog(); 71 } 72 catch (Exception $e) { 73 return false; 74 } 75 foreach($Posts->rows() as $k => $v) 76 { 77 $ftdatecrea = html::clean($v['blog_creadt']); 78 $ftdatecrea = substr($ftdatecrea,0,10); 79 $ftdatecrea = str_replace("-","/",$ftdatecrea); 80 list($annee, $mois, $jour) = explode('/', $ftdatecrea); 81 // On remet la date en forme française 82 $ftdatecrea=$jour."/".$mois."/".$annee; 83 #printf($ftdatecrea); 84 #printf(html::clean($v['blog_id'])); 85 } 86 //FIN ACCES BDD 87 /////////////////////////////////////////////// 88 } else { 89 list($jour, $mois, $annee) = explode('/', $ftdatecrea); 90 } 62 91 $nbrejours=0; 63 92 $nbreannee=0; 64 list($jour, $mois, $annee) = explode('/', $date);65 if( checkdate($mois,$jour,$annee)){93 // Test si la date est valide 94 if(@checkdate($mois,$jour,$annee)){ 66 95 // Ok nous pouvons calculer la date anniversaire et le nombre de jours restant avant 67 96 -
plugins/bloganniv/_widgets.php
r2794 r3145 23 23 if (!defined('DC_RC_PATH')) { return; } 24 24 25 $core->addBehavior('initWidgets',array('blogAnniv Behaviors','initWidgets'));25 $core->addBehavior('initWidgets',array('blogAnnivWidgets','initWidgets')); 26 26 27 class blogAnniv Behaviors27 class blogAnnivWidgets 28 28 { 29 29 public static function initWidgets($w) … … 32 32 $w->create('blogAnniv',__('Blog Anniv'),array('tplBlogAnniv','BlogAnnivWidget')); 33 33 $w->blogAnniv->setting('title',__('Title :'),''); 34 $w->blogAnniv->setting('ftdatecrea',__('Born Date (dd/mm/yyyy) :'),'jj/mm/aaaa');34 $w->blogAnniv->setting('ftdatecrea',__('Born Date (dd/mm/yyyy) or blank:'),''); 35 35 $w->blogAnniv->setting('dispyearborn',__('Display Born Date'),1,'check'); 36 36 $w->blogAnniv->setting('dispyear',__('Display Year(s) Old'),1,'check'); 37 $w->blogAnniv->setting('homeonly',__('Home page only'),1,'check'); 37 $w->blogAnniv->setting('homeonly',__('Display on:'),0,'combo', 38 array( 39 __('All pages') => 0, 40 __('Home page only') => 1, 41 __('Except on home page') => 2 42 ) 43 ); 38 44 } 39 45 } -
plugins/bloganniv/locales/fr/admin.po
r2794 r3145 7 7 msgstr "Content-Type: text/plain; charset=UTF-8\n" 8 8 9 msgid "Born Date (dd/mm/yyyy) :"10 msgstr "Date de naissance (jj/mm/aaaa) :"9 msgid "Born Date (dd/mm/yyyy) or blank:" 10 msgstr "Date de naissance (jj/mm/aaaa) ou vide :" 11 11 12 12 msgid "Display Born Date" … … 30 30 msgid "day(s)" 31 31 msgstr "jour(s)" 32 33 msgid "" 34 msgstr "Content-Type: text/plain; charset=UTF-8\n"
Note: See TracChangeset
for help on using the changeset viewer.