This commit has been accessed 649 times via Git panel.
commit 2e38960821040bc8cc5c9d9806d062575c1338a2
tree 47ca624f8f443ffa923e640d9200d3289aafb879
parent 36612ea51e4e7c823b0e3bcfd771df9d1fa5d521
author Engels Antonio <engels@majcms.org> 1347920110 +0800
committer Engels Antonio <engels@majcms.org> 1347920110 +0800
Add onmouseover alternative date display
diff --git a/inbox.php b/inbox.php
index 65403c5..33d2aa3 100644
--- a/inbox.php
+++ b/inbox.php
@@ -83,7 +83,7 @@ else {
echo "sender";
}
-echo "</td><td align=\"center\" width=\"300\">subject</td><td align=\"center\" width=\"64\">";
+echo "</td><td align=\"center\" width=\"300\">subject</td><td align=\"center\" width=\"100\">";
if ($folder == "Sent") {
echo "sent";
@@ -136,11 +136,27 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
if (strlen($date) > 0) {
$date = preg_replace("/\([^\)]+\)/","",$date);
$date = trim($date);
- $date = strtotime($date);
+ $date = strtotime($date);
+
+ $dalt = $date;
+
$date = time_elapsed_string($date) . " ago";
+
+ if (strpos($date,"week") or strpos($date,"month") or strpos($date,"year")) {
+ $dalt = date("M j, Y",$dalt);
+ }
+
+ if (strpos($date,"day")) {
+ $dalt = date("D, H:i",$dalt);
+ }
+
+ if (strpos($date,"second") or strpos($date,"minute") or strpos($date,"hour")) {
+ $dalt = date("H:i",$dalt);
+ }
+
}
else {
- $date = "no date";
+ $dalt = "";
}
$size = HumanReadableFilesize($size);
@@ -218,7 +234,13 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
echo "<td>$subj</td>";
- echo "<td align=\"center\"><nobr>$date</nobr></td>";
+ if ($dalt == "") {
+ echo "<td align=\"center\"><nobr>no date</nobr></td>";
+ }
+ else {
+ echo "<td align=\"center\" onmouseover=\"document.getElementById('$msgno').innerHTML='$dalt';\" onmouseout=\"document.getElementById('$msgno').innerHTML='$date';\"><nobr id=\"$msgno\">$date</nobr></td>";
+ }
+
echo "<td align=\"right\"><nobr>$size</nobr></td>";
echo "<form method=\"post\"><td align=\"center\">";
tree 47ca624f8f443ffa923e640d9200d3289aafb879
parent 36612ea51e4e7c823b0e3bcfd771df9d1fa5d521
author Engels Antonio <engels@majcms.org> 1347920110 +0800
committer Engels Antonio <engels@majcms.org> 1347920110 +0800
Add onmouseover alternative date display
diff --git a/inbox.php b/inbox.php
index 65403c5..33d2aa3 100644
--- a/inbox.php
+++ b/inbox.php
@@ -83,7 +83,7 @@ else {
echo "sender";
}
-echo "</td><td align=\"center\" width=\"300\">subject</td><td align=\"center\" width=\"64\">";
+echo "</td><td align=\"center\" width=\"300\">subject</td><td align=\"center\" width=\"100\">";
if ($folder == "Sent") {
echo "sent";
@@ -136,11 +136,27 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
if (strlen($date) > 0) {
$date = preg_replace("/\([^\)]+\)/","",$date);
$date = trim($date);
- $date = strtotime($date);
+ $date = strtotime($date);
+
+ $dalt = $date;
+
$date = time_elapsed_string($date) . " ago";
+
+ if (strpos($date,"week") or strpos($date,"month") or strpos($date,"year")) {
+ $dalt = date("M j, Y",$dalt);
+ }
+
+ if (strpos($date,"day")) {
+ $dalt = date("D, H:i",$dalt);
+ }
+
+ if (strpos($date,"second") or strpos($date,"minute") or strpos($date,"hour")) {
+ $dalt = date("H:i",$dalt);
+ }
+
}
else {
- $date = "no date";
+ $dalt = "";
}
$size = HumanReadableFilesize($size);
@@ -218,7 +234,13 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
echo "<td>$subj</td>";
- echo "<td align=\"center\"><nobr>$date</nobr></td>";
+ if ($dalt == "") {
+ echo "<td align=\"center\"><nobr>no date</nobr></td>";
+ }
+ else {
+ echo "<td align=\"center\" onmouseover=\"document.getElementById('$msgno').innerHTML='$dalt';\" onmouseout=\"document.getElementById('$msgno').innerHTML='$date';\"><nobr id=\"$msgno\">$date</nobr></td>";
+ }
+
echo "<td align=\"right\"><nobr>$size</nobr></td>";
echo "<form method=\"post\"><td align=\"center\">";