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!