We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1209
    • 49 Posts
    Hello.

    I had a plugin that was setting the un_pub date of a document during save according to the data in the EndDate TVs.

    global $tmplvars;
    global $unpub_date;
    
    if (isset($tmplvars['EndDate'])) {
      $date = is_array($tmplvars['EndDate']) ? $tmplvars['EndDate'][1] : $tmplvars['EndDate'];
      $unpub_date = strtotime($date) + 24*60*60;
      $min = date("i", $unpub_date);
      $sec = date("s", $unpub_date);
      $hrs = date("H", $unpub_date);
      $unpub_date -= $sec + $min * 60 + $hrs * 3600;
    }
    


    In 1.0.2 it stopped working.
    Can anyone help me to fix that? Has someone gone deeper into the new core functionality so far?
      • 27708 MODX Staff
      • 2,502 Posts
      I created AutomaticUnpublish to handle unpublish dates. The change along the way is that you actually need to use the TV id vs the TV name in the current version of Evo.
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub