-
- 14 Posts
Hi all,
I have designed a custom form and use a snippet to store the content in a folder called New. Users login at the frontend as webuser and create these documents.
I completely fill the table row in the table used to store documents. Also the ID of the author and editor.
When I submit a document from the backend the form properties do show the last editor based on te ID of the backend user.
When I submit a document form the frontend it does not show the name of the last editor.
It looks like the functionality is not looking up the name of web users. Am I right or am I doing something wrong?
I tried setting a positive ID and a negative ID for the web autor. Both result in ().
Purple
=== Don’t forget to smile ===
Hmmm... very odd. Perhaps a code sample would be helpful in determining the solution.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
- 14 Posts
Below is a code example I basically addapted from the newlisting sniplet. I also tried it by setting the createdby and editedby to a negative id.
The folder is created, but viewing the properties in readmode, below de heading Changes I see: Created: 15/01/06 11:13:55 ()
//Create the folder
$template_folder = $fid;
$flds = array(
'pagetitle' => $row['author'],
'longtitle' => 'Content for '.$row['author'],
'description' => 'Content for '.$row['author'],
'alias' => str_replace( ' ', '', $row['author'] ),
'parent' => $id_container,
'createdon' => time(),
'createdby' => $modx->getLoginUserID(),
'editedon' => '0',
'editedby' => $modx->getLoginUserID(),
'published' => '1',
'deleted' => '0',
'hidemenu' => '1',
'menuindex' => 0,
'isfolder' => '1',
'template' => $template_folder
);
$rid = $modx->db->insert($flds,$modx->getFullTableName('site_content'));
$user_id_folder = $modx->db->getInsertId();
Purple
=== Don’t forget to smile ===