]> git.p6c8.net - jirafeau_project.git/blobdiff - lib/functions.php
modularization date_int
[jirafeau_project.git] / lib / functions.php
index 2378d76a34a56710aafc07d04fee24ad6bdf63c7..d40feb22c4bc26803851b6fa408726dc04626c99 100644 (file)
@@ -1843,3 +1843,36 @@ function jirafeau_get_expiration_time_options() {
         echo '</select>';
  }
 
         echo '</select>';
  }
 
+ function jirafeau_datestr_to_int ($time_str) {
+    $time = time();
+    switch ($time_str) {
+        case 'minute':
+            $time += JIRAFEAU_MINUTE;
+            break;
+        case 'hour':
+            $time += JIRAFEAU_HOUR;
+            break;
+        case 'day':
+            $time += JIRAFEAU_DAY;
+            break;
+        case 'week':
+            $time += JIRAFEAU_WEEK;
+            break;
+        case 'fortnight':
+            $time += JIRAFEAU_FORTNIGHT;
+            break;
+        case 'month':
+            $time += JIRAFEAU_MONTH;
+            break;
+        case 'quarter':
+            $time += JIRAFEAU_QUARTER;
+            break;
+        case 'year':
+            $time += JIRAFEAU_YEAR;
+            break;
+       default:
+            $time = JIRAFEAU_INFINITY;
+            break;
+    }
+    return $time;
+}

patrick-canterino.de