Dotclear

Changeset 3145


Ignore:
Timestamp:
07/31/13 16:38:24 (10 years ago)
Author:
brol
Message:

version 1.3 : corrections diverses

Location:
plugins/bloganniv
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • plugins/bloganniv/CHANGELOG.txt

    r2794 r3145  
    66- Localisation 
    77- 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  
    22=============================================================================== 
    33 
    4 Cette version de plugin sert a afficher le nombre de jours restant avant l'anniversaire de votre blog 
     4Cette version de plugin sert à afficher le nombre de jours restant avant l'anniversaire de votre blog 
    55 
    6 Il affiche le nombre de jours restant avant l'anniversaire et le nombre d'année de votre blog. 
     6Il affiche le nombre de jours restant avant l'anniversaire et le nombre d'année(s) de votre blog. 
    77 
    88Installation 
  • plugins/bloganniv/_define.php

    r2794 r3145  
    2424     /* Name */                    "Blog Anniv", 
    2525     /* 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', 
    2828     /* Permissions */        'blogAnniv' 
    2929); 
  • plugins/bloganniv/_public.php

    r2794 r3145  
    5151           
    5252          // 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')) { 
    5456               return; 
    5557          } 
     
    5759          $title = $w->title ? html::escapeHTML($w->title) : __('Subscribe'); 
    5860          $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'; 
    6067           
    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          } 
    6291          $nbrejours=0; 
    6392          $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)){ 
    6695               // Ok nous pouvons calculer la date anniversaire et le nombre de jours restant avant 
    6796                
  • plugins/bloganniv/_widgets.php

    r2794 r3145  
    2323if (!defined('DC_RC_PATH')) { return; } 
    2424 
    25 $core->addBehavior('initWidgets',array('blogAnnivBehaviors','initWidgets')); 
     25$core->addBehavior('initWidgets',array('blogAnnivWidgets','initWidgets')); 
    2626 
    27 class blogAnnivBehaviors 
     27class blogAnnivWidgets 
    2828{ 
    2929     public static function initWidgets($w) 
     
    3232          $w->create('blogAnniv',__('Blog Anniv'),array('tplBlogAnniv','BlogAnnivWidget')); 
    3333          $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:'),''); 
    3535          $w->blogAnniv->setting('dispyearborn',__('Display Born Date'),1,'check'); 
    3636          $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          ); 
    3844     } 
    3945} 
  • plugins/bloganniv/locales/fr/admin.po

    r2794 r3145  
    77msgstr "Content-Type: text/plain; charset=UTF-8\n" 
    88 
    9 msgid "Born Date (dd/mm/yyyy):" 
    10 msgstr "Date de naissance (jj/mm/aaaa) :" 
     9msgid "Born Date (dd/mm/yyyy) or blank:" 
     10msgstr "Date de naissance (jj/mm/aaaa) ou vide :" 
    1111 
    1212msgid "Display Born Date" 
     
    3030msgid "day(s)" 
    3131msgstr "jour(s)" 
     32 
     33msgid "" 
     34msgstr "Content-Type: text/plain; charset=UTF-8\n" 
Note: See TracChangeset for help on using the changeset viewer.

Sites map