We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30215
    • 79 Posts
    I am a little bit confused about how the publishing time work in modx. I found two columns in database: pub_date and publishedon. I am not sure if I understand the difference correctly. The pub_date is time, when the article is supposed to be published, useful when I want to publish document in the future. Publishedon is the time when I check the ’Publish’ checkbox in editor and hit save. The problem is that if the article is published automatically at specific time given by pub_date, the field publishedon doesn’t update. Also the correct time of publishing is either in pub_date column or in publishedon column.

    Well, now tell me, how am I supposed to sort them? smiley It is impossible with ORDER BY.
      -- sorry for my english, bad teacher smiley
      • 30215
      • 79 Posts
      Ok, sorry! The publishedon field IS updated. However the time of publishedon and pub_date isn’t the same. That confused me. However it is still weird. Imagine small web with very few visitors. I create document and set the time of publishing to Monday. However first visitor comes at Friday and the publishedon field is set to Friday so it seems that the document is newer than it in fact is.
        -- sorry for my english, bad teacher smiley
        • 3749
        • 24,544 Posts
        You’re right, that might not be what you want. You can visit the page yourself on the pub date, but shouldn’t have to.

        MODx should probably set the publishedon date to the pub_date if there is one set and it is prior to today’s date (unless it does already -- I haven’t checked). If it doesn’t, feel free to file that request through the Jira Bugs and Requests link at the top of this page.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 30215
          • 79 Posts
          Or it might be possible to sync these two values with some plugin. There is an onDocPublished event but I am not sure whether it is triggered also when the document is published automatically. Maybe I’ll try it later.
            -- sorry for my english, bad teacher smiley
            • 3749
            • 24,544 Posts
            Quote from: tobice at Jun 04, 2010, 04:38 PM

            Or it might be possible to sync these two values with some plugin. There is an onDocPublished event but I am not sure whether it is triggered also when the document is published automatically. Maybe I’ll try it later.

            OnDocPublished doesn’t get triggered when docs are published automatically. It only happens when you publish a doc manually in the Manager.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 5340
              • 1,624 Posts
              You might be able to use this as inspiration to build your own plugin.

                • 30215
                • 79 Posts
                Thx. I’ll see.
                  -- sorry for my english, bad teacher smiley