[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/template/smarty/plugins/ -> modifier.stars.php (source)

   1  <?php
   2  
   3  /*

   4   * Smarty plugin

   5   * -------------------------------------------------------------

   6   * Type:     modifier

   7   * Name:     stars

   8   * Purpose:  convert chars to stars, excluding N suffix chars

   9   * Date:     April 15th, 2004

  10   * Version:  1.0

  11   * Author:   Monte Ohrt <monte at ohrt dot com>

  12   * -------------------------------------------------------------

  13   */
  14  function smarty_modifier_stars($string, $suffix = 0, $char = '*')
  15  {
  16      $_prefix_len = strlen($string) - $suffix;
  17      if($_prefix_len > 0) {
  18          return str_repeat($char, $_prefix_len) . substr($string, -$suffix, $suffix);
  19      } else {
  20          return $string;
  21      }
  22  }
  23  
  24  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics