summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2012-02-01 02:00:39 +0100
committerMichael Tänzer <neo@nhng.de>2012-02-01 02:00:39 +0100
commit7dcfa351436fa8dc6717416a8a37473a04ad7b54 (patch)
tree26a8fc52fc6c7679be1eec6d543e3c75f38f24d7
parentad894c47df71fd69a8f13185ee050ba45ed4fd6e (diff)
downloadcacert-devel-7dcfa351436fa8dc6717416a8a37473a04ad7b54.tar.gz
cacert-devel-7dcfa351436fa8dc6717416a8a37473a04ad7b54.tar.xz
cacert-devel-7dcfa351436fa8dc6717416a8a37473a04ad7b54.zip
Revert "bug 859: use DateTime class to calculate within which period the
account" DateTime::diff() is not available prior to PHP 5.3 This reverts commit ad894c47df71fd69a8f13185ee050ba45ed4fd6e.
-rw-r--r--pages/account/43.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/pages/account/43.php b/pages/account/43.php
index 381e9f8..118bdf6 100644
--- a/pages/account/43.php
+++ b/pages/account/43.php
@@ -357,10 +357,9 @@ if ($showactivity) {
$dres = mysql_query($query);
$drow = mysql_fetch_assoc($dres);
$created = $drow['created'];
+ $modified = $drow['modified'];
- $modified = new DateTime($drow['modified']);
- $now = new DateTime();
- $interval = $modified->diff($now, $absolute = true);
+ $today = date("Y-m-d");
?>
<tr>
<td class="DataTD"><?=_("Account created")?>:</td>
@@ -370,16 +369,18 @@ if ($showactivity) {
<tr>
<td class="DataTD"><?=_("Last activity")?>:</td>
<td class="DataTD"><?
- if ($interval->y >= 2) {
+ if (substr($modified,0,7) == substr($today,0,7)) {
+ echo _("this month");
+ } elseif (substr($modified,0,4) == substr($today,0,4)) {
+ echo _("this year");
+ } elseif (substr($modified,0,7) <
+ (intval(substr($today,0,4))-2)."-".substr($today,5,2) ) {
echo _("before 2 years");
- } elseif ($interval->y >= 1) {
+ } elseif (substr($modified,0,7) <
+ (intval(substr($today,0,4))-1)."-".substr($today,5,2)) {
echo _("before 1 year");
- } elseif ($interval->m >= 6) {
- echo _("within last 12 months");
- } elseif ($interval->m >= 1) {
- echo _("within last 6 months");
} else {
- echo _("within the last month");
+ echo _("within last 12 months");
} ?></td>
</tr> <?php
} ?>