From 1be510f9529cb082f802408b472a77d074b394c0 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Sun, 14 Apr 2013 13:46:12 +0000 Subject: Add zarb MLs html archives --- zarb-ml/mageia-sysadm/2011-January/002181.html | 136 +++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 zarb-ml/mageia-sysadm/2011-January/002181.html (limited to 'zarb-ml/mageia-sysadm/2011-January/002181.html') diff --git a/zarb-ml/mageia-sysadm/2011-January/002181.html b/zarb-ml/mageia-sysadm/2011-January/002181.html new file mode 100644 index 000000000..44fa911e1 --- /dev/null +++ b/zarb-ml/mageia-sysadm/2011-January/002181.html @@ -0,0 +1,136 @@ + + + + [Mageia-sysadm] [314] Better split of key2date + + + + + + + + + +

[Mageia-sysadm] [314] Better split of key2date

+ root at mageia.org + root at mageia.org +
+ Tue Jan 18 13:54:14 CET 2011 +

+
+ +
Revision: 314
+Author:   pterjan
+Date:     2011-01-18 13:54:14 +0100 (Tue, 18 Jan 2011)
+Log Message:
+-----------
+Better split of key2date
+
+Modified Paths:
+--------------
+    build_system/web/index.php
+
+Modified: build_system/web/index.php
+===================================================================
+--- build_system/web/index.php	2011-01-18 12:43:53 UTC (rev 313)
++++ build_system/web/index.php	2011-01-18 12:54:14 UTC (rev 314)
+@@ -149,26 +149,19 @@
+     return $date->getTimestamp();
+ }
+ 
+-function key2date($key, $diff = null) {
++function timediff($key, $end) {
+ /**
+- * Return human-readable time difference:
+- * - against $key (YmdHis expected format)
+- * - using only $diff (takes precedence over $key if provided)
++ * Return human-readable time difference
+  *
+- * @param string $key past date to diff against from now
+- * @param integer $diff time difference in seconds
++ * @param integer $start timestamp
++ * @param integer $end timestamp, defaults to now
+  *
+  * @return string
+ */
+-    global $tz;
+-
+-    if (is_null($diff) || $diff <= 0) {
+-        $t = key2timestamp($key);
+-        if (is_null($t))
+-            return null;
+-
+-        $diff = time() - $t;
++    if (is_null($end)) {
++	$end = time();
+     }
++    $diff = $end - $start;
+     if ($diff<60)
+        return $diff . " second" . plural($diff);
+     $diff = round($diff/60);
+@@ -292,7 +285,7 @@
+ 
+         $s .= sprintf($tmpl,
+             $p['type'],
+-            key2date($key) . ' ago',
++            timediff(key2timestamp($key)) . ' ago',
+             $p['user'], $p['user'],
+             $p['package'],
+             $p['version'],
+@@ -313,7 +306,7 @@
+ 
+         $s .= '</td><td>';
+         if ($p['type'] == 'uploaded')
+-            $s .= key2date(null, $p['buildtime']['diff']);
++            $s .= timediff($p['buildtime']['start'], $p['buildtime']['end']);
+         $s .= '</td>';
+         //$s .= '<td>' . sprintf($badges[$p['type']], $p['user']) . '</td>';
+         $s .= '</tr>';
+-------------- next part --------------
+An HTML attachment was scrubbed...
+URL: </pipermail/mageia-sysadm/attachments/20110118/7d427c6a/attachment.html>
+
+ + + + + + + + + + + + + +
+

+ +
+More information about the Mageia-sysadm +mailing list
+ -- cgit v1.2.1