*

kriskoyk

  • ****
  • 111 posts
Re: Repeat auto-republish.
« Reply #15 on: June 12, 2021, 09:01:32 PM »
Do we have control results?

*

MB Themes

Re: Repeat auto-republish.
« Reply #16 on: June 14, 2021, 08:45:43 AM »
@kriskoyk
Checked code.
This is from model to do updates in DB.
Code: [Select]
  public function republish_times( $item_id ) {
    return $this->dao->query('UPDATE '.$this->getTable_ItemBO().' SET republish_times=coalesce(republish_times, 0)+1 WHERE item_id='.$item_id);
  }

  public function republish_auto( $item_id ) {
    return $this->dao->query('UPDATE '.$this->getTable_ItemBO().' SET republish_auto=coalesce(republish_auto, 0)-1 WHERE item_id='.$item_id);
  }

It looks OK.

You can test republish by adding this code i.e. to theme functions.php and refreshing page.
Code: [Select]
ModelBO::newInstance()->republish_item( 284, '2021-01-01', null, false, true);
-> 284 is item id, then you have publish date, then expire date...
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots