I’ll have to reset it up to do a screen cap which I don’t think will help since the dynamically created container folder looks just like the one made by hand. The only difference is that I can’t access it from the front end
i.e.:
http://whaterver.com/news_and_articles/my_subject/1/my_article.php
I can get
http://whaterver.com/news_and_articles/my_subject/
but not
http://whaterver.com/news_and_articles/my_subject/1/
or
http://whaterver.com/news_and_articles/my_subject/1/my_article.php
I’ve even gone back in to the db to change the alias’s to make sure they were in place and still nothing.
I had to edit and save the container folder in the manager.....
But here’s the code I’m running to create the folders..
<br /> if(!$err)<br /> {<br /> // Get the current time <br /> $ts = time();<br /> <br /> // Get the default template ID.<br /> $tpl = $modx->config[’default_template’];<br /> <br /> // Create an article record<br /> $sql = ’INSERT INTO `’.$modx->db->config[’table_prefix’].’news_articles` (`id`) VALUES (\’\’)’;<br /> $qry = $modx->db->query($sql);<br /> $aid = $modx->db->getInsertId();<br /> <br /> // Create the sub folder (id) of article<br /> $sql = ’INSERT INTO `’.$modx->db->config[’table_prefix’].’site_content`<br /> (`type`, `contentType`, `pagetitle`, `published`, `pub_date`, `parent`, `richtext`, `template`, `searchable`, `cacheable`,<br /> `createdby`, `createdon`, `editedby`, `editedon`, `publishedon`, `publishedby`, `alias`, `isfolder`)<br /> VALUES<br /> (\’document\’, \’text/html\’, \’’.$aid.’\’, \’1\’, \’’.$ts.’\’, \’’.$modx->db->escape($_POST[’category’]).’\’,<br /> \’1\’, \’’.$tpl.’\’, \’0\’, \’0\’, \’’.$modx->getLoginUserID().’\’, \’’.$ts.’\’, <br /> \’’.$modx->getLoginUserID().’\’, \’’.$ts.’\’, \’’.$ts.’\’, \’’.$modx->getLoginUserID().’\’, \’’.$aid.’\’, \’1\’)’;<br /><br /> $modx->db->query($sql);<br /> <br /> $pid = $modx->db->getInsertId(); <br /> <br /> // Front page only item?<br /> if(empty($_POST[’fullarticle’]))<br /> {<br /> $fp_only = 1;<br /> <br /> $sql = ’INSERT INTO `’.$modx->db->config[’table_prefix’].’site_content`<br /> (`type`, `contentType`, `pagetitle`, `published`, `pub_date`, `parent`, `content`, `richtext`, `template`, `searchable`, `cacheable`,<br /> `createdby`, `createdon`, `editedby`, `editedon`, `publishedon`, `publishedby`)<br /> VALUES<br /> (\’document\’, \’text/html\’, \’’.$modx->db->escape($_POST[’title’]).’\’, \’1\’, \’’.$ts.’\’, \’’.$pid.’\’,<br /> \’’.$modx->db->escape($_POST[’frontpage’]).’\’, \’1\’, \’’.$tpl.’\’, \’1\’, \’1\’, \’’.$modx->getLoginUserID().’\’, \’’.$ts.’\’, <br /> \’’.$modx->getLoginUserID().’\’, \’’.$ts.’\’, \’’.$ts.’\’, \’’.$modx->getLoginUserID().’\’)’;<br /> }<br /> else<br /> {<br /> $sql = ’INSERT INTO `’.$modx->db->config[’table_prefix’].’site_content`<br /> (`type`, `contentType`, `pagetitle`, `published`, `pub_date`, `parent`, `content`, `richtext`, `template`, `searchable`, `cacheable`,<br /> `createdby`, `createdon`, `editedby`, `editedon`, `publishedon`, `publishedby`)<br /> VALUES<br /> (\’document\’, \’text/html\’, \’’.$modx->db->escape($_POST[’title’]).’\’, \’1\’, \’’.$ts.’\’, \’’.$pid.’\’,<br /> \’’.$modx->db->escape($_POST[’fullarticle’]).’\’, \’1\’, \’’.$tpl.’\’, \’1\’, \’1\’, \’’.$modx->getLoginUserID().’\’, \’’.$ts.’\’, <br /> \’’.$modx->getLoginUserID().’\’, \’’.$ts.’\’, \’’.$ts.’\’, \’’.$modx->getLoginUserID().’\’)’;<br /> }<br /> <br /> $modx->db->query($sql);<br /> <br /> $did = $modx->db->getInsertId(); <br /> <br /> // Update the news_articles<br /> $sql = ’UPDATE `’.$modx->db->config[’table_prefix’].’news_articles`<br /> SET `title` = \’’.$modx->db->escape($_POST[’title’]).’\’,<br /> `category` = \’’.$aid.’\’, <br /> `date` = NOW(),<br /> `time` = NOW(),<br /> `author` = \’’.$modx->getLoginUserID().’\’, <br /> `front_page` = \’’.$modx->db->escape($_POST[’frontpage’]).’\’,<br /> `feed` = \’’.$modx->db->escape($_POST[’feed’]).’\’,<br /> `pages` = \’’.$did.’\’, <br /> `fp_only` = \’’.$fp_only.’\’<br /> WHERE `id` = \’’.$aid.’\’’;<br /><br /> $modx->db->query($sql);<br /><br /> $html .= ’Article has been added.’;<br /> }<br />