Keyword

auto unpublished the item after time period (SOLVED)

  • Majdy
  • Majdy's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 6 months ago - 8 years 6 months ago #151762 by Majdy
Hi
how can make the item to be automatic unpublished after x days !?
Last edit: 8 years 6 months ago by Majdy.
The topic has been locked.
  • Majdy
  • Majdy's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 6 months ago - 8 years 6 months ago #151763 by Majdy
Ok I find the solution
unfortunately this method can't be override's solution:

In -> administrator/components/com_k2/views/item/view.html.php (k2 ver 2.6.9)
in row 115 search for

item->publish_down = $db->getNullDate();

and replace with

item->publish_down = JFactory::getDate()->add(new DateInterval('P1Y11M15DT0H0M0S'));

when the argument "P1Y11M15DT0H0M0S" represents the time period after publish, the item well be unpublished after 1 year and 11 months and 15 days in this example
Last edit: 8 years 6 months ago by Majdy.
The topic has been locked.

Powered by Kunena Forum