SHARE
TWEET

Mannequin

a guest Nov 18th, 2008 541 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. c.. function rvm_counter($atts)
  2. {
  3.         extract(lAtts(array(
  4.         'name'   => '',
  5.         'offset' => '0',
  6.         'reset'  => '',
  7.         'step'   => '1',
  8.         'width'  => '1'
  9.         ), $atts));
  10.  
  11.         static $counter = array();
  12.  
  13.         $name = 'rvm_counter_'.$name;
  14.  
  15.         if (!isset($counter[$name]))
  16.                 {
  17.                 $counter[$name] = ($reset !== '') ? intval($reset) : intval($step);
  18.                 }
  19.         else
  20.                 {
  21.                 $counter[$name] = ($reset !== '') ? intval($reset) : $counter[$name] + intval($step);
  22.                 }
  23.  
  24.         return sprintf('%0'.intval($width).'d', $counter[$name] + intval($offset));
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top