implement time travelling posts
This commit is contained in:
@@ -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'])
|
||||
|
||||
@@ -38,6 +38,16 @@ function poller_run($argv, $argc){
|
||||
intval(ACCOUNT_EXPIRED)
|
||||
);
|
||||
|
||||
// publish any applicable items that were set to be published in the future
|
||||
// (time travel posts)
|
||||
|
||||
q("update item set item_restrict = ( item_restrict ^ %d )
|
||||
where ( item_restrict & %d ) and created <= UTC_TIMESTAMP() ",
|
||||
intval(ITEM_DELAYED_PUBLISH),
|
||||
intval(ITEM_DELAYED_PUBLISH)
|
||||
);
|
||||
|
||||
|
||||
$abandon_days = intval(get_config('system','account_abandon_days'));
|
||||
if($abandon_days < 1)
|
||||
$abandon_days = 0;
|
||||
|
||||
Reference in New Issue
Block a user