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

    I’m using MODx Evolution 1.0.2 for a website and I’ve made a small login section with PHP in order to create new documents into website by some users.
    I need to use this custom login instead of modx backend to simplify the creation of new documents by users.

    So I’m creating new documents into my website by inserting data into modx database.
    That’s an example of the code i’m using:

    mysql_query("INSERT INTO modx_site_content (type, contentType, pagetitle, alias, published, pub_date, parent, introtext, content, richtext, template, menuindex, searchable, cacheable, createdby, createdon, editedby, editedon, publishedon, publishedby)
    values ('document', 'text/html', '".$name." Profile', '".$name."-profile', '1', '".(time()-20)."', '4', '', '".$content."', '1', '9', '0', '1', '1', '1', '".time()."', '1', '".time()."', '".time()."', '1') ") 
    or die(mysql_error());  


    This query works well and I can see the new document in the modx backend with all its content.

    But the problem is in my website the new document doesn’t appear.

    I’m using Ditto to show all this kind of documents in this way:

    [!Ditto? &parents=`4` &orderBy=`name ASC` &tpl=`Profile-icon`!]


    If I open the document I’ve created from my backend in modx backend, and I save it, then I can see the document into my website.

    Am I doing anything wrong in my sql insert into modx database? Or is there something I’m not taking into account?

    I will apreciate any help!

    Thanks a lot!
      • 20413
      • 2,877 Posts
      Try clearing the cache too!
      function clearCache() {
          $path = $modx->config['base_path'] . 'manager/processors/';
          include_once $path . 'cache_sync.class.processor.php';
          $sync = new synccache();
          $sync->setCachepath("assets/cache/");
          $sync->setReport(true);
          $sync->emptyCache();
      }
      return clearCache();


      Example http://modxcms.com/forums/index.php/topic,48418.msg287154.html#msg287154
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower