JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added even/odd enc type
authorJason Woofenden <jason183@herkamire.com>
Mon, 22 Oct 2007 22:19:40 +0000 (18:19 -0400)
committerJason Woofenden <jason183@herkamire.com>
Mon, 22 Oct 2007 22:19:40 +0000 (18:19 -0400)
encode.php

index ca33c59..fd00b97 100644 (file)
@@ -253,4 +253,19 @@ function enc_provinces($str) {
        return encode_options($str, $provinces_assoc, PULLDOWN_HASH);
 }
 
+# returns "odd", then "even", then "odd" etc.
+function enc_evenodd($values, $name) {
+       if(!isset($GLOBALS['wfpl_even_odds'])) {
+               $GLOBALS['wfpl_even_odds'] = array();
+       }
+
+       if($GLOBALS['wfpl_even_odds'][$name]) {
+               $GLOBALS['wfpl_even_odds'][$name] = false;
+               return 'even';
+       } else {
+               $GLOBALS['wfpl_even_odds'][$name] = true;
+               return 'odd';
+       }
+}
+
 ?>