<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -406,6 +406,45 @@ function blogsfera_register_widget($id, $name, $output_callback, $options = arra
 		$wp_registered_widgets[$id] = $widget;
 }
 
+function get_time_difference($post_time, $decorate = false){
+	$timestamp = time() - strtotime($post_time);
+	
+	if($decorate == true){
+		return duration($timestamp);
+	} else {
+		return $timestamp;
+	}
+}
+
+function duration($timestamp) {
+	
+	$years=floor($timestamp / (60*60*24*365));
+	$timestamp%=60*60*24*365;
+	
+	$weeks=floor($timestamp / (60*60*24*7));
+	$timestamp%=60*60*24*7;
+	
+	$days=floor($timestamp / (60*60*24));
+	$timestamp%=60*60*24;
+    
+	$hrs=floor($timestamp / (60*60));
+	$timestamp%=60*60;
+    
+	$mins=floor($timestamp / 60);
+	$secs=$timestamp % 60;
+   
+   $str=&quot;&quot;;
+
+   if ($secs &gt;= 1) { $str =&quot;{$secs} segundos &quot;; }
+   if ($mins &gt;= 1) { $str =&quot;{$mins} minutos &quot;; }
+   if ($hrs &gt;= 1) { $str =&quot;{$hrs} horas &quot;; }
+   if ($days &gt;= 1) { $str =&quot;{$days} d&amp;iacute;as &quot;; }
+   if ($weeks &gt;= 1) { $str =&quot;{$weeks} semanas &quot;; }
+   if ($years &gt;= 1) { $str =&quot;{$years} a&amp;ntilde;os &quot;; }
+   
+   return $str;
+}
+
 $widget_ops = array('classname' =&gt; 'widget_recent_articles', 'description' =&gt; __(&quot;Show last articles from the blogsfera&quot;) );
 blogsfera_register_widget('widget_recent_articles', __('Art&amp;iacute;culos recientes'), 'blogsfera_widget_recent_articles', $widget_ops);
 </diff>
      <filename>wp-content/plugins/portal_widgets.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>084335e033a84bc9ce91d40b7834588ac18401d5</id>
    </parent>
    <parent>
      <id>7314daab78ac032fa6ea2f6c6d75dc9d9d29432d</id>
    </parent>
  </parents>
  <author>
    <name>Alexandre Girard</name>
    <email>alx.girard@gmail.com</email>
  </author>
  <url>http://github.com/alx/blogsfera/commit/06448e866ca155160e6978184fe8048404651e82</url>
  <id>06448e866ca155160e6978184fe8048404651e82</id>
  <committed-date>2008-08-12T07:24:01-07:00</committed-date>
  <authored-date>2008-08-12T07:24:01-07:00</authored-date>
  <message>Merge branch 'master' of git@github.com:alx/blogsfera</message>
  <tree>94ae1daf4101e57527e883bcc6c8107d656ed35f</tree>
  <committer>
    <name>Alexandre Girard</name>
    <email>alx.girard@gmail.com</email>
  </committer>
</commit>
