We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37550 ☆ A M B ☆
    • 711 Posts
    Hi,

    A client of mine has asked if I can put something together which would tell them how many pages have been created in a given period, so that they can use this information for higher management.

    I’m kind of thinking using ditto and looking at the createdon field, and think that somehow I need to be able to give the customer two date picker boxes to select the period from and to.

    Does anyone have any suggestions / tips before I get cracking.

    Also im puzzled why the createdon is stored as an INT I’ve tried to convert this in SQL to a date format but get odd results,


    SELECT DATE_FORMAT( createdon, ’%M %D, %Y’ ) AS mydate
    FROM modx_site_content

    Thanks Aaron.
      http://www.onesmarthost.co.uk
      UK MODX Hosting with love.
      • 22303 MODX Staff
      • 10,725 Posts
      The unix timestamp format for date persistence in MODx is simply leftover from the original Etomite project from which MODx was derived.

      For SQL, you can do this:
      SELECT FROM_UNIXTIME(createdon, '%m %d, %Y') AS mydate FROM modx_site_content
        • 37550 ☆ A M B ☆
        • 711 Posts
        Cool thanks for that, I guess I could now either write a custom snippet which does an SQL Query and outputs a number total.

        Thanks,
          http://www.onesmarthost.co.uk
          UK MODX Hosting with love.