From c721c3a20e17783835672365ce56fe64876002c7 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 23 May 2013 17:24:15 -0700 Subject: implement time travelling posts --- include/items.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 9abc2e330..ca8cbdfc0 100755 --- a/include/items.php +++ b/include/items.php @@ -1486,6 +1486,15 @@ function item_store($arr,$force_parent = false) { $arr['item_flags'] = $arr['item_flags'] | ITEM_UNSEEN; + + // handle time travelers + // Allow a bit of fudge in case somebody just has a slightly slow/fast clock + + $d1 = new DateTime('now +10 minutes'); + $d2 = new DateTime($arr['created']); + if($d2 > $d1) + $arr['item_restrict'] = $arr['item_restrict'] | ITEM_DELAYED_PUBLISH; + $arr['llink'] = z_root() . '/display/' . $arr['mid']; if(! $arr['plink']) -- cgit v1.2.3