From 0b925899d421168b149f2703ac2673337f18cd07 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 3 Mar 2013 11:47:01 +0100 Subject: [PATCH 1/2] put edited meta info in item object to give theme developers the chance to display this in a fancy way --- object/Item.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/object/Item.php b/object/Item.php index 139a81f71..781d21f9c 100644 --- a/object/Item.php +++ b/object/Item.php @@ -86,7 +86,14 @@ class Item extends BaseObject { $a = $this->get_app(); $item = $this->get_data(); - + $edited = false; + if (strcmp($item['created'], $item['edited'])<>0) { + $edited = array( + 'label' => t('This entry was edited'), + 'date' => datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r'),, + 'relative' => relative_date($item['edited']) + ); + } $commentww = ''; $sparkle = ''; $buttons = ''; @@ -325,13 +332,14 @@ class Item extends BaseObject { 'drop' => $drop, 'vote' => $buttons, 'like' => $like, - 'dislike' => $dislike, + 'dislike' => $dislike, 'switchcomment' => t('Comment'), 'comment' => $this->get_comment_box($indent), 'previewing' => ($conv->is_preview() ? ' preview ' : ''), 'wait' => t('Please wait'), 'thread_level' => $thread_level, - 'postopts' => $langstr + 'postopts' => $langstr, + 'edited' => $edited ); $arr = array('item' => $item, 'output' => $tmp_item); From 4e68a6b3e0ae115fd29a5bcac2a98af0e719094f Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 3 Mar 2013 12:02:45 +0100 Subject: [PATCH 2/2] typo --- object/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/object/Item.php b/object/Item.php index 781d21f9c..06b3683c6 100644 --- a/object/Item.php +++ b/object/Item.php @@ -90,7 +90,7 @@ class Item extends BaseObject { if (strcmp($item['created'], $item['edited'])<>0) { $edited = array( 'label' => t('This entry was edited'), - 'date' => datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r'),, + 'date' => datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r'), 'relative' => relative_date($item['edited']) ); }