Dotclear


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • themes/ductile/_public.php

    r2566 r2581  
    3636          global $_ctx; 
    3737 
    38           $nb = 0; 
     38          $nb_other = $nb_first = 0; 
     39 
    3940          $s = $GLOBALS['core']->blog->settings->themes->get($GLOBALS['core']->blog->settings->system->theme.'_entries_counts'); 
    4041          if ($s !== null) { 
    4142               $s = @unserialize($s); 
    4243               if (is_array($s)) { 
    43                     if (isset($s[$GLOBALS['core']->url->type])) { 
    44                          // Nb de billets par page défini par la config du thème 
    45                          $nb = (integer) $s[$GLOBALS['core']->url->type]; 
    46                     } else { 
    47                          if (($GLOBALS['core']->url->type == 'default-page') && (isset($s['default']))) { 
    48                               // Les pages 2 et suivantes de la home ont le même nombre de billet que la première page 
    49                               $nb = (integer) $s['default']; 
    50                          } 
    51                     } 
    52                } 
    53           } 
    54  
    55           if ($nb == 0) { 
     44                    switch ($GLOBALS['core']->url->type) { 
     45                         case 'default': 
     46                         case 'default-page': 
     47                              if (isset($s['default'])) { 
     48                                   $nb_first = $nb_other = (integer) $s['default']; 
     49                              } 
     50                              if (isset($s['default-page'])) { 
     51                                   $nb_other = (integer) $s['default-page']; 
     52                              } 
     53                              break; 
     54                         default: 
     55                              if (isset($s[$GLOBALS['core']->url->type])) { 
     56                                   // Nb de billets par page défini par la config du thème 
     57                                   $nb_first = $nb_other = (integer) $s[$GLOBALS['core']->url->type]; 
     58                              } 
     59                              break; 
     60                    } 
     61               } 
     62          } 
     63 
     64          if ($nb_other == 0) { 
    5665               if (!empty($attr['nb'])) { 
    5766                    // Nb de billets par page défini par défaut dans le template 
    58                     $nb = (integer) $attr['nb']; 
    59                } 
    60           } 
    61  
    62           if ($nb > 0) 
    63                $_ctx->nb_entry_per_page = $nb; 
     67                    $nb_other = $nb_first = (integer) $attr['nb']; 
     68               } 
     69          } 
     70 
     71          if ($nb_other > 0) { 
     72               $_ctx->nb_entry_per_page = $nb_other; 
     73          } 
     74          if ($nb_first > 0) { 
     75               $_ctx->nb_entry_first_page = $nb_first; 
     76          } 
    6477     } 
    6578 
Note: See TracChangeset for help on using the changeset viewer.

Sites map