summaryrefslogtreecommitdiff
path: root/mod.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-02-27 17:30:33 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-02-27 17:30:33 +1100
commitc27027d3e069d6c0746bffd808411f35bfd753b9 (patch)
tree5884fd363f964f94c1a3cf314582745060875517 /mod.php
parent37f7c96f6f19fdea8447d467e504973c2bfa3325 (diff)
Added "months" for the ban length field
Diffstat (limited to 'mod.php')
-rw-r--r--mod.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/mod.php b/mod.php
index 48c63c08..0f3aeeda 100644
--- a/mod.php
+++ b/mod.php
@@ -720,30 +720,34 @@
// 1yr2hrs30mins
// 1y2h30m
$expire = 0;
- if(preg_match('/^((\d+)\s?ye?a?r?s?)?\s?+((\d+)\s?we?e?k?s?)?\s?+((\d+)\s?da?y?s?)?((\d+)\s?ho?u?r?s?)?\s?+((\d+)\s?mi?n?u?t?e?s?)?\s?+((\d+)\s?se?c?o?n?d?s?)?$/', $_POST['length'], $m)) {
+ if(preg_match('/^((\d+)\s?ye?a?r?s?)?\s?+((\d+)\s?mon?t?h?s?)?\s?+((\d+)\s?we?e?k?s?)?\s?+((\d+)\s?da?y?s?)?((\d+)\s?ho?u?r?s?)?\s?+((\d+)\s?mi?n?u?t?e?s?)?\s?+((\d+)\s?se?c?o?n?d?s?)?$/', $_POST['length'], $m)) {
if(isset($m[2])) {
// Years
$expire += $m[2]*60*60*24*365;
}
if(isset($m[4])) {
- // Weeks
- $expire += $m[4]*60*60*24*7;
+ // Months
+ $expire += $m[4]*60*60*24*30;
}
if(isset($m[6])) {
- // Days
- $expire += $m[6]*60*60*24;
+ // Weeks
+ $expire += $m[6]*60*60*24*7;
}
if(isset($m[8])) {
- // Hours
- $expire += $m[8]*60*60;
+ // Days
+ $expire += $m[8]*60*60*24;
}
if(isset($m[10])) {
- // Minutes
- $expire += $m[10]*60;
+ // Hours
+ $expire += $m[10]*60*60;
}
if(isset($m[12])) {
+ // Minutes
+ $expire += $m[12]*60;
+ }
+ if(isset($m[14])) {
// Seconds
- $expire += $m[12];
+ $expire += $m[14];
}
}
if($expire) {