Quote from: cipa at Nov 16, 2009, 10:57 PM
I’m not sure what you are trying to do but adding a column to modx_site_content tables is not a good thing to do.
Why aren’t you using TVs(template variables) to store additional information. Have a look at the modx_site_tmplvars and modx_site_tmplvar_contentvalues.
use something like
$vf = array();
$vf['tmplvarid'] = 3;
$vf['contentid'] = $newId;
$vf['value'] = 'your value';
$modx->db->insert( $vf, $modx->getFullTableName('site_tmplvar_contentvalues') );
to store you TV values
If you still want to add information your way create a new table called modx_site_content_extended. The table will have to fields: id and user
I hope this helps
I haven’t noticed any problems from having an extra column, existing pages and newly created ones don’t have any bugs in them since the column is left blank when not created specifically from my form.
I already have several template variables that add the content onto the page. Those are working fine(although I have mine written out differently since the content for them is called from a form) and I’m not having any problems with them.
Right the only problem I have is calling a user’s webShortname back from the database where it is saved as the actual username and not as a resource id#.
as I said above, you can do this with FDM.
You can have different webgroups with these permissions:
moderator-webgroup:
add new pages, edit all pages, delete pages
editor-webgroup:
can add new pages (if allowed), can edit only own pages.
I’ve used it several times and it workes well, once configured for your needs.
and more..........
if you want to create your own system have a look to FDMs code, to get an idea, how you can handle these permissions.
My goal is have a function where a user submits information to a form and, when logged in, only that user can edit it’s content. That FDM would allow anyone in the usergroup to edit it as well.
I’ll have to download and read through the code to see if it any any single user identification features though. At the very least it’ll help me to learn modx/php more(as you have probably guessed I’m new to both).