Message::Success("Deleted spamfilter entry: ".$r['name']." [type: ".$r['match_type']."] [targets: ".$r['spamfilter_targets']. "] [action: ".$r['ban_action']."] [reason: ".$r['reason']."] [set by: ".$r['set_by']."]");
}
return true;
+}
+
+/** Convert the duration_string */
+function rpc_convert_duration_string($str)
+{
+ $tok = explode("w", $str);
+ $weeks = $tok[0];
+ $tok = explode("d", $tok[1]);
+ $days = $tok[0];
+ $tok = explode("h", $tok[1]);
+ $hours = $tok[0];
+ return "$weeks weeks, $days days and $hours hours";
+
}
\ No newline at end of file
return;
}
- $msg_msg = ($duration == "0" || $duration == "0w0d0h") ? "permanently" : "for $duration";
+ $msg_msg = ($duration == "0" || $duration == "0w0d0h") ? "permanently" : "for ".rpc_convert_duration_string($duration);
$reason = (isset($_POST['ban_reason'])) ? $_POST['ban_reason'] : "No reason";
if (rpc_tkl_add($user, $bantype, $duration, $reason))
{